diff --git a/main/exercice/exercise_reminder.php b/main/exercice/exercise_reminder.php
index 0b9edfde63..00165ce93a 100644
--- a/main/exercice/exercise_reminder.php
+++ b/main/exercice/exercise_reminder.php
@@ -55,19 +55,21 @@ if (!$objExercise) {
}
$time_control = false;
-if ($objExercise->expired_time != 0 && $origin != 'learnpath') {
+$clock_expired_time = get_session_time_control_key($objExercise->id, $learnpath_id, $learnpath_item_id);
+
+if ($objExercise->expired_time != 0 && !empty($clock_expired_time)) {
$time_control = true;
}
-$clock_expired_time = get_session_time_control_key($objExercise->id, $learnpath_id);
-
-// Get time left for exipiring time
-$time_left = api_strtotime($clock_expired_time,'UTC') - time();
-
if ($time_control) {
- $htmlHeadXtra[] = api_get_js('jquery.epiclock.min.js');
- $htmlHeadXtra[] = $objExercise->show_time_control_js($time_left);
-
+ // Get time left for exipiring time
+ $time_left = api_strtotime($clock_expired_time,'UTC') - time();
+ $htmlHeadXtra[] = api_get_css(api_get_path(WEB_LIBRARY_PATH).'javascript/epiclock/stylesheet/jquery.epiclock.css');
+ $htmlHeadXtra[] = api_get_css(api_get_path(WEB_LIBRARY_PATH).'javascript/epiclock/renderers/minute/epiclock.minute.css');
+ $htmlHeadXtra[] = api_get_js('epiclock/javascript/jquery.dateformat.min.js');
+ $htmlHeadXtra[] = api_get_js('epiclock/javascript/jquery.epiclock.min.js');
+ $htmlHeadXtra[] = api_get_js('epiclock/renderers/minute/epiclock.minute.js');
+ $htmlHeadXtra[] = $objExercise->show_time_control_js($time_left);
}
diff --git a/main/exercice/exercise_show.php b/main/exercice/exercise_show.php
index 620ec69d05..33219bb07a 100644
--- a/main/exercice/exercise_show.php
+++ b/main/exercice/exercise_show.php
@@ -93,7 +93,7 @@ if (empty($objExercise)) {
$feedback_type = $objExercise->feedback_type;
//If is not valid
-$session_control_key = get_session_time_control_key($exercise_id);
+$session_control_key = get_session_time_control_key($exercise_id, $learnpath_id, $learnpath_item_id);
if (isset($session_control_key) && !exercise_time_control_is_valid($exercise_id, $learnpath_id, $learnpath_item_id) && !in_array($action, array('qualify','edit'))) {
$sql_fraud = "UPDATE $TBL_TRACK_ATTEMPT SET answer = 0, marks=0, position=0 WHERE exe_id = $id ";
Database::query($sql_fraud);
diff --git a/main/exercice/overview.php b/main/exercice/overview.php
index f8788267a9..2b25b959dd 100644
--- a/main/exercice/overview.php
+++ b/main/exercice/overview.php
@@ -45,16 +45,16 @@ $interbreadcrumb[] = array ("url" => "exercice.php?gradebook=$gradebook", "name"
$interbreadcrumb[] = array ("url" => "#","name" => $objExercise->name);
$time_control = false;
-$clock_expired_time = get_session_time_control_key($objExercise->id);
+$clock_expired_time = get_session_time_control_key($objExercise->id, $learnpath_id, $learnpath_item_id);
-$time_left = null;
if ($objExercise->expired_time != 0 && !empty($clock_expired_time)) {
- $time_control = true;
- // Get time left for expiring time
- $time_left = api_strtotime($clock_expired_time,'UTC') - time();
+ $time_control = true;
}
-if ($time_control) {
+if ($time_control) {
+ // Get time left for expiring time
+ $time_left = api_strtotime($clock_expired_time,'UTC') - time();
+
$htmlHeadXtra[] = api_get_css(api_get_path(WEB_LIBRARY_PATH).'javascript/epiclock/stylesheet/jquery.epiclock.css');
$htmlHeadXtra[] = api_get_css(api_get_path(WEB_LIBRARY_PATH).'javascript/epiclock/renderers/minute/epiclock.minute.css');
$htmlHeadXtra[] = api_get_js('epiclock/javascript/jquery.dateformat.min.js');
diff --git a/main/inc/lib/javascript/jquery.epiclock.min.js b/main/inc/lib/javascript/jquery.epiclock.min.js
deleted file mode 100644
index 93cc9ec243..0000000000
--- a/main/inc/lib/javascript/jquery.epiclock.min.js
+++ /dev/null
@@ -1,9 +0,0 @@
-/*
- * epiClock 2.1 - Create Epic Clocks Easily
- *
- * Copyright (c) 2008 Eric Garside (http://eric.garside.name)
- * Dual licensed under:
- * MIT: http://www.opensource.org/licenses/mit-license.php
- * GPLv3: http://www.opensource.org/licenses/gpl-3.0.html
- */
-var EC_HALT="disable",EC_RUN="enable",EC_KILL="destroy",EC_CLOCK=0,EC_COUNTDOWN=1,EC_COUNTUP=2,EC_ROLLOVER=3,EC_EXPIRE=4,EC_LOOP=5,EC_STOPWATCH=6,EC_HOLDUP=7;(function(c){c.epiclocks={};var f={epiClock:{offset:{hours:0,minutes:0,seconds:0,days:0,years:0},arbitrary:{days:0,years:0},gmt:false,target:null,onTimer:null,onKill:null,onRender:function(h,i){h.html(i)},format:null,frame:{},dead:false,displace:0,modifier:0,variance:0,daysadded:0,paused:0,tolerance:0,selfLoc:-1,mode:EC_CLOCK,onSetup:null,stylesheet:null,containerClass:null,tpl:""},formats:["F j, Y, g:i:s a","V{d} x{h} i{m} s{s}","Q{y} K{d} x{h} i{m} s{s}","V{d} x{h} i{m} s{s}","x{h} i{m} s{s}","i{m} s{s}","x{h} i{m} s{s}","Q{y} K{d} x{h} i{m} s{s}"]},e=null,a=null,d=[];c.cssIncludes={};c.cssInclude=function(h,i){if(c.cssIncludes[h]){return false}c.cssIncludes[h]=true;i=i||"screen";c('').appendTo("head")};c.epiclock=c.fn.clocks=function(j,h,i){j=j||EC_RUN;h=h||500;if(j==e){return}switch(j){case EC_KILL:c.each(d,function(){this.removeData("epiClock")});d=[];case EC_HALT:if(a){clearInterval(a);a=null}e=j;break;case EC_RUN:if(!a){b();a=setInterval(b,h)}e=j;break}return this};function b(){c.each(d,function(h){this.data("epiClock").render()})}c.fn.epiclock=function(h,j){var i=null;if(typeof h=="string"&&c.epiclocks&&c.epiclocks[h]){h=c.epiclocks[h]}else{if(j&&c.epiclocks&&c.epiclocks[j]){h=c.extend(true,{},c.epiclocks[j],h)}}switch(h){case"destroy":i="kill";case"disable":i=i||"pause";case"enable":i=i||"resume";return this.each(function(){var k=c(this).data("epiClock");if(k instanceof g){k[i]()}});default:h=c.extend(true,{},f.epiClock,h);break}this.each(function(){var m=c(this),p=(h.format||f.formats[h.mode]).split(""),o=false,l=h.tpl||f.tpl,k="",n=new g(h,m);m.data("epiClock",n);c.each(p,function(){x=this+"";switch(x){case" ":if(!o){c(l).addClass("epiclock epiclock-spacer").appendTo(m)}else{k+=x}break;case"{":o=true;break;case"}":o=false;c(l).addClass("epiclock").html(k).appendTo(m);k="";break;default:if(o){k+=x}else{if(Date.prototype[x]||n[x]){n.frame[x]=c(l).addClass("epiclock epiclock-digit").data("ec-encoding",x).appendTo(m)}else{c(l).addClass("epiclock epiclock-separator").html(x).appendTo(m)}}break}});n.selfLoc=d.push(m)-1;if(c.isFunction(n.onSetup)){n.onSetup.call(n,[])}if(n.stylesheet){c.cssInclude(n.stylesheet)}if(n.containerClass){m.addClass(n.containerClass)}});return this};function g(h,i){if(this instanceof g){return this.init(h,i)}else{return new g(h,i)}}g.prototype={Q:function(){return this.arbitrary.years},E:function(){return this.arbitrary.days},e:function(){return this.arbitrary.days.pad(0)},zero:new Date(0),pause:function(){if(this.dead){return}this.paused=new Date().valueOf();this.dead=true},resume:function(){if(!this.dead){return}if(this.mode==EC_STOPWATCH){this.displace+=(this.paused-new Date().valueOf())}this.paused=0;this.dead=false},kill:function(){d.splice(this.selfLoc,1);c.each(d,function(h){this.data("epiClock").selfLoc=h});if(c.isFunction(this.onKill)){this.onKill()}this.dead=true},init:function(h,j){if(h.modeEC_HOLDUP){throw"EPICLOCK_INVALID_MODE"}var i=this;c.each(h,function(m,l){i[m]=l});switch(this.mode){case EC_LOOP:case EC_EXPIRE:this.target=this.target||new Date();case EC_COUNTDOWN:case EC_ROLLOVER:this.modifier=-1;this.variance=1;break;case EC_STOPWATCH:this.displace+=this.calculateOffset()+(-1*new Date().valueOf());return;case EC_HOLDUP:this.variance=-1;this.modifier=1;break;default:this.modifier=1;this.variance=0;break}if(this.gmt){this.normalize()}switch(true){case this.target instanceof Date:this.target=this.target.valueOf();break;case typeof this.target=="string":this.target=new Date(this.target).valueOf();break}this.displace+=this.modifier*this.calculateOffset()},calculateOffset:function(h){h=h||this.offset;return(h.years*31570560000+h.days*86400000+h.hours*3600000+h.minutes*60000+(this.variance+h.seconds)*1000)},normalize:function(){this.displace+=new Date().getTimezoneOffset()*60000},render:function(){if(!this.tick()){return}var h=this,i=(this.mode==EC_HOLDUP)?this.zero:this.now;c.each(this.frame,function(l,j){var m=(c.isFunction(i[l])?i[l]():h[l]())+"";if(j.data("last")!=m){h.onRender(j,m)}j.data("last",m)})},tick:function(){if(this.dead){return false}var h=new Date().valueOf()+this.displace;switch(this.mode){case EC_HOLDUP:if(this.targetthis.target){h=h-this.target}else{h=this.target-h}break;case EC_COUNTDOWN:case EC_EXPIRE:case EC_LOOP:h=this.target-h;if(h=0?"+":"-")+Math.abs(h).pad(0).rpad(0,4)},P:function(){var h=this.O();return h.substr(0,3)+":"+h.substr(3)},Z:function(){return this.getTimezoneOffset()*60},c:function(){return this.Y()+"-"+this.m()+"-"+this.d()+"T"+this.H()+":"+this.i()+":"+this.s()+this.P()},r:function(){return this.toString()},U:function(){return this.getTime()/1000}})})(jQuery);
\ No newline at end of file