After a good deal of research and some extensive trial & error I couldn't figure out to efficiently build the routing and history functionality from scratch. SO I rebuilt the entire app using React and React Router ๐ Only took about a few hours to do, and I should be able to finish it this evening.
In the root directory of the project there will exist a directory: challenges, and a file called classroom_settings.json
The challenges directory will contain each lesson directory title like so: [C#].[L#].<name> i.e. 2.1.Addition (means the Addition lesson is Lesson 1 of Chapter 2).
Due note that chapter and lesson numbers is for our organization purposes and will not be reflected in the Repl.it Classroom.
Each lesson directory will contain four files:
lesson_code.py
lesson_tests.py
lesson.md
lesson_settings.json
lesson_code.py will be loaded into the initial-code section (top left container) of the classroom.
lesson_tests.py will be loaded into a hidden unittest file (behind the scenes).
lesson.md will be loaded into the markdown section (bottom right container) of the classroom.
lesson_settings.json will be used to store information such as Title, Chapter, Lesson number, ID(?). This will mainly be for FCC, but repl will be able to utilize the Title property and maybe the ID property.
Each Repl.it Classroom lesson url will be added to the challenges.json file in the project root directory.
[Down The Road] - implement a python script that auto builds the challenges.json file
The current structure for the FCC Python Curriculum is: Beginner Section, Intermediate Section, & Special Topic Section.
Discovered bug in generate-challenge-json.js. When a new challenge is added to an empty chapter, and the new challenge is not the first challenge in the chapter, it will be added as if it is the 'first'. When generate-challenge-json.js is ran again it will re-add the (not-first) challenge to the chapter producing unpredictable chapter structure. Will open a new issue and begin work on this soon.
I'll figure it out. Might need to add some sort of 'skip' functionality to renderMap, and loadChallenges for 'empty challenges'?