Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

improve XHTML compatability of HotPot reports; correct termination of…

… <input> tags in JCloze and JQuiz
  • Loading branch information...
commit b1062ec3623a4c1fef100de77df8ab4386a786ee 1 parent 14a6c97
gbateson authored
4 mod/hotpot/report/click/report.php
View
@@ -221,7 +221,7 @@ function create_clickreport_table(&$hotpot, &$cm, &$course, &$users, &$attempts,
} // 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 @@ function set_data_user(&$options, &$course, &$user) {
$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,
3  mod/hotpot/report/default.php
View
@@ -389,6 +389,7 @@ function print_html_start(&$table) {
$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 @@ function print_html_data(&$table) {
} 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]--;
}
4 mod/hotpot/report/fullstat/report.php
View
@@ -72,13 +72,13 @@ function create_responses_table(&$hotpot, &$course, &$users, &$attempts, &$quest
$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
14 mod/hotpot/report/overview/report.php
View
@@ -49,7 +49,7 @@ function create_overview_table(&$hotpot, &$cm, &$course, &$users, &$attempts, &$
$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 @@ function create_overview_table(&$hotpot, &$cm, &$course, &$users, &$attempts, &$
$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 @@ function create_overview_table(&$hotpot, &$cm, &$course, &$users, &$attempts, &$
$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";
}
4 mod/hotpot/report/simplestat/report.php
View
@@ -58,7 +58,7 @@ function create_scores_table(&$hotpot, &$course, &$users, &$attempts, &$question
$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 @@ function create_scores_table(&$hotpot, &$course, &$users, &$attempts, &$question
// 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>';
4 mod/hotpot/template/v6.php
View
@@ -913,7 +913,7 @@ function v6_expand_ClozeBody() {
$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 @@ function v6_expand_QuestionOutput() {
$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)");
Please sign in to comment.
Something went wrong with that request. Please try again.