Skip to content
Browse files

Cleaned some unused include

  • Loading branch information...
1 parent e7056ef commit 3eabd4cf97a526c169cba83a4c48935096bc8be0 bobopinna committed May 29, 2006
View
5 mod/scorm/aicc.php
@@ -1,8 +1,7 @@
-<?php
+<php
require_once('../../config.php');
require_once('locallib.php');
- require_once('sequencinglib.php');
-
+
$command = required_param('command', PARAM_ALPHA);
$sessionid = required_param('session_id', PARAM_ALPHANUM);
$aiccdata = optional_param('aicc_data', '', PARAM_RAW);
View
1 mod/scorm/api.php
@@ -2,7 +2,6 @@
require_once("../../config.php");
require_once('locallib.php');
- require_once('sequencinglib.php');
$id = optional_param('id', '', PARAM_INT); // Course Module ID, or
$a = optional_param('a', '', PARAM_INT); // scorm ID
View
3 mod/scorm/coefficientconfirm.php
@@ -1,10 +1,7 @@
<?php // $Id$
-// This script uses installed report plugins to print quiz reports
-
require_once("../../config.php");
require_once('locallib.php');
- require_once('sequencinglib.php');
$id = optional_param('id', '', PARAM_INT); // Course Module ID, or
$a = optional_param('a', '', PARAM_INT); // SCORM ID
View
3 mod/scorm/coefficientsetting.php
@@ -1,10 +1,7 @@
<?php // $Id$
-// This script uses installed report plugins to print quiz reports
-
require_once("../../config.php");
require_once('locallib.php');
- require_once('sequencinglib.php');
$id = optional_param('id', '', PARAM_INT); // Course Module ID, or
$a = optional_param('a', '', PARAM_INT); // SCORM ID
View
15 mod/scorm/datamodel.php
@@ -1,18 +1,12 @@
<?php
require_once('../../config.php');
require_once('locallib.php');
- require_once('sequencinglib.php');
-
- //$f = "D:\\test.txt";
- //@$ft = fopen($f,"a");
- //fwrite($ft,"Bat dau ghi tron datamodel.php \n");
-
+
$id = optional_param('id', '', PARAM_INT); // Course Module ID, or
$a = optional_param('a', '', PARAM_INT); // scorm ID
$scoid = required_param('scoid', PARAM_INT); // sco ID
// $attempt = required_param('attempt', PARAM_INT); // attempt number
- $attempt = $USER->attempt;
- //fwrite($ft,"\n --------Gia tri attempt thu duoc tu datamodel.php-------- : ".$attempt);
+ $attempt = $USER->attempt;
if (!empty($id)) {
@@ -42,25 +36,20 @@
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) {
if (substr($element,0,3) == 'cmi') {
$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-");
}
}
?>
View
2 mod/scorm/index.php
@@ -1,7 +1,6 @@
<?php // $Id$
require_once("../../config.php");
- require_once('sequencinglib.php');
$id = required_param('id', PARAM_INT); // course id
@@ -91,6 +90,5 @@
print_footer($course);
-
?>
View
1 mod/scorm/loadSCO.php
@@ -1,7 +1,6 @@
<?php
require_once("../../config.php");
require_once('locallib.php');
- require_once('sequencinglib.php');
$id = optional_param('id', '', PARAM_INT); // Course Module ID, or
$a = optional_param('a', '', PARAM_INT); // scorm ID
View
12 mod/scorm/locallib.php
@@ -337,12 +337,15 @@ function scorm_insert_trackmodel($userid,$scormid,$scoid,$attempt) {
return $id;
}
-function scorm_get_suspendscoid($scormid,$userid)
-{
- $sco = get_record("scorm_suspendtrack","scormid",$scormid,"userid",$userid);
+function scorm_get_suspendscoid($scormid,$userid) {
+ if ($sco = get_record("scorm_suspendtrack","scormid",$scormid,"userid",$userid)) {
$suspendscoid = $sco->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 .= '<img src="'.$scormpixdir.'/suspend.gif" alt="Dang tam dung o day" title="Dang dung o day" />';
- }
- else{
+ } else {
//-----------------------
if (isset($usertracks[$sco->identifier])) {
$usertrack = $usertracks[$sco->identifier];
View
64 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 "<script language='JavaScript'>";
- // echo "alert('Sequencing');";
- //echo "<script>";
+ if ($mode!='review') {
+ $sequencingResult = scorm_sequecingrule_implement($scorm->id,$scoid,$USER->id);
+ //echo "<script language='JavaScript'>";
+ // echo "alert('Sequencing');";
+ //echo "<script>";
if (($sequencingResult->rule == 'pre') && ($sequencingResult->action == 'disabled')){
echo "<script language='JavaScript'>";
echo "alert('Disabling');";
@@ -86,47 +83,43 @@
echo "alert('Exiting');";
echo "location.href='".$CFG->wwwroot.'/mod/scorm/player.php?id='.$cm->id.$orgstr.$modepop.$scostr."';";
echo "</script>";
-
}
}
//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';
$statisticInput->attemptnumber = $attempt;
$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;
}
}
//---------------------Ket thuc thiet lap thoi gian ---------------
//Lay thoi gian toi da cho phep
$absoluteTimeLimit = scorm_get_AbsoluteTimeLimit($scoid);
- if ($absoluteTimeLimit > 0)
- {
+ if ($absoluteTimeLimit > 0) {
echo "<script type='text/javascript'>";
echo "alert('Bai nay co thoi gian lam la: ".$absoluteTimeLimit."');";
echo "function remind(msg1) {";
@@ -175,8 +168,8 @@
//}
if (($newattempt=='on') && (($attempt < $scorm->maxattempt) || ($scorm->maxattempt == 0))) {
$attempt++;
- $f = "D:\\test.txt";
- @$ft = fopen($f,"a");
+ //$f = "D:\\test.txt";
+ //@$ft = fopen($f,"a");
//fwrite($ft,"\n ----New attempt------- ".$attempt);
}
@@ -198,7 +191,6 @@
} else {
$mode = 'normal';
////fwrite($ft,"\n ++ ++ + ++ Gia tri $mode ".$mode);
-
}
}
}
@@ -234,12 +226,10 @@
}
// Kiem tra xem co duoc exit khong
- if (scorm_isChoiceexit($sco->scorm,$sco->id)){
- $exitlink = '(<a href="'.$CFG->wwwroot.'/course/view.php?id='.$cm->course.'">'.get_string('exit','scorm').'</a>)&nbsp;';
- }
- else
- {
- $exitlink = get_string('exitisnotallowed','scorm');
+ if (scorm_isChoiceexit($sco->scorm,$sco->id)) {
+ $exitlink = '(<a href="'.$CFG->wwwroot.'/course/view.php?id='.$cm->course.'">'.get_string('exit','scorm').'</a>)&nbsp;';
+ } else {
+ $exitlink = get_string('exitisnotallowed','scorm');
}
//Luu giu khoa hoc thoat ra
View
1 mod/scorm/report.php
@@ -4,7 +4,6 @@
require_once("../../config.php");
require_once('locallib.php');
- require_once('sequencinglib.php');
$id = optional_param('id', '', PARAM_INT); // Course Module ID, or
$a = optional_param('a', '', PARAM_INT); // SCORM ID
View
39 mod/scorm/suspend.php
@@ -1,36 +1,29 @@
<?php
require_once('../../config.php');
require_once('locallib.php');
- require_once('sequencinglib.php');
-
-// $f = "D:\\test.txt";
-// @$ft = fopen($f,"a");
-// fwrite($ft,"Bat dau ghi tron datamodel.php \n");
$id = required_param('id', PARAM_INT); // course ID
$scormid = required_param('scorm', PARAM_INT); // scorm ID
$scoid = required_param('sco', PARAM_INT); // suspend sco ID
$userid = required_param('userid', PARAM_INT); // user ID
- $attempt = scorm_get_last_attempt($scormid,$userid);
- $statistic = get_record('scorm_statistic',"scormid",$scormid,"userid",$userid);
- $statisticInput->accesstime = $statistic->accesstime;
- $statisticInput->durationtime = $statistic->durationtime + time()- $statistic->accesstime;
- $statisticInput->status = 'suspend';
- $statisticInput->attemptnumber = $attempt;
- $statisticInput->scormid = $statistic->scormid;
- $statisticInput->userid = $statistic->userid;
- $statisticid = scorm_insert_statistic($statisticInput);
+ $attempt = scorm_get_last_attempt($scormid,$userid);
+ $statistic = get_record('scorm_statistic',"scormid",$scormid,"userid",$userid);
+ $statisticInput->accesstime = $statistic->accesstime;
+ $statisticInput->durationtime = $statistic->durationtime + time()- $statistic->accesstime;
+ $statisticInput->status = 'suspend';
+ $statisticInput->attemptnumber = $attempt;
+ $statisticInput->scormid = $statistic->scormid;
+ $statisticInput->userid = $statistic->userid;
+ $statisticid = scorm_insert_statistic($statisticInput);
$result = scorm_insert_trackmodel($userid, $scormid, $scoid,$attempt);
- if ($result) {
- echo "<script language='Javascript' type='text/javascript'>";
- echo "location.href='".$CFG->wwwroot." /course/view.php?id=".$id."';";
- echo "</script>";
- }
- else {
- echo "Suspend failed";
- }
-
+ if ($result) {
+ echo "<script language='Javascript' type='text/javascript'>";
+ echo "location.href='".$CFG->wwwroot." /course/view.php?id=".$id."';";
+ echo "</script>";
+ } else {
+ echo "Suspend failed";
+ }
?>
View
10 mod/scorm/timePassReport.htm
@@ -1,10 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
-<title></title>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-</head>
-<body>
-Thời gian làm bài đã hết... Mời bạn chọn bài khác.
-</body>
-</html>
View
1 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
View
4 mod/scorm/view.php
@@ -1,11 +1,7 @@
<?php // $Id$
-/// This page prints a particular instance of scorm
-/// (Replace scorm with the name of your module)
-
require_once("../../config.php");
require_once('locallib.php');
- require_once('sequencinglib.php');
$id = optional_param('id', '', PARAM_INT); // Course Module ID, or
$a = optional_param('a', '', PARAM_INT); // scorm ID

0 comments on commit 3eabd4c

Please sign in to comment.
Something went wrong with that request. Please try again.