Skip to content

Conversation

@sansaid
Copy link
Collaborator

@sansaid sansaid commented Apr 25, 2022

Created a generate-exercises.js which creates the src/Exercises folder that currently exists. However, one difference to the old structure of src/Exercises is that it creates an index.js in the root of src/Exercises which is exported to App.js so we don't have to maintain a manual list any more.

generate-exercises.js takes the inputs in the ./exercises folder, looks for references to block names enclosed in <!--block--> tags in the exercise .md and then locates a matching block name in the blocks-to-categories.json in order to generate the toolbox for that exercise. blocks-to-categories.json should be maintained as a list of identifiable blocks ID'd by human readable names which teachers can use inside their exercise .md.

The package.json has also been updated so that the exercises are automatically generated whenever anyone runs npm run start/build/test.

What's not included in this PR is a README of how to add exercises and how this process works. If approval is granted and we're happy with this approach, I'll add a commit to create a README with instructions.


View rendered client/exercises/01-stuff.md
View rendered client/exercises/02-more-stuff.md
View rendered client/exercises/03-test-content.md
View rendered client/src/Exercises/01-stuff/lesson.md
View rendered client/src/Exercises/02-more-stuff/lesson.md

sansaid added 4 commits April 25, 2022 23:34
This would get added to the package.json scripts, which is intended to run when Netlify builds the files
Makes location less confusing, since public directory is supposed to store static assets that get served to the client
To test blocks with identifiable Blockly block IDs
@gregdyke
Copy link
Collaborator

I'm not massively a fan of the tags, because I think the mds are already pretty consistently xxxxxx block, which is marginally easier to read and write? (also someone would need to go over all the mds and change them, which isn't the end of the world, but still effort)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants