diff --git a/scripts/langindex.json b/scripts/langindex.json index a355b0fd6..332c42ce7 100644 --- a/scripts/langindex.json +++ b/scripts/langindex.json @@ -872,12 +872,10 @@ "addon.mod_scorm.highestattempt": "scorm", "addon.mod_scorm.incomplete": "scorm", "addon.mod_scorm.lastattempt": "scorm", - "addon.mod_scorm.mode": "scorm", "addon.mod_scorm.modulenameplural": "scorm", "addon.mod_scorm.newattempt": "scorm", "addon.mod_scorm.noattemptsallowed": "scorm", "addon.mod_scorm.noattemptsmade": "scorm", - "addon.mod_scorm.normal": "scorm", "addon.mod_scorm.notattempted": "scorm", "addon.mod_scorm.offlineattemptnote": "local_moodlemobileapp", "addon.mod_scorm.offlineattemptovermax": "local_moodlemobileapp", diff --git a/src/addon/mod/scorm/components/index/addon-mod-scorm-index.html b/src/addon/mod/scorm/components/index/addon-mod-scorm-index.html index cd5e6b01a..cc16da2c2 100644 --- a/src/addon/mod/scorm/components/index/addon-mod-scorm-index.html +++ b/src/addon/mod/scorm/components/index/addon-mod-scorm-index.html @@ -98,7 +98,7 @@

- + ({{ 'addon.mod_scorm.score' | translate }}: {{sco.score_raw}})

@@ -130,43 +130,42 @@ - -
- -

{{ 'addon.mod_scorm.mode' | translate }}

-
- - {{ 'addon.mod_scorm.browse' | translate }} - - - - {{ 'addon.mod_scorm.normal' | translate }} - - -
- - - - {{ 'addon.mod_scorm.newattempt' | translate }} - - - - - + + + {{ 'addon.mod_scorm.newattempt' | translate }} + + + + -

{{ statusMessage | translate }}

-
- - {{ 'addon.mod_scorm.enter' | translate }} +

{{ statusMessage | translate }}

+ + + + + + + + + + + +
-

{{ progressMessage | translate }}

-

{{ 'core.percentagenumber' | translate:{$a: percentage} }}

+

{{ progressMessage | translate }}

+
diff --git a/src/addon/mod/scorm/components/index/index.ts b/src/addon/mod/scorm/components/index/index.ts index f2fd0a9a2..e16a6484a 100644 --- a/src/addon/mod/scorm/components/index/index.ts +++ b/src/addon/mod/scorm/components/index/index.ts @@ -37,12 +37,7 @@ export class AddonModScormIndexComponent extends CoreCourseModuleMainActivityCom scorm: any; // The SCORM object. currentOrganization: any = {}; // Selected organization. - scormOptions: any = { // Options to open the SCORM. - mode: AddonModScormProvider.MODENORMAL, - newAttempt: false - }; - modeNormal = AddonModScormProvider.MODENORMAL; // Normal open mode. - modeBrowser = AddonModScormProvider.MODEBROWSE; // Browser open mode. + startNewAttempt = false; errorMessage: string; // Error message. syncTime: string; // Last sync time. hasOffline: boolean; // Whether the SCORM has offline data. @@ -223,7 +218,7 @@ export class AddonModScormIndexComponent extends CoreCourseModuleMainActivityCom if (this.scorm.forcenewattempt == AddonModScormProvider.SCORM_FORCEATTEMPT_ALWAYS || (this.scorm.forcenewattempt && !this.scorm.incomplete)) { - this.scormOptions.newAttempt = true; + this.startNewAttempt = true; } promises.push(this.getReportedGrades()); @@ -372,7 +367,7 @@ export class AddonModScormIndexComponent extends CoreCourseModuleMainActivityCom if (this.hasPlayed) { this.hasPlayed = false; - this.scormOptions.newAttempt = false; // Uncheck new attempt. + this.startNewAttempt = false; // Uncheck new attempt. // Add a delay to make sure the player has started the last writing calls so we can detect conflicts. setTimeout(() => { @@ -492,7 +487,7 @@ export class AddonModScormIndexComponent extends CoreCourseModuleMainActivityCom * @param event Event. * @param scoId SCO that needs to be loaded when the SCORM is opened. If not defined, load first SCO. */ - open(event?: Event, scoId?: number): void { + open(event?: Event, preview: boolean = false, scoId?: number): void { if (event) { event.preventDefault(); event.stopPropagation(); @@ -515,7 +510,7 @@ export class AddonModScormIndexComponent extends CoreCourseModuleMainActivityCom this.downloadScormPackage().then(() => { // Success downloading, open SCORM if user hasn't left the view. if (!this.isDestroyed) { - this.openScorm(scoId); + this.openScorm(scoId, preview); } }).catch((error) => { if (!this.isDestroyed) { @@ -526,7 +521,7 @@ export class AddonModScormIndexComponent extends CoreCourseModuleMainActivityCom }); }); } else { - this.openScorm(scoId); + this.openScorm(scoId, preview); } } @@ -535,11 +530,11 @@ export class AddonModScormIndexComponent extends CoreCourseModuleMainActivityCom * * @param scoId SCO ID. */ - protected openScorm(scoId: number): void { + protected openScorm(scoId: number, preview: boolean = false): void { this.navCtrl.push('AddonModScormPlayerPage', { scorm: this.scorm, - mode: this.scormOptions.mode, - newAttempt: !!this.scormOptions.newAttempt, + mode: preview ? AddonModScormProvider.MODEBROWSE : AddonModScormProvider.MODENORMAL, + newAttempt: !!this.startNewAttempt, organizationId: this.currentOrganization.identifier, scoId: scoId }); diff --git a/src/addon/mod/scorm/lang/en.json b/src/addon/mod/scorm/lang/en.json index e7d6e5cfb..3e234713d 100644 --- a/src/addon/mod/scorm/lang/en.json +++ b/src/addon/mod/scorm/lang/en.json @@ -32,12 +32,10 @@ "highestattempt": "Highest attempt", "incomplete": "Incomplete", "lastattempt": "Last completed attempt", - "mode": "Mode", "modulenameplural": "SCORM packages", "newattempt": "Start a new attempt", "noattemptsallowed": "Number of attempts allowed", "noattemptsmade": "Number of attempts you have made", - "normal": "Normal", "notattempted": "Not attempted", "offlineattemptnote": "This attempt has data that hasn't been synchronised.", "offlineattemptovermax": "This attempt cannot be sent because you exceeded the maximum number of attempts.", diff --git a/src/addon/mod/scorm/providers/prefetch-handler.ts b/src/addon/mod/scorm/providers/prefetch-handler.ts index 0d3756312..d8263dbd7 100644 --- a/src/addon/mod/scorm/providers/prefetch-handler.ts +++ b/src/addon/mod/scorm/providers/prefetch-handler.ts @@ -220,6 +220,7 @@ export class AddonModScormPrefetchHandler extends CoreCourseActivityPrefetchHand /** * Function that converts a regular ProgressEvent into a AddonModScormProgressEvent. * + * @param downloading True when downloading, false when unzipping. * @param onProgress Function to call on progress. * @param progress Event returned by the download function. */ diff --git a/src/assets/lang/en.json b/src/assets/lang/en.json index 290fe79f4..537dbbacd 100644 --- a/src/assets/lang/en.json +++ b/src/assets/lang/en.json @@ -872,12 +872,10 @@ "addon.mod_scorm.highestattempt": "Highest attempt", "addon.mod_scorm.incomplete": "Incomplete", "addon.mod_scorm.lastattempt": "Last completed attempt", - "addon.mod_scorm.mode": "Mode", "addon.mod_scorm.modulenameplural": "SCORM packages", "addon.mod_scorm.newattempt": "Start a new attempt", "addon.mod_scorm.noattemptsallowed": "Number of attempts allowed", "addon.mod_scorm.noattemptsmade": "Number of attempts you have made", - "addon.mod_scorm.normal": "Normal", "addon.mod_scorm.notattempted": "Not attempted", "addon.mod_scorm.offlineattemptnote": "This attempt has data that hasn't been synchronised.", "addon.mod_scorm.offlineattemptovermax": "This attempt cannot be sent because you exceeded the maximum number of attempts.",