MDL-64968 mod_lesson: Style "Yes, I'd like to try again" button.

This commit is contained in:
Luca Bösch 2019-02-27 18:06:00 +01:00
parent a411b499b9
commit d8a3787567

View File

@ -97,23 +97,17 @@ if (!$reviewmode) {
// User is modifying attempts - save button and some instructions
if (isset($USER->modattempts[$lesson->id])) {
$url = $CFG->wwwroot.'/mod/lesson/view.php';
$content = $OUTPUT->box(get_string("gotoendoflesson", "lesson"), 'center');
$content .= $OUTPUT->box(get_string("or", "lesson"), 'center');
$content .= $OUTPUT->box(get_string("continuetonextpage", "lesson"), 'center');
$content .= html_writer::empty_tag('input', array('type'=>'hidden', 'name'=>'id', 'value'=>$cm->id));
$content .= html_writer::empty_tag('input', array('type'=>'hidden', 'name'=>'pageid', 'value'=>LESSON_EOL));
$content .= html_writer::empty_tag('input', array('type'=>'submit', 'name'=>'submit', 'value'=>get_string('finish', 'lesson')));
echo html_writer::tag('form', "<div>$content</div>", array('method'=>'post', 'action'=>$url));
$url = new moodle_url('/mod/lesson/view.php', array('id' => $cm->id, 'pageid' => LESSON_EOL));
echo $content . $OUTPUT->single_button($url, get_string('finish', 'lesson'));
}
// Review button back
if (!$result->correctanswer && !$result->noanswer && !$result->isessayquestion && !$reviewmode && $lesson->review && !$result->maxattemptsreached) {
$url = $CFG->wwwroot.'/mod/lesson/view.php';
$content = html_writer::empty_tag('input', array('type'=>'hidden', 'name'=>'id', 'value'=>$cm->id));
$content .= html_writer::empty_tag('input', array('type'=>'hidden', 'name'=>'pageid', 'value'=>$page->id));
$content .= html_writer::empty_tag('input', array('type'=>'submit', 'name'=>'submit', 'value'=>get_string('reviewquestionback', 'lesson')));
echo html_writer::tag('form', "<div class=\"singlebutton\">$content</div>", array('method'=>'post', 'action'=>$url));
$url = new moodle_url('/mod/lesson/view.php', array('id' => $cm->id, 'pageid' => $page->id));
echo $OUTPUT->single_button($url, get_string('reviewquestionback', 'lesson'));
}
$url = new moodle_url('/mod/lesson/view.php', array('id'=>$cm->id, 'pageid'=>$result->newpageid));