From: bobopinna Date: Mon, 29 May 2006 07:07:48 +0000 (+0000) Subject: Cleaned some unused include X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=3eabd4cf97a526c169cba83a4c48935096bc8be0;p=moodle.git Cleaned some unused include --- diff --git a/mod/scorm/aicc.php b/mod/scorm/aicc.php index 79b60e2eca..fd5c58b778 100755 --- a/mod/scorm/aicc.php +++ b/mod/scorm/aicc.php @@ -1,8 +1,7 @@ -attempt; - //fwrite($ft,"\n --------Gia tri attempt thu duoc tu datamodel.php-------- : ".$attempt); + $attempt = $USER->attempt; if (!empty($id)) { @@ -42,7 +36,6 @@ require_login($course->id, false, $cm); if (confirm_sesskey() && (!empty($scoid))) { - //fwrite($ft," --Ghi du lieu--- \n"); $result = true; if (isstudent($course->id) || (isteacher($course->id) && !isadmin())) { foreach ($_POST as $element => $value) { @@ -50,17 +43,13 @@ $element = str_replace('__','.',$element); $element = preg_replace('/_(\d+)/',".\$1",$element); $result = scorm_insert_track($USER->id, $scorm->id, $scoid, $attempt, $element, $value) && $result; - //fwrite($ft,"\n Ghi xong mot phan tu tai Datamodel.php-- ".$scoid); - } } } if ($result) { echo "true\n0"; - //fwrite($ft,"Ghi thanh cong trong Datamodel.php-"); } else { echo "false\n101"; - //fwrite($ft,"Ghi that bai trong Datamodel.php-"); } } ?> diff --git a/mod/scorm/index.php b/mod/scorm/index.php index 34c1489412..2c67f54029 100755 --- a/mod/scorm/index.php +++ b/mod/scorm/index.php @@ -1,7 +1,6 @@ diff --git a/mod/scorm/loadSCO.php b/mod/scorm/loadSCO.php index bce2b6f4fa..b822f36a66 100755 --- a/mod/scorm/loadSCO.php +++ b/mod/scorm/loadSCO.php @@ -1,7 +1,6 @@ suspendscoid; return $suspendscoid; + } else { + return 0; + } } + function scorm_add_time($a, $b) { $aes = explode(':',$a); $bes = explode(':',$b); @@ -744,8 +747,7 @@ function scorm_get_toc($user,$scorm,$liststyle,$currentorg='',$scoid='',$mode='n //Neu la sco suspend thi hien thi anh khac if ($suspendscoid == $sco->id){ $result->toc .= 'Dang tam dung o day'; - } - else{ + } else { //----------------------- if (isset($usertracks[$sco->identifier])) { $usertrack = $usertracks[$sco->identifier]; diff --git a/mod/scorm/player.php b/mod/scorm/player.php index 17dc67327e..6805b2ec7c 100755 --- a/mod/scorm/player.php +++ b/mod/scorm/player.php @@ -49,28 +49,25 @@ $strscorm = get_string('modulename', 'scorm'); $strpopup = get_string('popup','scorm'); - $attempt = scorm_get_last_attempt($scorm->id,$USER->id); //Kiem tra xem co phai la tiep tuc khong - if ($mode=='continue') - { + if ($mode=='continue') { $scoid = scorm_get_suspendscoid($scorm->id,$USER->id); $USER->setAttempt = 'set'; $mode = 'normal'; } - if (($mode == 'normal') && ($USER->setAttempt == 'notset')){ + if (($mode == 'normal') && ($USER->setAttempt == 'notset')) { $attempt++; $USER->setAttempt = 'set'; } //Thuc hien Sequencing - if ($mode!='review') - { - $sequencingResult = scorm_sequecingrule_implement($scorm->id,$scoid,$USER->id); - //echo ""; - } } //Thiet lap attempt_status cho scoid scorm_set_attempt($scoid,$USER->id); //Ket thuc thiet lap attemp_status - if ($mode!='review') - { - //Update trang thai - scorm_rollup_updatestatus($scorm->id,$scoid,$USER->id); - //------------------------------ + if ($mode!='review') { + //Update trang thai + scorm_rollup_updatestatus($scorm->id,$scoid,$USER->id); + //------------------------------ } //Thiet lap thong tin lien quan truy xuat Scorm $statistic = get_record('scorm_statistic',"scormid",$scorm->id,"userid",$USER->id); - if (empty($statistic)){ + if (empty($statistic)) { $statisticInput->accesstime = time(); $statisticInput->durationtime = 0; $statisticInput->status = 'during'; @@ -109,15 +104,14 @@ $statisticInput->scormid = $scorm->id; $statisticInput->userid = $USER->id; $statisticid = scorm_insert_statistic($statisticInput); - } - else{ - if ($statistic->status=='suspend'){ - $statisticInput->accesstime = time(); - $statisticInput->durationtime = $statistic->durationtime; - $statisticInput->status = 'during'; - $statisticInput->attemptnumber = $attempt; - $statisticInput->scormid = $scorm->id; - $statisticInput->userid = $USER->id; + } else { + if ($statistic->status=='suspend') { + $statisticInput->accesstime = time(); + $statisticInput->durationtime = $statistic->durationtime; + $statisticInput->status = 'during'; + $statisticInput->attemptnumber = $attempt; + $statisticInput->scormid = $scorm->id; + $statisticInput->userid = $USER->id; } } @@ -125,8 +119,7 @@ //Lay thoi gian toi da cho phep $absoluteTimeLimit = scorm_get_AbsoluteTimeLimit($scoid); - if ($absoluteTimeLimit > 0) - { + if ($absoluteTimeLimit > 0) { echo ""; - } - else { - echo "Suspend failed"; - } - + if ($result) { + echo ""; + } else { + echo "Suspend failed"; + } ?> diff --git a/mod/scorm/timePassReport.htm b/mod/scorm/timePassReport.htm deleted file mode 100755 index 8c0e3a04fe..0000000000 --- a/mod/scorm/timePassReport.htm +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - -Thời gian làm bài đã hết... Mời bạn chọn bài khác. - - diff --git a/mod/scorm/validate.php b/mod/scorm/validate.php index ab06ff7d04..dfd3bf0162 100755 --- a/mod/scorm/validate.php +++ b/mod/scorm/validate.php @@ -2,7 +2,6 @@ require_once("../../config.php"); require_once('locallib.php'); - require_once('sequencinglib.php'); $courseid = required_param('id', PARAM_INT); // Course Module ID, or $reference = required_param('reference', PARAM_PATH); // Package path diff --git a/mod/scorm/view.php b/mod/scorm/view.php index ea17ce03e7..427e4f066e 100755 --- a/mod/scorm/view.php +++ b/mod/scorm/view.php @@ -1,11 +1,7 @@