Skip to content

Commit

Permalink
No longer print the comment boxes for each question in review because…
Browse files Browse the repository at this point in the history
… it was too slow. We are back to opening the comment box in a popup window.
  • Loading branch information
gustav_delius committed Apr 10, 2006
1 parent 34b4089 commit 097bd3f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 32 deletions.
31 changes: 1 addition & 30 deletions question/type/question.html
Expand Up @@ -3,21 +3,6 @@
* 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; ?>" id="<?php echo $question->id; ?>"></a>
<div id="q<?php echo $question->id; ?>" class="que <?php echo $question->qtype; ?> clearfix">
<div class="info">
<span class="no"><?php echo $number; ?></span>
Expand All @@ -43,18 +28,8 @@
echo $comment;
?>
</div>
<?php } ?>
<div class="commentlink">
<?php
if (!empty($commentlink)) {
<?php }
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
Expand All @@ -64,7 +39,3 @@
</div>
<?php } ?>
</div>

<script language="javascript" type="text/javascript">
showhidecomment('comment-wrapper-<?php echo $question->id; ?>');
</script>
4 changes: 2 additions & 2 deletions question/type/questiontype.php
Expand Up @@ -478,8 +478,8 @@ function print_question(&$question, &$state, $number, $cmoptions, $options) {
$commentlink = '';
if (isset($options->questioncommentlink)) {
$strcomment = get_string('commentorgrade', 'quiz');
$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>";
$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>';
}

$history = $this->history($question, $state, $number, $cmoptions, $options);
Expand Down

0 comments on commit 097bd3f

Please sign in to comment.