Allow marking questions as mandatory in quiz editor

Description

It should be possible to mark questions as mandatory in the quiz editor. Mandatory questions should be selected every time.

Goal

Allow more flexibility in designing quizzes

Evidence

This functionality is wished for to improve the hygiene quiz.

Solution

  • Add a column is_mandatory to the question table
  • Add a checkbox to the question editor modal
  • Adjust APIs to handle this additional bool value
  • Adjust question selection algorithm to select all mandatory questions first and fill up remaining questions with the other questions
  • Display a warning in the quiz editor if too many questions are mandatory, or add another way of telling how many are mandatory