如何使问题从 studio code.org 上的列表中以随机顺序出现

发布于 2025-01-19 14:55:57 字数 804 浏览 0 评论 0原文

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文