From c5b8b4fb1998fd0bcb63e6dfe876f1f1fcc6d1d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Fri, 8 Apr 2022 14:11:52 +0200 Subject: [PATCH] MOBILE-3833 assignment: Add collapsible footer action buttons --- .../index/addon-mod-assign-index.html | 3 - .../addon-mod-assign-submission.html | 159 ++++++++++-------- .../components/submission/submission.ts | 3 +- src/core/classes/tabs.ts | 3 + 4 files changed, 90 insertions(+), 78 deletions(-) diff --git a/src/addons/mod/assign/components/index/addon-mod-assign-index.html b/src/addons/mod/assign/components/index/addon-mod-assign-index.html index 5aa7a97af..599a85136 100644 --- a/src/addons/mod/assign/components/index/addon-mod-assign-index.html +++ b/src/addons/mod/assign/components/index/addon-mod-assign-index.html @@ -134,6 +134,3 @@ [moduleId]="module.id"> - - - diff --git a/src/addons/mod/assign/components/submission/addon-mod-assign-submission.html b/src/addons/mod/assign/components/submission/addon-mod-assign-submission.html index 42dde1d55..753b18636 100644 --- a/src/addons/mod/assign/components/submission/addon-mod-assign-submission.html +++ b/src/addons/mod/assign/components/submission/addon-mod-assign-submission.html @@ -37,7 +37,7 @@ - + @@ -139,79 +139,6 @@ [submission]="userSubmission" [plugin]="plugin"> - - - -
- - - {{ 'addon.mod_assign.editsubmission' | translate }} - - - - - {{ 'addon.mod_assign.addsubmission' | translate }} - - - {{ 'addon.mod_assign.beginassignment' | translate }} - - - - - - {{ 'addon.mod_assign.addnewattemptfromprevious' | translate }} - - - {{ 'addon.mod_assign.addnewattempt' | translate }} - - - - - {{ 'addon.mod_assign.editsubmission' | translate }} - -
-
-

{{ 'addon.mod_assign.erroreditpluginsnotsupported' | translate }}

-

{{ name }}

-
-
-

{{ 'addon.mod_assign.cannoteditduetostatementsubmission' | translate }}

-
-
-
- - - - - - - - - - - - - - - {{ 'addon.mod_assign.submitassignment' | translate }} - -

{{ 'addon.mod_assign.submitassignment_help' | translate }}

-
-
- - - -

- {{ 'addon.mod_assign.cannotsubmitduetostatementsubmission' | translate }} -

-
-
-
- @@ -236,6 +163,90 @@ + + +
+
+ + + + + {{ 'addon.mod_assign.editsubmission' | translate }} + + + + + {{ 'addon.mod_assign.addsubmission' | translate }} + + + {{ 'addon.mod_assign.beginassignment' | translate }} + + + + + + {{ 'addon.mod_assign.addnewattemptfromprevious' | translate }} + + + {{ 'addon.mod_assign.addnewattempt' | translate }} + + + + + {{ 'addon.mod_assign.editsubmission' | translate }} + + + + + +

{{ 'addon.mod_assign.erroreditpluginsnotsupported' | translate }}

+

{{ name }}

+
+ +

{{ 'addon.mod_assign.cannoteditduetostatementsubmission' | translate }}

+
+
+
+ +
+ + + + + + + + + + + + + + + {{ 'addon.mod_assign.submitassignment' | translate }} + +

{{ 'addon.mod_assign.submitassignment_help' | translate }}

+
+
+ + + +

+ {{ 'addon.mod_assign.cannotsubmitduetostatementsubmission' | translate }} +

+
+
+
+
+ + +
diff --git a/src/addons/mod/assign/components/submission/submission.ts b/src/addons/mod/assign/components/submission/submission.ts index 3699d2c59..f3c2f3840 100644 --- a/src/addons/mod/assign/components/submission/submission.ts +++ b/src/addons/mod/assign/components/submission/submission.ts @@ -184,7 +184,7 @@ export class AddonModAssignSubmissionComponent implements OnInit, OnDestroy, Can } /** - * Component being initialized. + * @inheritdoc */ ngOnInit(): void { this.isSubmittedForGrading = !!this.submitId; @@ -1195,6 +1195,7 @@ export class AddonModAssignSubmissionComponent implements OnInit, OnDestroy, Can * @param tab The tab that was selected. */ tabSelected(tab: CoreTabComponent): void { + this.selectedTab = tab.id; // Block sync when selecting grade tab, unblock when leaving it. this.setGradeSyncBlocked(tab.id === 'grade'); } diff --git a/src/core/classes/tabs.ts b/src/core/classes/tabs.ts index 61f006286..166711854 100644 --- a/src/core/classes/tabs.ts +++ b/src/core/classes/tabs.ts @@ -482,6 +482,9 @@ export class CoreTabsBaseComponent implements OnInit, Aft */ async selectTab(tabId: string, e?: Event): Promise { const index = this.tabs.findIndex((tab) => tabId == tab.id); + if (index < 0) { + return; + } return this.selectByIndex(index, e); }