echo $title."<br />\n";
}
}
- notice_yesno(get_string("confirmdeletionofthispage","lesson"),
- "lesson.php?action=delete&id=$cm->id&pageid=$pageid&sesskey=".sesskey(),
+ echo $OUTPUT->confirm(get_string("confirmdeletionofthispage","lesson"),
+ "lesson.php?action=delete&id=$cm->id&pageid=$pageid",
"view.php?id=$cm->id");
?>
switch ($mode) {
case 'collapsed':
- $table = new stdClass;
+ $table = new html_table();
$table->head = array(get_string('pagetitle', 'lesson'), get_string('qtype', 'lesson'), get_string('jumps', 'lesson'), get_string('actions', 'lesson'));
$table->align = array('left', 'left', 'left', 'center');
$table->wrap = array('', 'nowrap', '', 'nowrap');
$pageid = $page->nextpageid;
}
- print_table($table);
+ echo $OUTPUT->table($table);
break;
case 'single':
}
// Setup table
- $table = new stdClass;
+ $table = new html_table();
$table->head = array(get_string('name'), get_string('essays', 'lesson'), get_string('email', 'lesson'));
$table->align = array('left', 'left', 'left');
$table->wrap = array('nowrap', 'nowrap', 'nowrap');
// email link for this user
$emaillink = "<a href=\"$CFG->wwwroot/mod/lesson/essay.php?id=$cm->id&mode=email&userid=$userid&sesskey=".sesskey().'">'.get_string('emailgradedessays', 'lesson').'</a>';
- $table->data[] = array(print_user_picture($userid, $course->id, $users[$userid]->picture, 0, true).$studentname, implode("<br />\n", $essaylinks), $emaillink);
+ $table->data[] = array($OUTPUT->user_picture(moodle_user_picture::make($users[$userid], $course->id)).$studentname, implode("<br />\n", $essaylinks), $emaillink);
}
// email link for all users
$emailalllink = "<a href=\"$CFG->wwwroot/mod/lesson/essay.php?id=$cm->id&mode=email&sesskey=".sesskey().'">'.get_string('emailallgradedessays', 'lesson').'</a>';
$table->data[] = array(' ', ' ', $emailalllink);
- print_table($table);
+ echo $OUTPUT->table($table);
break;
case 'grade':
// Grading form
<input type="hidden" name="sesskey" value="'.sesskey().'" />';
// All tables will have these settings
- $table = new stdClass;
- $table->align = array('left');
- $table->wrap = array();
- $table->width = '50%';
- $table->size = array('100%');
- $table->class = 'generaltable gradetable';
+ $originaltable = new html_table();
+ $originaltable->align = array('left');
+ $originaltable->wrap = array();
+ $originaltable->width = '50%';
+ $originaltable->size = array('100%');
+ $originaltable->add_class('generaltable gradetable');
// Print the question
+ $table = clone($originaltable);
$table->head = array(get_string('question', 'lesson'));
$options = new stdClass;
$options->noclean = true;
$table->data[] = array(format_text($page->contents, FORMAT_MOODLE, $options));
- print_table($table);
-
- unset($table->data);
+ echo $OUTPUT->table($table);
// Now the user's answer
$essayinfo = unserialize($attempt->useranswer);
+ $table = clone($originaltable);
+ $table = new html_table();
$table->head = array(get_string('studentresponse', 'lesson', fullname($user, true)));
$table->data[] = array(s($essayinfo->answer));
- print_table($table);
-
- unset($table->data);
+ echo $OUTPUT->table($table);
// Now a response box and grade drop-down for grader
+ $table = clone($originaltable);
$table->head = array(get_string('comments', 'lesson'));
$table->data[] = array(print_textarea(false, 15, 60, 0, 0, 'response', $essayinfo->response, $course->id, true));
$options = array();
$select->nothingvalue = '';
$table->data[] = array(get_string('essayscore', 'lesson').': '.$OUTPUT->select($select));
- print_table($table);
+ echo $OUTPUT->table($table);
echo '<div class="buttons">
<input type="submit" name="cancel" value="'.get_string('cancel').'" />
<input type="submit" value="'.get_string('savechanges').'" />
}
krsort($topscores);
- $table = new stdClass;
+ $table = new html_table();
$table->align = array('center', 'left', 'right');
$table->wrap = array();
$table->width = "30%";
break;
}
}
- print_table($table);
+ echo $OUTPUT->table($table);
}
if (!has_capability('mod/lesson:manage', $context)) { // teachers don't need the links
$strweek = get_string("week");
$strtopic = get_string("topic");
$strnodeadline = get_string("nodeadline", "lesson");
- $table = new stdClass;
+ $table = new html_table();
if ($course->format == "weeks") {
$table->head = array ($strweek, $strname, $strgrade, $strdeadline);
echo "<br />";
- print_table($table);
+ echo $OUTPUT->table($table);
/// Finish the page
if ($attempts = $DB->get_records_select("lesson_attempts", "lessonid = :lessonid AND userid = :userid", $params,
"retry, timeseen")) {
echo $OUTPUT->box_start();
+ $table = new html_table();
$table->head = array (get_string("attempt", "lesson"), get_string("numberofpagesviewed", "lesson"),
get_string("numberofcorrectanswers", "lesson"), get_string("time"));
$table->width = "100%";
if ($npages) {
$table->data[] = array($retry + 1, $npages, $ncorrect, userdate($timeseen));
}
- print_table($table);
+ echo $OUTPUT->table($table);
echo $OUTPUT->box_end();
// also print grade summary
$params = array ("lessonid" => $lesson->id, "userid" => $user->id);
$lowscore = NULL;
$hightime = NULL;
$lowtime = NULL;
- $table = new stdClass;
+
+ $table = new html_table();
// set up the table object
$table->head = array(get_string('name'), get_string('attempts', 'lesson'), get_string('highscore', 'lesson'));
<input type=\"hidden\" name=\"id\" value=\"$cm->id\" />\n
<input type=\"hidden\" name=\"id\" value=\"$cm->id\" />\n";
}
- print_table($table);
+ echo $OUTPUT->table($table);
if (has_capability('mod/lesson:edit', $context)) {
echo '<br /><table width="90%" align="center"><tr><td>'.
$stattable->width = "90%";
$stattable->data[] = array($avescore.'%', $avetime, $highscore.'%', $lowscore.'%', $hightime, $lowtime);
- print_table($stattable);
+ echo $OUTPUT->table($stattable);
}
/**************************************************************************
this action is for a student detailed view and for the general detailed view
}
/// actually start printing something
- $table = new stdClass;
+ $table = new html_table();
$table->wrap = array();
$table->width = "60%";
$gradeinfo = lesson_grade($lesson, $try, $user->id);
- $table->data[] = array(get_string('name').':', print_user_picture($user->id, $course->id, $user->picture, 0, true).fullname($user, true));
+ $table->data[] = array(get_string('name').':', $OUTPUT->user_picture(moodle_user_picture::make($user, $course->id)).fullname($user, true));
$table->data[] = array(get_string("timetaken", "lesson").":", format_time($timetotake));
$table->data[] = array(get_string("completed", "lesson").":", userdate($completed));
$table->data[] = array(get_string('rawgrade', 'lesson').':', $gradeinfo->earned.'/'.$gradeinfo->total);
$table->data[] = array(get_string("grade", "lesson").":", $grade."%");
}
- print_table($table);
+ echo $OUTPUT->table($table);
// Don't want this class for later tables
- unset($table->class);
+ $table->set_classes();
echo "<br />";
}
$table->data[] = array($fontstart.get_string("response", "lesson").": <br />".$fontend.$fontstart2.format_text($page->answerdata->response,FORMAT_MOODLE,$formattextdefoptions).$fontend2, " ");
}
$table->data[] = array($page->answerdata->score, " ");
- print_table($table);
+ echo $OUTPUT->table($table);
echo "<br />";
}
}