Skip to content

Commit

Permalink
feat(Show Group Work): Remove grading inputs (#1044)
Browse files Browse the repository at this point in the history
Co-authored-by: Jonathan Lim-Breitbart <breity10@gmail.com>
  • Loading branch information
hirokiterashima and breity authored Feb 17, 2023
1 parent 67c83c9 commit f038c9b
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="component__content" fxLayout="row wrap">
<div fxLayout="column" fxFlex="100" fxFlex.gt-sm="66" class="component--grading__response">
<div class="component__content" fxLayout="column" fxLayout.gt-sm="row" fxLayoutGap="16px">
<div fxLayout="column" fxFlex="100" [fxFlex.gt-sm]="isGradable ? 66 : 100">
<ng-container *ngIf="latestComponentState != null">
<animation-grading
*ngIf="component.type === 'Animation'"
Expand Down Expand Up @@ -121,7 +121,7 @@
</span>
</div>
</div>
<div fxFlex="100" fxFlex.gt-sm="33" class="component--grading__annotations">
<div *ngIf="isGradable" fxFlex="100" fxFlex.gt-sm="33" class="component--grading__annotations">
<edit-component-annotations
[componentId]="component.id"
[componentStateId]="latestComponentStateId"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import { Component, Input } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { ComponentContent } from '../../../common/ComponentContent';
import { ComponentFactory } from '../../../common/ComponentFactory';
import { ConfigService } from '../../../services/configService';
import { TeacherDataService } from '../../../services/teacherDataService';
import { TeacherProjectService } from '../../../services/teacherProjectService';
Expand All @@ -16,8 +18,9 @@ export class WorkgroupComponentGradingComponent {
@Input() nodeId: string;
@Input() workgroupId: number;

component: any;
component: ComponentContent;
componentStates: any[];
isGradable: boolean;
latestComponentState: any;
latestComponentStateId: number;
teacherWorkgroupId: number;
Expand All @@ -32,6 +35,9 @@ export class WorkgroupComponentGradingComponent {
ngOnInit() {
this.teacherWorkgroupId = this.ConfigService.getWorkgroupId();
this.component = this.ProjectService.getComponent(this.nodeId, this.componentId);
const factory = new ComponentFactory();
const component = factory.getComponent(this.component, this.nodeId);
this.isGradable = component.isGradable();
this.componentStates = this.TeacherDataService.getComponentStatesByWorkgroupIdAndComponentId(
this.workgroupId,
this.componentId
Expand Down
4 changes: 4 additions & 0 deletions src/assets/wise5/common/Component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ export class Component {
return false;
}

isGradable(): boolean {
return true;
}

getConnectedComponent(nodeId: string, componentId: string): any {
return this.content.connectedComponents.find(
(connectedComponent) =>
Expand Down
3 changes: 3 additions & 0 deletions src/assets/wise5/common/ComponentFactory.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { DialogGuidanceComponent } from '../components/dialogGuidance/DialogGuidanceComponent';
import { MultipleChoiceComponent } from '../components/multipleChoice/MultipleChoiceComponent';
import { PeerChatComponent } from '../components/peerChat/PeerChatComponent';
import { ShowGroupWorkComponent } from '../components/showGroupWork/ShowGroupWorkComponent';
import { Component } from './Component';
import { ComponentContent } from './ComponentContent';

Expand All @@ -12,6 +13,8 @@ export class ComponentFactory {
return new MultipleChoiceComponent(content, nodeId);
} else if (content.type === 'PeerChat') {
return new PeerChatComponent(content, nodeId);
} else if (content.type === 'ShowGroupWork') {
return new ShowGroupWorkComponent(content, nodeId);
} else {
return new Component(content, nodeId);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { Component } from '../../common/Component';

export class ShowGroupWorkComponent extends Component {
isGradable(): boolean {
return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,6 @@
}
}

.component--grading__response {
padding-bottom: 16px;

@media only screen and (min-width: $layout-breakpoint-sm) {
padding-right: 16px;
padding-bottom: 0;
}
}

.component--grading__response__content {
overflow: auto;
}
Expand Down
2 changes: 1 addition & 1 deletion src/assets/wise5/themes/default/style/monitor.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/assets/wise5/themes/default/style/monitor.css.map

Large diffs are not rendered by default.

0 comments on commit f038c9b

Please sign in to comment.