MOBILE-2359 workshop: Display correct number of dimensions

main
Pau Ferrer Ocaña 2018-07-05 16:30:53 +02:00
parent bfd4e9c936
commit 1515e2b678
5 changed files with 88 additions and 80 deletions

View File

@ -1,27 +1,29 @@
<ion-card *ngFor="let field of assessment.form.fields; let n = index">
<ion-item text-wrap>
<h2>{{ field.dimtitle }}</h2>
<core-format-text [text]="field.description"></core-format-text>
</ion-item>
<ion-item *ngIf="edit && field.grades">
<ion-label [core-mark-required]="true" stacked>{{ 'addon.mod_workshop_assessment_accumulative.dimensiongradefor' | translate : {'$a': field.dimtitle } }}</ion-label>
<ion-select [(ngModel)]="selectedValues[n].grade" interface="popover">
<ion-option *ngFor="let grade of field.grades" [value]="grade.value">{{grade.label}}</ion-option>
</ion-select>
<core-input-errors item-content *ngIf="fieldErrors['grade_' + n]" [errorText]="fieldErrors['grade_' + n]"></core-input-errors>
</ion-item>
<ion-item *ngIf="!edit && field.grades" text-wrap>
<h2>{{ 'addon.mod_workshop_assessment_accumulative.dimensiongradefor' | translate : {'$a': field.dimtitle } }}</h2>
<ng-container *ngFor="let grade of field.grades">
<p *ngIf="grade.value === selectedValues[n].grade">{{grade.label}}</p>
</ng-container>
</ion-item>
<ion-item *ngIf="edit">
<ion-label stacked>{{ 'addon.mod_workshop_assessment_accumulative.dimensioncommentfor' | translate : {'$a': field.dimtitle } }}</ion-label>
<ion-textarea aria-multiline="true" [(ngModel)]="selectedValues[n].peercomment" core-auto-rows></ion-textarea>
</ion-item>
<ion-item *ngIf="!edit" text-wrap>
<h2>{{ 'addon.mod_workshop_assessment_accumulative.dimensioncommentfor' | translate : {'$a': field.dimtitle } }}</h2>
<p><core-format-text [text]="selectedValues[n].peercomment"></core-format-text></p>
</ion-item>
</ion-card>
<ng-container *ngFor="let field of assessment.form.fields; let n = index">
<ion-card *ngIf="n < assessment.form.dimenssionscount">
<ion-item text-wrap>
<h2>{{ field.dimtitle }}</h2>
<core-format-text [text]="field.description"></core-format-text>
</ion-item>
<ion-item *ngIf="edit && field.grades">
<ion-label [core-mark-required]="true" stacked>{{ 'addon.mod_workshop_assessment_accumulative.dimensiongradefor' | translate : {'$a': field.dimtitle } }}</ion-label>
<ion-select [(ngModel)]="selectedValues[n].grade" interface="popover">
<ion-option *ngFor="let grade of field.grades" [value]="grade.value">{{grade.label}}</ion-option>
</ion-select>
<core-input-errors item-content *ngIf="fieldErrors['grade_' + n]" [errorText]="fieldErrors['grade_' + n]"></core-input-errors>
</ion-item>
<ion-item *ngIf="!edit && field.grades" text-wrap>
<h2>{{ 'addon.mod_workshop_assessment_accumulative.dimensiongradefor' | translate : {'$a': field.dimtitle } }}</h2>
<ng-container *ngFor="let grade of field.grades">
<p *ngIf="grade.value === selectedValues[n].grade">{{grade.label}}</p>
</ng-container>
</ion-item>
<ion-item *ngIf="edit">
<ion-label stacked>{{ 'addon.mod_workshop_assessment_accumulative.dimensioncommentfor' | translate : {'$a': field.dimtitle } }}</ion-label>
<ion-textarea aria-multiline="true" [(ngModel)]="selectedValues[n].peercomment" core-auto-rows></ion-textarea>
</ion-item>
<ion-item *ngIf="!edit" text-wrap>
<h2>{{ 'addon.mod_workshop_assessment_accumulative.dimensioncommentfor' | translate : {'$a': field.dimtitle } }}</h2>
<p><core-format-text [text]="selectedValues[n].peercomment"></core-format-text></p>
</ion-item>
</ion-card>
</ng-container>

View File

@ -1,15 +1,17 @@
<ion-card *ngFor="let field of assessment.form.fields; let n = index">
<ion-item text-wrap>
<h2>{{ field.dimtitle }}</h2>
<core-format-text [text]="field.description"></core-format-text>
</ion-item>
<ion-item *ngIf="edit">
<ion-label stacked [core-mark-required]="true">{{ 'addon.mod_workshop_assessment_comments.dimensioncommentfor' | translate : {'$a': field.dimtitle } }}</ion-label>
<ion-textarea aria-multiline="true" [(ngModel)]="selectedValues[n].peercomment" core-auto-rows></ion-textarea>
<core-input-errors item-content *ngIf="fieldErrors['peercomment_' + n]" [errorText]="fieldErrors['peercomment_' + n]"></core-input-errors>
</ion-item>
<ion-item *ngIf="!edit" text-wrap>
<h2>{{ 'addon.mod_workshop_assessment_comments.dimensioncommentfor' | translate : {'$a': field.dimtitle } }}</h2>
<p><core-format-text [text]="selectedValues[n].peercomment"></core-format-text></p>
</ion-item>
</ion-card>
<ng-container *ngFor="let field of assessment.form.fields; let n = index">
<ion-card *ngIf="n < assessment.form.dimenssionscount">
<ion-item text-wrap>
<h2>{{ field.dimtitle }}</h2>
<core-format-text [text]="field.description"></core-format-text>
</ion-item>
<ion-item *ngIf="edit">
<ion-label stacked [core-mark-required]="true">{{ 'addon.mod_workshop_assessment_comments.dimensioncommentfor' | translate : {'$a': field.dimtitle } }}</ion-label>
<ion-textarea aria-multiline="true" [(ngModel)]="selectedValues[n].peercomment" core-auto-rows></ion-textarea>
<core-input-errors item-content *ngIf="fieldErrors['peercomment_' + n]" [errorText]="fieldErrors['peercomment_' + n]"></core-input-errors>
</ion-item>
<ion-item *ngIf="!edit" text-wrap>
<h2>{{ 'addon.mod_workshop_assessment_comments.dimensioncommentfor' | translate : {'$a': field.dimtitle } }}</h2>
<p><core-format-text [text]="selectedValues[n].peercomment"></core-format-text></p>
</ion-item>
</ion-card>
</ng-container>

View File

@ -1,28 +1,30 @@
<ion-card *ngFor="let field of assessment.form.fields; let n = index">
<ion-item text-wrap>
<h2>{{ field.dimtitle }}</h2>
<core-format-text [text]="field.description"></core-format-text>
</ion-item>
<ion-list radio-group [(ngModel)]="selectedValues[n].grade" [name]="'grade_' + n">
<ion-item>
<ion-label stacked [core-mark-required]="edit">{{ 'addon.mod_workshop.yourassessmentfor' | translate : {'$a': field.dimtitle } }}</ion-label>
<core-input-errors item-content *ngIf="edit && fieldErrors['grade_' + n]" [errorText]="fieldErrors['grade_' + n]"></core-input-errors>
<ng-container *ngFor="let field of assessment.form.fields; let n = index">
<ion-card *ngIf="n < assessment.form.dimenssionscount">
<ion-item text-wrap>
<h2>{{ field.dimtitle }}</h2>
<core-format-text [text]="field.description"></core-format-text>
</ion-item>
<ion-item>
<ion-label><core-format-text [text]="field.grade0"></core-format-text></ion-label>
<ion-radio [value]="-1" [disabled]="!edit"></ion-radio>
<ion-list radio-group [(ngModel)]="selectedValues[n].grade" [name]="'grade_' + n">
<ion-item>
<ion-label stacked [core-mark-required]="edit">{{ 'addon.mod_workshop.yourassessmentfor' | translate : {'$a': field.dimtitle } }}</ion-label>
<core-input-errors item-content *ngIf="edit && fieldErrors['grade_' + n]" [errorText]="fieldErrors['grade_' + n]"></core-input-errors>
</ion-item>
<ion-item>
<ion-label><core-format-text [text]="field.grade0"></core-format-text></ion-label>
<ion-radio [value]="-1" [disabled]="!edit"></ion-radio>
</ion-item>
<ion-item>
<ion-label><core-format-text [text]="field.grade1"></core-format-text></ion-label>
<ion-radio [value]="1" [disabled]="!edit"></ion-radio>
</ion-item>
</ion-list>
<ion-item *ngIf="edit">
<ion-label stacked>{{ 'addon.mod_workshop_assessment_numerrors.dimensioncommentfor' | translate : {'$a': field.dimtitle } }}</ion-label>
<ion-textarea aria-multiline="true" [(ngModel)]="selectedValues[n].peercomment" [name]="'peercomment_' + n" core-auto-rows></ion-textarea>
</ion-item>
<ion-item>
<ion-label><core-format-text [text]="field.grade1"></core-format-text></ion-label>
<ion-radio [value]="1" [disabled]="!edit"></ion-radio>
<ion-item *ngIf="!edit" text-wrap>
<h2>{{ 'addon.mod_workshop_assessment_numerrors.dimensioncommentfor' | translate : {'$a': field.dimtitle } }}</h2>
<p><core-format-text [text]="selectedValues[n].peercomment"></core-format-text></p>
</ion-item>
</ion-list>
<ion-item *ngIf="edit">
<ion-label stacked>{{ 'addon.mod_workshop_assessment_numerrors.dimensioncommentfor' | translate : {'$a': field.dimtitle } }}</ion-label>
<ion-textarea aria-multiline="true" [(ngModel)]="selectedValues[n].peercomment" [name]="'peercomment_' + n" core-auto-rows></ion-textarea>
</ion-item>
<ion-item *ngIf="!edit" text-wrap>
<h2>{{ 'addon.mod_workshop_assessment_numerrors.dimensioncommentfor' | translate : {'$a': field.dimtitle } }}</h2>
<p><core-format-text [text]="selectedValues[n].peercomment"></core-format-text></p>
</ion-item>
</ion-card>
</ion-card>
</ng-container>

View File

@ -1,13 +1,15 @@
<ion-card *ngFor="let field of assessment.form.fields; let n = index">
<ion-item text-wrap>
<h2 [core-mark-required]="edit">{{ field.dimtitle }}</h2>
<core-format-text [text]="field.description"></core-format-text>
<core-input-errors *ngIf="edit && fieldErrors['chosenlevelid_' + n]" [errorText]="fieldErrors['chosenlevelid_' + n]"></core-input-errors>
</ion-item>
<ion-list radio-group [(ngModel)]="selectedValues[n].chosenlevelid" [name]="'chosenlevelid_' + n">
<ion-item *ngFor="let subfield of field.fields">
<ion-label><p><core-format-text [text]="subfield.definition"></core-format-text></p></ion-label>
<ion-radio [value]="subfield.levelid" [disabled]="!edit"></ion-radio>
<ng-container *ngFor="let field of assessment.form.fields; let n = index">
<ion-card *ngIf="n < assessment.form.dimenssionscount">
<ion-item text-wrap>
<h2 [core-mark-required]="edit">{{ field.dimtitle }}</h2>
<core-format-text [text]="field.description"></core-format-text>
<core-input-errors *ngIf="edit && fieldErrors['chosenlevelid_' + n]" [errorText]="fieldErrors['chosenlevelid_' + n]"></core-input-errors>
</ion-item>
</ion-list>
</ion-card>
<ion-list radio-group [(ngModel)]="selectedValues[n].chosenlevelid" [name]="'chosenlevelid_' + n">
<ion-item *ngFor="let subfield of field.fields">
<ion-label><p><core-format-text [text]="subfield.definition"></core-format-text></p></ion-label>
<ion-radio [value]="subfield.levelid" [disabled]="!edit"></ion-radio>
</ion-item>
</ion-list>
</ion-card>
</ng-container>

View File

@ -17,7 +17,7 @@
<ion-item stacked *ngIf="edit">
<ion-label stacked [core-mark-required]="overallFeedkbackRequired">{{ 'addon.mod_workshop.feedbackauthor' | translate }}</ion-label>
<core-rich-text-editor item-content [control]="feedbackControl" [component]="component" [componentId]="workshop.coursemodule" (contentChanged)="onFeedbackChange($event)"></core-rich-text-editor>
<core-input-errors item-content *ngIf="overallFeedkbackRequired && fieldErrors['feedbackauthor']" [errorText]="fieldErrors['feedbackauthor']"></core-input-errors>
<core-input-errors item-content *ngIf="overallFeedkbackRequired && fieldErrors && fieldErrors['feedbackauthor']" [errorText]="fieldErrors['feedbackauthor']"></core-input-errors>
</ion-item>
<core-attachments *ngIf="edit && workshop.overallfeedbackfiles" [files]="data.assessment.feedbackattachmentfiles" [maxSize]="workshop.overallfeedbackmaxbytes"
[maxSubmissions]="workshop.overallfeedbackfiles" [component]="component" [componentId]="componentId" [allowOffline]="true"></core-attachments>