Permalink
Browse files

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

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

0 comments on commit 3fa5724

Please sign in to comment.