Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 105... Línea 105...
105
    }
105
    }
Línea 106... Línea 106...
106
 
106
 
107
    /**
107
    /**
108
     * Test get_course_grades function case student
108
     * Test get_course_grades function case student
109
     */
109
     */
Línea 110... Línea 110...
110
    public function test_get_course_grades_student() {
110
    public function test_get_course_grades_student(): void {
111
 
111
 
112
        // A user can see his own grades in both courses.
112
        // A user can see his own grades in both courses.
113
        $this->setUser($this->student1);
113
        $this->setUser($this->student1);
Línea 149... Línea 149...
149
    }
149
    }
Línea 150... Línea 150...
150
 
150
 
151
    /**
151
    /**
152
     * Test get_course_grades function case admin
152
     * Test get_course_grades function case admin
153
     */
153
     */
Línea 154... Línea 154...
154
    public function test_get_course_grades_admin() {
154
    public function test_get_course_grades_admin(): void {
155
 
155
 
Línea 156... Línea 156...
156
        // A admin must see all student grades.
156
        // A admin must see all student grades.
Línea 183... Línea 183...
183
    }
183
    }
Línea 184... Línea 184...
184
 
184
 
185
    /**
185
    /**
186
     * Test get_course_grades function case teacher
186
     * Test get_course_grades function case teacher
187
     */
187
     */
188
    public function test_get_course_grades_teacher() {
188
    public function test_get_course_grades_teacher(): void {
189
        // Teachers don't see grades.
189
        // Teachers don't see grades.
Línea 190... Línea 190...
190
        $this->setUser($this->teacher);
190
        $this->setUser($this->teacher);
191
 
191
 
Línea 196... Línea 196...
196
    }
196
    }
Línea 197... Línea 197...
197
 
197
 
198
    /**
198
    /**
199
     * Test get_course_grades function case incorrect permissions
199
     * Test get_course_grades function case incorrect permissions
200
     */
200
     */
201
    public function test_get_course_grades_permissions() {
201
    public function test_get_course_grades_permissions(): void {
202
        // Student can't see other student grades.
202
        // Student can't see other student grades.
Línea 203... Línea 203...
203
        $this->setUser($this->student2);
203
        $this->setUser($this->student2);
204
 
204
 
205
        $this->expectException('required_capability_exception');
205
        $this->expectException('required_capability_exception');
Línea 206... Línea 206...
206
        $studentgrade = gradereport_overview_external::get_course_grades($this->student1->id);
206
        $studentgrade = gradereport_overview_external::get_course_grades($this->student1->id);
207
    }
207
    }
208
 
208
 
209
    /**
209
    /**
210
     * Test view_grade_report function
210
     * Test view_grade_report function
Línea 211... Línea 211...
211
     */
211
     */
212
    public function test_view_grade_report() {
212
    public function test_view_grade_report(): void {
Línea 241... Línea 241...
241
    }
241
    }
Línea 242... Línea 242...
242
 
242
 
243
    /**
243
    /**
244
     * Test view_grade_report_permissions function
244
     * Test view_grade_report_permissions function
245
     */
245
     */
246
    public function test_view_grade_report_permissions() {
246
    public function test_view_grade_report_permissions(): void {
Línea 247... Línea 247...
247
        $this->setUser($this->student2);
247
        $this->setUser($this->student2);
248
 
248
 
249
        $this->expectException('moodle_exception');
249
        $this->expectException('moodle_exception');