如何使问题从 studio code.org 上的列表中以随机顺序出现
var questionsList = ["what sense do you use to identify the color of something?", "what sense would you use to tell if someone is wearing perfume? ", "what sense would you use to listen to music? ", "what sense would you use to know if the food is sweet or salty?", "what sense would you use to tell if the blanket is wet or dry?"];
onEvent("randomMiddleQuestion", "click", function(updateScreen ) {
setText("randomMiddleQuestion", "what sense do you use to identify the color of something?");
});
onEvent("randomMiddleQuestion", "click", function() {
questionsList = randomNumber(0, questionsList.length - 1);
updateScreen();
});
function updateScreen() {
setProperty("randomMiddleQuestion", "text", questionsList[index]);
}
我想创建一个 on 事件,当单击文本框时,一组问题以不特定的顺序出现
var questionsList = ["what sense do you use to identify the color of something?", "what sense would you use to tell if someone is wearing perfume? ", "what sense would you use to listen to music? ", "what sense would you use to know if the food is sweet or salty?", "what sense would you use to tell if the blanket is wet or dry?"];
onEvent("randomMiddleQuestion", "click", function(updateScreen ) {
setText("randomMiddleQuestion", "what sense do you use to identify the color of something?");
});
onEvent("randomMiddleQuestion", "click", function() {
questionsList = randomNumber(0, questionsList.length - 1);
updateScreen();
});
function updateScreen() {
setProperty("randomMiddleQuestion", "text", questionsList[index]);
}
I want to make an on event for when a text box is clicked, a set of questions appear in no particular oder
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论