freeCodeCamp / python-coding-challenges

freeCodeCamp's stand-alone Python coding challenges
BSD 3-Clause "New" or "Revised" License
171 stars 205 forks source link

Generate challenges.json #19

Closed Ethan-Arrowood closed 7 years ago

Ethan-Arrowood commented 7 years ago

Big PR right here. Going to update README.md after this for proper way to submit challenges. Ref #8 #2

  1. Challenge object within challenges.json now reflects chapter & lesson order (nested arrays).
  2. Challenge directories with a lesson number > 9 will increment using the alphabet. Reason: due to an auto sort in fs.readdirSync('./challenges') when directories have double digits in the <lesson_number> portion of their name they are bumped up via the first digit (1 is followed by 10, then 11, then 12, then 2, 20, 21, 22, . . .). This creates a bug when generating the challenge list for challenges.json
  3. Updated load-challenges.js to work with new challenges.json format (nested arrays). Also checks the last_edit date of the challenge.json against the localStorage challenge.json to verify integrity.

Some cool features included within generate-challenge-settings.js