Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 52... Línea 52...
52
     * usages to 20, using a qubaid_list, and verify.
52
     * usages to 20, using a qubaid_list, and verify.
53
     *
53
     *
54
     * Then we change the max mark for the essay question in the other
54
     * Then we change the max mark for the essay question in the other
55
     * usage to 2, using a qubaid_join, and verify.
55
     * usage to 2, using a qubaid_join, and verify.
56
     */
56
     */
57
    public function test_set_max_mark_in_attempts() {
57
    public function test_set_max_mark_in_attempts(): void {
Línea 58... Línea 58...
58
 
58
 
59
        // Set up some things the tests will need.
59
        // Set up some things the tests will need.
60
        $this->resetAfterTest();
60
        $this->resetAfterTest();
Línea 125... Línea 125...
125
        $this->assertEquals(10, $quba1->get_question_max_mark(2));
125
        $this->assertEquals(10, $quba1->get_question_max_mark(2));
126
        $this->assertEquals( 5, $quba2->get_question_max_mark(1));
126
        $this->assertEquals( 5, $quba2->get_question_max_mark(1));
127
        $this->assertEquals( 2, $quba2->get_question_max_mark(2));
127
        $this->assertEquals( 2, $quba2->get_question_max_mark(2));
128
    }
128
    }
Línea 129... Línea 129...
129
 
129
 
130
    public function test_load_used_variants() {
130
    public function test_load_used_variants(): void {
131
        $this->resetAfterTest();
131
        $this->resetAfterTest();
Línea 132... Línea 132...
132
        $generator = $this->getDataGenerator()->get_plugin_generator('core_question');
132
        $generator = $this->getDataGenerator()->get_plugin_generator('core_question');
133
 
133
 
Línea 153... Línea 153...
153
                ), question_engine::load_used_variants(
153
                ), question_engine::load_used_variants(
154
                    array($questiondata1->id, $questiondata2->id, $questiondata3->id),
154
                    array($questiondata1->id, $questiondata2->id, $questiondata3->id),
155
                    new qubaid_list(array($quba->get_id()))));
155
                    new qubaid_list(array($quba->get_id()))));
156
    }
156
    }
Línea 157... Línea 157...
157
 
157
 
158
    public function test_repeated_usage_saving_new_usage() {
158
    public function test_repeated_usage_saving_new_usage(): void {
Línea 159... Línea 159...
159
        global $DB;
159
        global $DB;
Línea 160... Línea 160...
160
 
160
 
Línea 190... Línea 190...
190
        $this->assertEquals(1, $DB->count_records('question_usages') - $initialqurows);
190
        $this->assertEquals(1, $DB->count_records('question_usages') - $initialqurows);
191
        $this->assertEquals(1, $DB->count_records('question_attempts') - $initialqarows);
191
        $this->assertEquals(1, $DB->count_records('question_attempts') - $initialqarows);
192
        $this->assertEquals(2, $DB->count_records('question_attempt_steps') - $initialqasrows);
192
        $this->assertEquals(2, $DB->count_records('question_attempt_steps') - $initialqasrows);
193
    }
193
    }
Línea 194... Línea 194...
194
 
194
 
195
    public function test_repeated_usage_saving_existing_usage() {
195
    public function test_repeated_usage_saving_existing_usage(): void {
Línea 196... Línea 196...
196
        global $DB;
196
        global $DB;
Línea 197... Línea 197...
197
 
197
 
Línea 232... Línea 232...
232
    }
232
    }
Línea 233... Línea 233...
233
 
233
 
234
    /**
234
    /**
235
     * Test that database operations on an empty usage work without errors.
235
     * Test that database operations on an empty usage work without errors.
236
     */
236
     */
237
    public function test_save_and_load_an_empty_usage() {
237
    public function test_save_and_load_an_empty_usage(): void {
Línea 238... Línea 238...
238
        $this->resetAfterTest();
238
        $this->resetAfterTest();
239
 
239
 
240
        // Create a new usage.
240
        // Create a new usage.