Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exam mode: Show number of accepted complaints in assessment dashboard #7144

Merged
merged 8 commits into from
Oct 3, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
</td>
<td>{{ tutor.points }}</td>
<td>{{ tutor.numberOfAssessments }}</td>
<ng-container *ngIf="course && !course.isAtLeastInstructor; else atLeastInstructor">
<ng-container *ngIf="course && !course.isAtLeastInstructor && (!exercise || !exercise.isAtLeastInstructor); else atLeastInstructor">
valentin-boehm marked this conversation as resolved.
Show resolved Hide resolved
<td>{{ tutor.numberOfAcceptedComplaints }}</td>
<td *ngIf="!isExamMode">{{ tutor.numberOfNotAnsweredMoreFeedbackRequests }}</td>
</ng-container>
Expand All @@ -78,7 +78,12 @@
</ng-container>

<ng-container *ngIf="!isExerciseDashboard && course && course.id">
<td>
<td *ngIf="isExamMode && exam">
valentin-boehm marked this conversation as resolved.
Show resolved Hide resolved
<a [routerLink]="['/course-management', course.id, 'exams', exam.id, 'complaints']" [queryParams]="{ tutorId: tutor.userId }">
{{ tutor.numberOfAcceptedComplaints }}
</a>
</td>
<td *ngIf="!isExamMode">
<a [routerLink]="['/course-management', course.id, 'complaints']" [queryParams]="{ tutorId: tutor.userId }">
{{ tutor.numberOfAcceptedComplaints }}
</a>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Component, Input, OnInit } from '@angular/core';
import { TutorLeaderboardElement } from 'app/shared/dashboards/tutor-leaderboard/tutor-leaderboard.model';
import { Course } from 'app/entities/course.model';
import { Exercise } from 'app/entities/exercise.model';
import { Exercise, getCourseFromExercise } from 'app/entities/exercise.model';
import { AccountService } from 'app/core/auth/account.service';
import { SortService } from 'app/shared/service/sort.service';
import { Exam } from 'app/entities/exam.model';
Expand Down Expand Up @@ -35,10 +35,10 @@ export class TutorLeaderboardComponent implements OnInit {
* Life cycle hook called by Angular to indicate that Angular is done creating the component
*/
ngOnInit(): void {
if (this.exercise && this.exercise.course) {
this.course = this.exercise.course;
this.isExerciseDashboard = true;
if (this.exercise) {
this.course = getCourseFromExercise(this.exercise);
}
this.isExerciseDashboard = !!(this.exercise && this.course);
this.isExamMode = !!this.exam;
this.sortRows();
}
Expand Down