Línea 28... |
Línea 28... |
28 |
* @package qbank_customfields
|
28 |
* @package qbank_customfields
|
29 |
* @copyright 2021 Catalyst IT Australia Pty Ltd
|
29 |
* @copyright 2021 Catalyst IT Australia Pty Ltd
|
30 |
* @author Matt Porritt <mattp@catalyst-au.net>
|
30 |
* @author Matt Porritt <mattp@catalyst-au.net>
|
31 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
31 |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
32 |
*/
|
32 |
*/
|
33 |
class customfield_test extends \advanced_testcase {
|
33 |
final class customfield_test extends \advanced_testcase {
|
Línea 34... |
Línea 34... |
34 |
|
34 |
|
35 |
/**
|
35 |
/**
|
36 |
* @var array Data object for generating a question.
|
36 |
* @var array Data object for generating a question.
|
37 |
*/
|
37 |
*/
|
Línea 89... |
Línea 89... |
89 |
*/
|
89 |
*/
|
90 |
protected function setup_questions(): void {
|
90 |
protected function setup_questions(): void {
|
91 |
// Question initial set up.
|
91 |
// Question initial set up.
|
92 |
$this->category = $this->getDataGenerator()->create_category();
|
92 |
$this->category = $this->getDataGenerator()->create_category();
|
93 |
$this->course = $this->getDataGenerator()->create_course(['category' => $this->category->id]);
|
93 |
$this->course = $this->getDataGenerator()->create_course(['category' => $this->category->id]);
|
- |
|
94 |
$qbank = self::getDataGenerator()->create_module('qbank', ['course' => $this->course->id]);
|
94 |
$context = \context_coursecat::instance($this->category->id);
|
95 |
$context = \context_module::instance($qbank->cmid);
|
95 |
$this->qgen = $this->getDataGenerator()->get_plugin_generator('core_question');
|
96 |
$this->qgen = $this->getDataGenerator()->get_plugin_generator('core_question');
|
96 |
$qcat = $this->qgen->create_question_category(['contextid' => $context->id]);
|
97 |
$qcat = $this->qgen->create_question_category(['contextid' => $context->id]);
|
Línea 97... |
Línea 98... |
97 |
|
98 |
|
98 |
$this->question1data = [
|
99 |
$this->question1data = [
|