Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

javascript MDL-26098 manual grading was not working when quiz_attempt…

…s.id and question_attempts.id were out of synch.
  • Loading branch information...
commit 3fa5724a1fce8457266eb38ed0d4aef8980f56fd 1 parent 3708abd
Tim Hunt timhunt authored
8 mod/quiz/comment.php
@@ -2,9 +2,11 @@
2 2 /**
3 3 * This page allows the teacher to enter a manual grade for a particular question.
4 4 * This page is expected to only be used in a popup window.
5   - * *
  5 + *
  6 + * @package mod
  7 + * @subpackage quiz
  8 + * @copyright gustav delius 2006
6 9 * @license http://www.gnu.org/copyleft/gpl.html GNU Public License
7   - * @package quiz
8 10 */
9 11
10 12 require_once('../../config.php');
@@ -61,7 +63,7 @@
61 63 $attemptobj->question_print_comment_fields($questionid, 'response');
62 64 ?>
63 65 <div>
64   - <input type="hidden" name="attempt" value="<?php echo $attemptobj->get_uniqueid(); ?>" />
  66 + <input type="hidden" name="attempt" value="<?php echo $attemptobj->get_attemptid(); ?>" />
65 67 <input type="hidden" name="question" value="<?php echo $questionid; ?>" />
66 68 <input type="hidden" name="sesskey" value="<?php echo sesskey(); ?>" />
67 69 </div>
2  mod/quiz/locallib.php
@@ -917,7 +917,7 @@ function quiz_get_reviewoptions($quiz, $attempt, $context) {
917 917
918 918 // Show a link to the comment box only for closed attempts
919 919 if ($attempt->timefinish && has_capability('mod/quiz:grade', $context)) {
920   - $options->questioncommentlink = '/mod/quiz/comment.php';
  920 + $options->questioncommentlink = new moodle_url('/mod/quiz/comment.php', array('attempt' => $attempt->id));
921 921 }
922 922
923 923 // Whether to display a response history.
2  question/type/questiontype.php
@@ -957,7 +957,7 @@ function print_question(&$question, &$state, $number, $cmoptions, $options, $con
957 957 if (!empty($options->questioncommentlink)) {
958 958 $strcomment = get_string('commentorgrade', 'quiz');
959 959
960   - $link = new moodle_url("$options->questioncommentlink?attempt=$state->attempt&question=$actualquestionid");
  960 + $link = new moodle_url($options->questioncommentlink, array('question' => $actualquestionid));
961 961 $action = new popup_action('click', $link, 'commentquestion', array('height' => 480, 'width' => 750));
962 962 $commentlink = $OUTPUT->container($OUTPUT->action_link($link, $strcomment, $action), 'commentlink');
963 963 }

0 comments on commit 3fa5724

Please sign in to comment.
Something went wrong with that request. Please try again.