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

refactor(Grading): Clean up UpdateWorkgroup() #1524

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ export class MilestoneGradingViewComponent extends NodeGradingViewComponent {
this.saveMilestoneWorkgroupItemViewedEvent(workgroupId, value);
}

updateWorkgroup(workgroupId: number, init = false): void {
super.updateWorkgroup(workgroupId, init);
protected updateWorkgroup(workgroupId: number): void {
super.updateWorkgroup(workgroupId);
const workgroup = this.workgroupsById[workgroupId];
workgroup.score = this.getScoreByWorkgroupId(workgroupId);
if (this.milestone.report.locations.length > 1) {
Expand All @@ -160,9 +160,7 @@ export class MilestoneGradingViewComponent extends NodeGradingViewComponent {
);
workgroup.changeInScore = this.getChangeInScore(workgroup.initialScore, workgroup.score);
}
if (!init) {
this.workgroupsById[workgroupId] = copy(workgroup);
}
this.workgroupsById[workgroupId] = copy(workgroup);
}

private getChangeInScore(initialScore: number, revisedScore: number): number {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export class NodeGradingViewComponent implements OnInit {
const workgroupId = workgroup.workgroupId;
this.workgroupsById[workgroupId] = workgroup;
this.workVisibilityById[workgroupId] = false;
this.updateWorkgroup(workgroupId, true);
this.updateWorkgroup(workgroupId);
}
}

Expand Down Expand Up @@ -240,9 +240,8 @@ export class NodeGradingViewComponent implements OnInit {
* Update statuses, scores, notifications, etc. for a workgroup object. Also check if we need to
* hide student names because logged-in user does not have the right permissions
* @param workgroupID a workgroup ID number
* @param init Boolean whether we're in controller initialization or not
*/
protected updateWorkgroup(workgroupId: number, init = false): void {
protected updateWorkgroup(workgroupId: number): void {
const workgroup = this.workgroupsById[workgroupId];
const alertNotifications = this.notificationService.getAlertNotifications({
nodeId: this.nodeId,
Expand Down
6 changes: 3 additions & 3 deletions src/messages.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -13556,7 +13556,7 @@ Click &quot;Cancel&quot; to keep the invalid JSON open so you can fix it.</sourc
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/services/teacherDataService.ts</context>
<context context-type="linenumber">604</context>
<context context-type="linenumber">575</context>
</context-group>
</trans-unit>
<trans-unit id="6933068701447776492" datatype="html">
Expand Down Expand Up @@ -13910,14 +13910,14 @@ Are you sure you want to proceed?</source>
<source> Team has not saved any work </source>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/classroomMonitor/classroomMonitorComponents/workgroup-component-grading/workgroup-component-grading.component.html</context>
<context context-type="linenumber">16,18</context>
<context context-type="linenumber">22,24</context>
</context-group>
</trans-unit>
<trans-unit id="1a68048cfcd964c630f4316c43db20f0b8e3a80d" datatype="html">
<source>See revisions</source>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/classroomMonitor/classroomMonitorComponents/workgroup-component-grading/workgroup-component-grading.component.html</context>
<context context-type="linenumber">26</context>
<context context-type="linenumber">32</context>
</context-group>
</trans-unit>
<trans-unit id="9b7565e0b46708f16f29b8b055bc32b758f30834" datatype="html">
Expand Down
Loading