pxt-microbit
pxt-microbit copied to clipboard
Tutorials in embed view
Support tutorials in MakeCode embeds (i.e. Micro:bit Classroom)
Support tutorials in microbit classroom.
@abchatra roughly what were you thinking of changing here? Was it a new API via postMessage?
I think this is already supported pretty well, see the start activity message.
The path property there is what specifies which tutorial to load. Here are some examples:
- To load from a share link:
path: "S69736-92161-21676-29105" - To load from a GitHub repo, it's the repo followed by the filepath (minus
.md):path: "riknoll/microbit-tutorial-example/tutorial" - To load a tutorial from pxt-microbit/docs:
path: "/projects/rock-paper-scissors"
I always mess up the syntax for that last example, so here are the specific rules for that one:
- Must start with a leading slash
- Path should be relative to the pxt-microbit/docs folder
.mdis omitted from the filename
(some day I'll make it so that it's less picky)
@jaustin does that cover your needs or do you want something extra?
Also, I'll add some documentation for this somewhere
@jaustin @microbit-matt-hillsdon is it possible to try out one of the tutorial in the GitHub and see if it works with microbit classroom? If not we would like to address bugs sooner than later.
Thanks @abchatra and @riknoll, I'll try this today and add feedback here.
@abchatra @riknoll, this is working well. I've tested all three cases, though initially we're likely to be using the GH repo approach with the first lessons tutorials.
Is there a way to programatically discover the built-in MakeCode tutorials (in docs/projects)?
I think one needs to be intentional about which tutorial to show to the user. I am not sure programmatically showing tutorial is a good idea. However you can enumerate all the first row tutorials in the makecode site by reading the following file
https://github.com/microsoft/pxt-microbit/blob/master/docs/tutorials.md
I think one needs to be intentional about which tutorial to show to the user. I am not sure programmatically showing tutorial is a good idea. However you can enumerate all the first row tutorials in the makecode site by reading the following file
https://github.com/microsoft/pxt-microbit/blob/master/docs/tutorials.md
Thanks. I think we'll probably start by offering the "first lessons" tutorials but in the past we've discussed giving teachers the ability to choose a tutorial more broadly inside micro:bit classroom so having a list of the MakeCode ones could feed into that.