ndunand / moodle-qtype_matrix

Source code of https://moodle.org/plugins/qtype_matrix
2 stars 10 forks source link

changing anything in a kprime question after the question has been solved by a student, results in loss of the students response #18

Closed isacsonk closed 9 years ago

isacsonk commented 10 years ago

how to reproduce

  1. Create a test with kprime questions
  2. Solve the test as a student
  3. log in as teacher and display the questions
  4. enter one question and change something in the question, the answer statements or the responses, save changes --> the responses the student made are lost

    requirement

responses of the students should persist, even when the question is edited.

remark

the correct mark is still there, but we also need the responses to persist.

isacsonk commented 10 years ago

Found also following behavior:

  1. As a teacher go to your test and display it in preview mode
  2. Go to a kprime question, and solve the question
  3. go to the next question and then back again
  4. edit the kprime question and save ---> the before entered responses are lost Doing this with a MC question does not result in losses of the responses Could this have something to do with the partial workaround implemented in #11?
ghost commented 10 years ago

Please test.

isacsonk commented 10 years ago

It is allowed to change a question even after an attempt of a student. This is currently a feature of the Moodle quiz-module and thus applies to all question types. Also the matrix/kprime questiontype must have this feature. A teacher should be able to change something in a question without loosing the responses of a student. After that the teacher should be able to regrade the question by clicking on the regrade-button.

This problem contains two levels: 1) data of student answers needs to persist when row/column labels or answer correctness etc. are adjusted, and 2) data of student answers needs to persist even when rows/columns in the question are added or esp. deleted! Problem 2) would probably be quite a nightmare of a problem for which to find a solution, however, once issue #20 is solved as described above, rows and columns could not be added/deleted anyway and we thus will not need to find a solution to problem 2). Problem 1) however needs to be addressed and an appropriate solution found.

ghost commented 10 years ago

Hi, the way it is implemented in the above commit is as follows: the essence of the problem was that the original programmer who did the matrix question type deleted all the rows and columns and then created them from scratch after each edit of the question. As a result, all the associated attempts were messed up, because they were referring to the old, deleted rows / columns.

What I did was to update preexisting rows and columns rather than delete/re-create. This is the most simple behavior but it may sometimes be unexpected. For example: A user answers a question with two rows "question 1" and "question 2", which appear originally (before shuffling) in this order. Then the teacher edits the question so that now the first row is "question 2" and the second row is "question 1". Then the saved attempt of said student is obviously wrong.

Note that this problem persists even after issue #20 is solved, but to give it any better solution would require more programming than I think matrix deserves in its current form.

isacsonk commented 10 years ago

Hi The typical use case for changing a question after an attempt is because there are some typos or the wrong response was selected as the correct one. The teacher should really never change the responses (column labels) from true /false to false/true. If he does that it is his own responsibility, this would be more or less like changing a correct marked answer statement so that the answer statement is not correct anymore like in your example and moodle delegates this responsibility to the teacher. If the teacher by mistake choose the wrong answer for example for following single choice question: Which is the color of the sky? a. blue b. yellow (correct) c. white And he marked b yellow as correct. Then he would edit the question in that way, that option a. blue would be marked correct, and after that regrade the question (see button regrade on the resultspage). Similar if he made a mistake with a kprime or matrix question: Which of the following statements are true? a. The sky is blue (false) b. the grass is green (false) c. the sun is yellow (false)

Then he would not change the labels of the columns but change the selected responses. The labels would still be true and then false. And then he would regrade the question.

laurentopprecht commented 9 years ago

Tested and working but for the change from multiple to non-multiple

laurentopprecht commented 9 years ago

Changing from multiple to non-multiple fixed