From 4ba312f1eb7fa023ddbe43b568c7b9a0ca0c2eef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BB=94=E5=93=A5?= Date: Tue, 7 Nov 2017 12:59:31 +0800 Subject: [PATCH] * Fix tutorial score bug --- module/tutorial/control.php | 2 +- module/tutorial/view/index.html.php | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/module/tutorial/control.php b/module/tutorial/control.php index 2d1d0a3578..24e1263d18 100644 --- a/module/tutorial/control.php +++ b/module/tutorial/control.php @@ -137,7 +137,7 @@ class tutorial extends control */ public function ajaxFinish() { - define('TUTORIAL', false); + $this->session->set('tutorialMode', false); $this->loadModel('score')->create('tutorial', 'finish'); } } diff --git a/module/tutorial/view/index.html.php b/module/tutorial/view/index.html.php index 0d5b73c533..6641838fa4 100644 --- a/module/tutorial/view/index.html.php +++ b/module/tutorial/view/index.html.php @@ -440,15 +440,12 @@ $(function() $('.task-num-finish').text(finishCount); var isFinishAll = finishCount >= totalCount; - if(isFinishAll) - { - $.getJSON(createLink('tutorial', 'ajaxFinish')); - current = $tasks.children('li').first().data('name'); - } + if(isFinishAll) current = $tasks.children('li').first().data('name'); + var progress = Math.round(100*finishCount/totalCount); $progress.toggleClass('finish', isFinishAll).find('.progress-bar').css('width', (100*finishCount/totalCount) + '%'); $progress.find('.progress-text').text(progress + '%'); - + if(progress == 100) $.getJSON(createLink('tutorial', 'ajaxFinish')); showTask(current); };