Changed the Make comment or override grade link display the comment field and grade field in review.php instead of popup
This commit is contained in:
@@ -3,6 +3,21 @@
|
||||
* print_question() method.
|
||||
*/
|
||||
?>
|
||||
|
||||
<script language="javascript" type="text/javascript">
|
||||
if (typeof showhidecomment == "undefined") {
|
||||
function showhidecomment (id) {
|
||||
divobj = document.getElementById(id);
|
||||
if (divobj.style.display == 'none') {
|
||||
divobj.style.display = 'block';
|
||||
} else {
|
||||
divobj.style.display = 'none';
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<a name="<?php echo $question->id; ?>">
|
||||
<div id="q<?php echo $question->id; ?>" class="que <?php echo $question->qtype; ?> clearfix">
|
||||
<div class="info">
|
||||
<span class="no"><?php echo $number; ?></span>
|
||||
@@ -28,8 +43,18 @@
|
||||
echo $comment;
|
||||
?>
|
||||
</div>
|
||||
<?php }
|
||||
echo $commentlink;
|
||||
<?php } ?>
|
||||
<div class="commentlink">
|
||||
<?php
|
||||
if (!empty($commentlink)) {
|
||||
echo $commentlink;
|
||||
?>
|
||||
<div id="comment-wrapper-<?php echo $question->id; ?>">
|
||||
<?php question_print_comment_box($question, $state, $attempt, $CFG->wwwroot.'/mod/quiz/review.php?attempt='.$attempt->id.'#'.$question->id) ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<?php
|
||||
if ($history) { ?>
|
||||
<div class="history">
|
||||
<?php
|
||||
@@ -39,3 +64,7 @@
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<script language="javascript" type="text/javascript">
|
||||
showhidecomment('comment-wrapper-<?php echo $question->id; ?>');
|
||||
</script>
|
||||
@@ -478,8 +478,8 @@ class default_questiontype {
|
||||
$commentlink = '';
|
||||
if (isset($options->questioncommentlink)) {
|
||||
$strcomment = get_string('commentorgrade', 'quiz');
|
||||
$commentlink = '<div class="commentlink">'.link_to_popup_window ($options->questioncommentlink.'?attempt='.$state->attempt.'&question='.$question->id,
|
||||
'commentquestion', $strcomment, 450, 650, $strcomment, 'none', true).'</div>';
|
||||
$attempt = get_record('quiz_attempts', 'uniqueid', $state->attempt); // would just have $attempt->uniqueid = $state->attempt but review.php needs $attempt->id
|
||||
$commentlink = "<a href=\"javascript: showhidecomment('comment-wrapper-$question->id');\">$strcomment</a>";
|
||||
}
|
||||
|
||||
$history = $this->history($question, $state, $number, $cmoptions, $options);
|
||||
|
||||
Reference in New Issue
Block a user