MOBILE-3947 assign: Do not require submission statement if empty
parent
1e16f68070
commit
6c28885260
|
@ -1124,9 +1124,15 @@ export class AddonModAssignSubmissionComponent implements OnInit, OnDestroy, Can
|
|||
return [];
|
||||
}
|
||||
|
||||
// Receved submission statement should not be undefined. It would mean that the WS is not returning the value.
|
||||
const submissionStatementMissing = !!this.assign.requiresubmissionstatement &&
|
||||
this.assign.submissionstatement === undefined;
|
||||
|
||||
// If received submission statement is empty, then it's not required.
|
||||
if(!this.assign.submissionstatement && this.assign.submissionstatement !== undefined) {
|
||||
this.assign.requiresubmissionstatement = 0;
|
||||
}
|
||||
|
||||
this.canSubmit = !this.isSubmittedForGrading && !this.submittedOffline && (lastAttempt.cansubmit ||
|
||||
(this.hasOffline && AddonModAssign.canSubmitOffline(this.assign, submissionStatus)));
|
||||
|
||||
|
|
|
@ -205,6 +205,12 @@ export class AddonModAssignEditPage implements OnInit, OnDestroy, CanLeave {
|
|||
this.introAttachments = submissionStatus.assignmentdata?.attachments?.intro ?? this.assign.introattachments;
|
||||
|
||||
this.allowOffline = true; // If offline isn't allowed we shouldn't have reached this point.
|
||||
|
||||
// If received submission statement is empty, then it's not required.
|
||||
if(!this.assign.submissionstatement && this.assign.submissionstatement !== undefined) {
|
||||
this.assign.requiresubmissionstatement = 0;
|
||||
}
|
||||
|
||||
// Only show submission statement if we are editing our own submission.
|
||||
if (this.assign.requiresubmissionstatement && !this.assign.submissiondrafts && this.userId == currentUserId) {
|
||||
this.submissionStatement = this.assign.submissionstatement;
|
||||
|
|
Loading…
Reference in New Issue