| Línea 77... |
Línea 77... |
| 77 |
*
|
77 |
*
|
| 78 |
* @param null|array|stdClass $record data for module being generated.
|
78 |
* @param null|array|stdClass $record data for module being generated.
|
| 79 |
* @param null|array $options general options for course module.
|
79 |
* @param null|array $options general options for course module.
|
| 80 |
* @return stdClass record from module-defined table with additional field cmid (corresponding id in course_modules table)
|
80 |
* @return stdClass record from module-defined table with additional field cmid (corresponding id in course_modules table)
|
| 81 |
*/
|
81 |
*/
|
| 82 |
public function create_instance($record = null, array $options = null) {
|
82 |
public function create_instance($record = null, ?array $options = null) {
|
| 83 |
global $CFG;
|
83 |
global $CFG;
|
| Línea 84... |
Línea 84... |
| 84 |
|
84 |
|
| 85 |
// Add default values for lesson.
|
85 |
// Add default values for lesson.
|
| 86 |
$lessonconfig = get_config('mod_lesson');
|
86 |
$lessonconfig = get_config('mod_lesson');
|
| Línea 125... |
Línea 125... |
| 125 |
* Creates a page for testing purposes. The page will be created when answers are added.
|
125 |
* Creates a page for testing purposes. The page will be created when answers are added.
|
| 126 |
*
|
126 |
*
|
| 127 |
* @param null|array|stdClass $record data for page being generated.
|
127 |
* @param null|array|stdClass $record data for page being generated.
|
| 128 |
* @param null|array $options general options.
|
128 |
* @param null|array $options general options.
|
| 129 |
*/
|
129 |
*/
|
| 130 |
public function create_page($record = null, array $options = null) {
|
130 |
public function create_page($record = null, ?array $options = null) {
|
| 131 |
$record = (array) $record;
|
131 |
$record = (array) $record;
|
| Línea 132... |
Línea 132... |
| 132 |
|
132 |
|
| 133 |
// Pages require answers to work. Add it as a candidate page to be created once answers have been added.
|
133 |
// Pages require answers to work. Add it as a candidate page to be created once answers have been added.
|
| 134 |
$record['answer_editor'] = [];
|
134 |
$record['answer_editor'] = [];
|
| Línea 653... |
Línea 653... |
| 653 |
*
|
653 |
*
|
| 654 |
* @param null|array|stdClass $record data for module being generated.
|
654 |
* @param null|array|stdClass $record data for module being generated.
|
| 655 |
* @param null|array $options general options.
|
655 |
* @param null|array $options general options.
|
| 656 |
* @throws coding_exception
|
656 |
* @throws coding_exception
|
| 657 |
*/
|
657 |
*/
|
| 658 |
public function create_answer($record = null, array $options = null) {
|
658 |
public function create_answer($record = null, ?array $options = null) {
|
| 659 |
$record = (array) $record;
|
659 |
$record = (array) $record;
|
| Línea 660... |
Línea 660... |
| 660 |
|
660 |
|
| 661 |
$candidatepage = null;
|
661 |
$candidatepage = null;
|
| 662 |
$pagetitle = $record['page'];
|
662 |
$pagetitle = $record['page'];
|