-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Labels
frontendThis is a frontend issueThis is a frontend issuegood first issueGood for newcomersGood for newcomersmedium
Description
Currently the professor quiz creation UI assumes exactly 4 options per question (the form initializes options as ["", "", "", ""] and renders inputs based on that fixed-length array). This prevents creating questions with more than 4 alternatives. Students' quiz UI already reads and renders whatever questions are present, but professor-side creation / storage flow needs to support variable-length options.
Files involved
QuizTab(frontend/components/professor/tabs/quiz-tab.jsx)StudentQuizTab(frontend/components/student/tabs/quiz-tab.jsx)
Expected behavior
- Professor quiz creation should allow adding/removing any number of options per question.
- The "Correct Answer" select should reflect the current number of options.
- Saved quiz objects should include variable-length option arrays so the student UI can render them.
Changes to make
- Replace the fixed 4-element options initialization with a dynamic array (e.g. start with 2 or 4 but allow add/remove):
- Add UI controls per question to "Add Option" and "Remove Option". Enforce a minimum of 2 options per question.
- Update the "Correct Answer" to map over current options length so indices stay valid. Ensure correctAnswer remains within bounds when options are added/removed (e.g., if the current correct index is removed, reset to 0 or require user selection). Ensure backend API accepts and stores variable-length questions[].options arrays (basically confirm backend accepts arbitrary-length arrays).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
frontendThis is a frontend issueThis is a frontend issuegood first issueGood for newcomersGood for newcomersmedium