Skip to content

Commit 240f425

Browse files
authored
Merge pull request #1962 from albertgasset/MOBILE-3039
Mobile 3039
2 parents b662157 + e4e91bd commit 240f425

File tree

6 files changed

+9
-14
lines changed

6 files changed

+9
-14
lines changed

src/addon/mod/data/fields/textarea/providers/handler.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,9 @@ export class AddonModDataFieldTextareaHandler extends AddonModDataFieldTextHandl
103103
return this.translate.instant('addon.mod_data.errormustsupplyvalue');
104104
}
105105

106-
const found = inputData.some((input) => {
107-
return !input.subfield && this.textUtils.htmlIsBlank(input.value);
108-
});
106+
const value = inputData.find((value) => value.subfield == '');
109107

110-
if (!found) {
108+
if (!value || this.textUtils.htmlIsBlank(value.value)) {
111109
return this.translate.instant('addon.mod_data.errormustsupplyvalue');
112110
}
113111
}

src/addon/mod/data/pages/entry/entry.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
<core-rating-rate *ngIf="data && entry && ratingInfo && (!data.approval || entry.approved)" [ratingInfo]="ratingInfo" contextLevel="module" [instanceId]="data.coursemodule" [itemId]="entry.id" [itemSetId]="0" [courseId]="courseId" [aggregateMethod]="data.assessed" [scaleId]="data.scale" [userId]="entry.userid" (onLoading)="setLoadingRating($event)" (onUpdate)="ratingUpdated()"></core-rating-rate>
3232
<core-rating-aggregate *ngIf="data && entry && ratingInfo" [ratingInfo]="ratingInfo" contextLevel="module" [instanceId]="data.coursemodule" [itemId]="entry.id" [courseId]="courseId" [aggregateMethod]="data.assessed" [scaleId]="data.scale"></core-rating-aggregate>
3333

34-
<ion-item *ngIf="data && entry && entry.id > 0 && commentsEnabled">
34+
<ion-item *ngIf="data && data.comments && entry && entry.id > 0 && commentsEnabled">
3535
<core-comments contextLevel="module" [instanceId]="data.coursemodule" component="mod_data" [itemId]="entry.id" area="database_entry" [displaySpinner]="false" (onLoading)="setLoadingComments($event)"></core-comments>
3636
</ion-item>
3737

src/addon/mod/workshop/components/assessment-strategy/addon-mod-workshop-assessment-strategy.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ <h3 padding>{{ 'addon.mod_workshop.assessmentform' | translate }}</h3>
1010
{{ 'addon.mod_workshop.assessmentstrategynotsupported' | translate:{$a: strategy} }}
1111
</div>
1212

13-
<ion-card *ngIf="assessmentStrategyLoaded && overallFeedkback && (edit || data.assessment.feedbackauthor || data.assessment.feedbackattachmentfiles.length) ">
13+
<ion-card *ngIf="assessmentStrategyLoaded && overallFeedkback && (edit || data.assessment.feedbackauthor || data.assessment.feedbackattachmentfiles && data.assessment.feedbackattachmentfiles.length) ">
1414
<ion-item text-wrap>
1515
<h2>{{ 'addon.mod_workshop.overallfeedback' | translate }}</h2>
1616
</ion-item>

src/addon/mod/workshop/components/submission/addon-mod-workshop-submission.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ <h2>{{submission.title}}</h2>
3232
<core-local-file *ngIf="attachment.name" [file]="attachment"></core-local-file>
3333
</ion-item>
3434
<ion-item text-wrap *ngIf="viewDetails && submission.feedbackauthor">
35-
<ion-avatar core-user-avatar [user]="evaluateByProfile" item-start [courseId]="courseId" [userId]="evaluateByProfile.id"></ion-avatar>
35+
<ion-avatar *ngIf="evaluateByProfile" core-user-avatar [user]="evaluateByProfile" item-start [courseId]="courseId" [userId]="evaluateByProfile.id"></ion-avatar>
3636

3737
<h2 *ngIf="evaluateByProfile && evaluateByProfile.fullname">{{ 'addon.mod_workshop.feedbackby' | translate : {$a: evaluateByProfile.fullname} }}</h2>
3838
<core-format-text [text]="submission.feedbackauthor"></core-format-text>

src/addon/mod/workshop/pages/submission/submission.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<ion-navbar core-back-button>
33
<ion-title><core-format-text [text]="title"></core-format-text></ion-title>
44
<ion-buttons end [hidden]="!loaded">
5-
<button *ngIf="assessmentId" ion-button clear (click)="saveAssessment()" [attr.aria-label]="'core.save' | translate">
5+
<button *ngIf="assessmentId && access.assessingallowed" ion-button clear (click)="saveAssessment()" [attr.aria-label]="'core.save' | translate">
66
{{ 'core.save' | translate }}
77
</button>
88
<button *ngIf="canAddFeedback" ion-button clear (click)="saveEvaluation()" [attr.aria-label]="'core.save' | translate">

src/addon/mod/workshop/providers/helper.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ export class AddonModWorkshopHelperProvider {
159159
* @return {Promise<any>} Resolved with the assessment.
160160
*/
161161
getReviewerAssessmentById(workshopId: number, assessmentId: number, userId: number = 0, siteId?: string): Promise<any> {
162-
return this.workshopProvider.getAssessment(workshopId, assessmentId, siteId).catch(() => {
162+
return this.workshopProvider.getAssessment(workshopId, assessmentId, siteId).catch((error) => {
163163
return this.workshopProvider.getReviewerAssessments(workshopId, userId, undefined, undefined, siteId)
164164
.then((assessments) => {
165165
for (const x in assessments) {
@@ -168,13 +168,10 @@ export class AddonModWorkshopHelperProvider {
168168
}
169169
}
170170

171-
return false;
171+
// Not found, return original error.
172+
return Promise.reject(error);
172173
});
173174
}).then((assessment) => {
174-
if (!assessment) {
175-
return false;
176-
}
177-
178175
return this.workshopProvider.getAssessmentForm(workshopId, assessmentId, undefined, undefined, undefined, siteId)
179176
.then((assessmentForm) => {
180177
assessment.form = assessmentForm;

0 commit comments

Comments
 (0)