freeCodeCamp.org's open-source codebase and curriculum. Learn to code for free.
 
 
 
 
 
Go to file
Stuart Taylor c754880476 feat(schema): Implement challenge schema 2018-04-03 19:52:01 +05:30
challenges fix(seed): Fix schema violations 2018-04-03 19:52:01 +05:30
math-challenges fix(seed): Remove redundant seed files from math directory 2017-09-09 10:52:12 -05:00
schema feat(schema): Implement challenge schema 2018-04-03 19:52:01 +05:30
LICENSE.md docs(license): Update License fix for GitHub (#16113) 2017-11-25 11:47:27 -06:00
README.md docs(seed): Document how to edit and test challenges (#16511) 2018-01-20 22:00:21 +05:30
bonfireMDNlinks.js Fix: Add MDN Strict Inequality Link 2016-11-27 19:30:07 -05:00
challenge-style-guide.md docs(seed): Document how to edit and test challenges (#16511) 2018-01-20 22:00:21 +05:30
create-challenge-bundle.js restructure challenges within directories 2015-12-14 13:19:30 -08:00
get-challenge-completion.js Fixes invalid JSON format data exporting 2016-01-11 02:39:15 +04:00
get-emails.js update get-emails script 2015-08-27 16:37:01 -07:00
getChallenges.js docs(seed): Added Guide for contributing project euler (#16140) 2017-12-05 00:41:25 -06:00
index.js feat(schema): Implement challenge schema 2018-04-03 19:52:01 +05:30
loopbackMigration.js change node-uuid to uuid 2016-12-30 16:47:09 -06:00
normalize-seed-files.js feature(translations): Normalize translations 2016-07-28 23:40:01 -07:00
test-challenges.js chore(challenges): Normalise challengeTypes 2018-04-03 19:52:01 +05:30

README.md

Challenges

The seed directory contains all the challenges that appear on the freeCodeCamp learning platform.

For each challenge section, there is a JSON file (fields documented below) containing its name, seed HTML, tests, and so on.

Usage

command description
npm run test-challenges run all challenge tests (for each challenge JSON file, run all tests against all solutions)
npm run test run all JS tests in the system, including client, server, lint and challenge tests
node seed parses all the challenge JSON files and saves them into MongoDB (code is inside index.js)
npm run commit interactive tool to help you build a good commit message

Challenge Template

{
  "id": "unique identifier (alphanumerical, mongodb id)",
  "title": "Challenge Title",
  "description": [
    "Challenge description.",
    "An new string in the array will create a new paragraph."
  ],
  "releasedOn": "date formatted like: January 1, 2016",
  "challengeSeed": [
    "// code displayed in the editor by default",
    "// a new string in the array is a new line"
  ],
  "solutions": [
    "at least one code solution that passes the tests below, used for automated testing (and inspiration for students)."
  ],
  "tests": [
    "an array of assert tests that check if the user's solution is working",
    "assert(aFunction('argument') === 'result', 'message: This message explains what the test is testing');",
  ],
  "type": "string identifying type of challenge. takes priority for viewType",
  "challengeType": "number identifying type of challenge (step, project, normal). takes priority for submitType",
  "isRequired": "boolean value that indicates whether challenge is required for certificate",
  "translations": {
    "language-code": {
      "title": "The Title in a Different Language",
      "description": [
        "The description in a different language."
      ]
    }
  }
},