Issue Details (XML | Word | Printable)

Key: MDL-7698
Type: Bug Bug
Status: Resolved Resolved
Resolution: Duplicate
Priority: Minor Minor
Assignee: Tim Hunt
Reporter: Kurt Rosivatz
Votes: 2
Watchers: 1
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

overriding grade of randomly added questions in quiz doesn't work

Created: 27/Nov/06 11:59 PM   Updated: 22/Mar/07 05:01 AM
Return to search
Component/s: Questions, Quiz
Affects Version/s: 1.6.3
Fix Version/s: None

Issue Links:
Duplicate
 

Participants: Kurt Rosivatz, P Sunthar, Taum Hanlon and Tim Hunt
Security Level: None
Resolved date: 22/Mar/07
Affected Branches: MOODLE_16_STABLE


 Description  « Hide
We've created a quiz with randomly added questions. When we try to override the grade of an individual answer via the "Make comment or override grade" link, we cannot save the modified grade but get the error message "Could not insert entry in question_sessions".

It seems that the link "Make comment or ovveride grade" uses the wrong question-id for overriding the grade and therefore choses incorrect (or non-existent) question_state entries in the question_states table which later causes the described error message ($state->id is null).

Our solution was to change line 481 in moodle/question/type/questiontype.php

            $commentlink = '<div class="commentlink">'.link_to_popup_window ($options->questioncommentlink.'?attempt='.$state->attempt.'&amp;question='.$question->id,
                             'commentquestion', $strcomment, 450, 650, $strcomment, 'none', true).'</div>';

to

            $commentlink = '<div class="commentlink">'.link_to_popup_window ($options->questioncommentlink.'?attempt='.$state->attempt.'&amp;question='.$state->question,
                             'commentquestion', $strcomment, 450, 650, $strcomment, 'none', true).'</div>';

i.e.: $question->id was replaced by $state->question.

As far as we could figure out, $state->question holds the correct questionid for randomly added questions.

which seems to work.


 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
No commits have yet been performed on this issue.