Skip to content

Commit

Permalink
MDL-20700 coding style cleanup - cvs keywords removed, closign php ta…
Browse files Browse the repository at this point in the history
…g removed, trailing whitespace cleanup
  • Loading branch information
skodak committed Nov 1, 2009
1 parent 472e566 commit e5dd8e3
Show file tree
Hide file tree
Showing 37 changed files with 376 additions and 380 deletions.
5 changes: 2 additions & 3 deletions mod/scorm/aicc.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
$tempkey = strtolower($key);
$_POST[$tempkey] = $value;
}

$command = required_param('command', PARAM_ALPHA);
$sessionid = required_param('session_id', PARAM_ALPHANUM);
$aiccdata = optional_param('aicc_data', '', PARAM_RAW);
Expand Down Expand Up @@ -241,7 +241,7 @@

$value = '';
if (is_numeric($values[0])) {
$value = trim($values[0]);
$value = trim($values[0]);
$id = scorm_insert_track($USER->id, $scorm->id, $sco->id, $attempt, $element, $value);
}
$score = $value;
Expand Down Expand Up @@ -379,4 +379,3 @@
echo "error=3\r\nerror_text=Invalid Session ID\r\n";
}
}
?>
28 changes: 14 additions & 14 deletions mod/scorm/backuplib.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php //$Id$
<?php
//This php script contains all the stuff to backup/restore
//scorm mods

//This is the "graphical" structure of the scorm mod:
//
// scorm
// scorm
// (CL,pk->id)-------------------------------------
// | |
// | |
Expand Down Expand Up @@ -78,7 +78,7 @@ function scorm_backup_one_mod($bf,$preferences,$scorm) {
fwrite ($bf,full_tag("UPDATEFREQ",4,false,$scorm->updatefreq));
fwrite ($bf,full_tag('TIMEMODIFIED',4,false,$scorm->timemodified));
$status = backup_scorm_scoes($bf,$preferences,$scorm->id);

//if we've selected to backup users info, then execute backup_scorm_scoes_track
if ($status) {
if (backup_userdata_selected($preferences,'scorm',$scorm->id)) {
Expand Down Expand Up @@ -128,7 +128,7 @@ function backup_scorm_scoes ($bf,$preferences,$scorm) {
}
return $status;
}

//Backup scorm_scoes_data contents (executed from scorm_backup_scorm_scoes)
function backup_scorm_scoes_data ($bf,$preferences,$sco) {
global $CFG, $DB;
Expand Down Expand Up @@ -157,7 +157,7 @@ function backup_scorm_scoes_data ($bf,$preferences,$sco) {
}
return $status;
}

//Backup scorm_scoes_track contents (executed from scorm_backup_mods)
function backup_scorm_scoes_track ($bf,$preferences,$scorm) {
global $CFG, $DB;
Expand Down Expand Up @@ -203,7 +203,7 @@ function backup_scorm_seq_ruleconds ($bf,$preferences,$sco) {
$status =fwrite ($bf,start_tag('SEQ_RULECONDS',4,true));
//Iterate over each sco
foreach ($scorm_seq_ruleconditions as $seq_rulecondition) {
//Start sco
//Start sco
$status =fwrite ($bf,start_tag('SEQ_RULECOND',5,true));
//Print track contents
fwrite ($bf,full_tag('ID',6,false,$seq_rulecondition->id));
Expand Down Expand Up @@ -235,7 +235,7 @@ function backup_scorm_seq_rulecond ($bf,$preferences,$ruleconditions) {
$status =fwrite ($bf,start_tag('SEQ_RULECOND_DATAS',4,true));
//Iterate over each sco
foreach ($scorm_seq_ruleconditions as $seq_rulecondition) {
//Start sco
//Start sco
$status =fwrite ($bf,start_tag('SEQ_RULECOND_DATA',5,true));
//Print track contents
fwrite ($bf,full_tag('ID',6,false,$seq_rulecondition->id));
Expand Down Expand Up @@ -266,7 +266,7 @@ function backup_scorm_seq_rolluprule ($bf,$preferences,$sco) {
$status =fwrite ($bf,start_tag('SEQ_ROLLUPRULES',4,true));
//Iterate over each sco
foreach ($scorm_seq_rolluprules as $seq_rolluprule) {
//Start sco
//Start sco
$status =fwrite ($bf,start_tag('SEQ_ROLLUPRULE',5,true));
//Print track contents
fwrite ($bf,full_tag('ID',6,false,$seq_rolluprule->id));
Expand Down Expand Up @@ -299,7 +299,7 @@ function backup_scorm_seq_rolluprulecond ($bf,$preferences,$rolluprule) {
$status =fwrite ($bf,start_tag('SEQ_ROLLUPRULECONDS',4,true));
//Iterate over each sco
foreach ($scorm_seq_rollupruleconditions as $seq_rolluprulecondition) {
//Start sco
//Start sco
$status =fwrite ($bf,start_tag('SEQ_ROLLUPRULECOND',5,true));
//Print track contents
fwrite ($bf,full_tag('ID',6,false,$seq_rolluprulecondition->id));
Expand Down Expand Up @@ -330,7 +330,7 @@ function backup_scorm_seq_objective ($bf,$preferences,$sco) {
$status =fwrite ($bf,start_tag('SEQ_OBJECTIVES',4,true));
//Iterate over each sco
foreach ($scorm_seq_objectives as $seq_objective) {
//Start sco
//Start sco
$status =fwrite ($bf,start_tag('SEQ_OBJECTIVE',5,true));
//Print track contents
fwrite ($bf,full_tag('ID',6,false,$seq_objective->id));
Expand Down Expand Up @@ -362,7 +362,7 @@ function backup_scorm_seq_mapinfo ($bf,$preferences,$objectives) {
$status =fwrite ($bf,start_tag('SEQ_MAPINFO',4,true));
//Iterate over each sco
foreach ($scorm_seq_objectives as $seq_objective) {
//Start sco
//Start sco
$status =fwrite ($bf,start_tag('SEQ_MAPINF',5,true));
//Print track contents
fwrite ($bf,full_tag('ID',6,false,$seq_objective->id));
Expand All @@ -381,7 +381,7 @@ function backup_scorm_seq_mapinfo ($bf,$preferences,$objectives) {
}
return $status;
}

////Return an array of info (name,value)
function scorm_check_backup_mods($course,$user_data=false,$backup_unique_code,$instances=null) {
if (!empty($instances) && is_array($instances) && count($instances)) {
Expand Down Expand Up @@ -506,7 +506,7 @@ function scorm_ids ($course) {
FROM {scorm} a
WHERE a.course = ?", array($course));
}

//Returns an array of scorm_scoes id
function scorm_scoes_track_ids_by_course ($course) {
global $CFG, $DB;
Expand All @@ -525,4 +525,4 @@ function scorm_scoes_track_ids_by_instance ($instanceid) {
FROM {scorm_scoes_track} s
WHERE s.scormid = ?", array($instanceid));
}
?>

4 changes: 2 additions & 2 deletions mod/scorm/datamodel.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
require_once('../../config.php');
require_once('locallib.php');

$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
Expand Down Expand Up @@ -86,4 +86,4 @@
echo "\n".$request;
}
}
?>

4 changes: 2 additions & 2 deletions mod/scorm/datamodels/aicclib.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php // $Id$
<?php

function scorm_add_time($a, $b) {
$aes = explode(':',$a);
Expand Down Expand Up @@ -548,4 +548,4 @@ function scorm_get_toc($user,$scorm,$liststyle,$currentorg='',$scoid='',$mode='n
return $result;
}

?>

58 changes: 29 additions & 29 deletions mod/scorm/datamodels/scorm_12.js.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
require_once($CFG->dirroot.'/mod/scorm/locallib.php');

if (isset($userdata->status)) {
if ($userdata->status == '') {
$userdata->entry = 'ab-initio';
Expand Down Expand Up @@ -144,11 +144,11 @@ function SCORMapi1_2() {
scorm_reconstitute_array_element($scorm->version, $userdata, 'cmi.objectives', array('score'));
scorm_reconstitute_array_element($scorm->version, $userdata, 'cmi.interactions', array('objectives', 'correct_responses'));
?>

if (cmi.core.lesson_status == '') {
cmi.core.lesson_status = 'not attempted';
}
}

//
// API Methods definition
//
Expand All @@ -160,7 +160,7 @@ function LMSInitialize (param) {
if (!Initialized) {
Initialized = true;
errorCode = "0";
<?php
<?php
if (scorm_debugging($scorm)) {
//echo 'alert("Initialized SCORM 1.2");';
echo 'LogAPICall("LMSInitialize", param, "", errorCode);';
Expand All @@ -173,14 +173,14 @@ function LMSInitialize (param) {
} else {
errorCode = "201";
}
<?php
<?php
if (scorm_debugging($scorm)) {
echo 'LogAPICall("LMSInitialize", param, "", errorCode);';
}
?>
return "false";
}

function LMSFinish (param) {
errorCode = "0";
if (param == "") {
Expand All @@ -197,8 +197,8 @@ function LMSFinish (param) {
if (<?php echo $scorm->auto ?> == 1) {
setTimeout('top.document.location=top.next;',500);
}
}
<?php
}
<?php
if (scorm_debugging($scorm)) {
//echo 'alert("Finished SCORM 1.2");';
echo 'LogAPICall("LMSFinish", param, "", 0);';
Expand All @@ -211,14 +211,14 @@ function LMSFinish (param) {
} else {
errorCode = "201";
}
<?php
<?php
if (scorm_debugging($scorm)) {
echo 'LogAPICall("LMSFinish", param, "", errorCode);';
}
?>
return "false";
}

function LMSGetValue (element) {
errorCode = "0";
if (Initialized) {
Expand All @@ -236,7 +236,7 @@ function LMSGetValue (element) {
}
if (subelement == element) {
errorCode = "0";
<?php
<?php
if (scorm_debugging($scorm)) {
//echo 'alert(element+": "+eval(element));';
echo 'LogAPICall("LMSGetValue", element, eval(element), 0);';
Expand Down Expand Up @@ -276,14 +276,14 @@ function LMSGetValue (element) {
} else {
errorCode = "301";
}
<?php
<?php
if (scorm_debugging($scorm)) {
echo 'LogAPICall("LMSGetValue", element, "", errorCode);';
}
?>
return "";
}

function LMSSetValue (element,value) {
errorCode = "0";
if (Initialized) {
Expand All @@ -309,7 +309,7 @@ function LMSSetValue (element,value) {
}
if (elementIndexes[i+1] == eval(subelement+'.'+elementIndex+'._count')) {
eval(subelement+'.'+elementIndex+'._count++;');
}
}
if (elementIndexes[i+1] > eval(subelement+'.'+elementIndex+'._count')) {
errorCode = "201";
}
Expand Down Expand Up @@ -346,7 +346,7 @@ function LMSSetValue (element,value) {
if ((value >= ranges[0]) && (value <= ranges[1])) {
eval(element+'=value;');
errorCode = "0";
<?php
<?php
if (scorm_debugging($scorm)) {
echo 'LogAPICall("LMSSetValue", element, value, errorCode);';
//echo 'alert(element+":= "+value);';
Expand All @@ -363,7 +363,7 @@ function LMSSetValue (element,value) {
eval(element+'=value;');
}
errorCode = "0";
<?php
<?php
if (scorm_debugging($scorm)) {
echo 'LogAPICall("LMSSetValue", element, value, errorCode);';
//echo 'alert(element+":= "+value);';
Expand All @@ -387,20 +387,20 @@ function LMSSetValue (element,value) {
} else {
errorCode = "301";
}
<?php
<?php
if (scorm_debugging($scorm)) {
echo 'LogAPICall("LMSSetValue", element, value, errorCode);';
}
?>
return "false";
}

function LMSCommit (param) {
errorCode = "0";
if (param == "") {
if (Initialized) {
result = StoreData(cmi,false);
<?php
<?php
if (scorm_debugging($scorm)) {
echo 'LogAPICall("Commit", param, "", 0);';
//echo 'alert("Data Commited");';
Expand All @@ -413,23 +413,23 @@ function LMSCommit (param) {
} else {
errorCode = "201";
}
<?php
<?php
if (scorm_debugging($scorm)) {
echo 'LogAPICall("LMSCommit", param, "", 0);';
}
?>
return "false";
}

function LMSGetLastError () {
<?php
<?php
if (scorm_debugging($scorm)) {
echo 'LogAPICall("LMSGetLastError", "", "", errorCode);';
}
?>
return errorCode;
}

function LMSGetErrorString (param) {
if (param != "") {
var errorString = new Array();
Expand All @@ -444,27 +444,27 @@ function LMSGetErrorString (param) {
errorString["403"] = "Element is read only";
errorString["404"] = "Element is write only";
errorString["405"] = "Incorrect data type";
<?php
<?php
if (scorm_debugging($scorm)) {
echo 'LogAPICall("LMSGetErrorString", param, errorString[param], 0);';
}
?>
return errorString[param];
} else {
<?php
<?php
if (scorm_debugging($scorm)) {
echo 'LogAPICall("LMSGetErrorString", param, "No error string found!", 0);';
}
?>
return "";
}
}

function LMSGetDiagnostic (param) {
if (param == "") {
param = errorCode;
}
<?php
<?php
if (scorm_debugging($scorm)) {
echo 'LogAPICall("LMSGetDiagnostic", param, param, 0);';
}
Expand Down Expand Up @@ -583,7 +583,7 @@ function StoreData(data,storetotaltime) {
}
datastring += '&attempt=<?php echo $attempt ?>';
datastring += '&scoid=<?php echo $scoid ?>';

var myRequest = NewHttpReq();
result = DoRequest(myRequest,"<?php p($CFG->wwwroot) ?>/mod/scorm/datamodel.php","id=<?php p($id) ?>&sesskey=<?php echo sesskey() ?>"+datastring);
results = String(result).split('\n');
Expand Down
Loading

0 comments on commit e5dd8e3

Please sign in to comment.