question_multiple_form.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <main>
  2. <?php
  3. $chapter = $_SESSION['chapterPanel'];
  4. $subject = $_SESSION['subjectPanel'];
  5. echo "<center><h1>" . $subject . ": " . $chapter . "</div></h1></center>";
  6. ?>
  7. <div class="form">
  8. <form action="/teacher/teacher.php" method="POST">
  9. <p>Question type</p>
  10. <label class="switch">
  11. <input type="checkbox" name="questionTypeMultiple" <?php if (isset($_POST['questionTypeMultiple'])) echo "checked ='checked'"; ?> onclick="this.form.submit()">
  12. <span class="slider round"></span>
  13. </label><br><br>
  14. </form>
  15. </div>
  16. <div class="form">
  17. <form action="/teacher/formLogic.php" method="POST">
  18. <label for="question">Question</label>
  19. <input type="text" id="question" name="question" placeholder="question text.." required>
  20. <label for="addPoints">Points for correct answer (0-10)</label>
  21. <input type="number" id="addPoints" name="addPoints" step="0.01" min="0" max="10" required><br>
  22. <label for="cutPoints">Minus points for wrong answer (0-10)</label>
  23. <input type="number" id="cutPoints" name="cutPoints" step="0.01" min="0" max="10" required><br><br>
  24. <input type="radio" name="answer" value="A" id="A" checked />
  25. <label for="true">A</label>
  26. <input type="text" id="answerA" name="answerA" placeholder="answer text.." required>
  27. <input type="radio" name="answer" value="B" id="B" />
  28. <label for="true">B</label>
  29. <input type="text" id="answerB" name="answerB" placeholder="answer text.." required>
  30. <input type="radio" name="answer" value="C" id="C" />
  31. <label for="true">C</label>
  32. <input type="text" id="answerC" name="answerC" placeholder="answer text.." required>
  33. <input type="radio" name="answer" value="D" id="D" />
  34. <label for="true">D</label>
  35. <input type="text" id="answerD" name="answerD" placeholder="answer text.." required>
  36. <input type="submit" value="Submit">
  37. </form>
  38. </div>
  39. </main>