diff --git a/src/addon/mod/data/components/index/addon-mod-data-index.html b/src/addon/mod/data/components/index/addon-mod-data-index.html index 6ab11ee16..3d3d4e3f2 100644 --- a/src/addon/mod/data/components/index/addon-mod-data-index.html +++ b/src/addon/mod/data/components/index/addon-mod-data-index.html @@ -70,14 +70,14 @@ diff --git a/src/addon/mod/data/pages/entry/entry.html b/src/addon/mod/data/pages/entry/entry.html index 15ef58730..8d1ee2a9e 100644 --- a/src/addon/mod/data/pages/entry/entry.html +++ b/src/addon/mod/data/pages/entry/entry.html @@ -38,14 +38,14 @@ diff --git a/src/addon/mod/workshop/components/index/addon-mod-workshop-index.html b/src/addon/mod/workshop/components/index/addon-mod-workshop-index.html index b403cfab9..f1513402d 100644 --- a/src/addon/mod/workshop/components/index/addon-mod-workshop-index.html +++ b/src/addon/mod/workshop/components/index/addon-mod-workshop-index.html @@ -12,32 +12,24 @@ - + - -

{{ phases[selectedPhase].title }}

-

{{ 'addon.mod_workshop.userplancurrentphase' | translate }}

- +
+

{{ phases[workshop.phase].title }}

- - - {{ 'addon.mod_workshop.switchphase' + selectedPhase | translate }} - - -
+ + + + + + - - - - - - - -

{{task.title}}

-

- -
+

{{task.title}}

+

+ + +
@@ -46,72 +38,9 @@ {{ 'core.hasdatatosync' | translate: {$a: moduleName} }} -
- - - - -

{{ 'addon.mod_workshop.areainstructauthors' | translate }}

- -
-
- - - -

{{ 'addon.mod_workshop.yoursubmission' | translate }}

-

{{ 'addon.mod_workshop.noyoursubmission' | translate }}

-
- - - - -
- - - - - - - - -
- - - - - -

{{ 'addon.mod_workshop.areainstructreviewers' | translate }}

- -
-
- - - -

{{ 'addon.mod_workshop.assignedassessments' | translate }}

-
- - - -
-
- - - -

{{ 'addon.mod_workshop.yoursubmission' | translate }}

-
- -

{{ 'addon.mod_workshop.assignedassessments' | translate }}

-
-
- +
- +

{{ 'addon.mod_workshop.conclusion' | translate }}

@@ -123,34 +52,91 @@

{{ 'addon.mod_workshop.yourgrades' | translate }}

- +

{{ 'addon.mod_workshop.submissiongrade' | translate }}

-
- +
+

{{ 'addon.mod_workshop.gradinggrade' | translate }}

-
-
- - - -

{{ 'addon.mod_workshop.publishedsubmissions' | translate }}

+
+
+ + + + +

{{ 'addon.mod_workshop.areainstructauthors' | translate }}

+ +
+
+ + + +

{{ 'addon.mod_workshop.yoursubmission' | translate }}

+

{{ 'addon.mod_workshop.noyoursubmission' | translate }}

+
+ + + +

{{ 'addon.mod_workshop.yoursubmission' | translate }}

+
+ +
+
+ + + + + + + + + + + + +

{{ 'addon.mod_workshop.publishedsubmissions' | translate }}

+
+ + + + +

{{ 'addon.mod_workshop.areainstructreviewers' | translate }}

+ +
+
+ + + +

{{ 'addon.mod_workshop.assignedassessments' | translate }}

+
+ + + +
+
+ - - + +

{{ 'addon.mod_workshop.submissionsreport' | translate }}

-
- + +

{{ 'addon.mod_workshop.gradesreport' | translate }}

-
+ {{ 'core.groupsseparate' | translate }} {{ 'core.groupsvisible' | translate }} @@ -166,15 +152,15 @@ - diff --git a/src/addon/mod/workshop/components/index/index.ts b/src/addon/mod/workshop/components/index/index.ts index 5a1004709..4421edf87 100644 --- a/src/addon/mod/workshop/components/index/index.ts +++ b/src/addon/mod/workshop/components/index/index.ts @@ -41,7 +41,6 @@ export class AddonModWorkshopIndexComponent extends CoreCourseModuleMainActivity assessments: any; userGrades: any; publishedSubmissions: any; - selectedPhase: number; submission: any; groupInfo: CoreGroupInfo = { groups: [], @@ -61,9 +60,6 @@ export class AddonModWorkshopIndexComponent extends CoreCourseModuleMainActivity }; protected offlineSubmissions = []; - protected supportedTasks = { // Add here native supported tasks. - submit: true - }; protected obsSubmissionChanged: any; protected obsAssessmentSaved: any; protected appResumeSubscription: any; @@ -189,8 +185,6 @@ export class AddonModWorkshopIndexComponent extends CoreCourseModuleMainActivity return this.workshopProvider.getWorkshop(this.courseId, this.module.id).then((workshop) => { this.workshop = workshop; - this.selectedPhase = workshop.phase; - this.description = workshop.intro || workshop.description; this.dataRetrieved.emit(workshop); @@ -225,21 +219,12 @@ export class AddonModWorkshopIndexComponent extends CoreCourseModuleMainActivity }).then((phases) => { this.phases = phases; - // Treat phases. - for (const x in phases) { - phases[x].tasks.forEach((task) => { - if (!task.link && (task.code == 'examples' || task.code == 'prepareexamples')) { - // Add links to manage examples. - task.link = this.externalUrl; - } else if (task.link && typeof this.supportedTasks[task.code] !== 'undefined') { - task.support = true; - } - }); - const action = phases[x].actions.find((action) => { - return action.url && action.type == 'switchphase'; - }); - phases[x].switchUrl = action ? action.url : ''; - } + phases[this.workshop.phase].tasks.forEach((task) => { + if (!task.link && (task.code == 'examples' || task.code == 'prepareexamples')) { + // Add links to manage examples. + task.link = this.externalUrl; + } + }); // Check if there are info stored in offline. return this.workshopOffline.hasWorkshopOfflineData(this.workshop.id).then((hasOffline) => { @@ -295,47 +280,42 @@ export class AddonModWorkshopIndexComponent extends CoreCourseModuleMainActivity * @param {any} task Task to be done. */ runTask(task: any): void { - if (task.support) { - if (task.code == 'submit' && this.canSubmit && ((this.access.creatingsubmissionallowed && !this.submission) || - (this.access.modifyingsubmissionallowed && this.submission))) { - const params = { - module: this.module, - access: this.access, - courseId: this.courseId, - submissionId: this.submission && this.submission.id - }; - - this.navCtrl.push('AddonModWorkshopEditSubmissionPage', params); - } + if (task.code == 'submit') { + this.gotoSubmit(); } else if (task.link) { this.utils.openInBrowser(task.link); } } /** - * Run task link on current phase. - * - * @param {string} taskCode Code related to the task to run. + * Go to submit page. */ - runTaskByCode(taskCode: string): void { - const task = this.workshopHelper.getTask(this.phases[this.workshop.phase].tasks, taskCode); + gotoSubmit(): void { + if (this.canSubmit && ((this.access.creatingsubmissionallowed && !this.submission) || + (this.access.modifyingsubmissionallowed && this.submission))) { + const params = { + module: this.module, + access: this.access, + courseId: this.courseId, + submissionId: this.submission && this.submission.id + }; - return task ? this.runTask(task) : null; + this.navCtrl.push('AddonModWorkshopEditSubmissionPage', params); + } } /** - * Select Phase to be shown. + * View Phase info. */ - selectPhase(): void { + viewPhaseInfo(): void { if (this.phases) { - const modal = this.modalCtrl.create('AddonModWorkshopPhaseSelectorPage', { + const modal = this.modalCtrl.create('AddonModWorkshopPhaseInfoPage', { phases: this.utils.objectToArray(this.phases), - selected: this.selectedPhase, - workshopPhase: this.workshop.phase + workshopPhase: this.workshop.phase, + externalUrl: this.externalUrl }); - modal.onDidDismiss((phase) => { - // Add data to search object. - typeof phase != 'undefined' && this.switchPhase(phase); + modal.onDidDismiss((goSubmit) => { + goSubmit && this.gotoSubmit(); }); modal.present(); } @@ -442,16 +422,6 @@ export class AddonModWorkshopIndexComponent extends CoreCourseModuleMainActivity return Promise.all(promises); } - /** - * Switch shown phase. - * - * @param {number} phase Selected phase. - */ - switchPhase(phase: number): void { - this.selectedPhase = phase; - this.page = 0; - } - /** * Performs the sync of the activity. * diff --git a/src/addon/mod/workshop/components/submission/addon-mod-workshop-submission.html b/src/addon/mod/workshop/components/submission/addon-mod-workshop-submission.html index 8e142ba0b..04b9ebd54 100644 --- a/src/addon/mod/workshop/components/submission/addon-mod-workshop-submission.html +++ b/src/addon/mod/workshop/components/submission/addon-mod-workshop-submission.html @@ -34,7 +34,9 @@ - + + +

{{ 'addon.mod_workshop.feedbackby' | translate : {$a: evaluateByProfile.fullname} }}

diff --git a/src/addon/mod/workshop/lang/en.json b/src/addon/mod/workshop/lang/en.json index ff7cd8d55..d63f0d836 100644 --- a/src/addon/mod/workshop/lang/en.json +++ b/src/addon/mod/workshop/lang/en.json @@ -35,7 +35,6 @@ "publishsubmission_help": "Published submissions are available to the others when the workshop is closed.", "reassess": "Re-assess", "receivedgrades": "Grades received", - "selectphase": "Select phase", "submissionattachment": "Attachment", "submissioncontent": "Submission content", "submissiondeleteconfirm": "Are you sure you want to delete the following submission?", @@ -50,6 +49,7 @@ "switchphase30": "Switch to the assessment phase", "switchphase40": "Switch to the evaluation phase", "switchphase50": "Close workshop", + "userplan": "Workshop planner", "userplancurrentphase": "Current phase", "warningassessmentmodified": "The submission was modified on the site.", "warningsubmissionmodified": "The assessment was modified on the site.", diff --git a/src/addon/mod/workshop/pages/phase/phase.html b/src/addon/mod/workshop/pages/phase/phase.html index 848b1017d..1d23c2015 100644 --- a/src/addon/mod/workshop/pages/phase/phase.html +++ b/src/addon/mod/workshop/pages/phase/phase.html @@ -1,6 +1,6 @@ - {{ 'addon.mod_workshop.selectphase' | translate }} + {{ 'addon.mod_workshop.userplan' | translate }}