mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
MDL-20636 updates to view/renderer code
This commit is contained in:
parent
06eb64b8ba
commit
213d4cff9c
@ -660,6 +660,7 @@ class mod_quiz_renderer extends plugin_renderer_base {
|
||||
// Determine if we should be showing a start/continue attempt button,
|
||||
// or a button to go back to the course page.
|
||||
$output .= $this->box_start('quizattempt');
|
||||
$output .= 'TEST';
|
||||
$buttontext = ''; // This will be set something if as start/continue attempt button should appear.
|
||||
if (!quiz_clean_layout($quiz->questions, true)) {
|
||||
$output .= quiz_no_questions_message($quiz, $cm, $context);
|
||||
@ -703,7 +704,7 @@ class mod_quiz_renderer extends plugin_renderer_base {
|
||||
|
||||
// Now actually print the appropriate button.
|
||||
if ($buttontext) {
|
||||
$viewobj->accessmanager->print_start_attempt_button($viewobj->canpreview, $buttontext, $viewobj->unfinished);
|
||||
$output .= $viewobj->accessmanager->print_start_attempt_button($viewobj->canpreview, $buttontext, $viewobj->unfinished);
|
||||
} else if ($buttontext === '') {
|
||||
$output .= $this->single_button(new moodle_url('/course/view.php', array('id' => $course->id)),
|
||||
get_string('backtocourse', 'quiz'), 'get', array('class' => 'continuebutton'));
|
||||
|
@ -133,12 +133,9 @@ if ($attempts) {
|
||||
|
||||
$moreattempts = $unfinished || !$accessmanager->is_finished($numattempts, $lastfinishedattempt);
|
||||
|
||||
$title = $course->shortname . ': ' . format_string($quiz->name);
|
||||
$PAGE->set_title($title);
|
||||
$PAGE->set_heading($course->fullname);
|
||||
$output = $PAGE->get_renderer('mod_quiz');
|
||||
echo $OUTPUT->header();
|
||||
|
||||
/*
|
||||
* Create view object for use within renderers file
|
||||
*/
|
||||
$viewobj->attempts = $attempts;
|
||||
$viewobj->accessmanager = $accessmanager;
|
||||
$viewobj->canattempt = $canattempt;
|
||||
@ -160,6 +157,12 @@ $viewobj->feedbackcolumn = $feedbackcolumn;
|
||||
$viewobj->unfinished = $unfinished;
|
||||
$viewobj->lastfinishedattempt = $lastfinishedattempt;
|
||||
|
||||
$title = $course->shortname . ': ' . format_string($quiz->name);
|
||||
$PAGE->set_title($title);
|
||||
$PAGE->set_heading($course->fullname);
|
||||
$output = $PAGE->get_renderer('mod_quiz');
|
||||
echo $OUTPUT->header();
|
||||
|
||||
echo $output->view_page($course, $quiz, $cm, $context, $viewobj);
|
||||
|
||||
// Mark module as viewed (note, we do this here and not in finish_page,
|
||||
|
Loading…
x
Reference in New Issue
Block a user