-
Notifications
You must be signed in to change notification settings - Fork 581
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add "Hide Done" Option for Tutorials (#10248)
This adds a "hideDone" flag that can be set on a tutorial to indicate that the Done button should not be shown on the final step. Also added tests for hideDone and hideToolbox (which I added in 9e6dd9e). Not sure how much value they bring beyond parsing validation, but I suppose that's better than nothing!
- Loading branch information
Showing
10 changed files
with
120 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"editor": "blocksprj", | ||
"title": "Hide Done", | ||
"steps": [ | ||
{ | ||
"contentMd": "Tutorials can choose to hide the done button on the final step. This metadata is parsed and removed.", | ||
"headerContentMd": "Tutorials can choose to hide the done button on the final step. This metadata is parsed and removed." | ||
}, | ||
{ | ||
"contentMd": "Tutorial parsing for hints, steps, etc should function exactly as before.\n\n```blocks\nlet x = 8;\nlet y = x + 2;\n```", | ||
"headerContentMd": "Tutorial parsing for hints, steps, etc should function exactly as before.", | ||
"hintContentMd": "```blocks\nlet x = 8;\nlet y = x + 2;\n```" | ||
} | ||
], | ||
"activities": null, | ||
"code": [ | ||
"{\nlet x = 8;\nlet y = x + 2;\n}", | ||
"{\nbasic.showIcon(IconNames.Square)\n}" | ||
], | ||
"metadata": { | ||
"hideDone": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"editor": "blocksprj", | ||
"title": "Hide Toolbox", | ||
"steps": [ | ||
{ | ||
"contentMd": "Tutorials can choose to hide the toolbox. This metadata is parsed and removed.", | ||
"headerContentMd": "Tutorials can choose to hide the toolbox. This metadata is parsed and removed." | ||
}, | ||
{ | ||
"contentMd": "Tutorial parsing for hints, steps, etc should function exactly as before.\n\n```blocks\nlet x = 8;\nlet y = x + 2;\n```", | ||
"headerContentMd": "Tutorial parsing for hints, steps, etc should function exactly as before.", | ||
"hintContentMd": "```blocks\nlet x = 8;\nlet y = x + 2;\n```" | ||
} | ||
], | ||
"activities": null, | ||
"code": [ | ||
"{\nlet x = 8;\nlet y = x + 2;\n}", | ||
"{\nbasic.showIcon(IconNames.Square)\n}" | ||
], | ||
"metadata": { | ||
"hideToolbox": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Hide Done | ||
|
||
### @hideDone true | ||
|
||
## Introduction | ||
|
||
Tutorials can choose to hide the done button on the final step. This metadata is parsed and removed. | ||
|
||
## Step with hint | ||
|
||
Tutorial parsing for hints, steps, etc should function exactly as before. | ||
|
||
```blocks | ||
let x = 8; | ||
let y = x + 2; | ||
``` | ||
|
||
```ghost | ||
basic.showIcon(IconNames.Square) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Hide Toolbox | ||
|
||
### @hideToolbox true | ||
|
||
## Introduction | ||
|
||
Tutorials can choose to hide the toolbox. This metadata is parsed and removed. | ||
|
||
## Step with hint | ||
|
||
Tutorial parsing for hints, steps, etc should function exactly as before. | ||
|
||
```blocks | ||
let x = 8; | ||
let y = x + 2; | ||
``` | ||
|
||
```ghost | ||
basic.showIcon(IconNames.Square) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters