diff --git a/src/addons/mod/forum/components/post/post.ts b/src/addons/mod/forum/components/post/post.ts index 8024b9c25..63f44e1b1 100644 --- a/src/addons/mod/forum/components/post/post.ts +++ b/src/addons/mod/forum/components/post/post.ts @@ -333,7 +333,7 @@ export class AddonModForumPostComponent implements OnInit, OnDestroy, OnChanges * @param text The new text. */ onMessageChange(text?: string | null): void { - this.formData.message = text ?? ''; + this.formData.message = text ?? null; } /** diff --git a/src/addons/mod/forum/pages/new-discussion/new-discussion.ts b/src/addons/mod/forum/pages/new-discussion/new-discussion.ts index df9003480..3c4921173 100644 --- a/src/addons/mod/forum/pages/new-discussion/new-discussion.ts +++ b/src/addons/mod/forum/pages/new-discussion/new-discussion.ts @@ -512,7 +512,7 @@ export class AddonModForumNewDiscussionPage implements OnInit, OnDestroy, CanLea * @param text The new text. */ onMessageChange(text?: string | null): void { - this.newDiscussion.message = text ?? ''; + this.newDiscussion.message = text ?? null; } /** diff --git a/src/addons/mod/workshop/assessment/accumulative/services/handler.ts b/src/addons/mod/workshop/assessment/accumulative/services/handler.ts index b6ca10e7c..563be19b8 100644 --- a/src/addons/mod/workshop/assessment/accumulative/services/handler.ts +++ b/src/addons/mod/workshop/assessment/accumulative/services/handler.ts @@ -129,9 +129,7 @@ export class AddonModWorkshopAssessmentStrategyAccumulativeHandlerService implem hasErrors = true; } - if (currentValues[idx].peercomment) { - data['peercomment__idx_' + idx] = currentValues[idx].peercomment; - } + data['peercomment__idx_' + idx] = currentValues[idx].peercomment ?? ''; data['gradeid__idx_' + idx] = parseInt(form.current[idx].gradeid, 10) || 0; data['dimensionid__idx_' + idx] = parseInt(field.dimensionid, 10); diff --git a/src/addons/mod/workshop/assessment/numerrors/services/handler.ts b/src/addons/mod/workshop/assessment/numerrors/services/handler.ts index b48e438c6..ce7e5dc39 100644 --- a/src/addons/mod/workshop/assessment/numerrors/services/handler.ts +++ b/src/addons/mod/workshop/assessment/numerrors/services/handler.ts @@ -112,9 +112,7 @@ export class AddonModWorkshopAssessmentStrategyNumErrorsHandlerService implement hasErrors = true; } - if (currentValues[idx].peercomment) { - data['peercomment__idx_' + idx] = currentValues[idx].peercomment; - } + data['peercomment__idx_' + idx] = currentValues[idx].peercomment ?? ''; data['gradeid__idx_' + idx] = parseInt(form.current[idx].gradeid, 10) || 0; data['dimensionid__idx_' + idx] = parseInt(field.dimensionid, 10); diff --git a/src/addons/mod/workshop/components/index/addon-mod-workshop-index.html b/src/addons/mod/workshop/components/index/addon-mod-workshop-index.html index d5c71c7d2..a9ef7ca64 100644 --- a/src/addons/mod/workshop/components/index/addon-mod-workshop-index.html +++ b/src/addons/mod/workshop/components/index/addon-mod-workshop-index.html @@ -23,12 +23,16 @@ phases[workshop!.phase].tasks.length"> - -