如何创建具有三种不同答案模式的测验应用程序?
我正在尝试创建一个测验应用程序,该应用程序应该包含5个问题,这些问题是从一组问题中随机选择的。但是,应该有三种不同的方法来回答问题:
- 至少一个应该使用无线电按钮
- 至少应该使用一个下拉菜单
- 至少一个人应该使用文本输入,
请使用我该如何创建?我还没有JS文件,我不介意您创建JS文件。
@import url(https://fonts.googleapis.com/css?family=Poppins:100,200,300,regular,500,600,700,800,900);
:root {
--background: rgb(29, 26, 26);
--text-color: rgb(255, 255, 255);
}
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
background-color: var(--background);
font-family: 'Poppins', sans-serif;
}
.quiz-container {
margin: 30px auto;
width: 70%;
text-align: center;
}
.header h3 {
color: var(--text-color);
font-size: 30px;
}
.question-tog {
display: flex;
justify-content: space-between;
align-items: center;
width: 50%;
margin: 0 auto;
}
button {
padding: 8px 35px;
cursor: pointer;
border-radius: 5px;
font-size: 15px;
display: flex;
align-items: center;
gap: 20px;
}
i {
font-size: 25px;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Interactive Quiz App</title>
<link href='https://unpkg.com/[email protected]/css/boxicons.min.css' rel='stylesheet'>
<link rel="stylesheet" href="/quiz/style.css">
</head>
<body>
<div class="quiz-container">
<div class="header"><h3>Interactive Quiz App</h3></div>
<div class="quiz">
</div>
<div class="question-tog">
<button class="prev"> <span>Prev</span> <i class='bx bx-left-arrow-alt'></i></button>
<button class="next"> <span>Next</span> <i class='bx bx-right-arrow-alt'></i></button>
</div>
</div>
</body>
</html>
I am trying to create a quiz app which should feature 5 questions, chosen randomly from a bank of questions. But, the there should be three different ways of answering the questions :
- At least one should use radio buttons
- At least one should use a drop down
- At least one should use text input
How do I create this please ? I don't have a JS file yet, I don't mind you creating a JS file.
@import url(https://fonts.googleapis.com/css?family=Poppins:100,200,300,regular,500,600,700,800,900);
:root {
--background: rgb(29, 26, 26);
--text-color: rgb(255, 255, 255);
}
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
background-color: var(--background);
font-family: 'Poppins', sans-serif;
}
.quiz-container {
margin: 30px auto;
width: 70%;
text-align: center;
}
.header h3 {
color: var(--text-color);
font-size: 30px;
}
.question-tog {
display: flex;
justify-content: space-between;
align-items: center;
width: 50%;
margin: 0 auto;
}
button {
padding: 8px 35px;
cursor: pointer;
border-radius: 5px;
font-size: 15px;
display: flex;
align-items: center;
gap: 20px;
}
i {
font-size: 25px;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Interactive Quiz App</title>
<link href='https://unpkg.com/[email protected]/css/boxicons.min.css' rel='stylesheet'>
<link rel="stylesheet" href="/quiz/style.css">
</head>
<body>
<div class="quiz-container">
<div class="header"><h3>Interactive Quiz App</h3></div>
<div class="quiz">
</div>
<div class="question-tog">
<button class="prev"> <span>Prev</span> <i class='bx bx-left-arrow-alt'></i></button>
<button class="next"> <span>Next</span> <i class='bx bx-right-arrow-alt'></i></button>
</div>
</div>
</body>
</html>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为了创建以下测验,您需要使用JS数组。这将存储一组问题以随机选择。另一件事是您需要使用JS模块在页面上发送数据。这就是您可以做到的。
我宁愿您使用PHP会话,而是更简单,更易于使用。
In order to create the following quiz you need to use js arrays. Which will store the set of questions to choose randomly. Another thing is you need to use js modules to send data across pages. And that is how you can do it.
I'd rather suggest you to use php sessions instead they are way more simpler and easier to word with.