Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 74... Línea 74...
74
 
74
 
75
        $attempt = quiz_prepare_and_start_new_attempt($quizobj, 1, null, false, [], [], $user->id);
75
        $attempt = quiz_prepare_and_start_new_attempt($quizobj, 1, null, false, [], [], $user->id);
76
        return quiz_attempt::create($attempt->id);
76
        return quiz_attempt::create($attempt->id);
Línea 77... Línea 77...
77
    }
77
    }
78
 
78
 
Línea 79... Línea 79...
79
    public function test_attempt_url() {
79
    public function test_attempt_url(): void {
80
        $attempt = $this->create_quiz_and_attempt_with_layout('1,2,0,3,4,0,5,6,0');
80
        $attempt = $this->create_quiz_and_attempt_with_layout('1,2,0,3,4,0,5,6,0');
81
 
81
 
Línea 218... Línea 218...
218
    }
218
    }
Línea 219... Línea 219...
219
 
219
 
220
    /**
220
    /**
221
     * Tests attempt page titles when all questions are on a single page.
221
     * Tests attempt page titles when all questions are on a single page.
222
     */
222
     */
223
    public function test_attempt_titles_single() {
223
    public function test_attempt_titles_single(): void {
Línea 224... Línea 224...
224
        $attempt = $this->create_quiz_and_attempt_with_layout('1,2,0');
224
        $attempt = $this->create_quiz_and_attempt_with_layout('1,2,0');
225
 
225
 
Línea 234... Línea 234...
234
    }
234
    }
Línea 235... Línea 235...
235
 
235
 
236
    /**
236
    /**
237
     * Tests attempt page titles when questions are on multiple pages, but are reviewed on a single page.
237
     * Tests attempt page titles when questions are on multiple pages, but are reviewed on a single page.
238
     */
238
     */
239
    public function test_attempt_titles_multiple_single() {
239
    public function test_attempt_titles_multiple_single(): void {
Línea 240... Línea 240...
240
        $attempt = $this->create_quiz_and_attempt_with_layout('1,2,0,3,4,0,5,6,0');
240
        $attempt = $this->create_quiz_and_attempt_with_layout('1,2,0,3,4,0,5,6,0');
241
 
241
 
242
        // Attempt page.
242
        // Attempt page.
Línea 252... Línea 252...
252
    }
252
    }
Línea 253... Línea 253...
253
 
253
 
254
    /**
254
    /**
255
     * Tests attempt page titles when questions are on multiple pages, and they are reviewed on multiple pages as well.
255
     * Tests attempt page titles when questions are on multiple pages, and they are reviewed on multiple pages as well.
256
     */
256
     */
257
    public function test_attempt_titles_multiple_multiple() {
257
    public function test_attempt_titles_multiple_multiple(): void {
258
        $attempt = $this->create_quiz_and_attempt_with_layout(
258
        $attempt = $this->create_quiz_and_attempt_with_layout(
259
                '1,2,3,4,5,6,7,8,9,10,0,11,12,13,14,15,16,17,18,19,20,0,' .
259
                '1,2,3,4,5,6,7,8,9,10,0,11,12,13,14,15,16,17,18,19,20,0,' .
260
                '21,22,23,24,25,26,27,28,29,30,0,31,32,33,34,35,36,37,38,39,40,0,' .
260
                '21,22,23,24,25,26,27,28,29,30,0,31,32,33,34,35,36,37,38,39,40,0,' .
Línea 276... Línea 276...
276
        // When all questions are shown.
276
        // When all questions are shown.
277
        $this->assertEquals('Quiz 1: Attempt review', $attempt->review_page_title(0, true));
277
        $this->assertEquals('Quiz 1: Attempt review', $attempt->review_page_title(0, true));
278
        $this->assertEquals('Quiz 1: Attempt review', $attempt->review_page_title(1, true));
278
        $this->assertEquals('Quiz 1: Attempt review', $attempt->review_page_title(1, true));
279
    }
279
    }
Línea 280... Línea 280...
280
 
280
 
281
    public function test_is_participant() {
281
    public function test_is_participant(): void {
282
        global $USER;
282
        global $USER;
283
        $this->resetAfterTest();
283
        $this->resetAfterTest();
284
        $this->setAdminUser();
284
        $this->setAdminUser();
285
        $course = $this->getDataGenerator()->create_course();
285
        $course = $this->getDataGenerator()->create_course();
Línea 314... Línea 314...
314
    }
314
    }
Línea 315... Línea 315...
315
 
315
 
316
    /**
316
    /**
317
     * Test quiz_prepare_and_start_new_attempt function
317
     * Test quiz_prepare_and_start_new_attempt function
318
     */
318
     */
319
    public function test_quiz_prepare_and_start_new_attempt() {
319
    public function test_quiz_prepare_and_start_new_attempt(): void {
320
        global $USER;
320
        global $USER;
Línea 321... Línea 321...
321
        $this->resetAfterTest();
321
        $this->resetAfterTest();
322
 
322
 
Línea 418... Línea 418...
418
 
418
 
419
    /**
419
    /**
420
     * Test check_page_access function
420
     * Test check_page_access function
421
     * @covers \quiz_attempt::check_page_access
421
     * @covers \quiz_attempt::check_page_access
422
     */
422
     */
423
    public function test_check_page_access() {
423
    public function test_check_page_access(): void {
Línea 424... Línea 424...
424
        $timenow = time();
424
        $timenow = time();
425
 
425