Introduction
Scratch is an Open Source Project that has as the main objective to teach children about programming from a very early age, its design paradigm comes from the idea of kids playing with Lego blocks, in the same way, that a specific LEGO® set may come with its instructions to let the children build its own toy, the kid can then disassemble and turn everything into something else. This is translated into this platform as having tutorials that help the kids realize what every code block does, so they can build something more complicated by their own.
The goal of this project was to create a web application to teach programming using Wolfram Language and Scratch Blocks as an interface. Among the main objectives of the project were:
Create a useful design experience for the kids, so that it's intuitive and interesting enough for them.
The ability for them to use their previous outputs to evaluate them using other functions, just like in a regular Mathematica Notebook.
Create a persistence layer, so that the web application maintains its state and can communicate correctly with the WL server.
Features:
Friendly Interface
- Visual outputs, Functions focusing on visual stuff.
Tutorials
- Ability to create tutorials so the kids can follow along
Challenges
Reusable Outputs
Just like a regular Mathematica notebook, you can apply further transformations to the last output
You can also put the id of the output you want to use
Scalable
It is possible to add new Blocks, Tutorials and challenges easily
// This code adds an additional Block for the ReverseSort Function.
{
opcode: 'reverseSort',
blockType: BlockType.REPORTER,
text: "ReverseSort?[LIST]?",
arguments: {
LIST: {
type: ArgumentType.STRING
}
}
}
//...
reverseSort(args,util) {
return `ReverseSort[${args.LIST}]`;
}
(* This code adds additional challenges and has the ability to check them in the back end*)
CheckAnswer[resp_, problem_] :=
With[{answers = <|
ButterflyString :>
SameQ[resp,"Pneumonou..."],
MostCommonLetters :>
SameQ[Sort[resp], {"d", "e", "g", "s", "y"}]
(* ... *)
|>},
If[answers[problem], Style["Correct!", Green, 20],
Style["Wrong!", Red, 20]]];
Conclusion
This Project was a great opportunity to showcase the abilities of the Wolfram Web Engine, and additionally learn to use some functions interactively to have an idea of the potential that this platform can offer to teach Children about the Wolfram Language, that's also the main reason why I tried to focus on activities that could only be done using it. I have always been amazed by how you can make awesome demonstrations and graphics with it writing very little code, having such potential accessible for children especially at a young age makes them spark an interest in pursuing STEM fields, and there is nothing like the feeling that has in them to build something functional and see it working for the first time. And with the infinite capabilities of the Wolfram Language, I can't wait to see what they will create.
Future Work
A method to have the blocks look less cluttered horizontally is still needed.
There is a potential for anyone to add additional WL functions and definitions, and they should work just as well, the same thing with additional tutorials and challenges. there is also the possibility to have everything in the cloud, so the user just needs to log in to get their project anywhere.
There is also the possibility to package everything as a standalone app for Desktop or Tablets.
Download
You can download the full code here, it is self contained (however you must have some kind of Wolfram Language Engine installed, like Mathematica Wolfram Desktop, etc.)
References