var currentFlashing = 1;
var completedSteps = [];
var completedPart1 = false;
+var lastPassedStep = 0;
+
var STEPS = {
1: {"layers": [], 'e': 's1'},
try {
currentFlashing = parseInt(fluidbook.cache.get('map2_current_flashing', 1).toString());
completedSteps = fluidbook.cache.get('map2_completed_steps', []).sort();
- if (completedSteps.length === NB_STEPS) {
+ lastPassedStep = fluidbook.cache.get('map2_last_passed_step', 0);
+ if (lastPassedStep == 26) {
_end();
} else if (congratSteps.diff(completedSteps).length === 0) {
completedPart1 = true;
try {
fluidbook.cache.set('map2_completed_steps', completedSteps);
+ fluidbook.cache.set('map2_last_passed_step', s);
} catch (e) {
console.log(e);
}
if (completedSteps.length === NB_STEPS) {
- end(s);
+
} else if (congratSteps.diff(completedSteps).length === 0) {
congratulations(s);
}
}
function end(s) {
- if (!isPopupStep(s)) {
- return _end();
- } else {
- pJquery(fluidbook).one('fluidbook.view.close.all', function () {
- _end();
- });
- }
+
}
function _end() {
setTimeout(function () {
- fluidbook.links.triggerLinkById('m2end');
+ try {
+ if (fluidbook.cache.get('map2_end_seen', 0) == 0) {
+ fluidbook.cache.set('map2_end_seen', 1);
+ fluidbook.links.triggerLinkById('m2end');
+ }
+ } catch (e) {
+
+ }
}, 1000);
}