Can not save peer review due to duplicate question index
Problem
When testing !73 (merged) I came across the following issue:
When I try to save my peer review as a student, I am not able to upload a file and save. I get the error Error saving peer review
. After some inspection, I figured out that the checkbox question and upload question had the same id
as can be seen in the code snippet at the end.
The consequence of this is that in line 125 of review.ts
, the variable currentRubricUploadQuestion
is set to the checkboxquestion from the rubric and the error File uploaded for a non-upload question
is thrown. I am not sure why the ids are overlapping, the ids are determined at the creation of the rubric by the teacher.
Steps to reproduce:
- Create a course, assignment and rubric as teacher
- The rubric should contain all types of questions (if you print the question ids, you can see that they overlap)
- Submit submission as two students and assign reviews
- Try to save or submit a complete peer review. If you don't upload a file, you should be able to save
Code snippet
RUBRIC QUESTIONS:
[ { id: 21,
type_question: 'mc',
rubric_id: 13,
question: 'MPC question',
question_number: 1,
option: [ [Object], [Object], [Object], [Object] ] },
{ id: 1,
type_question: 'checkbox',
rubric_id: 13,
question: 'Checky question',
question_number: 2,
option: [ [Object], [Object], [Object] ] },
{ id: 17,
question: 'Openness',
rubric_id: 13,
question_number: 4,
type_question: 'open' },
{ id: 15,
question: 'Rangy question',
range: 5,
rubric_id: 13,
question_number: 3,
type_question: 'range' },
{ id: 1,
question: 'File question',
extension: '.pdf,.zip,.doc,.docx',
rubric_id: 13,
question_number: 5,
type_question: 'upload' } ]