Skip to content

Commit

Permalink
javascript MDL-26098 manual grading was not working when quiz_attempt…
Browse files Browse the repository at this point in the history
…s.id and question_attempts.id were out of synch.
  • Loading branch information
timhunt committed Jan 29, 2011
1 parent 3708abd commit 3fa5724
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions mod/quiz/comment.php
Expand Up @@ -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');
Expand Down Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion mod/quiz/locallib.php
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion question/type/questiontype.php
Expand Up @@ -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');
}
Expand Down

0 comments on commit 3fa5724

Please sign in to comment.