mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
MDL-19812 upgraded calls to print_table, print_single_button, print_user_picture, print_container* and notice_yesno
This commit is contained in:
parent
cf4d502665
commit
3ab269ed44
@ -25,7 +25,7 @@
|
||||
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");
|
||||
?>
|
||||
|
@ -62,7 +62,7 @@
|
||||
|
||||
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');
|
||||
@ -98,7 +98,7 @@
|
||||
$pageid = $page->nextpageid;
|
||||
}
|
||||
|
||||
print_table($table);
|
||||
echo $OUTPUT->table($table);
|
||||
break;
|
||||
|
||||
case 'single':
|
||||
|
@ -257,7 +257,7 @@
|
||||
}
|
||||
|
||||
// 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');
|
||||
@ -309,14 +309,14 @@
|
||||
// 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
|
||||
@ -330,34 +330,34 @@
|
||||
<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();
|
||||
@ -373,7 +373,7 @@
|
||||
$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').'" />
|
||||
|
@ -165,7 +165,7 @@
|
||||
}
|
||||
krsort($topscores);
|
||||
|
||||
$table = new stdClass;
|
||||
$table = new html_table();
|
||||
$table->align = array('center', 'left', 'right');
|
||||
$table->wrap = array();
|
||||
$table->width = "30%";
|
||||
@ -188,7 +188,7 @@
|
||||
break;
|
||||
}
|
||||
}
|
||||
print_table($table);
|
||||
echo $OUTPUT->table($table);
|
||||
}
|
||||
|
||||
if (!has_capability('mod/lesson:manage', $context)) { // teachers don't need the links
|
||||
|
@ -52,7 +52,7 @@
|
||||
$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);
|
||||
@ -102,7 +102,7 @@
|
||||
|
||||
echo "<br />";
|
||||
|
||||
print_table($table);
|
||||
echo $OUTPUT->table($table);
|
||||
|
||||
/// Finish the page
|
||||
|
||||
|
@ -219,6 +219,7 @@ function lesson_user_complete($course, $user, $mod, $lesson) {
|
||||
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%";
|
||||
@ -252,7 +253,7 @@ function lesson_user_complete($course, $user, $mod, $lesson) {
|
||||
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);
|
||||
|
@ -185,7 +185,8 @@
|
||||
$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'));
|
||||
@ -268,7 +269,7 @@
|
||||
<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>'.
|
||||
@ -325,7 +326,7 @@
|
||||
$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
|
||||
@ -822,7 +823,7 @@
|
||||
}
|
||||
|
||||
/// actually start printing something
|
||||
$table = new stdClass;
|
||||
$table = new html_table();
|
||||
$table->wrap = array();
|
||||
$table->width = "60%";
|
||||
|
||||
@ -866,16 +867,16 @@
|
||||
|
||||
$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 />";
|
||||
}
|
||||
|
||||
@ -913,7 +914,7 @@
|
||||
$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 />";
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user