Skip to content
8 changes: 5 additions & 3 deletions src/assets/wise5/components/common/cRater/CRaterIdea.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
export class CRaterIdea {
name: string;
detected: boolean;
detected?: boolean;
characterOffsets: any[];
text?: string;

constructor(name: string, detected: boolean) {
constructor(name: string, detected?: boolean) {
this.name = name;
this.detected = detected;
if (detected) {
this.detected = detected;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<div class="idea-descriptions notice-bg-bg">
<h5 class="flex flex-row items-center gap-1 !text-xl">
<span i18n>Idea Names</span>
<span i18n>Idea Descriptions</span>
<button
mat-icon-button
color="primary"
matTooltip="Add a new idea name"
matTooltip="Add a new idea description"
i18n-matTooltip
matTooltipPosition="after"
(click)="addNewIdeaDescription(true)"
Expand Down Expand Up @@ -35,7 +35,7 @@ <h5 class="flex flex-row items-center gap-1 !text-xl">
/>
</mat-form-field>
<mat-form-field class="idea-input form-field-no-hint" appearance="fill">
<mat-label i18n>User-Friendly Name</mat-label>
<mat-label i18n>User-Friendly Description</mat-label>
<textarea
matInput
[(ngModel)]="idea.text"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import { ComponentContent } from '../../../../common/ComponentContent';
import { CRaterIdea } from '../CRaterIdea';
import { debounceTime, distinctUntilChanged } from 'rxjs/operators';
import { FlexLayoutModule } from '@angular/flex-layout';
import { FormsModule } from '@angular/forms';
import { MatButtonModule } from '@angular/material/button';
import { MatCardModule } from '@angular/material/card';
import { MatFormFieldModule } from '@angular/material/form-field';
import { FormsModule } from '@angular/forms';
import { MatIconModule } from '@angular/material/icon';
import { MatInputModule } from '@angular/material/input';
import { MatTooltipModule } from '@angular/material/tooltip';
import { Subject, Subscription } from 'rxjs';
import { TeacherProjectService } from '../../../../services/teacherProjectService';
import { MatButtonModule } from '@angular/material/button';

@Component({
imports: [
Expand All @@ -34,6 +34,7 @@ import { MatButtonModule } from '@angular/material/button';
export class EditCRaterIdeaDescriptionsComponent implements OnInit {
@Input() componentContent: ComponentContent;
@Input() ideaDescriptions: CRaterIdea[] = [];
@Input() enableAutoscrolling: boolean = true;
protected inputChanged: Subject<string> = new Subject<string>();
private subscriptions: Subscription = new Subscription();

Expand All @@ -59,13 +60,13 @@ export class EditCRaterIdeaDescriptionsComponent implements OnInit {
newIdeaDescription
);
this.projectService.nodeChanged();
if (!addToTop) {
if (!addToTop && this.enableAutoscrolling) {
this.scrollToBottomOfList();
}
}

private createNewIdea(): CRaterIdea {
const idea = new CRaterIdea('', null);
const idea = new CRaterIdea('');
idea.text = '';
return idea;
}
Expand All @@ -84,7 +85,7 @@ export class EditCRaterIdeaDescriptionsComponent implements OnInit {
}

protected deleteIdeaDescription(ideaIndex: number): void {
if (confirm($localize`Are you sure you want to delete this idea name?`)) {
if (confirm($localize`Are you sure you want to delete this idea description?`)) {
this.ideaDescriptions.splice(ideaIndex, 1);
this.projectService.nodeChanged();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { CRaterIdea } from '../../common/cRater/CRaterIdea';
import { EditAdvancedComponentComponent } from '../../../../../app/authoring-tool/edit-advanced-component/edit-advanced-component.component';

@Component({
selector: 'edit-dialog-guidance-advanced',
templateUrl: 'edit-dialog-guidance-advanced.component.html',
standalone: false
selector: 'edit-dialog-guidance-advanced',
templateUrl: 'edit-dialog-guidance-advanced.component.html',
standalone: false
})
export class EditDialogGuidanceAdvancedComponent extends EditAdvancedComponentComponent {
@Input() ideaDescriptions: CRaterIdea[] = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,17 @@
}
}
</div>
<div class="section-container">
@if (showIdeaDescriptions) {
<edit-crater-idea-descriptions
[ideaDescriptions]="componentContent.cRater.rubric.ideas"
[enableAutoscrolling]="false"
/>
<a (click)="toggleShowIdeaDescriptions()" i18n>Hide</a>
} @else {
<a (click)="toggleShowIdeaDescriptions()" i18n>Show Idea Descriptions</a>
}
</div>
}
@if (isNotebookEnabled) {
<edit-component-add-to-notebook-button [componentContent]="componentContent" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,20 @@ import { TeacherProjectService } from '../../../services/teacherProjectService';
standalone: false
})
export class EditOpenResponseAdvancedComponent extends EditAdvancedComponentComponent {
allowedConnectedComponentTypes = ['OpenResponse'];
protected allowedConnectedComponentTypes = ['OpenResponse'];
componentContent: OpenResponseContent;
cRaterItemIdIsValid: boolean = null;
initialFeedbackRules = [
protected cRaterItemIdIsValid: boolean = null;
private initialFeedbackRules = [
{
id: 'isDefault',
expression: 'isDefault',
feedback: [$localize`Default feedback`]
}
];
isVerifyingCRaterItemId: boolean = false;
nodeIds: string[] = [];
useCustomCompletionCriteria: boolean = false;
protected isVerifyingCRaterItemId: boolean;
protected nodeIds: string[] = [];
useCustomCompletionCriteria: boolean;
protected showIdeaDescriptions = true;

constructor(
protected cRaterService: CRaterService,
Expand All @@ -45,11 +46,18 @@ export class EditOpenResponseAdvancedComponent extends EditAdvancedComponentComp
this.nodeIds = this.teacherProjectService.getFlattenedProjectAsNodeIds();
}

private createCRaterAndRubricIfNull() {
if (this.componentContent.cRater == null) {
this.componentContent.cRater = this.createCRaterObject();
}
if (!this.componentContent.cRater.rubric) {
this.componentContent.cRater.rubric = { ideas: [] };
}
}

enableCRaterClicked(): void {
if (this.componentContent.enableCRater) {
if (this.componentContent.cRater == null) {
this.componentContent.cRater = this.createCRaterObject();
}
this.createCRaterAndRubricIfNull();
this.setShowSubmitButtonValue(true);
} else {
this.setShowSubmitButtonValue(false);
Expand All @@ -70,7 +78,10 @@ export class EditOpenResponseAdvancedComponent extends EditAdvancedComponentComp
rules: this.initialFeedbackRules
},
enableMultipleAttemptScoringRules: false,
multipleAttemptScoringRules: []
multipleAttemptScoringRules: [],
rubric: {
ideas: []
}
};
}

Expand Down Expand Up @@ -261,6 +272,10 @@ export class EditOpenResponseAdvancedComponent extends EditAdvancedComponentComp
}
}

protected toggleShowIdeaDescriptions(): void {
this.showIdeaDescriptions = !this.showIdeaDescriptions;
}

getComponents(nodeId: string): ComponentContent[] {
return this.teacherProjectService.getComponents(nodeId);
}
Expand Down
59 changes: 35 additions & 24 deletions src/messages.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -16457,19 +16457,23 @@ Are you ready to receive feedback on this answer?</source>
<context context-type="linenumber">285</context>
</context-group>
</trans-unit>
<trans-unit id="6468116689332890293" datatype="html">
<source>Idea Names</source>
<trans-unit id="6050147698447258490" datatype="html">
<source>Idea Descriptions</source>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/components/common/cRater/edit-crater-idea-descriptions/edit-crater-idea-descriptions.component.html</context>
<context context-type="linenumber">3,7</context>
</context-group>
</trans-unit>
<trans-unit id="2517228276717136307" datatype="html">
<source>Add a new idea name</source>
<trans-unit id="4572902223495707288" datatype="html">
<source>Add a new idea description</source>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/components/common/cRater/edit-crater-idea-descriptions/edit-crater-idea-descriptions.component.html</context>
<context context-type="linenumber">7,10</context>
</context-group>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/components/common/cRater/edit-crater-idea-descriptions/edit-crater-idea-descriptions.component.html</context>
<context context-type="linenumber">68,71</context>
</context-group>
</trans-unit>
<trans-unit id="275818851315293243" datatype="html">
<source>Idea ID</source>
Expand All @@ -16478,8 +16482,8 @@ Are you ready to receive feedback on this answer?</source>
<context context-type="linenumber">30,33</context>
</context-group>
</trans-unit>
<trans-unit id="314152887019216557" datatype="html">
<source>User-Friendly Name</source>
<trans-unit id="5849203454479447363" datatype="html">
<source>User-Friendly Description</source>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/components/common/cRater/edit-crater-idea-descriptions/edit-crater-idea-descriptions.component.html</context>
<context context-type="linenumber">38,41</context>
Expand All @@ -16492,18 +16496,11 @@ Are you ready to receive feedback on this answer?</source>
<context context-type="linenumber">52,54</context>
</context-group>
</trans-unit>
<trans-unit id="4572902223495707288" datatype="html">
<source>Add a new idea description</source>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/components/common/cRater/edit-crater-idea-descriptions/edit-crater-idea-descriptions.component.html</context>
<context context-type="linenumber">68,71</context>
</context-group>
</trans-unit>
<trans-unit id="7862038253187581980" datatype="html">
<source>Are you sure you want to delete this idea name?</source>
<trans-unit id="7728068163356050294" datatype="html">
<source>Are you sure you want to delete this idea description?</source>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/components/common/cRater/edit-crater-idea-descriptions/edit-crater-idea-descriptions.component.ts</context>
<context context-type="linenumber">87</context>
<context context-type="linenumber">88</context>
</context-group>
</trans-unit>
<trans-unit id="5596810972110629301" datatype="html">
Expand Down Expand Up @@ -19954,6 +19951,20 @@ Warning: This will delete all existing choices in this component.</source>
<context context-type="linenumber">572,575</context>
</context-group>
</trans-unit>
<trans-unit id="8461609631969932886" datatype="html">
<source>Hide</source>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/components/openResponse/edit-open-response-advanced/edit-open-response-advanced.component.html</context>
<context context-type="linenumber">590,591</context>
</context-group>
</trans-unit>
<trans-unit id="493950846706766768" datatype="html">
<source>Show Idea Descriptions</source>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/components/openResponse/edit-open-response-advanced/edit-open-response-advanced.component.html</context>
<context context-type="linenumber">591,596</context>
</context-group>
</trans-unit>
<trans-unit id="8705933649296793690" datatype="html">
<source>Default feedback</source>
<context-group purpose="location">
Expand All @@ -19969,7 +19980,7 @@ Score: <x id="PH" equiv-text="score"/>
Feedback Text: <x id="PH_1" equiv-text="feedbackText"/></source>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/components/openResponse/edit-open-response-advanced/edit-open-response-advanced.component.ts</context>
<context context-type="linenumber">96</context>
<context context-type="linenumber">107</context>
</context-group>
</trans-unit>
<trans-unit id="1461861786609911168" datatype="html">
Expand All @@ -19982,28 +19993,28 @@ Current Score: <x id="PH_1" equiv-text="currentScore"/>
Feedback Text: <x id="PH_2" equiv-text="feedbackText"/></source>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/components/openResponse/edit-open-response-advanced/edit-open-response-advanced.component.ts</context>
<context context-type="linenumber">144</context>
<context context-type="linenumber">155</context>
</context-group>
</trans-unit>
<trans-unit id="846244999760672149" datatype="html">
<source>you got a score of</source>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/components/openResponse/edit-open-response-advanced/edit-open-response-advanced.component.ts</context>
<context context-type="linenumber">174</context>
<context context-type="linenumber">185</context>
</context-group>
</trans-unit>
<trans-unit id="7599226289089492371" datatype="html">
<source>Please talk to your teacher</source>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/components/openResponse/edit-open-response-advanced/edit-open-response-advanced.component.ts</context>
<context context-type="linenumber">176</context>
<context context-type="linenumber">187</context>
</context-group>
</trans-unit>
<trans-unit id="5580639382077453513" datatype="html">
<source>got a score of</source>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/components/openResponse/edit-open-response-advanced/edit-open-response-advanced.component.ts</context>
<context context-type="linenumber">178</context>
<context context-type="linenumber">189</context>
</context-group>
</trans-unit>
<trans-unit id="867656616658826137" datatype="html">
Expand All @@ -20014,21 +20025,21 @@ Previous Score: <x id="PH" equiv-text="previousScore"/>
Current Score: <x id="PH_1" equiv-text="currentScore"/></source>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/components/openResponse/edit-open-response-advanced/edit-open-response-advanced.component.ts</context>
<context context-type="linenumber">192</context>
<context context-type="linenumber">203</context>
</context-group>
</trans-unit>
<trans-unit id="3689003016353565518" datatype="html">
<source>Are you sure you want to delete the custom completion criteria?</source>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/components/openResponse/edit-open-response-advanced/edit-open-response-advanced.component.ts</context>
<context context-type="linenumber">226</context>
<context context-type="linenumber">237</context>
</context-group>
</trans-unit>
<trans-unit id="2986030604058491184" datatype="html">
<source>Are you sure you want to delete this completion criteria?</source>
<context-group purpose="location">
<context context-type="sourcefile">src/assets/wise5/components/openResponse/edit-open-response-advanced/edit-open-response-advanced.component.ts</context>
<context context-type="linenumber">258</context>
<context context-type="linenumber">269</context>
</context-group>
</trans-unit>
<trans-unit id="8648892006027324370" datatype="html">
Expand Down