簡體   English   中英

如何創建具有三種不同答案模式的測驗應用程序?

[英]How do I create a quiz app with three different answer modes?

我正在嘗試創建一個應該包含 5 個問題的測驗應用程序,這些問題是從一組問題中隨機選擇的。 但是,應該有三種不同的方式來回答問題:

  1. 至少一個應該使用單選按鈕
  2. 至少一個應該使用下拉菜單
  3. 至少一個應該使用文本輸入

請問這個怎么創建? 我還沒有 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/boxicons@2.1.2/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>

為了創建以下測驗,您需要使用 js arrays。 它將存儲要隨機選擇的問題集。 另一件事是您需要使用 js 模塊跨頁面發送數據。 這就是你可以做到的。

我寧願建議你使用 php 會話,而不是它們更簡單,更容易用詞。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM