improve XHTML compatability of HotPot reports; fix termination of <input> tags for JCloze and JQuiz

This commit is contained in:
gbateson
2007-10-22 01:48:14 +00:00
parent 956cabd4ab
commit 7762e45ef4
6 changed files with 17 additions and 16 deletions
+2 -2
View File
@@ -221,7 +221,7 @@ class hotpot_report extends hotpot_default_report {
} // foreach $detail
// set data cell values for
$this->set_data_click(
$allow_review ? '<a href="review.php?hp='.$hotpot->id.'&attempt='.$attempt->id.'">'.$clickcount.'</a>' : $clickcount,
$allow_review ? '<a href="review.php?hp='.$hotpot->id.'&amp;attempt='.$attempt->id.'">'.$clickcount.'</a>' : $clickcount,
trim(userdate($attempt->timefinish, $strftimetime)),
$exercisetype,
$click
@@ -399,7 +399,7 @@ class hotpot_report extends hotpot_default_report {
$idnumber = fullname($attempt);
}
if ($options['reportformat']=='htm') {
$idnumber = '<a href="'.$CFG->wwwroot.'/user/view.php?id='.$attempt->userid.'&course='.$course->id.'">'.$idnumber.'</a>';
$idnumber = '<a href="'.$CFG->wwwroot.'/user/view.php?id='.$attempt->userid.'&amp;course='.$course->id.'">'.$idnumber.'</a>';
}
$this->data['user'] = array(
'idnumber' => $idnumber,
+2 -1
View File
@@ -389,6 +389,7 @@ class hotpot_default_report {
$align = empty($table->align[$i]) ? '' : ' align="'.$table->align[$i].'"';
$class = empty($table->class[$i]) ? $d : ' class="'.$table->class[$i].'"';
$class = ' class="'.(empty($table->class[$i]) ? $d : $table->class[$i]).'"';
$size = empty($table->size[$i]) ? '' : ' width="'.$table->size[$i].'"';
$wrap = empty($table->wrap[$i]) ? '' : ' nowrap="nowrap"';
@@ -472,7 +473,7 @@ class hotpot_default_report {
} else { // $cell is a string
$text = $cell;
}
print $td.$text."</td>\n";
print $td.$text.(empty($table->fontsize[$col]) ? '' : '</font>')."</td>\n";
} else {
$skipcol[$col]--;
}
+2 -2
View File
@@ -72,13 +72,13 @@ class hotpot_report extends hotpot_default_report {
$name = "$u->firstname $u->lastname";
}
if ($is_html) {
$name = '<a href="'.$CFG->wwwroot.'/user/view.php?id='.$u->userid.'&course='.$course->id.'">'.$name.'</a>';
$name = '<a href="'.$CFG->wwwroot.'/user/view.php?id='.$u->userid.'&amp;course='.$course->id.'">'.$name.'</a>';
}
$grade = isset($user->grade) ? $user->grade : $blank;
foreach ($user->attempts as $attempt) {
$attemptnumber = $attempt->attempt;
if ($allow_review) {
$attemptnumber = ' <a href="review.php?hp='.$hotpot->id.'&attempt='.$attempt->id.'">'.$attemptnumber.'</a>';
$attemptnumber = ' <a href="review.php?hp='.$hotpot->id.'&amp;attempt='.$attempt->id.'">'.$attemptnumber.'</a>';
}
$cells = array ($name, $grade, $attemptnumber);
// $name and $grade are only printed on first line per user
+7 -7
View File
@@ -49,7 +49,7 @@ class hotpot_report extends hotpot_default_report {
$name = fullname($u);
if ($is_html) {
$picture = print_user_picture($u->userid, $course->id, $u->picture, false, true);
$name = '<a href="'.$CFG->wwwroot.'/user/view.php?id='.$u->userid.'&course='.$course->id.'">'.$name.'</a>';
$name = '<a href="'.$CFG->wwwroot.'/user/view.php?id='.$u->userid.'&amp;course='.$course->id.'">'.$name.'</a>';
}
$grade = isset($user->grade) && $user->grade<>'&nbsp;' ? $user->grade : $spacer;
$attemptcount = count($user->attempts);
@@ -83,11 +83,11 @@ class hotpot_report extends hotpot_default_report {
$attemptnumber = $attempt->attempt;
$starttime = trim(userdate($attempt->timestart, $strtimeformat));
if ($is_html && isset($attempt->score) && (has_capability('mod/hotpot:viewreport',get_context_instance(CONTEXT_COURSE, $course->id)) || $hotpot->review)) {
$attemptnumber = '<a href="review.php?hp='.$hotpot->id.'&attempt='.$attempt->id.'">'.$attemptnumber.'</a>';
$starttime = '<a href="review.php?hp='.$hotpot->id.'&attempt='.$attempt->id.'">'.$starttime.'</a>';
$attemptnumber = '<a href="review.php?hp='.$hotpot->id.'&amp;attempt='.$attempt->id.'">'.$attemptnumber.'</a>';
$starttime = '<a href="review.php?hp='.$hotpot->id.'&amp;attempt='.$attempt->id.'">'.$starttime.'</a>';
}
if ($is_html && has_capability('mod/hotpot:viewreport',get_context_instance(CONTEXT_COURSE, $course->id))) {
$checkbox = '<input type=checkbox name="box'.$attempt->clickreportid.'" value="'.$attempt->clickreportid.'">'.$spacer;
$checkbox = '<input type="checkbox" name="box'.$attempt->clickreportid.'" value="'.$attempt->clickreportid.'" />'.$spacer;
} else {
$checkbox = '';
}
@@ -116,13 +116,13 @@ class hotpot_report extends hotpot_default_report {
$table->start = $this->deleteform_javascript();
$table->start .= '<form method="post" action="report.php" id="deleteform" onsubmit="'."return deletecheck('".$strdeletecheck."', 'selection')".'">'."\n";
$table->start .= '<input type="hidden" name="del" value="selection" />'."\n";
$table->start .= '<input type="hidden" name="id" value="'.$cm->id.'">'."\n";
$table->start .= '<input type="hidden" name="id" value="'.$cm->id.'" />'."\n";
$table->finish = '<center>'."\n";
$table->finish .= '<input type="submit" value="'.get_string("deleteselected").'" />&nbsp;'."\n";
if ($abandoned) {
$table->finish .= '<input type=button value="'.get_string('deleteabandoned', 'hotpot').'" onClick="if(deletecheck('."'".addslashes(get_string('deleteabandonedcheck', 'hotpot', $abandoned))."', 'abandoned', true".')) document.getElementById(\'deleteform\').submit();" />'."\n";
$table->finish .= '<input type="button" value="'.get_string('deleteabandoned', 'hotpot').'" onClick="if(deletecheck('."'".addslashes(get_string('deleteabandonedcheck', 'hotpot', $abandoned))."', 'abandoned', true".')) document.getElementById(\'deleteform\').submit();" />'."\n";
}
$table->finish .= '<input type=button value="'.get_string("deleteall").'" onClick="if(deletecheck('."'".addslashes($strdeletecheck)."', 'all', true".'))document.getElementById(\'deleteform\').submit();" />'."\n";
$table->finish .= '<input type="button" value="'.get_string("deleteall").'" onClick="if(deletecheck('."'".addslashes($strdeletecheck)."', 'all', true".'))document.getElementById(\'deleteform\').submit();" />'."\n";
$table->finish .= '</center>'."\n";
$table->finish .= '</form>'."\n";
}
+2 -2
View File
@@ -58,7 +58,7 @@ class hotpot_report extends hotpot_default_report {
$name = fullname($u);
if ($is_html) {
$picture = print_user_picture($u->userid, $course->id, $u->picture, false, true);
$name = '<a href="'.$CFG->wwwroot.'/user/view.php?id='.$u->userid.'&course='.$course->id.'">'.$name.'</a>';
$name = '<a href="'.$CFG->wwwroot.'/user/view.php?id='.$u->userid.'&amp;course='.$course->id.'">'.$name.'</a>';
}
if (isset($user->grade)) {
$grade = $user->grade;
@@ -97,7 +97,7 @@ class hotpot_report extends hotpot_default_report {
// get attempt number
$attemptnumber= $attempt->attempt;
if ($is_html && $allow_review) {
$attemptnumber = '<a href="review.php?hp='.$hotpot->id.'&attempt='.$attempt->id.'">'.$attemptnumber.'</a>';
$attemptnumber = '<a href="review.php?hp='.$hotpot->id.'&amp;attempt='.$attempt->id.'">'.$attemptnumber.'</a>';
}
if ($is_best_grade) {
$score = '<span class="highlight">'.$attemptnumber.'</span>';
+2 -2
View File
@@ -913,7 +913,7 @@ class hotpot_xml_quiz_template extends hotpot_xml_template_default {
$a++;
}
$gap .= '<input type="text" id="Gap'.$q.'" onfocus="TrackFocus('.$q.')" onblur="LeaveGap()" class="GapBox" size="'.$gapsize.'" /></input>';
$gap .= '<input type="text" id="Gap'.$q.'" onfocus="TrackFocus('.$q.')" onblur="LeaveGap()" class="GapBox" size="'.$gapsize.'"></input>';
}
if ($includeclues) {
$clue = $this->parent->xml_value($question_record, $question."['clue'][0]['#']");
@@ -1264,7 +1264,7 @@ class hotpot_xml_quiz_template extends hotpot_xml_template_default {
$question_type==HOTPOT_JQUIZ_HYBRID
) {
$str .= '<div class="ShortAnswer" id="Q_'.$q.'_SA"><form method="post" action="" onsubmit="return false;"><div>';
$str .= '<input type="text" id="Q_'.$q.'_Guess" onfocus="TrackFocus('."'".'Q_'.$q.'_Guess'."'".')" onblur="LeaveGap()" class="ShortAnswerBox" size="9" /></input><br /><br />';
$str .= '<input type="text" id="Q_'.$q.'_Guess" onfocus="TrackFocus('."'".'Q_'.$q.'_Guess'."'".')" onblur="LeaveGap()" class="ShortAnswerBox" size="9"></input><br /><br />';
$caption = $this->v6_expand_CheckCaption();
$str .= $this->v6_expand_jquiz_button($caption, "CheckShortAnswer($q)");