mirror of
https://github.com/moodle/moodle.git
synced 2025-02-13 12:34:28 +01:00
MDL-27955 lesson module: fixed error for reviewing lesson and update string to continue or finish reviewing
This commit is contained in:
parent
7fde489dae
commit
57a4bd032b
@ -180,12 +180,12 @@ echo $result->feedback;
|
||||
// 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("savechangesandeol", "lesson"), 'center');
|
||||
$content = $OUTPUT->box(get_string("gotoendoflesson", "lesson"), 'center');
|
||||
$content .= $OUTPUT->box(get_string("or", "lesson"), 'center');
|
||||
$content .= $OUTPUT->box(get_string("continuetoanswer", "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('savechanges', 'lesson')));
|
||||
$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));
|
||||
}
|
||||
|
||||
|
@ -108,7 +108,7 @@ $string['confirmdelete'] = 'Delete page';
|
||||
$string['confirmdeletionofthispage'] = 'Confirm deletion of this page';
|
||||
$string['congratulations'] = 'Congratulations - end of lesson reached';
|
||||
$string['continue'] = 'Continue';
|
||||
$string['continuetoanswer'] = 'Continue to change answers.';
|
||||
$string['continuetonextpage'] = 'Continue to next page.';
|
||||
$string['correctanswerjump'] = 'Correct answer jump';
|
||||
$string['correctanswerscore'] = 'Correct answer score';
|
||||
$string['correctresponse'] = 'Correct response';
|
||||
@ -166,11 +166,13 @@ $string['essayemailsubject'] = 'Your grade for {$a} question';
|
||||
$string['essays'] = 'Essays';
|
||||
$string['essayscore'] = 'Essay score';
|
||||
$string['fileformat'] = 'File format';
|
||||
$string['finish'] = 'Finish';
|
||||
$string['firstanswershould'] = 'First answer should jump to the "Correct" page';
|
||||
$string['firstwrong'] = 'Unfortunately you cannot earn this one point, because your response was not correct. Would you like to keep guessing, just for the sheer joy of learning (but for no point credit)?';
|
||||
$string['flowcontrol'] = 'Flow control';
|
||||
$string['full'] = 'Expanded';
|
||||
$string['general'] = 'General';
|
||||
$string['gotoendoflesson'] = 'Go to the end of the lesson';
|
||||
$string['grade'] = 'Grade';
|
||||
$string['gradebetterthan'] = 'Grade better than (%)';
|
||||
$string['gradebetterthanerror'] = 'Earn a grade better than {$a} percent';
|
||||
|
@ -61,7 +61,14 @@ class lesson_page_type_matching extends lesson_page {
|
||||
protected function make_answer_form($attempt=null) {
|
||||
global $USER, $CFG;
|
||||
// don't shuffle answers (could be an option??)
|
||||
$answers = array_slice($this->get_answers(), 2);
|
||||
$getanswers = array_slice($this->get_answers(), 2);
|
||||
|
||||
//reassing array keys for answers
|
||||
$answers = array();
|
||||
foreach ($getanswers as $getanswer) {
|
||||
$answers[$getanswer->id] = $getanswer;
|
||||
}
|
||||
|
||||
$responses = array();
|
||||
foreach ($answers as $answer) {
|
||||
// get all the response
|
||||
@ -503,7 +510,7 @@ class lesson_display_answer_form_matching extends moodleform {
|
||||
if ($answer->response != NULL) {
|
||||
$mform->addElement('select', 'response['.$answer->id.']', format_text($answer->answer,$answer->answerformat,$options), $responseoptions);
|
||||
$mform->setType('response['.$answer->id.']', PARAM_TEXT);
|
||||
if (isset($USER->modattempts[$lessonid])) {
|
||||
if (isset($useranswers) && !empty($useranswers)) {
|
||||
$mform->setDefault('response['.$answer->id.']', htmlspecialchars(trim($answers[$useranswers[$i]]->response))); //TODO: this is suspicious
|
||||
} else {
|
||||
$mform->setDefault('response['.$answer->id.']', 'answeroption');
|
||||
|
@ -506,7 +506,7 @@ class lesson_display_answer_form_multichoice_singleanswer extends moodleform {
|
||||
$mform->addElement('radio','answerid',null,format_text($answer->answer, $answer->answerformat, $options),$answer->id);
|
||||
$mform->setType('answer'.$i, PARAM_INT);
|
||||
if (isset($USER->modattempts[$lessonid]) && $answer->id == $USER->modattempts[$lessonid]->answerid) {
|
||||
$mform->setDefault('answerid', true);
|
||||
$mform->setDefault('answerid', $USER->modattempts[$lessonid]->answerid);
|
||||
}
|
||||
$mform->addElement('html', '</div>');
|
||||
$i++;
|
||||
|
@ -319,7 +319,7 @@ class lesson_display_answer_form_truefalse extends moodleform {
|
||||
$mform->addElement('radio', 'answerid', null, format_text($answer->answer, $answer->answerformat, $options), $answer->id);
|
||||
$mform->setType('answerid', PARAM_INT);
|
||||
if (isset($USER->modattempts[$lessonid]) && $answer->id == $attempt->answerid) {
|
||||
$mform->setDefault('answerid', true);
|
||||
$mform->setDefault('answerid', $attempt->answerid);
|
||||
}
|
||||
$mform->addElement('html', '</div>');
|
||||
$i++;
|
||||
|
@ -359,6 +359,7 @@ if ($pageid != LESSON_EOL) {
|
||||
} else {
|
||||
$attempt = false;
|
||||
}
|
||||
$USER->modattempts[$lesson->id] = $attempt;
|
||||
$lessoncontent = $lessonoutput->display_page($lesson, $page, $attempt);
|
||||
} else {
|
||||
$data = new stdClass;
|
||||
|
Loading…
x
Reference in New Issue
Block a user