questionDeleteUpdateForm.php 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <main>
  2. <table border="1px" id="users">
  3. <thead>
  4. <tr>
  5. <th>Subject and chapter</th>
  6. <th>Question description</th>
  7. <th>Question type</th>
  8. <th>Correct Answer</th>
  9. <th>Answer A</th>
  10. <th>Answer B</th>
  11. <th>Answer C</th>
  12. <th>Answer D</th>
  13. <th>Points for correct answer</th>
  14. <th>Minus points for wrong answer</th>
  15. </tr>
  16. </thead>
  17. <tbody>
  18. <?php
  19. $chapter = $_SESSION['chapterPanel'];
  20. $subject = $_SESSION['subjectPanel'];
  21. $query = "SELECT * FROM questions WHERE chapterID = '$chapter' AND subjectID = '$subject'";
  22. $result = mysqli_query($db, $query);
  23. while ($row = mysqli_fetch_assoc($result)) { ?>
  24. <tr>
  25. <td><?php echo $row['subjectID'] . ": " . $row['chapterID']; ?><br>
  26. <a href="/teacher/logic/deleteUpdateQuestion.php?IDdel=<?php echo $row['questionID'] ?>">Delete</a>
  27. <?php
  28. $ID = $row['questionID'];
  29. $type = $row['questionType'];
  30. echo '<a href="/teacher/logic/deleteUpdateQuestion.php?IDupd=' . $ID . '&type=' . $type . '">Modify</a>';
  31. ?>
  32. </td>
  33. <td><?php echo $row['questionDescription']; ?></td>
  34. <td><?php echo $row['questionType']; ?></td>
  35. <td><?php if ($row['questionType'] == 'TF') {
  36. echo $row['answerTrueFalse'];
  37. } else {
  38. echo $row['answerABCD'];
  39. }; ?></td>
  40. <td><?php echo $row['descriptionAnswerA']; ?></td>
  41. <td><?php echo $row['descriptionAnswerB']; ?></td>
  42. <td><?php echo $row['descriptionAnswerC']; ?></td>
  43. <td><?php echo $row['descriptionAnswerD']; ?></td>
  44. <td><?php echo $row['correctPoints']; ?></td>
  45. <td><?php echo $row['assHolePoints']; ?></td>
  46. </tr>
  47. <?php } ?>
  48. </tbody>
  49. </table>
  50. </main>