Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 11
Línea 34... Línea 34...
34
 * @copyright 2012 The Open University
34
 * @copyright 2012 The Open University
35
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
35
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
36
 */
36
 */
37
class multianswerformat_test extends \question_testcase {
37
class multianswerformat_test extends \question_testcase {
Línea 38... Línea 38...
38
 
38
 
39
    public function test_import() {
39
    public function test_import(): void {
Línea 40... Línea 40...
40
        $lines = file(__DIR__ . '/fixtures/questions.multianswer.txt');
40
        $lines = file(__DIR__ . '/fixtures/questions.multianswer.txt');
41
 
41
 
Línea 70... Línea 70...
70
        $this->assertEquals('multichoice', $qs[0]->options->questions[3]->qtype);
70
        $this->assertEquals('multichoice', $qs[0]->options->questions[3]->qtype);
71
        $this->assertEquals('multichoice', $qs[0]->options->questions[4]->qtype);
71
        $this->assertEquals('multichoice', $qs[0]->options->questions[4]->qtype);
72
        $this->assertEquals('shortanswer', $qs[0]->options->questions[5]->qtype);
72
        $this->assertEquals('shortanswer', $qs[0]->options->questions[5]->qtype);
73
    }
73
    }
Línea 74... Línea 74...
74
 
74
 
75
    public function test_read_brokencloze_1() {
75
    public function test_read_brokencloze_1(): void {
76
        $lines = file(__DIR__ . '/fixtures/broken_multianswer_1.txt');
76
        $lines = file(__DIR__ . '/fixtures/broken_multianswer_1.txt');
Línea 77... Línea 77...
77
        $importer = new qformat_multianswer();
77
        $importer = new qformat_multianswer();
78
 
78
 
Línea 89... Línea 89...
89
 
89
 
90
        // No question  have been imported.
90
        // No question  have been imported.
91
        $this->assertCount(0, $questions);
91
        $this->assertCount(0, $questions);
Línea 92... Línea 92...
92
    }
92
    }
93
 
93
 
94
    public function test_read_brokencloze_2() {
94
    public function test_read_brokencloze_2(): void {
Línea 95... Línea 95...
95
        $lines = file(__DIR__ . '/fixtures/broken_multianswer_2.txt');
95
        $lines = file(__DIR__ . '/fixtures/broken_multianswer_2.txt');
96
        $importer = new qformat_multianswer();
96
        $importer = new qformat_multianswer();
Línea 109... Línea 109...
109
 
109
 
110
        // No question  have been imported.
110
        // No question  have been imported.
111
        $this->assertCount(0, $questions);
111
        $this->assertCount(0, $questions);
Línea 112... Línea 112...
112
    }
112
    }
113
 
113
 
114
    public function test_read_brokencloze_3() {
114
    public function test_read_brokencloze_3(): void {
Línea 115... Línea 115...
115
        $lines = file(__DIR__ . '/fixtures/broken_multianswer_3.txt');
115
        $lines = file(__DIR__ . '/fixtures/broken_multianswer_3.txt');
116
        $importer = new qformat_multianswer();
116
        $importer = new qformat_multianswer();
Línea 128... Línea 128...
128
 
128
 
129
        // No question  have been imported.
129
        // No question  have been imported.
130
        $this->assertCount(0, $questions);
130
        $this->assertCount(0, $questions);
Línea 131... Línea 131...
131
    }
131
    }
132
 
132
 
133
    public function test_read_brokencloze_4() {
133
    public function test_read_brokencloze_4(): void {
Línea 134... Línea 134...
134
        $lines = file(__DIR__ . '/fixtures/broken_multianswer_4.txt');
134
        $lines = file(__DIR__ . '/fixtures/broken_multianswer_4.txt');
135
        $importer = new qformat_multianswer();
135
        $importer = new qformat_multianswer();