Merge branch 'w27_MDL-39754_m23_evn26' of https://github.com/skodak/moodle into MOODL...
[moodle.git] / mod / lesson / pagetypes / matching.php
CommitLineData
0a4abb73
SH
1<?php
2
3// This file is part of Moodle - http://moodle.org/
4//
5// Moodle is free software: you can redistribute it and/or modify
6// it under the terms of the GNU General Public License as published by
7// the Free Software Foundation, either version 3 of the License, or
8// (at your option) any later version.
9//
10// Moodle is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU General Public License for more details.
14//
15// You should have received a copy of the GNU General Public License
16// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
17
18/**
19 * Matching
20 *
cc3dbaaa
PS
21 * @package mod
22 * @subpackage lesson
23 * @copyright 2009 Sam Hemelryk
24 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
0a4abb73
SH
25 **/
26
1e7f8ea2
PS
27defined('MOODLE_INTERNAL') || die();
28
0a4abb73
SH
29/** Matching question type */
30define("LESSON_PAGE_MATCHING", "5");
31
32class lesson_page_type_matching extends lesson_page {
33
34 protected $type = lesson_page::TYPE_QUESTION;
35 protected $typeid = LESSON_PAGE_MATCHING;
36 protected $typeidstring = 'matching';
37 protected $string = null;
38
39 public function get_typeid() {
40 return $this->typeid;
41 }
42 public function get_typestring() {
43 if ($this->string===null) {
44 $this->string = get_string($this->typeidstring, 'lesson');
45 }
46 return $this->string;
47 }
48 public function get_idstring() {
49 return $this->typeidstring;
50 }
51 public function display($renderer, $attempt) {
52 global $USER, $CFG, $PAGE;
53 $mform = $this->make_answer_form($attempt);
54 $data = new stdClass;
55 $data->id = $PAGE->cm->id;
56 $data->pageid = $this->properties->id;
57 $mform->set_data($data);
58 return $mform->display();
59 }
60
61 protected function make_answer_form($attempt=null) {
62 global $USER, $CFG;
4fb3f253 63 // don't shuffle answers (could be an option??)
57a4bd03
RW
64 $getanswers = array_slice($this->get_answers(), 2);
65
57a4bd03
RW
66 $answers = array();
67 foreach ($getanswers as $getanswer) {
68 $answers[$getanswer->id] = $getanswer;
69 }
70
0a4abb73
SH
71 $responses = array();
72 foreach ($answers as $answer) {
73 // get all the response
74 if ($answer->response != NULL) {
7f529009 75 $responses[$answer->id] = trim($answer->response);
0a4abb73
SH
76 }
77 }
78
04932409 79 $responseoptions = array(''=>get_string('choosedots'));
0a4abb73 80 if (!empty($responses)) {
7f529009
RW
81 $shuffleresponses = $responses;
82 shuffle($shuffleresponses);
7f529009
RW
83 foreach ($shuffleresponses as $response) {
84 $key = array_search($response, $responses);
85 $responseoptions[$key] = $response;
0a4abb73
SH
86 }
87 }
88 if (isset($USER->modattempts[$this->lesson->id]) && !empty($attempt->useranswer)) {
89 $useranswers = explode(',', $attempt->useranswer);
90 $t = 0;
91 } else {
92 $useranswers = array();
93 }
94
95 $action = $CFG->wwwroot.'/mod/lesson/continue.php';
96 $params = array('answers'=>$answers, 'useranswers'=>$useranswers, 'responseoptions'=>$responseoptions, 'lessonid'=>$this->lesson->id, 'contents'=>$this->get_contents());
97 $mform = new lesson_display_answer_form_matching($action, $params);
98 return $mform;
99 }
100
101 public function create_answers($properties) {
102 global $DB;
103 // now add the answers
104 $newanswer = new stdClass;
105 $newanswer->lessonid = $this->lesson->id;
106 $newanswer->pageid = $this->properties->id;
107 $newanswer->timecreated = $this->properties->timecreated;
108
109 $answers = array();
110
111 // need to add two to offset correct response and wrong response
112 $this->lesson->maxanswers = $this->lesson->maxanswers + 2;
113 for ($i = 0; $i < $this->lesson->maxanswers; $i++) {
114 $answer = clone($newanswer);
981debb7 115 if (!empty($properties->answer_editor[$i]) && is_array($properties->answer_editor[$i])) {
01c37ef1
PS
116 $answer->answer = $properties->answer_editor[$i]['text'];
117 $answer->answerformat = $properties->answer_editor[$i]['format'];
981debb7 118 }
0fabd979
JR
119 if (!empty($properties->response_editor[$i])) {
120 $answer->response = $properties->response_editor[$i];
121 $answer->responseformat = 0;
981debb7
SH
122 }
123
b43251b8
RW
124 if (isset($properties->jumpto[$i])) {
125 $answer->jumpto = $properties->jumpto[$i];
126 }
127 if ($this->lesson->custom && isset($properties->score[$i])) {
128 $answer->score = $properties->score[$i];
129 }
130
6d84e82f 131 if (isset($answer->answer) && $answer->answer != '') {
0a4abb73
SH
132 $answer->id = $DB->insert_record("lesson_answers", $answer);
133 $answers[$answer->id] = new lesson_page_answer($answer);
134 } else if ($i < 2) {
135 $answer->id = $DB->insert_record("lesson_answers", $answer);
136 $answers[$answer->id] = new lesson_page_answer($answer);
137 } else {
138 break;
139 }
140 }
141 $this->answers = $answers;
142 return $answers;
143 }
144
145 public function check_answer() {
df0442c6 146 global $CFG, $PAGE;
01c37ef1 147
39790bd8 148 $formattextdefoptions = new stdClass();
01c37ef1
PS
149 $formattextdefoptions->noclean = true;
150 $formattextdefoptions->para = false;
151
0a4abb73
SH
152 $result = parent::check_answer();
153
154 $mform = $this->make_answer_form();
155
156 $data = $mform->get_data();
157 require_sesskey();
158
159 if (!$data) {
a6855934 160 redirect(new moodle_url('/mod/lesson/view.php', array('id'=>$PAGE->cm->id, 'pageid'=>$this->properties->id)));
0a4abb73 161 }
2f67a9b3 162
0a4abb73 163 $response = $data->response;
c0f177f1 164 $getanswers = $this->get_answers();
a675ada5 165
c0f177f1
RW
166 $correct = array_shift($getanswers);
167 $wrong = array_shift($getanswers);
a675ada5 168
c0f177f1
RW
169 $answers = array();
170 foreach ($getanswers as $key=>$answer) {
7f529009
RW
171 if ($answer->answer !== '' or $answer->response !== '') {
172 $answers[$answer->id] = $answer;
0a4abb73 173 }
c0f177f1 174 unset($getanswers[$key]);
0a4abb73 175 }
152a040a 176 // get the user's exact responses for record keeping
a675ada5 177 $hits = 0;
0a4abb73 178 $userresponse = array();
7f529009 179 foreach ($response as $id => $value) {
b26066bf
RW
180 if ($value == '') {
181 $result->noanswer = true;
182 return $result;
183 }
7f529009 184 $userresponse[] = $value;
152a040a 185 // Make sure the user's answer exists in question's answer
9705bfa8 186 if (array_key_exists($id, $answers)) {
7f529009
RW
187 $answer = $answers[$id];
188 $result->studentanswer .= '<br />'.format_text($answer->answer, $answer->answerformat, $formattextdefoptions).' = '.$answers[$value]->response;
189 if ($id == $value) {
a675ada5
PS
190 $hits++;
191 }
0a4abb73
SH
192 }
193 }
7f529009 194
0a4abb73
SH
195 $result->userresponse = implode(",", $userresponse);
196
a675ada5 197 if ($hits == count($answers)) {
0a4abb73 198 $result->correctanswer = true;
a675ada5
PS
199 $result->response = format_text($correct->answer, $correct->answerformat, $formattextdefoptions);
200 $result->answerid = $correct->id;
201 $result->newpageid = $correct->jumpto;
0a4abb73 202 } else {
a675ada5
PS
203 $result->correctanswer = false;
204 $result->response = format_text($wrong->answer, $wrong->answerformat, $formattextdefoptions);
205 $result->answerid = $wrong->id;
206 $result->newpageid = $wrong->jumpto;
0a4abb73 207 }
a675ada5 208
0a4abb73
SH
209 return $result;
210 }
211
212 public function option_description_string() {
213 return get_string("firstanswershould", "lesson");
214 }
215
216 public function display_answers(html_table $table) {
217 $answers = $this->get_answers();
218 $options = new stdClass;
219 $options->noclean = true;
220 $options->para = false;
221 $i = 1;
222 $n = 0;
2f67a9b3 223
0a4abb73
SH
224 foreach ($answers as $answer) {
225 if ($n < 2) {
226 if ($answer->answer != NULL) {
227 $cells = array();
228 if ($n == 0) {
229 $cells[] = "<span class=\"label\">".get_string("correctresponse", "lesson").'</span>';
230 } else {
231 $cells[] = "<span class=\"label\">".get_string("wrongresponse", "lesson").'</span>';
232 }
01c37ef1 233 $cells[] = format_text($answer->answer, $answer->answerformat, $options);
8cea545e 234 $table->data[] = new html_table_row($cells);
0a4abb73 235 }
b43251b8
RW
236
237 if ($n == 0) {
238 $cells = array();
239 $cells[] = '<span class="label">'.get_string("correctanswerscore", "lesson")."</span>: ";
240 $cells[] = $answer->score;
241 $table->data[] = new html_table_row($cells);
242
243 $cells = array();
244 $cells[] = '<span class="label">'.get_string("correctanswerjump", "lesson")."</span>: ";
245 $cells[] = $this->get_jump_name($answer->jumpto);
246 $table->data[] = new html_table_row($cells);
247 } elseif ($n == 1) {
248 $cells = array();
249 $cells[] = '<span class="label">'.get_string("wronganswerscore", "lesson")."</span>: ";
250 $cells[] = $answer->score;
251 $table->data[] = new html_table_row($cells);
252
253 $cells = array();
254 $cells[] = '<span class="label">'.get_string("wronganswerjump", "lesson")."</span>: ";
255 $cells[] = $this->get_jump_name($answer->jumpto);
256 $table->data[] = new html_table_row($cells);
257 }
258
259 if ($n === 0){
260 $table->data[count($table->data)-1]->cells[0]->style = 'width:20%;';
261 }
0a4abb73
SH
262 $n++;
263 $i--;
264 } else {
265 $cells = array();
266 if ($this->lesson->custom && $answer->score > 0) {
267 // if the score is > 0, then it is correct
268 $cells[] = '<span class="labelcorrect">'.get_string("answer", "lesson")." $i</span>: \n";
269 } else if ($this->lesson->custom) {
270 $cells[] = '<span class="label">'.get_string("answer", "lesson")." $i</span>: \n";
271 } else if ($this->lesson->jumpto_is_correct($this->properties->id, $answer->jumpto)) {
272 $cells[] = '<span class="labelcorrect">'.get_string("answer", "lesson")." $i</span>: \n";
273 } else {
274 $cells[] = '<span class="label">'.get_string("answer", "lesson")." $i</span>: \n";
275 }
01c37ef1 276 $cells[] = format_text($answer->answer, $answer->answerformat, $options);
8cea545e 277 $table->data[] = new html_table_row($cells);
0a4abb73
SH
278
279 $cells = array();
280 $cells[] = '<span class="label">'.get_string("matchesanswer", "lesson")." $i</span>: ";
01c37ef1 281 $cells[] = format_text($answer->response, $answer->responseformat, $options);
8cea545e 282 $table->data[] = new html_table_row($cells);
0a4abb73 283 }
0a4abb73
SH
284 $i++;
285 }
286 return $table;
287 }
981debb7
SH
288 /**
289 * Updates the page and its answers
290 *
291 * @global moodle_database $DB
292 * @global moodle_page $PAGE
293 * @param stdClass $properties
294 * @return bool
295 */
0ed6f712 296 public function update($properties, $context = null, $maxbytes = null) {
0a4abb73
SH
297 global $DB, $PAGE;
298 $answers = $this->get_answers();
299 $properties->id = $this->properties->id;
300 $properties->lessonid = $this->lesson->id;
64f93798 301 $properties = file_postupdate_standard_editor($properties, 'contents', array('noclean'=>true, 'maxfiles'=>EDITOR_UNLIMITED_FILES, 'maxbytes'=>$PAGE->course->maxbytes), get_context_instance(CONTEXT_MODULE, $PAGE->cm->id), 'mod_lesson', 'page_contents', $properties->id);
0a4abb73
SH
302 $DB->update_record("lesson_pages", $properties);
303
304 // need to add two to offset correct response and wrong response
305 $this->lesson->maxanswers += 2;
306 for ($i = 0; $i < $this->lesson->maxanswers; $i++) {
307 if (!array_key_exists($i, $this->answers)) {
308 $this->answers[$i] = new stdClass;
309 $this->answers[$i]->lessonid = $this->lesson->id;
310 $this->answers[$i]->pageid = $this->id;
311 $this->answers[$i]->timecreated = $this->timecreated;
312 }
981debb7
SH
313
314 if (!empty($properties->answer_editor[$i]) && is_array($properties->answer_editor[$i])) {
01c37ef1
PS
315 $this->answers[$i]->answer = $properties->answer_editor[$i]['text'];
316 $this->answers[$i]->answerformat = $properties->answer_editor[$i]['format'];
981debb7 317 }
0fabd979
JR
318 if (!empty($properties->response_editor[$i])) {
319 $this->answers[$i]->response = $properties->response_editor[$i];
320 $this->answers[$i]->responseformat = 0;
981debb7
SH
321 }
322
b43251b8
RW
323 if (isset($properties->jumpto[$i])) {
324 $this->answers[$i]->jumpto = $properties->jumpto[$i];
325 }
326 if ($this->lesson->custom && isset($properties->score[$i])) {
327 $this->answers[$i]->score = $properties->score[$i];
328 }
329
6d84e82f
RW
330 // we don't need to check for isset here because properties called it's own isset method.
331 if ($this->answers[$i]->answer != '') {
0a4abb73
SH
332 if (!isset($this->answers[$i]->id)) {
333 $this->answers[$i]->id = $DB->insert_record("lesson_answers", $this->answers[$i]);
334 } else {
335 $DB->update_record("lesson_answers", $this->answers[$i]->properties());
336 }
0a4abb73
SH
337 } else if ($i < 2) {
338 if (!isset($this->answers[$i]->id)) {
339 $this->answers[$i]->id = $DB->insert_record("lesson_answers", $this->answers[$i]);
340 } else {
341 $DB->update_record("lesson_answers", $this->answers[$i]->properties());
342 }
343
981debb7
SH
344 } else if (isset($this->answers[$i]->id)) {
345 $DB->delete_records('lesson_answers', array('id'=>$this->answers[$i]->id));
346 unset($this->answers[$i]);
0a4abb73
SH
347 }
348 }
349 return true;
350 }
351 public function stats(array &$pagestats, $tries) {
352 if(count($tries) > $this->lesson->maxattempts) { // if there are more tries than the max that is allowed, grab the last "legal" attempt
353 $temp = $tries[$this->lesson->maxattempts - 1];
354 } else {
355 // else, user attempted the question less than the max, so grab the last one
356 $temp = end($tries);
357 }
358 if ($temp->correct) {
359 if (isset($pagestats[$temp->pageid]["correct"])) {
360 $pagestats[$temp->pageid]["correct"]++;
361 } else {
362 $pagestats[$temp->pageid]["correct"] = 1;
363 }
364 }
365 if (isset($pagestats[$temp->pageid]["total"])) {
366 $pagestats[$temp->pageid]["total"]++;
367 } else {
368 $pagestats[$temp->pageid]["total"] = 1;
369 }
370 return true;
371 }
372 public function report_answers($answerpage, $answerdata, $useranswer, $pagestats, &$i, &$n) {
373 $answers = array();
374 foreach ($this->get_answers() as $answer) {
375 $answers[$answer->id] = $answer;
376 }
377 $formattextdefoptions = new stdClass;
378 $formattextdefoptions->para = false; //I'll use it widely in this page
379 foreach ($answers as $answer) {
380 if ($n == 0 && $useranswer != NULL && $useranswer->correct) {
381 if ($answer->response == NULL && $useranswer != NULL) {
382 $answerdata->response = get_string("thatsthecorrectanswer", "lesson");
383 } else {
384 $answerdata->response = $answer->response;
385 }
c90ba16f 386 if ($this->lesson->custom) {
6d3ae910
AB
387 $answerdata->score = get_string("pointsearned", "lesson").": ".$answer->score;
388 } else {
389 $answerdata->score = get_string("receivedcredit", "lesson");
390 }
0a4abb73
SH
391 } elseif ($n == 1 && $useranswer != NULL && !$useranswer->correct) {
392 if ($answer->response == NULL && $useranswer != NULL) {
393 $answerdata->response = get_string("thatsthewronganswer", "lesson");
394 } else {
395 $answerdata->response = $answer->response;
396 }
c90ba16f
RW
397 if ($this->lesson->custom) {
398 $answerdata->score = get_string("pointsearned", "lesson").": ".$answer->score;
399 } else {
400 $answerdata->score = get_string("didnotreceivecredit", "lesson");
0a4abb73 401 }
c90ba16f 402 } elseif ($n > 1) {
077e06f6
RW
403 $data = '<label class="accesshide" for="answer_' . $n . '">' . get_string('answer', 'lesson') . '</label>';
404 $data .= "<select id=\"answer_". $n ."\" disabled=\"disabled\"><option selected=\"selected\">".strip_tags(format_string($answer->answer))."</option></select>";
0a4abb73
SH
405 if ($useranswer != NULL) {
406 $userresponse = explode(",", $useranswer->useranswer);
077e06f6
RW
407 $data .= '<label class="accesshide" for="stu_answer_response_' . $n . '">' . get_string('matchesanswer', 'lesson') . '</label>';
408 $data .= "<select id=\"stu_answer_response_" . $n . "\" disabled=\"disabled\"><option selected=\"selected\">";
981debb7
SH
409 if (array_key_exists($i, $userresponse)) {
410 $data .= strip_tags(format_string($answers[$userresponse[$i]]->response));
411 }
412 $data .= "</option></select>";
0a4abb73 413 } else {
077e06f6
RW
414 $data .= '<label class="accesshide" for="answer_response_' . $n . '">' . get_string('matchesanswer', 'lesson') . '</label>';
415 $data .= "<select id=\"answer_response_" . $n . "\" disabled=\"disabled\"><option selected=\"selected\">".strip_tags(format_string($answer->response))."</option></select>";
0a4abb73
SH
416 }
417
418 if ($n == 2) {
419 if (isset($pagestats[$this->properties->id])) {
420 if (!array_key_exists('correct', $pagestats[$this->properties->id])) {
421 $pagestats[$this->properties->id]["correct"] = 0;
422 }
423 $percent = $pagestats[$this->properties->id]["correct"] / $pagestats[$this->properties->id]["total"] * 100;
424 $percent = round($percent, 2);
425 $percent .= "% ".get_string("answeredcorrectly", "lesson");
426 } else {
427 $percent = get_string("nooneansweredthisquestion", "lesson");
428 }
429 } else {
c90ba16f 430 $percent = '';
0a4abb73
SH
431 }
432
433 $answerdata->answers[] = array($data, $percent);
434 $i++;
435 }
436 $n++;
437 $answerpage->answerdata = $answerdata;
438 }
439 return $answerpage;
440 }
441 public function get_jumps() {
442 global $DB;
86d99db3 443 // The jumps for matching question type are stored in the 1st and 2nd answer record.
0a4abb73 444 $jumps = array();
04932409 445 if ($answers = $DB->get_records("lesson_answers", array("lessonid" => $this->lesson->id, "pageid" => $this->properties->id), 'id', '*', 0, 2)) {
0a4abb73
SH
446 foreach ($answers as $answer) {
447 $jumps[] = $this->get_jump_name($answer->jumpto);
448 }
9170dea7
SH
449 } else {
450 $jumps[] = $this->get_jump_name($this->properties->nextpageid);
0a4abb73
SH
451 }
452 return $jumps;
453 }
454}
455
456class lesson_add_page_form_matching extends lesson_add_page_form_base {
457
458 public $qtype = 'matching';
459 public $qtypestring = 'matching';
460
461 public function custom_definition() {
462
463 $this->_form->addElement('header', 'correctresponse', get_string('correctresponse', 'lesson'));
cb2c1963 464 $this->_form->addElement('editor', 'answer_editor[0]', get_string('correctresponse', 'lesson'), array('rows'=>'4', 'columns'=>'80'), array('noclean'=>true));
76f5f66f 465 $this->add_jumpto(0, get_string('correctanswerjump','lesson'), LESSON_NEXTPAGE);
b43251b8 466 $this->add_score(0, get_string("correctanswerscore", "lesson"), 1);
0a4abb73
SH
467
468 $this->_form->addElement('header', 'wrongresponse', get_string('wrongresponse', 'lesson'));
cb2c1963 469 $this->_form->addElement('editor', 'answer_editor[1]', get_string('wrongresponse', 'lesson'), array('rows'=>'4', 'columns'=>'80'), array('noclean'=>true));
76f5f66f 470 $this->add_jumpto(1, get_string('wronganswerjump','lesson'), LESSON_THISPAGE);
b43251b8 471 $this->add_score(1, get_string("wronganswerscore", "lesson"), 0);
0a4abb73
SH
472
473 for ($i = 2; $i < $this->_customdata['lesson']->maxanswers+2; $i++) {
474 $this->_form->addElement('header', 'matchingpair'.($i-1), get_string('matchingpair', 'lesson', $i-1));
a675ada5 475 $this->add_answer($i, NULL, ($i < 4));
0fabd979
JR
476 $required = ($i < 4);
477 $label = get_string('matchesanswer','lesson');
478 $count = $i;
479 $this->_form->addElement('text', 'response_editor['.$count.']', $label, array('size'=>'50'));
480 $this->_form->setDefault('response_editor['.$count.']', '');
481 if ($required) {
482 $this->_form->addRule('response_editor['.$count.']', get_string('required'), 'required', null, 'client');
483 }
0a4abb73
SH
484 }
485 }
486}
487
0a4abb73
SH
488class lesson_display_answer_form_matching extends moodleform {
489
490 public function definition() {
491 global $USER, $OUTPUT;
492 $mform = $this->_form;
493 $answers = $this->_customdata['answers'];
494 $useranswers = $this->_customdata['useranswers'];
495 $responseoptions = $this->_customdata['responseoptions'];
496 $lessonid = $this->_customdata['lessonid'];
497 $contents = $this->_customdata['contents'];
498
ffdf7f8a
DM
499 $mform->addElement('header', 'pageheader');
500
501 $mform->addElement('html', $OUTPUT->container($contents, 'contents'));
0a4abb73 502
abd5c24e
RW
503 $hasattempt = false;
504 $disabled = '';
505 if (isset($useranswers) && !empty($useranswers)) {
506 $hasattempt = true;
507 $disabled = array('disabled' => 'disabled');
508 }
509
0a4abb73
SH
510 $options = new stdClass;
511 $options->para = false;
512 $options->noclean = true;
513
514 $mform->addElement('hidden', 'id');
515 $mform->setType('id', PARAM_INT);
516
517 $mform->addElement('hidden', 'pageid');
518 $mform->setType('pageid', PARAM_INT);
519
520 $i = 0;
521 foreach ($answers as $answer) {
522 $mform->addElement('html', '<div class="answeroption">');
523 if ($answer->response != NULL) {
abd5c24e
RW
524 $responseid = 'response['.$answer->id.']';
525 if ($hasattempt) {
526 $responseid = 'response_'.$answer->id;
527 $mform->addElement('hidden', 'response['.$answer->id.']', htmlspecialchars(trim($answers[$useranswers[$i]]->response)));
528 $mform->setType('response['.$answer->id.']', PARAM_TEXT);
529 }
530 $mform->addElement('select', $responseid, format_text($answer->answer,$answer->answerformat,$options), $responseoptions, $disabled);
531 $mform->setType($responseid, PARAM_TEXT);
532 if ($hasattempt) {
533 $mform->setDefault($responseid, htmlspecialchars(trim($answers[$useranswers[$i]]->response))); //TODO: this is suspicious
0a4abb73 534 } else {
abd5c24e 535 $mform->setDefault($responseid, 'answeroption');
0a4abb73
SH
536 }
537 }
538 $mform->addElement('html', '</div>');
539 $i++;
540 }
abd5c24e
RW
541 if ($hasattempt) {
542 $this->add_action_buttons(null, get_string("nextpage", "lesson"));
543 } else {
544 $this->add_action_buttons(null, get_string("submit", "lesson"));
545 }
0a4abb73
SH
546 }
547
ffdf7f8a 548}