From e5dd8e3bbd103734383b6021ae371bf3a6fbbca0 Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Sun, 1 Nov 2009 15:24:58 +0000 Subject: [PATCH] MDL-20700 coding style cleanup - cvs keywords removed, closign php tag removed, trailing whitespace cleanup --- mod/scorm/aicc.php | 5 +- mod/scorm/backuplib.php | 28 +-- mod/scorm/datamodel.php | 4 +- mod/scorm/datamodels/aicclib.php | 4 +- mod/scorm/datamodels/scorm_12.js.php | 58 +++--- mod/scorm/datamodels/scorm_12lib.php | 4 +- mod/scorm/datamodels/scorm_13lib.php | 4 +- mod/scorm/datamodels/scormlib.php | 1 - mod/scorm/datamodels/sequencinglib.php | 256 ++++++++++++------------- mod/scorm/db/access.php | 1 - mod/scorm/db/install.php | 2 +- mod/scorm/db/upgrade.php | 4 +- mod/scorm/index.php | 2 +- mod/scorm/lib.php | 12 +- mod/scorm/locallib.php | 6 +- mod/scorm/mod_form.php | 2 +- mod/scorm/rd.js | 20 +- mod/scorm/report.php | 4 +- mod/scorm/restorelib.php | 84 ++++---- mod/scorm/settings.php | 4 +- mod/scorm/styles.php | 102 +++++----- mod/scorm/version.php | 3 +- mod/scorm/view.php | 10 +- mod/survey/backuplib.php | 14 +- mod/survey/db/access.php | 2 +- mod/survey/db/install.php | 2 +- mod/survey/db/upgrade.php | 6 +- mod/survey/graph.php | 6 +- mod/survey/index.php | 2 +- mod/survey/lib.php | 56 +++--- mod/survey/mod_form.php | 2 +- mod/survey/report.php | 10 +- mod/survey/restorelib.php | 22 +-- mod/survey/save.php | 6 +- mod/survey/version.php | 4 +- mod/survey/view.php | 2 +- mod/url/mod_form.php | 2 +- 37 files changed, 376 insertions(+), 380 deletions(-) diff --git a/mod/scorm/aicc.php b/mod/scorm/aicc.php index e7d91b960941a..e042868c8e6ab 100755 --- a/mod/scorm/aicc.php +++ b/mod/scorm/aicc.php @@ -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); @@ -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; @@ -379,4 +379,3 @@ echo "error=3\r\nerror_text=Invalid Session ID\r\n"; } } -?> \ No newline at end of file diff --git a/mod/scorm/backuplib.php b/mod/scorm/backuplib.php index 50921ec337c9e..7267a294bdc01 100755 --- a/mod/scorm/backuplib.php +++ b/mod/scorm/backuplib.php @@ -1,10 +1,10 @@ -id)------------------------------------- // | | // | | @@ -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)) { @@ -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; @@ -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; @@ -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)); @@ -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)); @@ -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)); @@ -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)); @@ -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)); @@ -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)); @@ -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)) { @@ -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; @@ -525,4 +525,4 @@ function scorm_scoes_track_ids_by_instance ($instanceid) { FROM {scorm_scoes_track} s WHERE s.scormid = ?", array($instanceid)); } -?> + diff --git a/mod/scorm/datamodel.php b/mod/scorm/datamodel.php index ab462de72214c..7d55d7bc10ef9 100755 --- a/mod/scorm/datamodel.php +++ b/mod/scorm/datamodel.php @@ -1,7 +1,7 @@ + diff --git a/mod/scorm/datamodels/aicclib.php b/mod/scorm/datamodels/aicclib.php index dd4564644509b..bfa56babf861b 100644 --- a/mod/scorm/datamodels/aicclib.php +++ b/mod/scorm/datamodels/aicclib.php @@ -1,4 +1,4 @@ - + diff --git a/mod/scorm/datamodels/scorm_12.js.php b/mod/scorm/datamodels/scorm_12.js.php index 6b7142f5c52d3..999bbfdbd2c2c 100644 --- a/mod/scorm/datamodels/scorm_12.js.php +++ b/mod/scorm/datamodels/scorm_12.js.php @@ -1,6 +1,6 @@ dirroot.'/mod/scorm/locallib.php'); - + if (isset($userdata->status)) { if ($userdata->status == '') { $userdata->entry = 'ab-initio'; @@ -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 // @@ -160,7 +160,7 @@ function LMSInitialize (param) { if (!Initialized) { Initialized = true; errorCode = "0"; - return "false"; } - + function LMSFinish (param) { errorCode = "0"; if (param == "") { @@ -197,8 +197,8 @@ function LMSFinish (param) { if (auto ?> == 1) { setTimeout('top.document.location=top.next;',500); } - } - return "false"; } - + function LMSGetValue (element) { errorCode = "0"; if (Initialized) { @@ -236,7 +236,7 @@ function LMSGetValue (element) { } if (subelement == element) { errorCode = "0"; - return ""; } - + function LMSSetValue (element,value) { errorCode = "0"; if (Initialized) { @@ -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"; } @@ -346,7 +346,7 @@ function LMSSetValue (element,value) { if ((value >= ranges[0]) && (value <= ranges[1])) { eval(element+'=value;'); errorCode = "0"; - return "false"; } - + function LMSCommit (param) { errorCode = "0"; if (param == "") { if (Initialized) { result = StoreData(cmi,false); - return "false"; } - + function LMSGetLastError () { - return errorCode; } - + function LMSGetErrorString (param) { if (param != "") { var errorString = new Array(); @@ -444,14 +444,14 @@ function LMSGetErrorString (param) { errorString["403"] = "Element is read only"; errorString["404"] = "Element is write only"; errorString["405"] = "Incorrect data type"; - return errorString[param]; } else { - '; datastring += '&scoid='; - + var myRequest = NewHttpReq(); result = DoRequest(myRequest,"wwwroot) ?>/mod/scorm/datamodel.php","id=&sesskey="+datastring); results = String(result).split('\n'); diff --git a/mod/scorm/datamodels/scorm_12lib.php b/mod/scorm/datamodels/scorm_12lib.php index ae69e2a747e1e..2f50dfb4d7b3c 100644 --- a/mod/scorm/datamodels/scorm_12lib.php +++ b/mod/scorm/datamodels/scorm_12lib.php @@ -1,4 +1,4 @@ - + diff --git a/mod/scorm/datamodels/scorm_13lib.php b/mod/scorm/datamodels/scorm_13lib.php index 33bee3bbc72df..329ba5e682eaf 100644 --- a/mod/scorm/datamodels/scorm_13lib.php +++ b/mod/scorm/datamodels/scorm_13lib.php @@ -1,4 +1,4 @@ - + diff --git a/mod/scorm/datamodels/scormlib.php b/mod/scorm/datamodels/scormlib.php index 93765bdf6121a..14b4cec2a970a 100644 --- a/mod/scorm/datamodels/scormlib.php +++ b/mod/scorm/datamodels/scormlib.php @@ -808,4 +808,3 @@ function tagClosed($parser, $name) { } } -?> \ No newline at end of file diff --git a/mod/scorm/datamodels/sequencinglib.php b/mod/scorm/datamodels/sequencinglib.php index bba997ad632f6..6c87d065750c7 100755 --- a/mod/scorm/datamodels/sequencinglib.php +++ b/mod/scorm/datamodels/sequencinglib.php @@ -1,4 +1,4 @@ -nextactivity = null; $seq->deliveryvalid = null; $seq->attempt = $attempt; - + $seq->identifiedactivity = null; $seq->delivery = null; $seq->deliverable = false; @@ -61,7 +61,7 @@ function scorm_seq_navigation ($scoid,$userid,$request,$attempt=0) { $seq->sequencing = 'start'; } else { $seq->exception = 'NB.2.1-1'; /// Sequencing session already begun - } + } break; case 'resumeall_': if (empty($seq->currentactivity)) { @@ -73,7 +73,7 @@ function scorm_seq_navigation ($scoid,$userid,$request,$attempt=0) { } } else { $seq->exception = 'NB.2.1-1'; /// Sequencing session already begun - } + } break; case 'continue_': case 'previous_': @@ -81,7 +81,7 @@ function scorm_seq_navigation ($scoid,$userid,$request,$attempt=0) { $sco = $seq->currentactivity; if ($sco->parent != '/') { if ($parentsco = scorm_get_parent($sco)) { - + if (isset($parentsco->flow) && ($parentsco->flow == true)) {//I think it's parentsco // Current activity is active ! if (scorm_seq_is('active',$sco->id,$userid)) { @@ -132,7 +132,7 @@ function scorm_seq_navigation ($scoid,$userid,$request,$attempt=0) { $seq->exception = 'NB.2.1-2'; /// Current activity not defined } break; - default: /// {target=}choice + default: /// {target=}choice if ($targetsco = $DB->get_record('scorm_scoes', array('scorm'=>$sco->scorm,'identifier'=>$request))) { if ($targetsco->parent != '/') { $seq->target = $request; @@ -141,7 +141,7 @@ function scorm_seq_navigation ($scoid,$userid,$request,$attempt=0) { if (!isset($parentsco->choice) || ($parent->choice == true)) { $seq->target = $request; } - } + } } if ($seq->target != null) { if (empty($seq->currentactivity)) { @@ -165,7 +165,7 @@ function scorm_seq_navigation ($scoid,$userid,$request,$attempt=0) { $seq->exception = 'NB.2.1-8'; /// Violates control mode return $seq; } - } + } } else { $seq->navigation = false; $seq->termination = null; @@ -235,8 +235,8 @@ function scorm_seq_termination ($seq,$userid) { } /// Terminate Descendent Attempts Process - - if ($ancestors = scorm_get_ancestors($sco)) { + + if ($ancestors = scorm_get_ancestors($sco)) { foreach ($ancestors as $ancestor) { scorm_seq_end_attempt($ancestor,$userid,$seq); $seq->currentactivity = $ancestor; @@ -260,7 +260,7 @@ function scorm_seq_termination ($seq,$userid) { // return $seq; } } - if ($ancestors = scorm_get_ancestors($sco)) { + if ($ancestors = scorm_get_ancestors($sco)) { foreach ($ancestors as $ancestor) { scorm_seq_set('active',$ancestor->id,$userid,false); scorm_seq_set('suspended',$ancestor->id,$userid); @@ -279,7 +279,7 @@ function scorm_seq_termination ($seq,$userid) { $seq->termination = true; break; case 'abandonall': - if ($ancestors = scorm_get_ancestors($sco)) { + if ($ancestors = scorm_get_ancestors($sco)) { foreach ($ancestors as $ancestor) { scorm_seq_set('active',$ancestor->id,$userid,false); $seq->currentactivity = $ancestor; @@ -307,7 +307,7 @@ function scorm_seq_end_attempt($sco,$userid,$seq) { if (!scorm_seq_is('suspended',$sco->id,$userid)) { if (!isset($sco->completionsetbycontent) || ($sco->completionsetbycontent == 0)) { if (!scorm_seq_is('attemptprogressstatus',$sco->id,$userid,$seq->attempt)) { - // if (!scorm_seq_is('attemptprogressstatus',$sco->id,$userid)) { + // if (!scorm_seq_is('attemptprogressstatus',$sco->id,$userid)) { scorm_seq_set('attemptprogressstatus',$sco->id,$userid); scorm_seq_set('attemptcompletionstatus',$sco->id,$userid); } @@ -338,7 +338,7 @@ function scorm_seq_end_attempt($sco,$userid,$seq) { } if ($suspended) { scorm_seq_set('suspended',$sco,$userid); - } else { + } else { scorm_seq_set('suspended',$sco,$userid,false); } } @@ -386,12 +386,12 @@ function scorm_seq_exit_action_rules($seq,$userid) { } } if ($exittarget != null) { - $commons = array_slice($ancestors,0,scorm_find_common_ancestor($ancestors,$exittarget)); - + $commons = array_slice($ancestors,0,scorm_find_common_ancestor($ancestors,$exittarget)); + /// Terminate Descendent Attempts Process - if ($commons) { + if ($commons) { foreach ($commons as $ancestor) { - + scorm_seq_end_attempt($ancestor,$userid,$seq->attempt); $seq->currentactivity = $ancestor; } @@ -452,7 +452,7 @@ function scorm_seq_rule_check ($sco, $rule){ } } $bag [$rule->id] = $rulecond->cond; - + } if (empty($bag)){ $cond = 'unknown'; @@ -465,7 +465,7 @@ function scorm_seq_rule_check ($sco, $rule){ if ($rule->conditioncombination = 'all'){ foreach ($bag as $con){ $cond = $cond.' and '.$con; - + } } else{ @@ -479,7 +479,7 @@ function scorm_seq_rule_check ($sco, $rule){ function scorm_seq_overall_rollup($sco,$userid){//Carlos - if ($ancestors = scorm_get_ancestors($sco)) { + if ($ancestors = scorm_get_ancestors($sco)) { foreach ($ancestors as $ancestor) { if(!scorm_is_leaf($ancestor)){ scorm_seq_measure_rollup($sco,$userid); @@ -489,7 +489,7 @@ function scorm_seq_overall_rollup($sco,$userid){//Carlos } - } + } } /* For this next function I have defined measure weight and measure status as records with the attempt = 0 on the scorm_scoes_track table. According to the page 89 of the SeqNav.pdf those datas give us some information about the progress of the objective*/ @@ -505,7 +505,7 @@ function scorm_seq_measure_rollup($sco,$userid){ foreach ($objectives as $objective){ - if ($objective->primaryobj == true){//Objective contributes to rollup I'm using primaryobj field, but not + if ($objective->primaryobj == true){//Objective contributes to rollup I'm using primaryobj field, but not $targetobjective = $objective; break; } @@ -517,18 +517,18 @@ function scorm_seq_measure_rollup($sco,$userid){ foreach ($children as $child){ $child = scorm_get_sco ($child); if (!isset($child->tracked) || ($child->tracked == 1)){ - + $rolledupobjective = null;// we set the rolled up activity to undefined $objectives = $DB->get_records('scorm_seq_objective', array('scoid'=>$child->id)); foreach ($objectives as $objective){ - if ($objective->primaryobj == true){//Objective contributes to rollup I'm using primaryobj field, but not + if ($objective->primaryobj == true){//Objective contributes to rollup I'm using primaryobj field, but not $rolledupobjective = $objective; break; } } if ($rolledupobjective != null){ $child = scorm_get_sco($child->id); - + $countedmeasures = $countedmeasures + ($child->measureweight); if (!scorm_seq_is('objectivemeasurestatus',$sco->id,$userid)) { $normalizedmeasure = $DB->get_record('scorm_scoes_track', array('scoid'=>$child->id,'userid'=>$userid,'element'=>'objectivenormalizedmeasure')); @@ -536,13 +536,13 @@ function scorm_seq_measure_rollup($sco,$userid){ $valid = true; } - - + + } } } - + if(!$valid){ scorm_seq_set('objectivemeasurestatus',$sco->id,$userid,false); @@ -553,21 +553,21 @@ function scorm_seq_measure_rollup($sco,$userid){ scorm_seq_set('objectivemeasurestatus',$sco->id,$userid); $val=$totalmeasure/$countedmeasures; scorm_seq_set('objectivenormalizedmeasure',$sco->id,$userid,$val); - + } else{ scorm_seq_set('objectivemeasurestatus',$sco->id,$userid,false); - + } } } - + } function scorm_seq_objective_rollup($sco,$userid){ global $DB; - + scorm_seq_objective_rollup_measure($sco,$userid); scorm_seq_objective_rollup_rules($sco,$userid); scorm_seq_objective_rollup_default($sco,$userid); @@ -586,26 +586,26 @@ function scorm_seq_objective_rollup($sco,$userid){ foreach($rolluprules as $rolluprule){ $rollupruleconds = $DB->get_records('scorm_seq_rolluprulecond', array('rollupruleid'=>$rolluprule->id)); foreach($rollupruleconds as $rolluprulecond){ - + switch ($rolluprulecond->cond!='satisfied' && $rolluprulecond->cond!='completed' && $rolluprulecond->cond!='attempted'){ - + scorm_seq_set('objectivesatisfiedstatus',$sco->id,$userid, false); break; } } - + } } -*/ +*/ } function scorm_seq_objective_rollup_measure($sco,$userid){ global $DB; $targetobjective = null; - + $objectives = $DB->get_records('scorm_seq_objective', array('scoid'=>$sco->id)); foreach ($objectives as $objective){ @@ -618,11 +618,11 @@ function scorm_seq_objective_rollup_measure($sco,$userid){ if($targetobjective->satisfiedbymeasure){ - + if (!scorm_seq_is('objectiveprogressstatus',$sco->id,$userid)) { scorm_seq_set('objectiveprogressstatus',$sco->id,$userid,false); - + } else{ @@ -650,7 +650,7 @@ function scorm_seq_objective_rollup_measure($sco,$userid){ else{ scorm_seq_set('objectiveprogressstatus',$sco->id,$userid,false); - + } } } @@ -662,24 +662,24 @@ function scorm_seq_objective_rollup_default($sco,$userid){ global $DB; if (!(scorm_seq_rollup_rule_check($sco,$userid,'incomplete')) && !(scorm_seq_rollup_rule_check($sco,$userid,'completed'))){ - + $rolluprules = $DB->get_record('scorm_seq_rolluprule', array('scoid'=>$sco->id,'userid'=>$userid)); foreach($rolluprules as $rolluprule){ $rollupruleconds = $DB->get_records('scorm_seq_rolluprulecond', array('rollupruleid'=>$rolluprule->id)); foreach($rollupruleconds as $rolluprulecond){ - + if ($rolluprulecond->cond!='satisfied' && $rolluprulecond->cond!='completed' && $rolluprulecond->cond!='attempted'){ - + scorm_seq_set('objectivesatisfiedstatus',$sco->id,$userid, false); break; } } - + } } - + } @@ -690,18 +690,18 @@ function scorm_seq_objective_rollup_rules($sco,$userid){ $objectives = $DB->get_records('scorm_seq_objective', array('scoid'=>$sco->id)); foreach ($objectives as $objective){ - if ($objective->primaryobj == true){//Objective contributes to rollup I'm using primaryobj field, but not + if ($objective->primaryobj == true){//Objective contributes to rollup I'm using primaryobj field, but not $targetobjective = $objective; break; } } if ($targetobjective != null){ - + if(scorm_seq_rollup_rule_check($sco,$userid,'notsatisfied')){//with not satisfied rollup for the activity - + scorm_seq_set('objectiveprogressstatus',$sco->id,$userid); scorm_seq_set('objectivesatisfiedstatus',$sco->id,$userid,false); } @@ -764,7 +764,7 @@ function scorm_seq_rollup_rule_check ($sco,$userid,$action){ } } } - + } $change = false; @@ -843,7 +843,7 @@ function scorm_seq_evaluate_rollupcond($sco,$conditioncombination,$rolluprulecon $condit = scorm_evaluate_cond($rolluprulecond,$sco,$userid); if($rule->operator=='not'){// If operator is not, negate the condition - if ($rule->cond != 'unknown'){ + if ($rule->cond != 'unknown'){ if ($condit){ $condit = false; } @@ -879,7 +879,7 @@ function scorm_seq_evaluate_rollupcond($sco,$conditioncombination,$rolluprulecon else{ $val = false; - + if($b == 'unknown'){ $unk = true; } @@ -900,11 +900,11 @@ function scorm_seq_evaluate_rollupcond($sco,$conditioncombination,$rolluprulecon function scorm_evaluate_condition ($rolluprulecond,$sco,$userid){ global $DB; - + $res = false; switch ($rolluprulecond->cond){ - + case 'satisfied': if($r=$DB->get_record('scorm_scoes_track', array('scoid'=>$sco->id,'userid'=>$userid,'element'=>'objectivesatisfiedstatus'))) { if($r->value == true){ @@ -930,7 +930,7 @@ function scorm_evaluate_condition ($rolluprulecond,$sco,$userid){ if($r->value == true){ $res = true; } - + } break; @@ -942,10 +942,10 @@ function scorm_evaluate_condition ($rolluprulecond,$sco,$userid){ if($r->value){ $res = true; } - + } } - + } break; @@ -956,13 +956,13 @@ function scorm_evaluate_condition ($rolluprulecond,$sco,$userid){ if($r->value > 0){ $res = true; } - + } } - + } break; - + case 'attemptLimitExceeded': if ($r = $DB->get_record('scorm_scoes_track', array('scoid'=>$sco->id,'userid'=>$userid,'element'=>'activityprogressstatus'))) { @@ -973,17 +973,17 @@ function scorm_evaluate_condition ($rolluprulecond,$sco,$userid){ if($r->value >= $r2->value){ $res = true; } - + } - + } - + } - + } - + } - + break; case 'activityProgressKnown': @@ -994,13 +994,13 @@ function scorm_evaluate_condition ($rolluprulecond,$sco,$userid){ if($r->value){ $res = true; } - + } - + } - + } - + break; } return $res; @@ -1017,7 +1017,7 @@ function scorm_seq_check_child ($sco, $action, $userid){ if (!$sco->rollupobjectivesatisfied){ $included = true; if (($action == 'satisfied' && $sco->requiredforsatisfied == 'ifnotsuspended') || ($action == 'notsatisfied' && $sco->requiredfornotsatisfied == 'ifnotsuspended')){ - + if (!scorm_seq_is('activityprogressstatus',$sco->id,$userid) || ((($r->value)>0)&& !scorm_seq_is('suspended',$sco->id,$userid))){ $included = false; } @@ -1052,7 +1052,7 @@ function scorm_seq_check_child ($sco, $action, $userid){ } else{ - + if (($action == 'completed' && $sco->requiredforcompleted == 'ifattempted') || ($action == 'incomplete' && $sco->requiredforincomplete == 'ifattempted')){ if (!scorm_seq_is('activityprogressstatus',$sco->id,$userid) || (($r->value)==0)){ $included = false; @@ -1085,45 +1085,45 @@ function scorm_seq_sequencing ($scoid,$userid,$seq) { //TODO: undefined $sco! $seq = scorm_seq_start_sequencing($sco,$userid,$seq); //We'll see the parameters we have to send, this should update delivery and end $seq->sequencing = true; - - + + break; - + case 'resumeall': $seq = scorm_seq_resume_sequencing($sco,$userid,$seq); //We'll see the parameters we have to send, this should update delivery and end $seq->sequencing = true; - - - + + + break; case 'exit': $seq = scorm_seq_exit_sequencing($sco,$userid,$seq); //We'll see the parameters we have to send, this should update delivery and end $seq->sequencing = true; - - + + break; case 'retry': $seq = scorm_seq_retry_sequencing($sco,$userid,$seq); //We'll see the parameters we have to send, this should update delivery and end $seq->sequencing = true; - - + + break; case 'previous': $seq = scorm_seq_previous_sequencing($sco,$userid,$seq);// We'll see the parameters we have to send, this should update delivery and end $seq->sequencing = true; - + break; case 'choice': $seq = scorm_seq_choice_sequencing($sco,$userid,$seq);// We'll see the parameters we have to send, this should update delivery and end - $seq->sequencing = true; - - + $seq->sequencing = true; + + break; } @@ -1132,7 +1132,7 @@ function scorm_seq_sequencing ($scoid,$userid,$seq) { $seq->sequencing = false; return $seq; } - + $seq->sequencing= true; return $seq; } @@ -1178,7 +1178,7 @@ function scorm_seq_resume_all_sequencing($scoid,$userid,$seq){ return $seq; } $seq->delivery = $DB->get_record('scorm_scoes', array('scoid'=>$scoid,'userid'=>$userid));//we assign the sco to the delivery - + } function scorm_seq_continue_sequencing($scoid,$userid,$seq){ @@ -1214,7 +1214,7 @@ function scorm_seq_previous_sequencing($scoid,$userid,$seq){ $seq->exception = 'SB.2.8-1'; return $seq; } - + $currentact= $seq->currentactivity; if ($currentact->parent != '/') {//if the activity is the root and is leaf $parent = scorm_get_parent ($activity); // TODO: undefined!! @@ -1253,7 +1253,7 @@ function scorm_seq_exit_sequencing($scoid,$userid,$seq){ $seq->endsession = true; return $seq; } - + $seq->endsession = false; return $seq; } @@ -1270,7 +1270,7 @@ function scorm_seq_retry_sequencing($scoid,$userid,$seq){ $seq->exception = 'SB.2.10-2'; return $seq; } - + if (!scorm_is_leaf($seq->currentactivity)){ $res = scorm_seq_flow($seq->currentactivity,'forward',$seq,true,$userid); if($res != null){ @@ -1319,7 +1319,7 @@ function scorm_seq_flow_activity_traversal ($activity, $userid, $direction, $chi $seq->nextactivity = $activity; return $seq; } - + $rulch = scorm_seq_rules_check($sco, 'skipped'); // TODO: undefined if ($rulch != null){ $seq = scorm_seq_flow_tree_traversal ($activity, $direction, false, $prevdirection, $seq,$userid);//endsession and exception @@ -1329,7 +1329,7 @@ function scorm_seq_flow_activity_traversal ($activity, $userid, $direction, $chi return $seq; } else{ - + if ($prevdirection = 'backward' && $seq->traversaldir == 'backward'){ $seq = scorm_seq_flow_tree_traversal ($activity,$direction,false,null,$seq,$userid); $seq = scorm_seq_flow_activity($seq->identifiedactivity, $userid, $direction, $childrenflag, $prevdirection, $seq,$userid); @@ -1406,7 +1406,7 @@ function scorm_seq_flow_tree_traversal ($activity,$direction,$childrenflag,$prev } if (scorm_is_leaf ($activity) || !$childrenflag){ if ($children[$siz-1]->id == $activity->id){ - + $seq = scorm_seq_flow_tree_traversal ($parent, $direction, false, null, $seq,$userid); // I think it's not necessary to do a return in here } @@ -1442,10 +1442,10 @@ function scorm_seq_flow_tree_traversal ($activity,$direction,$childrenflag,$prev return $seq; } } - + } if($direction = 'backward'){ - + if ($activity->parent == '/'){ $seq->traversaldir = null; $seq->nextactivity = null; @@ -1486,7 +1486,7 @@ function scorm_seq_flow_tree_traversal ($activity,$direction,$childrenflag,$prev $seq->traversaldir = 'forward'; $seq->nextactivity = $children[0]; return $seq; - + } else{ $children = scorm_get_children ($activity); @@ -1497,7 +1497,7 @@ function scorm_seq_flow_tree_traversal ($activity,$direction,$childrenflag,$prev } else{ - + $seq->traversaldir = null; $seq->nextactivity = null; $seq->exception = 'SB.2.1-2'; @@ -1526,7 +1526,7 @@ function scorm_limit_cond_check ($activity,$userid){ global $DB; if (isset($activity->tracked) && ($activity->tracked == 0)){ - + return false; } @@ -1534,55 +1534,55 @@ function scorm_limit_cond_check ($activity,$userid){ return false; } - if (!isset($activity->limitcontrol) || ($activity->limitcontrol == 1)){ + if (!isset($activity->limitcontrol) || ($activity->limitcontrol == 1)){ $r = $DB->get_record('scorm_scoes_track', array('scoid'=>$activity->id,'userid'=>$userid,'element'=>'activityattemptcount')); if (scorm_seq_is('activityprogressstatus',$activity->id,$userid) && ($r->value >=$activity->limitattempt)){ return true; } } - if (!isset($activity->limitabsdurcontrol) || ($activity->limitabsdurcontrol == 1)){ + if (!isset($activity->limitabsdurcontrol) || ($activity->limitabsdurcontrol == 1)){ $r = $DB->get_record('scorm_scoes_track', array('scoid'=>$activity->id,'userid'=>$userid,'element'=>'activityabsoluteduration')); if (scorm_seq_is('activityprogressstatus',$activity->id,$userid) && ($r->value >=$activity->limitabsduration)){ return true; } } - if (!isset($activity->limitexpdurcontrol) || ($activity->limitexpdurcontrol == 1)){ + if (!isset($activity->limitexpdurcontrol) || ($activity->limitexpdurcontrol == 1)){ $r = $DB->get_record('scorm_scoes_track', array('scoid'=>$activity->id,'userid'=>$userid,'element'=>'activityexperiencedduration')); if (scorm_seq_is('activityprogressstatus',$activity->id,$userid) && ($r->value >=$activity->limitexpduration)){ return true; } } - - if (!isset($activity->limitattabsdurcontrol) || ($activity->limitattabsdurcontrol == 1)){ + + if (!isset($activity->limitattabsdurcontrol) || ($activity->limitattabsdurcontrol == 1)){ $r = $DB->get_record('scorm_scoes_track', array('scoid'=>$activity->id,'userid'=>$userid,'element'=>'attemptabsoluteduration')); if (scorm_seq_is('activityprogressstatus',$activity->id,$userid) && ($r->value >=$activity->limitattabsduration)){ return true; } } - if (!isset($activity->limitattexpdurcontrol) || ($activity->limitattexpdurcontrol == 1)){ + if (!isset($activity->limitattexpdurcontrol) || ($activity->limitattexpdurcontrol == 1)){ $r = $DB->get_record('scorm_scoes_track', array('scoid'=>$activity->id,'userid'=>$userid,'element'=>'attemptexperiencedduration')); if (scorm_seq_is('activityprogressstatus',$activity->id,$userid) && ($r->value >=$activity->limitattexpduration)){ return true; } } - if (!isset($activity->limitbegincontrol) || ($activity->limitbegincontrol == 1)){ + if (!isset($activity->limitbegincontrol) || ($activity->limitbegincontrol == 1)){ $r = $DB->get_record('scorm_scoes_track', array('scoid'=>$activity->id,'userid'=>$userid,'element'=>'begintime')); if (time()>=$activity->limitbegintime){ return true; } } - if (!isset($activity->limitbegincontrol) || ($activity->limitbegincontrol == 1)){ + if (!isset($activity->limitbegincontrol) || ($activity->limitbegincontrol == 1)){ if (time()<$activity->limitbegintime){ return true; } } - if (!isset($activity->limitendcontrol) || ($activity->limitendcontrol == 1)){ + if (!isset($activity->limitendcontrol) || ($activity->limitendcontrol == 1)){ if (time()>$activity->limitendtime){ return true; @@ -1667,7 +1667,7 @@ function scorm_seq_choice_sequencing($sco,$userid,$seq){ return $seq; } - + $children = scorm_get_children (scorm_get_parent ($sco)); $pos1 = array_search($children, $sco); $pos2 = array_search($seq->currentactivity, $sco); @@ -1826,7 +1826,7 @@ function scorm_seq_choice_sequencing($sco,$userid,$seq){ } } } - break; + break; } if(scorm_is_leaf ($sco)){ @@ -1848,7 +1848,7 @@ function scorm_seq_choice_sequencing($sco,$userid,$seq){ else{ return $seq; } - + } function scorm_seq_choice_flow ($constrained, $traverse, $seq){ @@ -2034,13 +2034,13 @@ function scorm_content_delivery_environment ($seq,$userid){ //ONCE THE DELIVERY BEGINS (How should I check that?) if(isset($activity->tracked) || ($activity->tracked == 0)){ - //How should I track the info and what should I do to not record the information for the activity during delivery? + //How should I track the info and what should I do to not record the information for the activity during delivery? $atabsdur = $DB->get_record('scorm_scoes_track', array('scoid'=>$activity->id,'userid'=>$userid,'element'=>'attemptabsoluteduration')); $atexpdur = $DB->get_record('scorm_scoes_track', array('scoid'=>$activity->id,'userid'=>$userid,'element'=>'attemptexperiencedduration')); } return $seq; - + } function scorm_clear_suspended_activity($act,$seq){ global $DB; @@ -2059,7 +2059,7 @@ function scorm_clear_suspended_activity($act,$seq){ } else{ $children = scorm_get_children($activity); - $bool= false; + $bool= false; foreach ($children as $child){ if(scorm_seq_is('suspended',$child->id,$userid)){ $bool= true; @@ -2091,7 +2091,7 @@ function scorm_select_children_process($scoid,$userid){ case 'oneachnewattempt': case 'never': break; - + case 'once': if(!scorm_seq_is('activityprogressstatus',$scoid,$userid)){ if(scorm_seq_is('selectioncountsstatus',$scoid,$userid)){ @@ -2115,7 +2115,7 @@ function scorm_select_children_process($scoid,$userid){ } } break; - + } } @@ -2132,10 +2132,10 @@ function scorm_randomize_children_process($scoid,$userid){ switch($r->value) { - + case 'never': break; - + case 'oneachnewattempt': case 'once': if(!scorm_seq_is('activityprogressstatus',$scoid,$userid)){ @@ -2151,7 +2151,7 @@ function scorm_randomize_children_process($scoid,$userid){ array_splice($children,$pos,1); $i--; } - + $clist = serialize ($childlist); scorm_seq_set('availablechildren', $scoid, $userid, false); scorm_seq_set('availablechildren', $scoid, $userid, $clist); @@ -2160,9 +2160,9 @@ function scorm_randomize_children_process($scoid,$userid){ } } break; - - - + + + } } @@ -2178,11 +2178,11 @@ function scorm_terminate_descendent_attempts ($activity,$userid,$seq){ foreach ($activitypath as $sco) { scorm_seq_end_attempt($sco,$userid,$seq->attempt); - + } } } - } + } } function scorm_sequencing_exception($seq){ @@ -2338,7 +2338,7 @@ function scorm_sequencing_exception($seq){ case 'SB.2.10-3': echo $OUTPUT->notification("Flow Sequencing Control Model Violation"); break; - + case 'SB.2.11-1': echo $OUTPUT->notification("Sequencing session has not begun"); break; @@ -2363,13 +2363,13 @@ function scorm_sequencing_exception($seq){ case 'DB.2-1': echo $OUTPUT->notification("Identified activity is already active"); break; - + } - + } } -?> + diff --git a/mod/scorm/db/access.php b/mod/scorm/db/access.php index 173bf64f2c278..20676a31fae5b 100644 --- a/mod/scorm/db/access.php +++ b/mod/scorm/db/access.php @@ -88,4 +88,3 @@ ) ); -?> \ No newline at end of file diff --git a/mod/scorm/db/install.php b/mod/scorm/db/install.php index f7b5ca9517157..c9feba3875c51 100644 --- a/mod/scorm/db/install.php +++ b/mod/scorm/db/install.php @@ -1,4 +1,4 @@ - + diff --git a/mod/scorm/index.php b/mod/scorm/index.php index 7bef611e60782..4ea04b0cfce89 100755 --- a/mod/scorm/index.php +++ b/mod/scorm/index.php @@ -99,4 +99,4 @@ echo $OUTPUT->footer(); -?> + diff --git a/mod/scorm/lib.php b/mod/scorm/lib.php index b7a906589c40e..154e4adec3cc0 100755 --- a/mod/scorm/lib.php +++ b/mod/scorm/lib.php @@ -664,7 +664,7 @@ function scorm_get_post_actions() { */ function scorm_option2text($scorm) { $scorm_popoup_options = scorm_get_popup_options_array(); - + if (isset($scorm->popup)) { if ($scorm->popup == 1) { $optionlist = array(); @@ -689,7 +689,7 @@ function scorm_option2text($scorm) { /** * Implementation of the function for printing the form elements that control * whether the course reset functionality affects the scorm. - * + * * @param object $mform form passed by reference */ function scorm_reset_course_form_definition(&$mform) { @@ -791,7 +791,7 @@ function scorm_get_file_areas($course, $cm, $context) { /** * File browsing support - * + * * @todo Document this function */ function scorm_get_file_info($browser, $areas, $course, $cm, $context, $filearea, $itemid, $filepath, $filename) { @@ -809,7 +809,7 @@ function scorm_get_file_info($browser, $areas, $course, $cm, $context, $filearea $filepath = is_null($filepath) ? '/' : $filepath; $filename = is_null($filename) ? '.' : $filename; - + $urlbase = $CFG->wwwroot.'/pluginfile.php'; if (!$storedfile = $fs->get_file($context->id, $filearea, 0, $filepath, $filename)) { if ($filepath === '/' and $filename === '.') { @@ -843,7 +843,7 @@ public function get_visible_name() { } else if ($filearea === 'scorm_package') { $filepath = is_null($filepath) ? '/' : $filepath; $filename = is_null($filename) ? '.' : $filename; - + $urlbase = $CFG->wwwroot.'/pluginfile.php'; if (!$storedfile = $fs->get_file($context->id, $filearea, 0, $filepath, $filename)) { if ($filepath === '/' and $filename === '.') { @@ -884,7 +884,7 @@ function scorm_pluginfile($course, $cminfo, $context, $filearea, $args, $forcedo if (!$cm = get_coursemodule_from_instance('scorm', $cminfo->instance, $course->id)) { return false; } - + require_login($course, true, $cm); if ($filearea === 'scorm_content') { diff --git a/mod/scorm/locallib.php b/mod/scorm/locallib.php index 938b1afb2c444..5a660b6ea9c0a 100755 --- a/mod/scorm/locallib.php +++ b/mod/scorm/locallib.php @@ -1,4 +1,4 @@ -dirroot/mod/scorm/lib.php"); @@ -739,13 +739,13 @@ function scorm_view_display ($user, $scorm, $action, $cm, $boxwidth='') {
- options = $orgs; $select->name = 'organization'; $select->selectedvalue = $organization; $select->add_action('change', 'submit_form_by_id', array('id' => 'changeorg')); - echo $OUTPUT->select($select); + echo $OUTPUT->select($select); ?>
diff --git a/mod/scorm/mod_form.php b/mod/scorm/mod_form.php index 108a78c2484a8..4088e623d5827 100644 --- a/mod/scorm/mod_form.php +++ b/mod/scorm/mod_form.php @@ -372,4 +372,4 @@ function set_data($default_values) { parent::set_data($default_values); } } -?> + diff --git a/mod/scorm/rd.js b/mod/scorm/rd.js index e4eebcf62d3ff..3817890e6bee5 100644 --- a/mod/scorm/rd.js +++ b/mod/scorm/rd.js @@ -14,14 +14,14 @@ function scorm_set_next(url) { function scorm_get_element_style(obj, prop, cssProp) { var ret = ''; - + if (obj.currentStyle) { ret = obj.currentStyle[prop]; } else if (document.defaultView && document.defaultView.getComputedStyle) { var compStyle = document.defaultView.getComputedStyle(obj, null); ret = compStyle.getPropertyValue(cssProp); } - + if (ret == 'auto') ret = '0'; return ret; } @@ -43,14 +43,14 @@ function scorm_resize () { winwidth = document.body.clientWidth; winheight = document.body.clientHeight; } - - var header = document.getElementById('header'); + + var header = document.getElementById('header'); var content = document.getElementById('content'); var headerheight = 0; if (content) { headerheight = content.offsetTop; } - + var footer = document.getElementById('footer'); var imsnavbar = document.getElementById('tochead'); var scormtop = document.getElementById('scormtop'); @@ -69,9 +69,9 @@ function scorm_resize () { var topmargin = parseInt(scorm_get_element_style(document.getElementsByTagName('body')[0], 'marginTop', 'margin-top')); var bottommargin = parseInt(scorm_get_element_style(document.getElementsByTagName('body')[0], 'marginBottom', 'margin-bottom')); - - var totalheight = headerheight + - footerheight + + + var totalheight = headerheight + + footerheight + scormtopheight+ topmargin + bottommargin+10; // +10 to save a minor vertical scroll always present! @@ -84,11 +84,11 @@ function scorm_resize () { var finalheighttoc = winheight - totalheighttoc; if (finalheighttoc <= 0) { finalheighttoc = winheight; - } + } var finalheight = winheight - totalheight; if (finalheight <= 0) { finalheight = winheight; - } + } var toctree = document.getElementById('toctree'); if (toctree != null){ var toctreeHeight = toctree.offsetHeight; diff --git a/mod/scorm/report.php b/mod/scorm/report.php index 967a05992d01f..10b6560b1bbb2 100755 --- a/mod/scorm/report.php +++ b/mod/scorm/report.php @@ -23,7 +23,7 @@ if ($action !== '') { $url->param('action', $action); } - + if (!empty($id)) { $url->param('id', $id); if (! $cm = get_coursemodule_from_id('scorm', $id)) { @@ -472,4 +472,4 @@ if (empty($noheader)) { echo $OUTPUT->footer(); } -?> + diff --git a/mod/scorm/restorelib.php b/mod/scorm/restorelib.php index a9d8362470785..73cfd325ff6c0 100755 --- a/mod/scorm/restorelib.php +++ b/mod/scorm/restorelib.php @@ -1,4 +1,4 @@ -width = $value; @@ -146,8 +146,8 @@ function scorm_restore_mods($mod,$restore) { $scorm->launch = $launchsco->new_id; $DB->update_record('scorm',$scorm); } - } - + } + } else { $status = false; } @@ -190,7 +190,7 @@ function scorm_scoes_restore_mods($scorm_id,$info,$restore,$oldmodid) { //The structure is equal to the db, so insert the scorm_scoes $newid = $DB->insert_record ("scorm_scoes",$sco); - + if ($newid) { //We have the newid, update backup_ids backup_putid($restore->backup_unique_code,"scorm_scoes", $oldid, $newid); @@ -212,8 +212,8 @@ function scorm_scoes_restore_mods($scorm_id,$info,$restore,$oldmodid) { $status = scorm_scoes_tracks_restore_mods ($scorm_id,$info,$restore); } } - } - + } + return $status; } @@ -225,7 +225,7 @@ function scorm_scoes_seq_objective_restore_mods($sco_id,$info,$restore) { //Get the discussions array $objectives = array(); - + if (!empty($info['MOD']['#']['SEQ_OBJECTIVES']['0']['#']['SEQ_OBJECTIVE'])) { $objectives = $info['MOD']['#']['SEQ_OBJECTIVES']['0']['#']['SEQ_OBJECTIVE']; } @@ -243,7 +243,7 @@ function scorm_scoes_seq_objective_restore_mods($sco_id,$info,$restore) { $objective->objectiveid = backup_todb($obj_info['#']['OBJECTIVEID']['0']['#']); $objective->satisfiedbymeasure = backup_todb($obj_info['#']['SATISFIEDBYMEASURE']['0']['#']); $objective->minnormalizedmeasure = backup_todb($obj_info['#']['MINNORMALIZEDMEASURE']['0']['#']); - + //The structure is equal to the db, so insert the forum_discussions $newid = $DB->insert_record ("scorm_seq_objective",$objective); @@ -268,7 +268,7 @@ function scorm_scoes_seq_objective_restore_mods($sco_id,$info,$restore) { //Now restore the scorm_seq_mapinfo for each objective $status = scorm_seq_mapinfo_restore_mods ($sco_id,$newid,$obj_info,$restore); - + } return $status; @@ -283,7 +283,7 @@ function scorm_scoes_seq_rolluprule_restore_mods($sco_id,$info,$restore) { //Get the discussions array $rolluprules = array(); - + if (!empty($info['MOD']['#']['SEQ_ROLLUPRULES']['0']['#']['SEQ_ROLLUPRULE'])) { $rolluprules = $info['MOD']['#']['SEQ_ROLLUPRULES']['0']['#']['SEQ_ROLLUPRULE']; } @@ -302,7 +302,7 @@ function scorm_scoes_seq_rolluprule_restore_mods($sco_id,$info,$restore) { $rolluprule->minimumpercent = backup_todb($rol_info['#']['MINIMUMPERCENT']['0']['#']); $rolluprule->conditioncombination = backup_todb($rol_info['#']['CONDITIONCOMBINATION']['0']['#']); $rolluprule->action = backup_todb($rol_info['#']['ACTION']['0']['#']); - + //The structure is equal to the db, so insert the forum_discussions $newid = $DB->insert_record ("scorm_seq_rolluprule",$rolluprule); @@ -327,7 +327,7 @@ function scorm_scoes_seq_rolluprule_restore_mods($sco_id,$info,$restore) { //Now restore the scorm_seq_mapinfo for each objective $status = scorm_seq_rolluprulecond_restore_mods ($sco_id, $newid,$obj_info,$restore); - + } return $status; @@ -340,7 +340,7 @@ function scorm_scoes_seq_ruleconds_restore_mods($sco_id,$info,$restore) { //Get the discussions array $ruleconds = array(); - + if (!empty($info['MOD']['#']['SEQ_RULECONDS']['0']['#']['SEQ_RULECOND'])) { $ruleconds = $info['MOD']['#']['SEQ_RULECONDS']['0']['#']['SEQ_RULECOND']; } @@ -352,12 +352,12 @@ function scorm_scoes_seq_ruleconds_restore_mods($sco_id,$info,$restore) { //We'll need this later!! $oldid = backup_todb($rul_info['#']['ID']['0']['#']); - - $rulecond->scoid = $sco_id; + + $rulecond->scoid = $sco_id; $rulecond->conditioncombination = backup_todb($rul_info['#']['CONDITIONCOMBINATION']['0']['#']); $rulecond->minimumpercent = backup_todb($rul_info['#']['RULETYPE']['0']['#']); $rulecond->action = backup_todb($rul_info['#']['ACTION']['0']['#']); - + //The structure is equal to the db, so insert the forum_discussions $newid = $DB->insert_record ("scorm_seq_ruleconds",$rulecond); @@ -382,7 +382,7 @@ function scorm_scoes_seq_ruleconds_restore_mods($sco_id,$info,$restore) { //Now restore the scorm_seq_mapinfo for each objective $status = scorm_seq_rulecond_restore_mods ($sco_id, $newid,$obj_info,$restore); - + } return $status; @@ -395,26 +395,26 @@ function scorm_scoes_seq_rulecond_restore_mods($sco_id,$rulecondid,$info,$restor //Get the discussions array $rulecondsd = array(); - + if (!empty($info['MOD']['#']['SEQ_RULECOND_DATAS']['0']['#']['SEQ_RULECOND_DATA'])) { $rulecondsd = $info['MOD']['#']['SEQ_RULECOND_DATAS']['0']['#']['SEQ_RULECOND_DATA']; } - + for($i = 0; $i < sizeof($rulecondsd); $i++) { $ruld_info = $rulecondsd[$i]; //Debug //We'll need this later!! $oldid = backup_todb($rul_info['#']['ID']['0']['#']); - - $rulecondd->scoid = $sco_id; + + $rulecondd->scoid = $sco_id; $rulecondd->ruleconditions = $rulecondid; $rulecondd->refrencedobjective = backup_todb($ruld_info['#']['REFRENCEDOBJECTIVE']['0']['#']); $rulecondd->measurethreshold = backup_todb($ruld_info['#']['MEASURETHRESHOLD']['0']['#']); $rulecondd->operator = backup_todb($ruld_info['#']['OPERATOR']['0']['#']); $rulecondd->cond = backup_todb($ruld_info['#']['COND']['0']['#']); - + //The structure is equal to the db, so insert the forum_discussions $newid = $DB->insert_record ("scorm_seq_rulecond",$rulecondd); @@ -450,20 +450,20 @@ function scorm_scoes_seq_rolluprulecond_restore_mods($sco_id,$rolluprule,$info,$ //Get the discussions array $rollupruleconds = array(); - + if (!empty($info['MOD']['#']['SEQ_ROLLUPRULECONDS']['0']['#']['SEQ_ROLLUPRULECOND'])) { $rollupruleconds = $info['MOD']['#']['SEQ_ROLLUPRULECONDS']['0']['#']['SEQ_ROLLUPRULECOND']; } - + for($i = 0; $i < sizeof($rollupruleconds); $i++) { $rulc_info = $rollupruleconds[$i]; //Debug //We'll need this later!! $oldid = backup_todb($rulc_info['#']['ID']['0']['#']); - - $rolluprulecond->scoid = $sco_id; + + $rolluprulecond->scoid = $sco_id; $rolluprulecond->ruleconditions = $rolluprule; $rolluprulecond->cond = backup_todb($rulc_info['#']['COND']['0']['#']); $rolluprulecond->operator = backup_todb($rulc_info['#']['OPERATOR']['0']['#']); @@ -504,20 +504,20 @@ function scorm_scoes_seq_mapinfo_restore_mods($sco_id,$objectiveid,$info,$restor //Get the discussions array $mapinfos = array(); - + if (!empty($info['MOD']['#']['SEQ_MAPINFO']['0']['#']['SEQ_MAPINF'])) { $mapinfos = $info['MOD']['#']['SEQ_MAPINFO']['0']['#']['SEQ_MAPINF']; } - + for($i = 0; $i < sizeof($mapinfos); $i++) { $map_info = $mapinfos[$i]; //Debug //We'll need this later!! $oldid = backup_todb($map_info['#']['ID']['0']['#']); - - $mapinfo->scoid = $sco_id; + + $mapinfo->scoid = $sco_id; $mapinfo->objectiveid = $ojectiveid; $mapinfo->targetobjectiveid = backup_todb($map_info['#']['TARGETOBJECTIVEID']['0']['#']); $mapinfo->readsatisfiedstatus = backup_todb($map_info['#']['READSATISFIEDSTATUS']['0']['#']); @@ -525,7 +525,7 @@ function scorm_scoes_seq_mapinfo_restore_mods($sco_id,$objectiveid,$info,$restor $mapinfo->writesatisfiedstatus = backup_todb($map_info['#']['WRITESATISFIEDSTATUS']['0']['#']); $mapinfo->writenormalizedmeasure = backup_todb($map_info['#']['WRITENORMALIZEDMEASURE']['0']['#']); - + //The structure is equal to the db, so insert the forum_discussions $newid = $DB->insert_record ("scorm_seq_mapinfo",$mapinfo); @@ -545,8 +545,8 @@ function scorm_scoes_seq_mapinfo_restore_mods($sco_id,$objectiveid,$info,$restor } } } - } - + } + return $status; } @@ -605,7 +605,7 @@ function scorm_scoes_tracks_restore_mods($scorm_id,$info,$restore) { return $status; } - + //This function restores the scorm_scoes_track from Moodle 1.4 function scorm_scoes_tracks_restore_mods_pre15 ($scorm_id,$info,$restore) { global $CFG, $DB; @@ -617,7 +617,7 @@ function scorm_scoes_tracks_restore_mods_pre15 ($scorm_id,$info,$restore) { if (!empty($info['MOD']['#']['SCO_USERS']['0']['#']['SCO_USER'])) { $scousers = $info['MOD']['#']['SCO_USERS']['0']['#']['SCO_USER']; } - + $oldelements = array ('CMI_CORE_LESSON_LOCATION', 'CMI_CORE_LESSON_STATUS', 'CMI_CORE_EXIT', @@ -741,13 +741,13 @@ function scorm_restore_files ($package, $restore) { //scorm_decode_content_links_caller() function in each module //in the restore process function scorm_decode_content_links ($content,$restore) { - + global $CFG; - + $result = $content; - + //Link to the list of scorms - + $searchstring='/\$@(SCORMINDEX)\*([0-9]+)@\$/'; //We look for it preg_match_all($searchstring,$content,$foundset); @@ -764,7 +764,7 @@ function scorm_decode_content_links ($content,$restore) { if($rec->new_id) { //Now replace it $result= preg_replace($searchstring,$CFG->wwwroot.'/mod/scorm/index.php?id='.$rec->new_id,$result); - } else { + } else { //It's a foreign link so leave it as original $result= preg_replace($searchstring,$restore->original_wwwroot.'/mod/scorm/index.php?id='.$old_id,$result); } @@ -850,4 +850,4 @@ function scorm_restore_logs($restore,$log) { return $status; } -?> + diff --git a/mod/scorm/settings.php b/mod/scorm/settings.php index b7078c9068d4f..fad41def1faca 100644 --- a/mod/scorm/settings.php +++ b/mod/scorm/settings.php @@ -1,4 +1,4 @@ -dirroot . '/mod/scorm/locallib.php'); $yesno = array(0 => get_string('no'), 1 => get_string('yes')); @@ -58,4 +58,4 @@ $settings->add(new admin_setting_configtext('scorm/apidebugmask', get_string('apidebugmask', 'scorm'), '', '/.*/')); -?> + diff --git a/mod/scorm/styles.php b/mod/scorm/styles.php index 7bc83b9992f4e..0efa2aa21f142 100644 --- a/mod/scorm/styles.php +++ b/mod/scorm/styles.php @@ -47,8 +47,8 @@ width: 100%; height: 100%; - - + + } @@ -59,9 +59,9 @@ position: relative; width: 100%; - - - + + + } @@ -73,37 +73,37 @@ top: 3px; - height: 30px; - - + height: 30px; + + } #mod-scorm-player .toc { - width: 80%; + width: 80%; + + margin-left: 20%; + + - margin-left: 20%; - - - } #mod-scorm-player .no-toc { width: 100%; - - + + } #mod-scorm-player #scormobject { - height: 400px; - - - + height: 400px; + + + } @@ -114,8 +114,8 @@ width: 100%; height: 30px; - - + + } @@ -126,9 +126,9 @@ left: 5px; top: 0px; - - - + + + } @@ -145,9 +145,9 @@ top: 3px; width: 100%; - - - + + + } @@ -156,8 +156,8 @@ #mod-scorm-view .structurehead { text-align: center; - - + + } @@ -168,8 +168,8 @@ list-style-type: none; white-space: nowrap; - - + + } @@ -184,8 +184,8 @@ right: 0px; top: 0px; - - + + } @@ -200,8 +200,8 @@ width: 24%; font-size: 0.8em; - - + + } @@ -215,9 +215,9 @@ top: 3px; - height: 30px; - - + height: 30px; + + } @@ -232,8 +232,8 @@ overflow-x: auto; overflow-y: auto; - - + + } @@ -252,24 +252,24 @@ width: 96%; margin-left:0; - + padding-left: 0; - + margin-right:0; - + padding-right: 0; - + padding-top: 0; - + padding-bottom: 0; - + margin-top:0; - + margin-bottom:0; - - - - + + + + } diff --git a/mod/scorm/version.php b/mod/scorm/version.php index b0eb5c3c62a6b..3fa801e017f19 100755 --- a/mod/scorm/version.php +++ b/mod/scorm/version.php @@ -1,4 +1,4 @@ -requires = 2009041700; // The version of Moodle that is required $module->cron = 300; // How often should cron check this module (seconds)? -?> \ No newline at end of file diff --git a/mod/scorm/view.php b/mod/scorm/view.php index 84081aa9fd2f3..770acfe654c6b 100755 --- a/mod/scorm/view.php +++ b/mod/scorm/view.php @@ -2,7 +2,7 @@ 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 $organization = optional_param('organization', '', PARAM_INT); // organization ID @@ -36,7 +36,7 @@ $url->param('organization', $organization); } $PAGE->set_url($url); - + require_login($course->id, false, $cm); $context = get_context_instance(CONTEXT_COURSE, $course->id); @@ -65,7 +65,7 @@ echo $OUTPUT->header(); if (has_capability('mod/scorm:viewreport', $context)) { - + $trackedusers = scorm_get_count_users($scorm->id, $cm->groupingid); if ($trackedusers > 0) { echo "'; @@ -81,7 +81,7 @@ $attemptstatus = scorm_get_attempt_status($USER,$scorm); } echo $OUTPUT->box(format_module_intro('scorm', $scorm, $cm->id).$attemptstatus, 'generalbox boxaligncenter boxwidthwide', 'intro'); - + $scormopen = true; $timenow = time(); if ($scorm->timeclose !=0) { @@ -97,4 +97,4 @@ scorm_view_display($USER, $scorm, 'view.php?id='.$cm->id, $cm); } echo $OUTPUT->footer(); -?> + diff --git a/mod/survey/backuplib.php b/mod/survey/backuplib.php index 01cbb72159214..546aa893628e0 100644 --- a/mod/survey/backuplib.php +++ b/mod/survey/backuplib.php @@ -1,4 +1,4 @@ -id) |(CL,pk->id,?????) | // | -------------------- // | - // ----------------------------------- + // ----------------------------------- // | | // survey_analysis survey_answers // (UL,pk->id, fk->survey) (UL,pk->id, fk->survey) @@ -41,13 +41,13 @@ function survey_backup_mods($bf,$preferences) { function survey_backup_one_mod($bf,$preferences,$survey) { global $DB; - + $status = true; - + if (is_numeric($survey)) { $survey = $DB->get_record('survey', array('id'=>$survey)); } - + //Start mod fwrite ($bf,start_tag("MOD",3,true)); //Print choice data @@ -60,7 +60,7 @@ function survey_backup_one_mod($bf,$preferences,$survey) { fwrite ($bf,full_tag("NAME",4,false,$survey->name)); fwrite ($bf,full_tag("INTRO",4,false,$survey->intro)); fwrite ($bf,full_tag("QUESTIONS",4,false,$survey->questions)); - + //if we've selected to backup users info, then execute backup_survey_answers and //backup_survey_analysis if (backup_userdata_selected($preferences,'survey',$survey->id)) { @@ -224,4 +224,4 @@ function survey_answer_ids_by_instance ($instanceid) { WHERE s.survey = ?", array($instanceid)); } -?> + diff --git a/mod/survey/db/access.php b/mod/survey/db/access.php index 3b533c4ab45ec..201a0a292249d 100644 --- a/mod/survey/db/access.php +++ b/mod/survey/db/access.php @@ -69,4 +69,4 @@ ); -?> + diff --git a/mod/survey/db/install.php b/mod/survey/db/install.php index a3d75a0b8656d..00add77fea9c2 100644 --- a/mod/survey/db/install.php +++ b/mod/survey/db/install.php @@ -1,4 +1,4 @@ - + diff --git a/mod/survey/graph.php b/mod/survey/graph.php index 4bcd5a9e4578d..7541955e5647e 100644 --- a/mod/survey/graph.php +++ b/mod/survey/graph.php @@ -56,7 +56,7 @@ /// Check to see if groups are being used in this survey if ($group) { $users = get_users_by_capability($context, 'mod/survey:participate', '', '', '', '', $group, null, false); - } else if (!empty($CFG->enablegroupings) && !empty($cm->groupingid)) { + } else if (!empty($CFG->enablegroupings) && !empty($cm->groupingid)) { $groups = groups_get_all_groups($courseid, 0, $cm->groupingid); $groups = array_keys($groups); $users = get_users_by_capability($context, 'mod/survey:participate', '', '', '', '', $groups, null, false); @@ -67,7 +67,7 @@ $stractual = get_string("actual", "survey"); $stractualclass = get_string("actualclass", "survey"); - + $strpreferred = get_string("preferred", "survey"); $strpreferredclass = get_string("preferredclass", "survey"); @@ -744,4 +744,4 @@ exit; -?> + diff --git a/mod/survey/index.php b/mod/survey/index.php index f85f737ad795d..be7435982de49 100644 --- a/mod/survey/index.php +++ b/mod/survey/index.php @@ -82,4 +82,4 @@ echo $OUTPUT->table($table); echo $OUTPUT->footer(); -?> + diff --git a/mod/survey/lib.php b/mod/survey/lib.php index 137ba095dd60d..dec4dbc32add6 100644 --- a/mod/survey/lib.php +++ b/mod/survey/lib.php @@ -74,7 +74,7 @@ function survey_add_instance($survey) { return 0; } - $survey->questions = $template->questions; + $survey->questions = $template->questions; $survey->timecreated = time(); $survey->timemodified = $survey->timecreated; @@ -98,8 +98,8 @@ function survey_update_instance($survey) { return 0; } - $survey->id = $survey->instance; - $survey->questions = $template->questions; + $survey->id = $survey->instance; + $survey->questions = $template->questions; $survey->timemodified = time(); return $DB->update_record("survey", $survey); @@ -108,7 +108,7 @@ function survey_update_instance($survey) { /** * Given an ID of an instance of this module, * this function will permanently delete the instance - * and any data that depends on it. + * and any data that depends on it. * * @global object * @param int $id @@ -179,11 +179,11 @@ function survey_user_complete($course, $user, $mod, $survey) { $questions = $DB->get_records_list("survey_questions", "id", explode(',', $survey->questions)); $questionorder = explode(",", $survey->questions); - + foreach ($questionorder as $key=>$val) { $question = $questions[$val]; $questiontext = get_string($question->shorttext, "survey"); - + if ($answer = survey_get_user_answer($survey->id, $question->id, $user->id)) { $answertext = "$answer->answer1"; } else { @@ -192,12 +192,12 @@ function survey_user_complete($course, $user, $mod, $survey) { $table->data[] = array("$questiontext", $answertext); } echo $OUTPUT->table($table); - + } else { - + survey_print_graph("id=$mod->id&sid=$user->id&type=student.png"); } - + } else { print_string("notdone", "survey"); } @@ -249,7 +249,7 @@ function survey_print_recent_activity($course, $viewfullnames, $timestart) { $survey->name = $cm->name; $survey->cmid = $cm->id; $surveys[] = $survey; - } + } $rs->close(); if (!$surveys) { @@ -261,7 +261,7 @@ function survey_print_recent_activity($course, $viewfullnames, $timestart) { $url = $CFG->wwwroot.'/mod/survey/view.php?id='.$survey->cmid; print_recent_activity_note($survey->time, $survey, $survey->name, $url, false, $viewfullnames); } - + return true; } @@ -321,7 +321,7 @@ function survey_log_info($log) { function survey_get_responses($surveyid, $groupid, $groupingid) { global $DB; - $params = array('surveyid'=>$surveyid, 'groupid'=>$groupid, 'groupingid'=>$groupingid); + $params = array('surveyid'=>$surveyid, 'groupid'=>$groupid, 'groupingid'=>$groupingid); if ($groupid) { $groupsjoin = "JOIN {groups_members} gm ON u.id = gm.userid AND gm.groupid = :groupid "; @@ -351,7 +351,7 @@ function survey_get_responses($surveyid, $groupid, $groupingid) { function survey_get_analysis($survey, $user) { global $DB; - return $DB->get_record_sql("SELECT notes + return $DB->get_record_sql("SELECT notes FROM {survey_analysis} WHERE survey=? AND userid=?", array($survey, $user)); } @@ -366,8 +366,8 @@ function survey_update_analysis($survey, $user, $notes) { global $DB; return $DB->execute("UPDATE {survey_analysis} - SET notes=? - WHERE survey=? + SET notes=? + WHERE survey=? AND userid=?", array($notes, $survey, $user)); } @@ -389,10 +389,10 @@ function survey_get_user_answers($surveyid, $questionid, $groupid, $sort="sa.ans $groupsql = ""; } - return $DB->get_records_sql("SELECT sa.*,u.firstname,u.lastname,u.picture - FROM {survey_answers} sa, {user} u, {groups_members} gm - WHERE sa.survey = :surveyid - AND sa.question = :questionid + return $DB->get_records_sql("SELECT sa.*,u.firstname,u.lastname,u.picture + FROM {survey_answers} sa, {user} u, {groups_members} gm + WHERE sa.survey = :surveyid + AND sa.question = :questionid AND u.id = sa.userid $groupsql ORDER BY $sort", $params); } @@ -407,10 +407,10 @@ function survey_get_user_answers($surveyid, $questionid, $groupid, $sort="sa.ans function survey_get_user_answer($surveyid, $questionid, $userid) { global $DB; - return $DB->get_record_sql("SELECT sa.* + return $DB->get_record_sql("SELECT sa.* FROM {survey_answers} sa - WHERE sa.survey = ? - AND sa.question = ? + WHERE sa.survey = ? + AND sa.question = ? AND sa.userid = ?", array($surveyid, $questionid, $userid)); } @@ -471,7 +471,7 @@ function survey_print_all_responses($cmid, $results, $courseid) { foreach ($results as $a) { $table->data[] = array($OUTPUT->user_picture(moodle_user_picture::make($a, $courseid)), - $OUTPUT->link("report.php?action=student&student=$a->id&id=$cmid", fullname($a)), + $OUTPUT->link("report.php?action=student&student=$a->id&id=$cmid", fullname($a)), userdate($a->time)); } @@ -549,7 +549,7 @@ function survey_print_multi($question) { if ($oneanswer) { echo "$question->intro\n"; } else { - echo "$question->intro\n"; + echo "$question->intro\n"; } $subquestions = $DB->get_records_list("survey_questions", "id", explode(',', $question->multi)); @@ -575,8 +575,8 @@ function survey_print_multi($question) { $default = get_accesshide($strdefault, 'label', '', "for=\"q$P$q->id\""); echo "id\" id=\"q$P" . $q->id . "_D\" value=\"0\" checked=\"checked\" />$default"; $checklist["q$P$q->id"] = $numoptions; - - } else { + + } else { // yu : fix for MDL-7501, possibly need to use user flag as this is quite ugly. echo ""; echo "$qnum   "; @@ -605,7 +605,7 @@ function survey_print_multi($question) { $default = get_accesshide($strdefault, 'label', '', "for=\"q$q->id\""); echo "id\" id=\"q$q->id\" value=\"0\" checked=\"checked\" />$default"; $checklist["qP$q->id"] = $numoptions; - $checklist["q$q->id"] = $numoptions; + $checklist["q$q->id"] = $numoptions; } echo "\n"; } @@ -706,7 +706,7 @@ function survey_get_post_actions() { /** * Implementation of the function for printing the form elements that control * whether the course reset functionality affects the survey. - * + * * @param object $mform form passed by reference */ function survey_reset_course_form_definition(&$mform) { diff --git a/mod/survey/mod_form.php b/mod/survey/mod_form.php index 79925e98c79c5..ce225dc373d03 100644 --- a/mod/survey/mod_form.php +++ b/mod/survey/mod_form.php @@ -44,4 +44,4 @@ function definition() { } -?> + diff --git a/mod/survey/report.php b/mod/survey/report.php index 767760763a177..7de4822d3bd5a 100644 --- a/mod/survey/report.php +++ b/mod/survey/report.php @@ -62,7 +62,7 @@ $PAGE->set_url($url); require_login($course->id, false, $cm); - + $context = get_context_instance(CONTEXT_MODULE, $cm->id); require_capability('mod/survey:readresponses', $context); @@ -133,7 +133,7 @@ if ($currentgroup) { $users = get_users_by_capability($context, 'mod/survey:participate', '', '', '', '', $currentgroup, null, false); - } else if (!empty($CFG->enablegroupings) && !empty($cm->groupingid)) { + } else if (!empty($CFG->enablegroupings) && !empty($cm->groupingid)) { $groups = groups_get_all_groups($courseid, 0, $cm->groupingid); $groups = array_keys($groups); $users = get_users_by_capability($context, 'mod/survey:participate', '', '', '', '', $groups, null, false); @@ -143,7 +143,7 @@ } $groupingid = $cm->groupingid; - + echo $OUTPUT->box_start("generalbox boxaligncenter"); if ($showscales) { echo "$strsummary"; @@ -307,7 +307,7 @@ $table->data[] = array($contents); echo $OUTPUT->table($table); - + $spacer = new html_image(); $spacer->height = 30; $spacer->width = 1; @@ -506,4 +506,4 @@ } echo $OUTPUT->footer(); -?> + diff --git a/mod/survey/restorelib.php b/mod/survey/restorelib.php index 9c2a253738a6b..b085e762ecb20 100644 --- a/mod/survey/restorelib.php +++ b/mod/survey/restorelib.php @@ -1,4 +1,4 @@ -id) |(CL,pk->id,?????) | // | -------------------- // | - // ----------------------------------- + // ----------------------------------- // | | // survey_analysis survey_answers // (UL,pk->id, fk->survey) (UL,pk->id, fk->survey) @@ -32,7 +32,7 @@ function survey_restore_mods($mod,$restore) { $data = backup_getid($restore->backup_unique_code,$mod->modtype,$mod->id); if ($data) { - //Now get completed xmlized object + //Now get completed xmlized object $info = $data->info; //traverse_xmlize($info); //Debug //print_object ($GLOBALS['traverse_array']); //Debug @@ -177,7 +177,7 @@ function survey_analysis_restore_mods($survey_id,$info,$restore) { //Do some output if (($i+1) % 50 == 0) { if (!defined('RESTORE_SILENTLY')) { - echo "."; + echo "."; if (($i+1) % 1000 == 0) { echo "
"; } @@ -202,13 +202,13 @@ function survey_analysis_restore_mods($survey_id,$info,$restore) { //servey_decode_content_links_caller() function in each module //in the restore process function servey_decode_content_links ($content,$restore) { - + global $CFG; - + $result = $content; - + //Link to the list of serveys - + $searchstring='/\$@(SURVEYINDEX)\*([0-9]+)@\$/'; //We look for it preg_match_all($searchstring,$content,$foundset); @@ -225,7 +225,7 @@ function servey_decode_content_links ($content,$restore) { if($rec->new_id) { //Now replace it $result= preg_replace($searchstring,$CFG->wwwroot.'/mod/servey/index.php?id='.$rec->new_id,$result); - } else { + } else { //It's a foreign link so leave it as original $result= preg_replace($searchstring,$restore->original_wwwroot.'/mod/servey/index.php?id='.$old_id,$result); } @@ -268,7 +268,7 @@ function servey_decode_content_links ($content,$restore) { function survey_decode_content_links_caller($restore) { global $CFG, $DB; $status = true; - + if ($surveys = $DB->get_records('survey', array('course'=>$restore->course_id), '', "id,intro")) { //Iterate over each survey->intro $i = 0; //Counter to send some output to the browser to avoid timeouts @@ -406,4 +406,4 @@ function survey_restore_logs($restore,$log) { } return $status; } -?> + diff --git a/mod/survey/save.php b/mod/survey/save.php index c122dbe920bd7..b6934bfa20e8b 100644 --- a/mod/survey/save.php +++ b/mod/survey/save.php @@ -46,10 +46,10 @@ $PAGE->set_url(new moodle_url($CFG->wwwroot.'/mod/survey/save.php', array('id'=>$id))); require_login($course->id, false, $cm); - + $context = get_context_instance(CONTEXT_MODULE, $cm->id); require_capability('mod/survey:participate', $context); - + if (! $survey = $DB->get_record("survey", array("id"=>$cm->instance))) { print_error('invalidsurveyid', 'survey'); } @@ -118,4 +118,4 @@ exit; -?> + diff --git a/mod/survey/version.php b/mod/survey/version.php index 662eadcac810a..f623c4d0ce779 100644 --- a/mod/survey/version.php +++ b/mod/survey/version.php @@ -1,4 +1,4 @@ -requires = 2009041700; // Requires this Moodle version $module->cron = 0; -?> + diff --git a/mod/survey/view.php b/mod/survey/view.php index 8f4f4bb1b323f..45a484140efc7 100644 --- a/mod/survey/view.php +++ b/mod/survey/view.php @@ -202,4 +202,4 @@ echo $OUTPUT->footer(); -?> + diff --git a/mod/url/mod_form.php b/mod/url/mod_form.php index abab8c7ebb7fe..e0eff0d0cd6fe 100644 --- a/mod/url/mod_form.php +++ b/mod/url/mod_form.php @@ -46,7 +46,7 @@ function definition() { //------------------------------------------------------- $mform->addElement('header', 'content', get_string('contentheader', 'url')); - $mform->addElement('url', 'externalurl', get_string('externalurl', 'url'), array('size'=>'60'), array('usefilepicker'=>true)); + $mform->addElement('url', 'externalurl', get_string('externalurl', 'url'), array('size'=>'60'), array('usefilepicker'=>true)); //------------------------------------------------------- $mform->addElement('header', 'optionssection', get_string('optionsheader', 'url'));