= workshopPhases.PHASE_SUBMISSION">
-
+ = workshopPhases.PHASE_CLOSED">
{{ '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 }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ = workshopPhases.PHASE_CLOSED">
+
+
+ {{ 'addon.mod_workshop.publishedsubmissions' | translate }}
+
+
+ = workshopPhases.PHASE_ASSESSMENT">
+
+
+ {{ 'addon.mod_workshop.areainstructreviewers' | translate }}
+
+
+
+
+
+
+ {{ 'addon.mod_workshop.assignedassessments' | translate }}
+
+
+
+
+
+
+
- = workshopPhases.PHASE_SUBMISSION && grades && grades.length">
-
+ = workshopPhases.PHASE_SUBMISSION && grades && grades.length">
+
{{ 'addon.mod_workshop.submissionsreport' | translate }}
-
- workshopPhases.PHASE_SUBMISSION">
+
+ workshopPhases.PHASE_SUBMISSION">
{{ 'addon.mod_workshop.gradesreport' | translate }}
-
+
{{ 'core.groupsseparate' | translate }}
{{ 'core.groupsvisible' | translate }}
@@ -166,15 +152,15 @@
0 || hasNextPage">
0">
-
{{ 'core.next' | translate }}
-
+
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 }}
@@ -9,17 +9,27 @@
-
+
- = phase.code || phase.tasks.length || phase.switchUrl">
- {{ phase.title }}
- {{ 'addon.mod_workshop.userplancurrentphase' | translate }}
-
-
-
- = phase.code || phase.tasks.length || phase.switchUrl)">
- {{ phase.title }}
-
+
+ {{ phase.title }}
+ {{ 'addon.mod_workshop.userplancurrentphase' | translate }}
+
+
+
+ {{ 'addon.mod_workshop.switchphase' + phase.code | translate }}
+
+
+
+
+
+
+
+
+ {{task.title}}
+
+
+
diff --git a/src/addon/mod/workshop/pages/phase/phase.module.ts b/src/addon/mod/workshop/pages/phase/phase.module.ts
index 2085e6ca9..7cda380cf 100644
--- a/src/addon/mod/workshop/pages/phase/phase.module.ts
+++ b/src/addon/mod/workshop/pages/phase/phase.module.ts
@@ -16,18 +16,18 @@ import { NgModule } from '@angular/core';
import { IonicPageModule } from 'ionic-angular';
import { TranslateModule } from '@ngx-translate/core';
import { CoreDirectivesModule } from '@directives/directives.module';
-import { AddonModWorkshopPhaseSelectorPage } from './phase';
+import { AddonModWorkshopPhaseInfoPage } from './phase';
import { CoreCompileHtmlComponentModule } from '@core/compile/components/compile-html/compile-html.module';
@NgModule({
declarations: [
- AddonModWorkshopPhaseSelectorPage,
+ AddonModWorkshopPhaseInfoPage,
],
imports: [
CoreDirectivesModule,
CoreCompileHtmlComponentModule,
- IonicPageModule.forChild(AddonModWorkshopPhaseSelectorPage),
+ IonicPageModule.forChild(AddonModWorkshopPhaseInfoPage),
TranslateModule.forChild()
],
})
-export class AddonModWorkshopPhaseSelectorPageModule {}
+export class AddonModWorkshopPhaseInfoPageModule {}
diff --git a/src/addon/mod/workshop/pages/phase/phase.scss b/src/addon/mod/workshop/pages/phase/phase.scss
new file mode 100644
index 000000000..b454614ef
--- /dev/null
+++ b/src/addon/mod/workshop/pages/phase/phase.scss
@@ -0,0 +1,22 @@
+page-addon-mod-workshop-phase-info {
+ .core-workshop-phase-selected {
+ background-color: $white;
+ @include ltr() {
+ border-left: 5px solid $core-splitview-selected;
+ }
+
+ @include rtl() {
+ border-right: 5px solid $core-splitview-selected;
+ }
+
+ &.item-md {
+ @include padding(null, null, null, $item-md-padding-start - 5px);
+ }
+ &.item-ios {
+ @include padding(null, null, null, $item-ios-padding-start - 5px);
+ }
+ &.item-wp {
+ @include padding(null, null, null, $item-wp-padding-start - 5px);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/addon/mod/workshop/pages/phase/phase.ts b/src/addon/mod/workshop/pages/phase/phase.ts
index f1fe2fdcc..a0d88a01f 100644
--- a/src/addon/mod/workshop/pages/phase/phase.ts
+++ b/src/addon/mod/workshop/pages/phase/phase.ts
@@ -14,26 +14,38 @@
import { Component } from '@angular/core';
import { IonicPage, NavParams, ViewController } from 'ionic-angular';
+import { CoreUtilsProvider } from '@providers/utils/utils';
/**
- * Page that displays the phase selector modal.
+ * Page that displays the phase info modal.
*/
-@IonicPage({ segment: 'addon-mod-workshop-phase-selector' })
+@IonicPage({ segment: 'addon-mod-workshop-phase-info' })
@Component({
- selector: 'page-addon-mod-workshop-phase-selector',
+ selector: 'page-addon-mod-workshop-phase-info',
templateUrl: 'phase.html',
})
-export class AddonModWorkshopPhaseSelectorPage {
- selected: number;
+export class AddonModWorkshopPhaseInfoPage {
phases: any;
workshopPhase: number;
- protected original: number;
- constructor(params: NavParams, private viewCtrl: ViewController) {
- this.selected = params.get('selected');
- this.original = this.selected;
+ constructor(params: NavParams, private viewCtrl: ViewController, private utils: CoreUtilsProvider) {
this.phases = params.get('phases');
this.workshopPhase = params.get('workshopPhase');
+ const externalUrl = params.get('externalUrl');
+
+ // Treat phases.
+ for (const x in this.phases) {
+ this.phases[x].tasks.forEach((task) => {
+ if (!task.link && (task.code == 'examples' || task.code == 'prepareexamples')) {
+ // Add links to manage examples.
+ task.link = externalUrl;
+ }
+ });
+ const action = this.phases[x].actions.find((action) => {
+ return action.url && action.type == 'switchphase';
+ });
+ this.phases[x].switchUrl = action ? action.url : '';
+ }
}
/**
@@ -44,13 +56,16 @@ export class AddonModWorkshopPhaseSelectorPage {
}
/**
- * Select phase.
+ * Open task.
+ *
+ * @param {any} task Task to be done.
*/
- switchPhase(): void {
- // This is a quick hack to avoid the first switch phase call done just when opening the modal.
- if (this.original != this.selected) {
- this.viewCtrl.dismiss(this.selected);
+ runTask(task: any): void {
+ if (task.code == 'submit') {
+ // This will close the modal and go to the submit.
+ this.viewCtrl.dismiss(true);
+ } else if (task.link) {
+ this.utils.openInBrowser(task.link);
}
- this.original = null;
}
}