-
Notifications
You must be signed in to change notification settings - Fork 5
feat(Dialog Guidance): Summary display for teachers #2115
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
Merged
Aaron-Detre
merged 7 commits into
develop
from
issue-2094-dialog-guidance-teacher-summary-display
Apr 8, 2025
Merged
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
6c13206
feat(SummaryDisplay): Dialog guidance summary display for teachers
Aaron-Detre bcd4c15
Added sections for least common ideas and all ideas
Aaron-Detre c8152cc
Added tests and made requested changes
Aaron-Detre 6457d04
Merge develop and other minor changes
Aaron-Detre a444c10
Update detected ideas styles and layout
breity 58eb03f
Extracted duplicate idea HTML to ng-template
Aaron-Detre 5b5c9f5
Updated messages
github-actions[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
44 changes: 23 additions & 21 deletions
44
...wise5/classroomMonitor/classroomMonitorComponents/shared/node-info/node-info.component.ts
This file contains hidden or 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 hidden or 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
20 changes: 20 additions & 0 deletions
20
...directives/teacher-summary-display/dialog-guidance-teacher-summary-display.component.html
This file contains hidden or 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,20 @@ | ||
| <mat-card appearance="outlined" class="summary-card"> | ||
| <mat-card-content> | ||
| @if (hasWarning) { | ||
| <p class="warn center">{{ warningMessage }}</p> | ||
| } | ||
| @if (doRender) { | ||
| <h2>Most Common Ideas Detected:</h2> | ||
| @for (idea of seeAllIdeas ? sortedIdeas : topIdeas; let i = $index; track idea.id) { | ||
| <h3>{{ i + 1 }}. {{ idea.text }} (<mat-icon>person</mat-icon>{{ idea.count }})</h3> | ||
| } | ||
| @if (sortedIdeas.length > 5) { | ||
| @if (seeAllIdeas) { | ||
| <a (mouseup)="toggleSeeAllIdeas()">See fewer ideas</a> | ||
| } @else { | ||
| <a (mouseup)="toggleSeeAllIdeas()">See all ideas</a> | ||
| } | ||
| } | ||
| } | ||
| </mat-card-content> | ||
| </mat-card> |
85 changes: 85 additions & 0 deletions
85
...5/directives/teacher-summary-display/dialog-guidance-teacher-summary-display.component.ts
This file contains hidden or 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,85 @@ | ||
| import { AnnotationService } from '../../services/annotationService'; | ||
| import { CommonModule } from '@angular/common'; | ||
| import { Component } from '@angular/core'; | ||
| import { ComponentState } from '../../../../app/domain/componentState'; | ||
| import { ConfigService } from '../../services/configService'; | ||
| import { CRaterIdea } from '../../components/common/cRater/CRaterIdea'; | ||
| import { CRaterService } from '../../services/cRaterService'; | ||
| import { MatCardModule } from '@angular/material/card'; | ||
| import { MatIconModule } from '@angular/material/icon'; | ||
| import { ProjectService } from '../../services/projectService'; | ||
| import { SummaryService } from '../../components/summary/summaryService'; | ||
| import { TeacherDataService } from '../../services/teacherDataService'; | ||
| import { TeacherSummaryDisplayComponent } from './teacher-summary-display.component'; | ||
|
|
||
| @Component({ | ||
| imports: [CommonModule, MatCardModule, MatIconModule], | ||
| selector: 'dialog-guidance-teacher-summary-display', | ||
| templateUrl: 'dialog-guidance-teacher-summary-display.component.html' | ||
| }) | ||
| export class DialogGuidanceTeacherSummaryDisplayComponent extends TeacherSummaryDisplayComponent { | ||
| protected ideaCountMap: Map<string, Set<number>>; | ||
Aaron-Detre marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| protected sortedIdeas: { id: string; count: number }[] = []; | ||
| protected topIdeas: { id: string; count: number }[] = []; | ||
| protected seeAllIdeas: boolean = false; | ||
Aaron-Detre marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| constructor( | ||
| protected annotationService: AnnotationService, | ||
| protected configService: ConfigService, | ||
| private cRaterService: CRaterService, | ||
| protected dataService: TeacherDataService, | ||
| protected projectService: ProjectService, | ||
Aaron-Detre marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| protected summaryService: SummaryService | ||
| ) { | ||
| super(annotationService, configService, dataService, projectService, summaryService); | ||
| this.ideaCountMap = new Map<string, Set<number>>(); | ||
| } | ||
|
|
||
| ngOnInit() { | ||
Aaron-Detre marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| this.getLatestWork().subscribe((componentStates) => { | ||
| this.extractIdeasFromComponentStates(componentStates); | ||
| this.sortIdeas(); | ||
Aaron-Detre marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| }); | ||
| } | ||
|
|
||
| private extractIdeasFromComponentStates(componentStates: ComponentState[]): void { | ||
Aaron-Detre marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| componentStates.forEach((componentState) => { | ||
| const detectedIdeas = this.getDetectedIdeasFromWorkgroup(componentState); | ||
| if (detectedIdeas !== undefined) { | ||
| detectedIdeas.forEach((idea) => { | ||
| if (this.ideaCountMap.has(idea.name)) { | ||
| this.ideaCountMap.get(idea.name).add(componentState.workgroupId); | ||
| } else { | ||
| this.ideaCountMap.set(idea.name, new Set([componentState.workgroupId])); | ||
| } | ||
| }); | ||
| } | ||
| }); | ||
Aaron-Detre marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| private getDetectedIdeasFromWorkgroup(componentState: ComponentState): CRaterIdea[] { | ||
Aaron-Detre marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| const detectedIdeas = []; | ||
| componentState.studentData.responses.forEach((response) => { | ||
| response.ideas | ||
| ?.filter((idea) => idea.detected) | ||
| .forEach((idea) => detectedIdeas.push(new CRaterIdea(idea.name, idea.detected))); | ||
| }); | ||
| return detectedIdeas; | ||
Aaron-Detre marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| private sortIdeas(): void { | ||
| const rubric = this.cRaterService.getCRaterRubric(this.nodeId, this.componentId); | ||
Aaron-Detre marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| this.sortedIdeas = [...this.ideaCountMap.entries()] | ||
| .sort((a, b) => b[1].size - a[1].size) | ||
| .map((mapIterator) => ({ | ||
| id: mapIterator[0], | ||
| text: rubric.getIdea(mapIterator[0])?.text ?? mapIterator[0], | ||
| count: mapIterator[1].size | ||
| })); | ||
| this.topIdeas = [...this.sortedIdeas].splice(0, 5); | ||
Aaron-Detre marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| protected toggleSeeAllIdeas(): void { | ||
| this.seeAllIdeas = !this.seeAllIdeas; | ||
| } | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.