-
Notifications
You must be signed in to change notification settings - Fork 593
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Teacher tool: Initial validation logic #9823
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Co-authored-by: Eric Anderson <[email protected]>
webapp/src/app.tsx
Outdated
@@ -4038,6 +4038,14 @@ export class ProjectView | |||
}); | |||
} | |||
|
|||
async getBlocksAsync(): Promise<Blockly.Block[]> { | |||
if (!this.isBlocksActive()) { | |||
await this.openBlocksAsync(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we should just throw an error in this case rather than switch to blocks. Having that switch be a side-effect of another call feels like it could lead to some unwanted behavior...plus, if we throw an error instead of switching, this function doesn't have to be async :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point!
Co-authored-by: Thomas Sparks <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One thought about perhaps throwing an error rather than having a switch-to-blocks side effect on that getBlocksAsync
call. Otherwise LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Big thanks to @thsparks for helping me get this set up.
Currently, the validation works for
BlockCheckCriteria
only. It takes the rubric and sets the required block counts for each block id. Then it runs thevalidateBlocksExist
function for each set of blocks in the rubric.Upload target: https://arcade.makecode.com/app/5df94cd2b924c898ff9960973789eff8048cc4c5-2776605799--eval
Sample share link: https://arcade.makecode.com/S42128-59682-77192-60950
Sample rubric: