Skip to content

Add initial ask block to prompt for user input in Play Lab#9610

Merged
joshlory merged 3 commits into
stagingfrom
ask-block
Jul 22, 2016
Merged

Add initial ask block to prompt for user input in Play Lab#9610
joshlory merged 3 commits into
stagingfrom
ask-block

Conversation

@joshlory

Copy link
Copy Markdown
Contributor

This first iteration uses the browser's built-in prompt() API to block execution and get input from the user.

In the demo below, clicking the witch prompts for a new value. Clicking the dog makes the actor say the current value.

ask-block

  • Fix bug where setting the actor to a cat and a dog causes the prompt to appear twice.

Comment thread apps/src/studio/blocks.js Outdated
// Must be marked EDITABLE so that cloned blocks share the same var name
fieldLabel.EDITABLE = true;
this.setHSV(312, 0.32, 0.62);
this.appendDummyInput().appendTitle('ask');

@Hamms Hamms Jul 21, 2016

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this (edit: and "to set" below) be internationalized?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, fixed in e72bf80.

@joshlory

Copy link
Copy Markdown
Contributor Author

Confirmed the double-bind bug is a pre-existing issue. I'm not going to block this change on fixing it. Still need to remove the new block from the /p/playlab toolbox so it's not accessible to students yet.

@joshlory

Copy link
Copy Markdown
Contributor Author

@Hamms Ready for another pass when you get a chance!

@Hamms

Hamms commented Jul 21, 2016

Copy link
Copy Markdown
Contributor

LGTM!

@joshlory joshlory merged commit 2280d07 into staging Jul 22, 2016
@joshlory joshlory deleted the ask-block branch July 22, 2016 19:00
deploy-code-org added a commit that referenced this pull request Jul 22, 2016
2280d07 Merge pull request #9610 from code-dot-org/ask-block (Josh Lory)
5ec4d1b Merge pull request #9667 from code-dot-org/allow-for-while-blocks-in-20hour (Elijah Hamovitz)
96af5fc Merge pull request #9672 from code-dot-org/revert-9632-encodeUrl (Mehal Shah)
6295268 Revert "[test ui] Encode URLs in free response" (Mehal Shah)
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.

2 participants