-
Notifications
You must be signed in to change notification settings - Fork 304
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Learning paths: Redesign learning path instructor view (#9144)
- Loading branch information
1 parent
09ed4fb
commit 96284c7
Showing
44 changed files
with
1,734 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 4 additions & 2 deletions
6
...ebapp/app/course/learning-paths/components/competency-node/competency-node.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
...earning-paths/components/learning-paths-analytics/learning-paths-analytics.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<div class="learning-paths-analytics-container"> | ||
<h5 class="m-0" jhiTranslate="artemisApp.learningPathManagement.learningPathsAnalytics.title"></h5> | ||
<hr class="my-2" /> | ||
<div class="row h-100 m-0 gap-3"> | ||
<div class="col-2 p-0 learning-paths-analytics-graph-selection-container"> | ||
<ng-container [ngTemplateOutlet]="radioTemplate" [ngTemplateOutletContext]="{ $implicit: CompetencyGraphNodeValueType.AVERAGE_MASTERY_PROGRESS }"></ng-container> | ||
</div> | ||
<div class="col p-0"> | ||
@if (isLoading()) { | ||
<div class="row justify-content-center p-2"> | ||
<div class="spinner-border text-primary" role="status"> | ||
<span class="sr-only" jhiTranslate="loading"></span> | ||
</div> | ||
</div> | ||
} @else if (instructorCompetencyGraph()) { | ||
<jhi-competency-graph [competencyGraph]="instructorCompetencyGraph()!" /> | ||
} | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<ng-template #radioTemplate let-competencyNodeValueType> | ||
<div class="row m-0 align-items-center"> | ||
<input type="radio" class="col-md-auto" [checked]="valueSelection() === competencyNodeValueType" /> | ||
<label class="col-md-auto pe-0 text-break" [jhiTranslate]="'artemisApp.learningPathManagement.learningPathsAnalytics.graphSelection.' + competencyNodeValueType"></label> | ||
</div> | ||
</ng-template> |
7 changes: 7 additions & 0 deletions
7
...earning-paths/components/learning-paths-analytics/learning-paths-analytics.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.learning-paths-analytics-container { | ||
height: 500px; | ||
|
||
.learning-paths-analytics-graph-selection-container { | ||
border-right: var(--bs-border-width) solid var(--border-color); | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
.../learning-paths/components/learning-paths-analytics/learning-paths-analytics.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { Component, effect, inject, input, signal } from '@angular/core'; | ||
import { LearningPathApiService } from 'app/course/learning-paths/services/learning-path-api.service'; | ||
import { CompetencyGraphDTO, CompetencyGraphNodeValueType } from 'app/entities/competency/learning-path.model'; | ||
import { AlertService } from 'app/core/util/alert.service'; | ||
import { ArtemisSharedCommonModule } from 'app/shared/shared-common.module'; | ||
import { CompetencyGraphComponent } from 'app/course/learning-paths/components/competency-graph/competency-graph.component'; | ||
import { onError } from 'app/shared/util/global.utils'; | ||
|
||
@Component({ | ||
selector: 'jhi-learning-paths-analytics', | ||
standalone: true, | ||
imports: [ArtemisSharedCommonModule, CompetencyGraphComponent], | ||
templateUrl: './learning-paths-analytics.component.html', | ||
styleUrl: './learning-paths-analytics.component.scss', | ||
}) | ||
export class LearningPathsAnalyticsComponent { | ||
protected readonly CompetencyGraphNodeValueType = CompetencyGraphNodeValueType; | ||
|
||
private readonly learningPathApiService = inject(LearningPathApiService); | ||
private readonly alertService = inject(AlertService); | ||
|
||
readonly courseId = input.required<number>(); | ||
|
||
readonly isLoading = signal<boolean>(false); | ||
readonly instructorCompetencyGraph = signal<CompetencyGraphDTO | undefined>(undefined); | ||
|
||
readonly valueSelection = signal<CompetencyGraphNodeValueType>(CompetencyGraphNodeValueType.AVERAGE_MASTERY_PROGRESS); | ||
|
||
constructor() { | ||
effect(() => this.loadInstructionCompetencyGraph(this.courseId()), { allowSignalWrites: true }); | ||
} | ||
|
||
private async loadInstructionCompetencyGraph(courseId: number): Promise<void> { | ||
try { | ||
this.isLoading.set(true); | ||
const instructorCompetencyGraph = await this.learningPathApiService.getLearningPathInstructorCompetencyGraph(courseId); | ||
this.instructorCompetencyGraph.set(instructorCompetencyGraph); | ||
} catch (error) { | ||
onError(this.alertService, error); | ||
} finally { | ||
this.isLoading.set(false); | ||
} | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
...paths/components/learning-paths-configuration/learning-paths-configuration.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<div> | ||
<div class="row m-0 align-items-center justify-content-between"> | ||
<h5 class="m-0 col-md-auto p-0" jhiTranslate="artemisApp.learningPathManagement.learningPathsConfiguration.title"></h5> | ||
@if (isEditMode()) { | ||
<button id="save-learning-paths-configuration-button" class="btn btn-primary btn-sm col-md-auto" (click)="saveLearningPathsConfiguration()"> | ||
@if (isSaving()) { | ||
<fa-icon [icon]="faSpinner" animation="spin" /> | ||
} | ||
<span jhiTranslate="artemisApp.learningPathManagement.learningPathsConfiguration.saveButtonLabel"></span> | ||
</button> | ||
} @else { | ||
<button | ||
id="edit-learning-paths-configuration-button" | ||
class="btn btn-secondary btn-sm col-md-auto" | ||
(click)="enableEditMode()" | ||
jhiTranslate="artemisApp.learningPathManagement.learningPathsConfiguration.editButtonLabel" | ||
></button> | ||
} | ||
</div> | ||
<hr class="my-2" /> | ||
<div class="row align-items-center m-0 learning-paths-management-container"> | ||
@if (isConfigLoading()) { | ||
<div class="row justify-content-center p-2"> | ||
<div class="spinner-border text-primary" role="status"> | ||
<span class="sr-only" jhiTranslate="loading"></span> | ||
</div> | ||
</div> | ||
} @else { | ||
<input | ||
id="include-all-graded-exercises-checkbox" | ||
type="checkbox" | ||
class="col-md-auto" | ||
(change)="toggleIncludeAllGradedExercises()" | ||
[checked]="includeAllGradedExercisesEnabled()" | ||
[disabled]="!isEditMode()" | ||
/> | ||
<label class="col-md-auto" jhiTranslate="artemisApp.learningPathManagement.learningPathsConfiguration.configuration.includeAllGradedExercises"></label> | ||
<jhi-help-icon class="col-md-auto p-0" text="artemisApp.learningPathManagement.learningPathsConfiguration.configuration.includeAllGradedExercisesToolTip" /> | ||
} | ||
</div> | ||
</div> |
Oops, something went wrong.