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

General: Add missing details to course detail view in course management #7397

Merged
merged 10 commits into from
Oct 23, 2023
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<div class="doughnut mx-3">
<a *ngIf="titleLink" [routerLink]="['/course-management', course.id, titleLink]">
<h4 class="text-center">{{ 'artemisApp.course.detail.' + doughnutChartTitle + 'Title' | artemisTranslate }}</h4>
<h5 class="text-center">{{ 'artemisApp.course.detail.' + doughnutChartTitle + 'Title' | artemisTranslate }}</h5>
</a>
<h4 *ngIf="!titleLink" class="text-center">{{ 'artemisApp.course.detail.' + doughnutChartTitle + 'Title' | artemisTranslate }}</h4>
<h5 *ngIf="!titleLink" class="text-center">{{ 'artemisApp.course.detail.' + doughnutChartTitle + 'Title' | artemisTranslate }}</h5>
<div class="doughnut-chart-container" [ngClass]="titleLink ? 'clickable' : ''" (click)="openCorrespondingPage()">
<div class="doughnut-chart-text">
<h2 *ngIf="receivedStats" class="text-center">{{ currentPercentage }}%</h2>
Expand All @@ -11,6 +11,6 @@ <h1 *ngIf="!receivedStats" class="text-center" style="z-index: 1">
<fa-icon [icon]="faSpinner" [spin]="true">&nbsp;</fa-icon>
</h1>
</div>
<ngx-charts-pie-chart [view]="[250, 250]" [results]="ngxData" [scheme]="ngxColor" [doughnut]="true" [tooltipText]="bindFormatting"> </ngx-charts-pie-chart>
<ngx-charts-pie-chart [view]="[200, 200]" [results]="ngxData" [scheme]="ngxColor" [doughnut]="true" [tooltipText]="bindFormatting"> </ngx-charts-pie-chart>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ <h5>{{ 'artemisApp.courseStatistics.activeStudents' | artemisTranslate }}</h5>
></fa-icon>
<div #containerRef class="chart col-md-10 mt-1 justify-content-center align-items-start h-99" [ngClass]="showsCurrentWeek && startDateDisplayed ? 'col-12' : 'col-10'">
<ngx-charts-line-chart
[view]="[containerRef.offsetWidth, 500]"
[view]="[containerRef.offsetWidth, 400]"
[scheme]="chartColor"
[legend]="legend"
[showXAxisLabel]="showXAxisLabel"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ <h2><span jhiTranslate="artemisApp.course.detail.title">Course Details:</span></
<dd id="course-short-name">
<span>{{ course.shortName }}</span>
</dd>
<ng-container *ngIf="(course.organizations?.length ?? 0) > 0">
milljoniaer marked this conversation as resolved.
Show resolved Hide resolved
<dt><span jhiTranslate="artemisApp.course.organizations">Course Organizations</span></dt>
<dd id="course-organisations">
<span *ngFor="let organization of course.organizations" class="badge bg-primary font-weight-normal m-1 ps-3">{{ organization.name }}</span>
</dd>
</ng-container>
<!--
For users which are at least instructor we show the group name including a link to the course user group management,
where new users can be added to the group, since they have the permission to add/remove users to/from the group
Expand Down Expand Up @@ -110,23 +116,29 @@ <h2><span jhiTranslate="artemisApp.course.detail.title">Course Details:</span></
</dd>
</div>
</ng-template>
<dt><span jhiTranslate="artemisApp.course.maxPoints.title">Max. Number of Points</span></dt>
<dd>
<span>{{ course.maxPoints || '-' }}</span>
</dd>
<dt><span jhiTranslate="artemisApp.course.accuracyOfScores">Number of decimal places used for calculating the scores</span></dt>
<dd>
<span>{{ course.accuracyOfScores || '-' }}</span>
</dd>
<dt><span jhiTranslate="artemisApp.course.startDate">Start Date</span></dt>
<dd id="course-start-date">
<span>{{ course.startDate | artemisDate }}</span>
<span>{{ (course.startDate | artemisDate) || '-' }}</span>
</dd>
<dt><span jhiTranslate="artemisApp.course.endDate">End Date</span></dt>
<dd id="course-end-date">
<span>{{ course.endDate | artemisDate }}</span>
<span>{{ (course.endDate | artemisDate) || '-' }}</span>
</dd>
<dt><span jhiTranslate="artemisApp.course.semester">Semester</span></dt>
<dd id="course-semester">
<span *ngIf="course.semester && course.semester !== ''">{{ course.semester }}</span>
<span *ngIf="!course.semester || course.semester === ''">{{ 'global.generic.unset' | artemisTranslate }}</span>
<span>{{ course.semester || '-' }}</span>
</dd>
<dt><span jhiTranslate="artemisApp.course.defaultProgrammingLanguage">Default Programming Language</span></dt>
<dd id="course-programming-language">
<span *ngIf="course.defaultProgrammingLanguage">{{ course.defaultProgrammingLanguage }}</span>
<span *ngIf="!course.defaultProgrammingLanguage">{{ 'global.generic.unset' | artemisTranslate }}</span>
<span>{{ course.defaultProgrammingLanguage || '-' }}</span>
</dd>
<dt><span jhiTranslate="artemisApp.course.testCourse.title">Test Course</span></dt>
<dd id="course-test-course">
Expand All @@ -145,28 +157,28 @@ <h2><span jhiTranslate="artemisApp.course.detail.title">Course Details:</span></
<a [routerLink]="['/course-management', course?.id, 'lti-configuration']">LTI Configuration</a>
</dd>
</ng-container>
<dt><span jhiTranslate="artemisApp.course.registrationEnabled.title">Student Course Registration Enabled</span></dt>
<dd id="course-enrollment-enabled">
<span *ngIf="course.enrollmentEnabled">{{ 'global.generic.yes' | artemisTranslate }}</span>
<span *ngIf="!course.enrollmentEnabled">{{ 'global.generic.no' | artemisTranslate }}</span>
</dd>
<dt *ngIf="course.enrollmentEnabled"><span jhiTranslate="artemisApp.course.enrollmentStartDate">Enrollment Start</span></dt>
<dd *ngIf="course.enrollmentEnabled" id="course-enrollment-start-date">
<span>{{ course.enrollmentStartDate | artemisDate }}</span>
</dd>
<dt *ngIf="course.enrollmentEnabled"><span jhiTranslate="artemisApp.course.enrollmentEndDate">Enrollment End</span></dt>
<dd *ngIf="course.enrollmentEnabled" id="course-enrollment-end-date">
<span>{{ course.enrollmentEndDate | artemisDate }}</span>
</dd>
<dt><span jhiTranslate="artemisApp.course.unenrollmentEnabled.title">Student Course Unenrollment Enabled</span></dt>
<dd *ngIf="course.enrollmentEnabled" id="course-unenrollment-enabled">
<span *ngIf="course.unenrollmentEnabled">{{ 'global.generic.yes' | artemisTranslate }}</span>
<span *ngIf="!course.unenrollmentEnabled">{{ 'global.generic.no' | artemisTranslate }}</span>
</dd>
<dt *ngIf="course.unenrollmentEnabled"><span jhiTranslate="artemisApp.course.unenrollmentEndDate">Latest date to unenroll</span></dt>
<dd *ngIf="course.unenrollmentEnabled" id="course-unenrollment-end-date">
<span>{{ course.unenrollmentEndDate | artemisDate }}</span>
</dd>
<ng-container *ngIf="course.enrollmentEnabled">
<dt><span jhiTranslate="artemisApp.course.enrollmentStartDate">Enrollment Start</span></dt>
<dd id="course-enrollment-start-date">
<span>{{ (course.enrollmentStartDate | artemisDate) || '-' }}</span>
</dd>
<dt><span jhiTranslate="artemisApp.course.enrollmentEndDate">Enrollment End</span></dt>
<dd id="course-enrollment-end-date">
<span>{{ (course.enrollmentEndDate | artemisDate) || '-' }}</span>
</dd>
<dt><span jhiTranslate="artemisApp.course.registrationConfirmationMessage">Registration Confirmation Message</span></dt>
<dd
id="course-enrollment-confirmation"
class="markdown-preview editor-outline-background"
[innerHTML]="course.enrollmentConfirmationMessage | htmlForMarkdown"
></dd>
</ng-container>
<ng-container *ngIf="course.unenrollmentEnabled">
<dt><span jhiTranslate="artemisApp.course.unenrollmentEndDate">Latest date to unenroll</span></dt>
<dd id="course-unenrollment-end-date">
<span>{{ (course.unenrollmentEndDate | artemisDate) || '-' }}</span>
</dd>
</ng-container>
<ng-container [jhiFeatureToggleLink]="FeatureToggle.TutorialGroups">
<dt>
<span>{{ 'artemisApp.forms.configurationForm.timeZoneInput.label' | artemisTranslate }} </span>
Expand All @@ -180,30 +192,52 @@ <h2><span jhiTranslate="artemisApp.course.detail.title">Course Details:</span></
</div>
</dd>
</ng-container>
<ng-container *ngIf="course.maxComplaints !== 0">
<ng-container *ngIf="course.complaintsEnabled">
<dt><span jhiTranslate="artemisApp.course.maxComplaints.title">Maximum amount of complaints per student</span></dt>
<dd id="course-max-complaints">
<span>{{ course.maxComplaints }}</span>
<span>{{ course.maxComplaints || '-' }}</span>
</dd>
</ng-container>
<ng-container *ngIf="course.maxTeamComplaints !== 0">
<dt><span jhiTranslate="artemisApp.course.maxTeamComplaints.title">Maximum amount of complaints per team</span></dt>
<dd id="course-max-team-complaints">
<span>{{ course.maxTeamComplaints }}</span>
<span>{{ course.maxTeamComplaints || '-' }}</span>
</dd>
</ng-container>
<ng-container *ngIf="course.maxComplaintTimeDays !== 0">
<dt><span jhiTranslate="artemisApp.course.maxComplaintTimeDays.title">Due date for complaints in days after result date</span></dt>
<dd id="course-max-time-days">
<span>{{ course.maxComplaintTimeDays }}</span>
<span>{{ course.maxComplaintTimeDays || '-' }}</span>
</dd>
<dt><span jhiTranslate="artemisApp.course.maxComplaintTextLimit.title">Maximum number of characters per complaint</span></dt>
<dd id="course-max-complaint-text-limit">
<span>{{ course.maxComplaintTextLimit || '-' }}</span>
</dd>
<dt><span jhiTranslate="artemisApp.course.maxComplaintResponseTextLimit.title">Maximum number of characters per complaint response</span></dt>
<dd id="course-max-complaint-response-text-limit">
<span>{{ course.maxComplaintResponseTextLimit || '-' }}</span>
</dd>
</ng-container>
<ng-container *ngIf="course.maxRequestMoreFeedbackTimeDays !== 0">
<ng-container *ngIf="course.requestMoreFeedbackEnabled">
<dt><span jhiTranslate="artemisApp.course.maxRequestMoreFeedbackTimeDays.title">Due date for more feedback requests in days after result date</span></dt>
<dd id="course-max-request-more-feedback-days">
<span>{{ course.maxRequestMoreFeedbackTimeDays }}</span>
<span>{{ course.maxRequestMoreFeedbackTimeDays || '-' }}</span>
</dd>
</ng-container>
<dt><span jhiTranslate="artemisApp.course.courseCommunicationSetting.communicationEnabled.label">Communication Enabled</span></dt>
<dd id="course-communication-enabled">
<span *ngIf="this.communicationEnabled">{{ 'global.generic.yes' | artemisTranslate }}</span>
<span *ngIf="!this.communicationEnabled">{{ 'global.generic.no' | artemisTranslate }}</span>
</dd>
<dt><span jhiTranslate="artemisApp.course.courseCommunicationSetting.messagingEnabled.label">Messaging Enabled</span></dt>
<dd id="course-messaging-enabled">
<span *ngIf="this.messagingEnabled">{{ 'global.generic.yes' | artemisTranslate }}</span>
<span *ngIf="!this.messagingEnabled">{{ 'global.generic.no' | artemisTranslate }}</span>
</dd>
<ng-container *ngIf="this.messagingEnabled">
<dt><span jhiTranslate="artemisApp.course.courseCommunicationSetting.messagingEnabled.codeOfConduct">Messaging Code of Conduct</span></dt>
<dd
id="course-code-of-conduct"
class="markdown-preview editor-outline-background"
[innerHTML]="course.courseInformationSharingMessagingCodeOfConduct | htmlForMarkdown"
></dd>
</ng-container>
</dl>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { AlertService } from 'app/core/util/alert.service';
import { EventManager } from 'app/core/util/event-manager.service';
import { faChartBar, faClipboard, faEye, faFlag, faListAlt, faTable, faTimes, faWrench } from '@fortawesome/free-solid-svg-icons';
import { FeatureToggle } from 'app/shared/feature-toggle/feature-toggle.service';
import { OrganizationManagementService } from 'app/admin/organization-management/organization-management.service';

export enum DoughnutChartType {
ASSESSMENT = 'ASSESSMENT',
Expand All @@ -36,6 +37,9 @@ export class CourseDetailComponent implements OnInit, OnDestroy {
activeStudents?: number[];
course: Course;

messagingEnabled: boolean;
communicationEnabled: boolean;

ltiEnabled = false;

private eventSubscriber: Subscription;
Expand All @@ -54,6 +58,7 @@ export class CourseDetailComponent implements OnInit, OnDestroy {
constructor(
private eventManager: EventManager,
private courseManagementService: CourseManagementService,
private organizationService: OrganizationManagementService,
private route: ActivatedRoute,
private alertService: AlertService,
private profileService: ProfileService,
Expand All @@ -69,6 +74,8 @@ export class CourseDetailComponent implements OnInit, OnDestroy {
this.route.data.subscribe(({ course }) => {
if (course) {
this.course = course;
this.messagingEnabled = !!this.course.courseInformationSharingConfiguration?.includes('MESSAGING');
this.communicationEnabled = !!this.course.courseInformationSharingConfiguration?.includes('COMMUNICATION');
}
});
// There is no course 0 -> will fetch no course if route does not provide different courseId
Expand All @@ -78,6 +85,7 @@ export class CourseDetailComponent implements OnInit, OnDestroy {
});
this.fetchCourseStatistics(courseId);
this.registerChangeInCourses(courseId);
this.fetchOrganizations(courseId);
}

/**
Expand Down Expand Up @@ -114,4 +122,10 @@ export class CourseDetailComponent implements OnInit, OnDestroy {
error: (error: HttpErrorResponse) => onError(this.alertService, error),
});
}

private fetchOrganizations(courseId: number) {
this.organizationService.getOrganizationsByCourse(courseId).subscribe((organizations) => {
this.course.organizations = organizations;
});
}
}
3 changes: 2 additions & 1 deletion src/main/webapp/i18n/de/course.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@
},
"messagingEnabled": {
"label": "Nachrichten aktiviert",
"tooltip": "Ermöglicht den Nachrichtenaustausch zwischen Nutzer:innen in privaten oder öffentlichen Kanälen, Gruppenchats oder Direktnachrichten. Kanäle können nur von Lehrenden und Tutor:innen erstellt werden. Nutzer:innen können selbst öffentlichen Kanälen beitreten und müssen zu privaten Kanälen hinzugefügt werden. Alle Nutzer:innen können einen privaten Gruppenchat starten und andere Nutzer:innen hinzufügen. Ein Gruppenchat ist auf zehn Mitglieder:innen begrenzt. Alle Nutzer:innen können Direktnachrichten an andere Nutzer:innen senden. Die Chats finden im Nachrichtenbereich des Kurses statt."
"tooltip": "Ermöglicht den Nachrichtenaustausch zwischen Nutzer:innen in privaten oder öffentlichen Kanälen, Gruppenchats oder Direktnachrichten. Kanäle können nur von Lehrenden und Tutor:innen erstellt werden. Nutzer:innen können selbst öffentlichen Kanälen beitreten und müssen zu privaten Kanälen hinzugefügt werden. Alle Nutzer:innen können einen privaten Gruppenchat starten und andere Nutzer:innen hinzufügen. Ein Gruppenchat ist auf zehn Mitglieder:innen begrenzt. Alle Nutzer:innen können Direktnachrichten an andere Nutzer:innen senden. Die Chats finden im Nachrichtenbereich des Kurses statt.",
"codeOfConduct": "Nachrichten: Code of Conduct"
}
},
"registrationEnabled": {
Expand Down
5 changes: 3 additions & 2 deletions src/main/webapp/i18n/en/course.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"title": "Maximum number of points for course",
"info": "This value is used for example calculations (e.g. in the grading key) and does not influence the students' grades. The grades are calculated based on the points achievable in the course."
},
"accuracyOfScores": "Amount of decimal places used for calculating the scores",
"accuracyOfScores": "Number of decimal places used for calculating the scores",
"defaultProgrammingLanguage": "Default Programming Language",
"gradingSystem": "Grading Key",
"testCourse": {
Expand All @@ -93,7 +93,8 @@
},
"messagingEnabled": {
"label": "Messaging Enabled",
"tooltip": "Enables messaging between course users in private or public channels, group chats or direct messages. Channels can only be created by instructors and tutors. Users can self-join public channels and must be invited to private channels. Every user can start a private group chat and add other users. A group chat is limited to 10 members. Every user can start a private one-to-one chat with another user. The chats happens in the messaging space of the course."
"tooltip": "Enables messaging between course users in private or public channels, group chats or direct messages. Channels can only be created by instructors and tutors. Users can self-join public channels and must be invited to private channels. Every user can start a private group chat and add other users. A group chat is limited to 10 members. Every user can start a private one-to-one chat with another user. The chats happens in the messaging space of the course.",
b-fein marked this conversation as resolved.
Show resolved Hide resolved
"codeOfConduct": "Messaging Code of Conduct"
}
},
"registrationEnabled": {
Expand Down
Loading