Completed
Pull Request — 1.11.x (#1421)
by José
46:34 queued 10:32
created
main/inc/lib/search/tool_processors/quiz_processor.class.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -8,8 +8,8 @@  discard block
 block discarded – undo
8 8
 /**
9 9
  * Code
10 10
  */
11
-include_once dirname(__FILE__) . '/../../../global.inc.php';
12
-require_once dirname(__FILE__) . '/search_processor.class.php';
11
+include_once dirname(__FILE__).'/../../../global.inc.php';
12
+require_once dirname(__FILE__).'/search_processor.class.php';
13 13
 
14 14
 /**
15 15
  * Process exercises before pass it to search listing scripts
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
                     $visibility = api_get_item_visibility(api_get_course_info($courseid), TOOL_QUIZ, $exercise_id);
71 71
                     if ($visibility) {
72 72
                         list($thumbnail, $image, $name, $author) = $this->get_information($courseid, $exercise_id);
73
-                        $url = api_get_path(WEB_CODE_PATH) . 'exercise/exercise_submit.php?cidReq=%s&exerciseId=%s';
73
+                        $url = api_get_path(WEB_CODE_PATH).'exercise/exercise_submit.php?cidReq=%s&exerciseId=%s';
74 74
                         $url = sprintf($url, $courseid, $exercise_id);
75 75
                         $result = array(
76 76
                             'toolid' => TOOL_QUIZ,
Please login to merge, or discard this patch.
main/lp/lp_move_item.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 
22 22
 /* Header and action code */
23 23
 $htmlHeadXtra[] = '<script type="text/javascript">'.
24
-$_SESSION['oLP']->get_js_dropdown_array() .
24
+$_SESSION['oLP']->get_js_dropdown_array().
25 25
 "
26 26
     function load_cbo(id) {
27 27
         if (!id) {
@@ -45,13 +45,13 @@  discard block
 block discarded – undo
45 45
         $('#previous').selectpicker('refresh');
46 46
     }
47 47
 " .
48
-"\n" .
49
-'$().ready(function() {'."\n" .
50
-  'if ($(\'#previous\')) {'."\n" .
48
+"\n".
49
+'$().ready(function() {'."\n".
50
+  'if ($(\'#previous\')) {'."\n".
51 51
     'if(\'parent is\'+$(\'#idParent\').val()) {'.
52
-      'load_cbo($(\'#idParent\').val());'."\n" .
53
-  '}}'."\n" .
54
-'});</script>'."\n" ;
52
+      'load_cbo($(\'#idParent\').val());'."\n".
53
+  '}}'."\n".
54
+'});</script>'."\n";
55 55
 
56 56
 /* Constants and variables */
57 57
 
@@ -90,11 +90,11 @@  discard block
 block discarded – undo
90 90
 /* SHOWING THE ADMIN TOOLS */
91 91
 
92 92
 if (isset($_SESSION['gradebook'])) {
93
-    $gradebook=	$_SESSION['gradebook'];
93
+    $gradebook = $_SESSION['gradebook'];
94 94
 }
95 95
 
96 96
 if (!empty($gradebook) && $gradebook == 'view') {
97
-    $interbreadcrumb[] = array (
97
+    $interbreadcrumb[] = array(
98 98
         'url' => '../gradebook/'.$_SESSION['gradebook_dest'],
99 99
         'name' => get_lang('ToolGradebook')
100 100
     );
Please login to merge, or discard this patch.
main/lp/scorm.class.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
                 $path = '';
394 394
                 $type = 'dir';
395 395
                 if (isset($this->resources[$item['identifierref']])) {
396
-                    $oRes =& $this->resources[$item['identifierref']];
396
+                    $oRes = & $this->resources[$item['identifierref']];
397 397
                     $path = @$oRes->get_path();
398 398
                     if (!empty($path)) {
399 399
                         $temptype = $oRes->get_scorm_type();
@@ -444,7 +444,7 @@  discard block
 block discarded – undo
444 444
                 $item['parameters'] = Database::escape_string($item['parameters']);
445 445
 
446 446
                 $sql = "INSERT INTO $new_lp_item (c_id, lp_id,item_type,ref,title, path,min_score,max_score, $field_add parent_item_id,previous_item_id,next_item_id, prerequisite,display_order,launch_data, parameters)
447
-                        VALUES ($courseId, $lp_id, '$type', '$identifier', '$title', '$path' , 0, $max_score, $value_add $parent, $previous, 0, '$prereq', ".$item['rel_order'] .", '".$item['datafromlms']."', '".$item['parameters']."' )";
447
+                        VALUES ($courseId, $lp_id, '$type', '$identifier', '$title', '$path' , 0, $max_score, $value_add $parent, $previous, 0, '$prereq', ".$item['rel_order'].", '".$item['datafromlms']."', '".$item['parameters']."' )";
448 448
 
449 449
                 Database::query($sql);
450 450
                 if ($this->debug > 1) { error_log('New LP - In import_manifest(), inserting item : '.$sql, 0); }
@@ -478,7 +478,7 @@  discard block
 block discarded – undo
478 478
                     foreach ($specific_fields as $specific_field) {
479 479
                         if (isset($_REQUEST[$specific_field['code']])) {
480 480
                             $sterms = trim($_REQUEST[$specific_field['code']]);
481
-                            $all_specific_terms .= ' '. $sterms;
481
+                            $all_specific_terms .= ' '.$sterms;
482 482
                             if (!empty($sterms)) {
483 483
                                 $sterms = explode(',', $sterms);
484 484
                                 foreach ($sterms as $sterm) {
@@ -487,7 +487,7 @@  discard block
 block discarded – undo
487 487
                             }
488 488
                         }
489 489
                     }
490
-                    $body_to_index = $all_specific_terms .' '. $title;
490
+                    $body_to_index = $all_specific_terms.' '.$title;
491 491
                     $ic_slide->addValue("content", $body_to_index);
492 492
                     // TODO: Add a comment to say terms separated by commas.
493 493
                     $courseid = api_get_course_id();
@@ -497,7 +497,7 @@  discard block
 block discarded – undo
497 497
                         SE_COURSE_ID => $courseid,
498 498
                         SE_TOOL_ID => TOOL_LEARNPATH,
499 499
                         SE_DATA => array('lp_id' => $lp_id, 'lp_item'=> $previous, 'document_id' => ''), // TODO: Unify with other lp types.
500
-                        SE_USER => (int)api_get_user_id(),
500
+                        SE_USER => (int) api_get_user_id(),
501 501
                     );
502 502
                     $ic_slide->xapian_data = serialize($xapian_data);
503 503
                     $di->addChunk($ic_slide);
@@ -543,7 +543,7 @@  discard block
 block discarded – undo
543 543
     public function import_package($zip_file_info, $current_dir = '', $courseInfo = array())
544 544
     {
545 545
         if ($this->debug > 0) {
546
-            error_log('In scorm::import_package('.print_r($zip_file_info,true).',"'.$current_dir.'") method', 0);
546
+            error_log('In scorm::import_package('.print_r($zip_file_info, true).',"'.$current_dir.'") method', 0);
547 547
         }
548 548
 
549 549
         $courseInfo = empty($courseInfo) ? api_get_course_info() : $courseInfo;
@@ -554,7 +554,7 @@  discard block
 block discarded – undo
554 554
         $zip_file_name = $zip_file_info['name'];
555 555
 
556 556
         if ($this->debug > 1) {
557
-            error_log('New LP - import_package() - zip file path = ' . $zip_file_path . ', zip file name = ' . $zip_file_name, 0);
557
+            error_log('New LP - import_package() - zip file path = '.$zip_file_path.', zip file name = '.$zip_file_name, 0);
558 558
         }
559 559
 
560 560
         $course_rel_dir = api_get_course_path($courseInfo['code']).'/scorm'; // scorm dir web path starting from /courses
@@ -562,7 +562,7 @@  discard block
 block discarded – undo
562 562
         $current_dir = api_replace_dangerous_char(trim($current_dir)); // Current dir we are in, inside scorm/
563 563
 
564 564
         if ($this->debug > 1) {
565
-            error_log( 'New LP - import_package() - current_dir = ' . $current_dir, 0);
565
+            error_log('New LP - import_package() - current_dir = '.$current_dir, 0);
566 566
         }
567 567
 
568 568
         // Get name of the zip file without the extension.
@@ -570,7 +570,7 @@  discard block
 block discarded – undo
570 570
         $file_info = pathinfo($zip_file_name);
571 571
         $filename = $file_info['basename'];
572 572
         $extension = $file_info['extension'];
573
-        $file_base_name = str_replace('.'.$extension,'',$filename); // Filename without its extension.
573
+        $file_base_name = str_replace('.'.$extension, '', $filename); // Filename without its extension.
574 574
         $this->zipname = $file_base_name; // Save for later in case we don't have a title.
575 575
 
576 576
         if ($this->debug > 1) { error_log("New LP - base file name is : ".$file_base_name, 0); }
@@ -616,7 +616,7 @@  discard block
 block discarded – undo
616 616
         $slash_count = substr_count($shortest_path, '/');
617 617
         foreach ($manifest_list as $manifest_path) {
618 618
             $tmp_slash_count = substr_count($manifest_path, '/');
619
-            if ($tmp_slash_count<$slash_count) {
619
+            if ($tmp_slash_count < $slash_count) {
620 620
                 $shortest_path = $manifest_path;
621 621
                 $slash_count = $tmp_slash_count;
622 622
             }
@@ -625,7 +625,7 @@  discard block
 block discarded – undo
625 625
         $this->subdir .= '/'.dirname($shortest_path); // Do not concatenate because already done above.
626 626
         $manifest = $shortest_path;
627 627
         if ($this->debug > 1) { error_log('New LP - Package type is now '.$package_type, 0); }
628
-        if ($package_type== '') {
628
+        if ($package_type == '') {
629 629
             // && defined('CHECK_FOR_SCORM') && CHECK_FOR_SCORM)
630 630
             if ($this->debug > 1) { error_log('New LP - Package type is empty', 0); }
631 631
             return api_failure::set_failure('not_scorm_content');
@@ -641,8 +641,8 @@  discard block
 block discarded – undo
641 641
             $new_dir = '/'.$new_dir;
642 642
         }
643 643
 
644
-        if ($new_dir[strlen($new_dir)-1] == '/') {
645
-            $new_dir = substr($new_dir,0,-1);
644
+        if ($new_dir[strlen($new_dir) - 1] == '/') {
645
+            $new_dir = substr($new_dir, 0, -1);
646 646
         }
647 647
 
648 648
         /* Uncompressing phase */
@@ -683,7 +683,7 @@  discard block
 block discarded – undo
683 683
                     if ($file != '.' && $file != '..') {
684 684
                         $filetype = 'file';
685 685
 
686
-                        if (is_dir($course_sys_dir . $new_dir . $file)) {
686
+                        if (is_dir($course_sys_dir.$new_dir.$file)) {
687 687
                             $filetype = 'folder';
688 688
                         }
689 689
 
@@ -712,7 +712,7 @@  discard block
 block discarded – undo
712 712
                                     }
713 713
                                 }
714 714
                             }
715
-                            @rename($course_sys_dir.$new_dir.$file,$course_sys_dir.$new_dir.$safe_file);
715
+                            @rename($course_sys_dir.$new_dir.$file, $course_sys_dir.$new_dir.$safe_file);
716 716
                             if ($this->debug >= 1) { error_log('New LP - Renaming '.$course_sys_dir.$new_dir.$file.' to '.$course_sys_dir.$new_dir.$safe_file, 0); }
717 717
                         }
718 718
                     }
@@ -901,7 +901,7 @@  discard block
 block discarded – undo
901 901
         if ($this->debug > 0) { error_log('In scorm::get_res_path('.$id.') method', 0); }
902 902
         $path = '';
903 903
         if (isset($this->resources[$id])) {
904
-            $oRes =& $this->resources[$id];
904
+            $oRes = & $this->resources[$id];
905 905
             $path = @$oRes->get_path();
906 906
         }
907 907
         return $path;
@@ -917,7 +917,7 @@  discard block
 block discarded – undo
917 917
         if ($this->debug > 0) { error_log('In scorm::get_res_type('.$id.') method', 0); }
918 918
         $type = '';
919 919
         if (isset($this->resources[$id])) {
920
-            $oRes =& $this->resources[$id];
920
+            $oRes = & $this->resources[$id];
921 921
             $temptype = $oRes->get_scorm_type();
922 922
             if (!empty($temptype)) {
923 923
                 $type = $temptype;
@@ -936,9 +936,9 @@  discard block
 block discarded – undo
936 936
         $title = '';
937 937
         if (isset($this->manifest['organizations']['default'])) {
938 938
             $title = $this->organizations[$this->manifest['organizations']['default']]->get_name();
939
-        } elseif (count($this->organizations)==1) {
939
+        } elseif (count($this->organizations) == 1) {
940 940
             // This will only get one title but so we don't need to know the index.
941
-            foreach($this->organizations as $id => $value) {
941
+            foreach ($this->organizations as $id => $value) {
942 942
                 $title = $this->organizations[$id]->get_name();
943 943
                 break;
944 944
             }
Please login to merge, or discard this patch.
main/lp/scormResource.class.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@
 block discarded – undo
69 69
                         }
70 70
                     }
71 71
                     //$keep_href = '';
72
-                    if ($element->hasAttributes()){ //in some cases we get here with an empty attributes array
72
+                    if ($element->hasAttributes()) { //in some cases we get here with an empty attributes array
73 73
                         // TODO: Find when and why we get such a case (empty array).
74 74
                         $attributes = $element->attributes;
75 75
                         foreach ($attributes as $attrib) {
Please login to merge, or discard this patch.
main/lp/blank.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
 Display::display_reduced_header();
17 17
 
18 18
 if (isset($_GET['error'])) {
19
-    switch ($_GET['error']){
19
+    switch ($_GET['error']) {
20 20
         case 'document_deleted':
21 21
             echo '<br /><br />';
22 22
             Display::display_error_message(get_lang('DocumentHasBeenDeleted'));
Please login to merge, or discard this patch.
main/lp/lp_ajax_save_item.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
         // Set status to completed for hotpotatoes if score > 80%.
164 164
         if ($my_type == 'hotpotatoes') {
165 165
             if ((empty($status) || $status == 'undefined' || $status == 'not attempted') && $max > 0) {
166
-                if (($score/$max) > 0.8) {
166
+                if (($score / $max) > 0.8) {
167 167
                     $myStatus = 'completed';
168 168
                     if ($debug > 1) {
169 169
                         error_log('Calling set_status('.$myStatus.') for hotpotatoes', 0);
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
                         error_log('Done calling set_status for hotpotatoes - now '.$myLPI->get_status(false), 0);
175 175
                     }
176 176
                 }
177
-            } elseif ($status == 'completed' && $max > 0 && ($score/$max) < 0.8) {
177
+            } elseif ($status == 'completed' && $max > 0 && ($score / $max) < 0.8) {
178 178
                 $myStatus = 'failed';
179 179
                 if ($debug > 1) {
180 180
                     error_log('Calling set_status('.$myStatus.') for hotpotatoes', 0);
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
             $myLPI->current_data = $suspend;
368 368
         }
369 369
 
370
-        if (isset($location) && $location != '' && $location!='undefined') {
370
+        if (isset($location) && $location != '' && $location != 'undefined') {
371 371
             $myLPI->set_lesson_location($location);
372 372
         }
373 373
 
Please login to merge, or discard this patch.
main/lp/lp_final_item.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
8 8
 // Initialize context
9 9
 $_in_course = true;
10 10
 
11
-require_once __DIR__ . '/../inc/global.inc.php';
11
+require_once __DIR__.'/../inc/global.inc.php';
12 12
 
13 13
 $current_course_tool = TOOL_GRADEBOOK;
14 14
 
@@ -170,19 +170,19 @@  discard block
 block discarded – undo
170 170
                 <div class='row'>
171 171
                     <div class='col-md-2 col-xs-4'>
172 172
                         <div class='thumbnail'>
173
-                          <img class='skill-badge-img' src='" . $skill->getWebIconPath() . "' >
173
+                          <img class='skill-badge-img' src='" . $skill->getWebIconPath()."' >
174 174
                         </div>
175 175
                     </div>
176 176
                     <div class='col-md-8 col-xs-8'>
177
-                        <h5><b>" . $skill->getName() . "</b></h5>
178
-                        " . $skill->getDescription() . "
177
+                        <h5><b>" . $skill->getName()."</b></h5>
178
+                        " . $skill->getDescription()."
179 179
                     </div>
180 180
                     <div class='col-md-2 col-xs-12'>
181
-                        <h5><b>" . get_lang('ShareWithYourFriends') . "</b></h5>
182
-                        <a href='http://www.facebook.com/sharer.php?u=" . api_get_path(WEB_PATH) . "badge/" . $skill->getId() . "/user/" . $userId . "' target='_new'>
181
+                        <h5><b>" . get_lang('ShareWithYourFriends')."</b></h5>
182
+                        <a href='http://www.facebook.com/sharer.php?u=" . api_get_path(WEB_PATH)."badge/".$skill->getId()."/user/".$userId."' target='_new'>
183 183
                             <em class='fa fa-facebook-square fa-3x text-info' aria-hidden='true'></em>
184 184
                         </a>
185
-                        <a href='https://twitter.com/home?status=" . sprintf(get_lang('IHaveObtainedSkillXOnY'), '"' . $skill->getName() . '"', api_get_setting('siteName')) . ' - ' . api_get_path(WEB_PATH) . 'badge/' . $skill->getId() . '/user/' . $userId . "' target='_new'>
185
+                        <a href='https://twitter.com/home?status=" . sprintf(get_lang('IHaveObtainedSkillXOnY'), '"'.$skill->getName().'"', api_get_setting('siteName')).' - '.api_get_path(WEB_PATH).'badge/'.$skill->getId().'/user/'.$userId."' target='_new'>
186 186
                             <em class='fa fa-twitter-square fa-3x text-light' aria-hidden='true'></em>
187 187
                         </a>
188 188
                     </div>
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
         $badgeLink .= "
193 193
             <div class='panel panel-default'>
194 194
                 <div class='panel-body'>
195
-                    <h3 class='text-center'>" . get_lang('AdditionallyYouHaveObtainedTheFollowingSkills') . "</h3>
195
+                    <h3 class='text-center'>" . get_lang('AdditionallyYouHaveObtainedTheFollowingSkills')."</h3>
196 196
                     $skillList
197 197
                 </div>
198 198
             </div>
@@ -209,7 +209,7 @@  discard block
 block discarded – undo
209 209
 function generateLPFinalItemTemplateCertificateLinks($certificate)
210 210
 {
211 211
     $downloadCertificateLink = Display::url(
212
-        Display::returnFontAwesomeIcon('file-pdf-o') . get_lang('DownloadCertificatePdf'),
212
+        Display::returnFontAwesomeIcon('file-pdf-o').get_lang('DownloadCertificatePdf'),
213 213
         $certificate['pdf_url'],
214 214
         ['class' => 'btn btn-default']
215 215
     );
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
     $downloadCertificateLink = "
218 218
         <div class='panel panel-default'>
219 219
             <div class='panel-body'>
220
-                <h3 class='text-center'>" . get_lang('NowDownloadYourCertificateClickHere') . "</h3>
220
+                <h3 class='text-center'>" . get_lang('NowDownloadYourCertificateClickHere')."</h3>
221 221
                 <div class='text-center'>$downloadCertificateLink $viewCertificateLink</div>
222 222
             </div>
223 223
         </div>
Please login to merge, or discard this patch.
main/lp/scorm_api.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 
26 26
 require_once '../inc/global.inc.php';
27 27
 
28
-$file   = (empty($_SESSION['file'])?'':$_SESSION['file']);
28
+$file = (empty($_SESSION['file']) ? '' : $_SESSION['file']);
29 29
 /** @var learnpath $oLP */
30 30
 $oLP = unserialize($_SESSION['lpobject']);
31 31
 /** @var learnpathItem $oItem */
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 
42 42
 header('Content-type: text/javascript');
43 43
 
44
-?>var scorm_logs=<?php echo ((empty($oLP->scorm_debug) or (!api_is_course_admin() && !api_is_platform_admin()) )?'0':'3');?>; //debug log level for SCORM. 0 = none, 1=light, 2=a lot, 3=all - displays logs in log frame
44
+?>var scorm_logs=<?php echo ((empty($oLP->scorm_debug) or (!api_is_course_admin() && !api_is_platform_admin())) ? '0' : '3'); ?>; //debug log level for SCORM. 0 = none, 1=light, 2=a lot, 3=all - displays logs in log frame
45 45
 var lms_logs = 0; //debug log level for LMS actions. 0=none, 1=light, 2=a lot, 3=all
46 46
 
47 47
 // API Object initialization (eases access later on)
@@ -144,25 +144,25 @@  discard block
 block discarded – undo
144 144
 olms.statusSignalReceived = 0;
145 145
 
146 146
 // Strictly scorm variables
147
-olms.score=<?php echo $oItem->get_score();?>;
148
-olms.max='<?php echo $oItem->get_max();?>';
149
-olms.min='<?php echo $oItem->get_min();?>';
150
-olms.lesson_status='<?php echo $oItem->get_status();?>';
151
-olms.session_time='<?php echo $oItem->get_scorm_time('js');?>';
152
-olms.suspend_data = '<?php echo $oItem->get_suspend_data();?>';
153
-olms.lesson_location = '<?php echo $oItem->get_lesson_location();?>';
154
-olms.total_time = '<?php echo $oItem->get_scorm_time('js');?>';
155
-olms.mastery_score = '<?php echo $oItem->get_mastery_score();?>';
147
+olms.score=<?php echo $oItem->get_score(); ?>;
148
+olms.max='<?php echo $oItem->get_max(); ?>';
149
+olms.min='<?php echo $oItem->get_min(); ?>';
150
+olms.lesson_status='<?php echo $oItem->get_status(); ?>';
151
+olms.session_time='<?php echo $oItem->get_scorm_time('js'); ?>';
152
+olms.suspend_data = '<?php echo $oItem->get_suspend_data(); ?>';
153
+olms.lesson_location = '<?php echo $oItem->get_lesson_location(); ?>';
154
+olms.total_time = '<?php echo $oItem->get_scorm_time('js'); ?>';
155
+olms.mastery_score = '<?php echo $oItem->get_mastery_score(); ?>';
156 156
 olms.launch_data = '<?php echo $oItem->get_launch_data(); ?>';
157
-olms.max_time_allowed = '<?php echo $oItem->get_max_time_allowed();?>';
158
-olms.interactions = new Array(<?php echo $oItem->get_interactions_js_array();?>);
157
+olms.max_time_allowed = '<?php echo $oItem->get_max_time_allowed(); ?>';
158
+olms.interactions = new Array(<?php echo $oItem->get_interactions_js_array(); ?>);
159 159
 olms.item_objectives = new Array();
160 160
 olms.info_lms_item = new Array();
161 161
 
162 162
 // Chamilo internal variables (not SCORM)
163 163
 // olms.saved_lesson_status = 'not attempted';
164
-olms.lms_lp_id = <?php echo $oLP->get_id();?>;
165
-olms.lms_item_id = <?php echo $oItem->get_id();?>;
164
+olms.lms_lp_id = <?php echo $oLP->get_id(); ?>;
165
+olms.lms_item_id = <?php echo $oItem->get_id(); ?>;
166 166
 olms.lms_initialized = 0;
167 167
 // switch_finished indicates if the switch process is finished (if it has gone
168 168
 // through LMSInitialize() for the new item. Until then, all LMSSetValue()
@@ -171,26 +171,26 @@  discard block
 block discarded – undo
171 171
 olms.switch_finished = 0;
172 172
 
173 173
 //olms.lms_total_lessons = <?php echo $oLP->get_total_items_count(); ?>;
174
-//olms.lms_complete_lessons = <?php echo $oLP->get_complete_items_count();?>;
175
-//olms.lms_progress_bar_mode = '<?php echo $oLP->progress_bar_mode;?>';
174
+//olms.lms_complete_lessons = <?php echo $oLP->get_complete_items_count(); ?>;
175
+//olms.lms_progress_bar_mode = '<?php echo $oLP->progress_bar_mode; ?>';
176 176
 //if(lms_progress_bar_mode == ''){lms_progress_bar_mode='%';}
177 177
 
178
-olms.lms_view_id = '<?php echo $oLP->get_view();?>';
178
+olms.lms_view_id = '<?php echo $oLP->get_view(); ?>';
179 179
 if(olms.lms_view_id == ''){ olms.lms_view_id = 1;}
180
-olms.lms_user_id = '<?php echo $userId;?>';
181
-olms.lms_next_item = '<?php echo $oLP->get_next_item_id();?>';
182
-olms.lms_previous_item = '<?php echo $oLP->get_previous_item_id();?>';
183
-olms.lms_lp_type = '<?php echo $oLP->get_type();?>';
184
-olms.lms_item_type = '<?php echo $oItem->get_type();?>';
185
-olms.lms_item_credit = '<?php echo $oItem->get_credit();?>';
186
-olms.lms_item_lesson_mode = '<?php echo $oItem->get_lesson_mode();?>';
187
-olms.lms_item_launch_data = '<?php echo addslashes($oItem->get_launch_data());?>';
188
-olms.lms_item_core_exit = '<?php echo $oItem->get_core_exit();?>';
180
+olms.lms_user_id = '<?php echo $userId; ?>';
181
+olms.lms_next_item = '<?php echo $oLP->get_next_item_id(); ?>';
182
+olms.lms_previous_item = '<?php echo $oLP->get_previous_item_id(); ?>';
183
+olms.lms_lp_type = '<?php echo $oLP->get_type(); ?>';
184
+olms.lms_item_type = '<?php echo $oItem->get_type(); ?>';
185
+olms.lms_item_credit = '<?php echo $oItem->get_credit(); ?>';
186
+olms.lms_item_lesson_mode = '<?php echo $oItem->get_lesson_mode(); ?>';
187
+olms.lms_item_launch_data = '<?php echo addslashes($oItem->get_launch_data()); ?>';
188
+olms.lms_item_core_exit = '<?php echo $oItem->get_core_exit(); ?>';
189 189
 olms.lms_course_id = '<?php echo $oLP->get_course_int_id(); ?>';
190 190
 olms.lms_session_id = '<?php echo api_get_session_id(); ?>';
191 191
 olms.lms_course_code = '<?php echo $oLP->getCourseCode(); ?>';
192 192
 olms.lms_course_id =  '<?php echo $oLP->get_course_int_id(); ?>';
193
-<?php echo $oLP->get_items_details_as_js('olms.lms_item_types');?>
193
+<?php echo $oLP->get_items_details_as_js('olms.lms_item_types'); ?>
194 194
 
195 195
 // Following definition of cmi.core.score.raw in SCORM 1.2, "LMS should
196 196
 // initialize this to an empty string ("") upon initial launch of a SCO. The
@@ -227,8 +227,8 @@  discard block
 block discarded – undo
227 227
     logit_scorm('Other SCORM calls are shown in orange.', 1);
228 228
     logit_lms('To add new messages to these logs, use logit_lms() or logit_scorm().');
229 229
 
230
-    olms.info_lms_item[0] = '<?php echo $oItem->get_id();?>';
231
-    olms.info_lms_item[1] = '<?php echo $oItem->get_id();?>';
230
+    olms.info_lms_item[0] = '<?php echo $oItem->get_id(); ?>';
231
+    olms.info_lms_item[1] = '<?php echo $oItem->get_id(); ?>';
232 232
 
233 233
     $("#content_id").load(function() {
234 234
         logit_lms('#content_id load event starts');
@@ -499,7 +499,7 @@  discard block
 block discarded – undo
499 499
         result = 'id,score,status';
500 500
     } else if(param == 'cmi.objectives._count'){
501 501
     // ---- cmi.objectives._count
502
-        //result='<?php echo $oItem->get_view_count();?>';
502
+        //result='<?php echo $oItem->get_view_count(); ?>';
503 503
         result = olms.item_objectives.length;
504 504
     } else if(param.substring(0,15)== 'cmi.objectives.'){
505 505
         var myres = '';
Please login to merge, or discard this patch.
main/lp/lp_ajax_initialize.php 1 patch
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -101,21 +101,21 @@  discard block
 block discarded – undo
101 101
 	$myobjectives = json_encode($phpobjectives);
102 102
 
103 103
     $return .=
104
-            "olms.score=".$myscore.";" .
105
-            "olms.max=".$mymax.";" .
106
-            "olms.min=".$mymin.";" .
107
-            "olms.lesson_status='".$mylesson_status."';" .
108
-            "olms.lesson_location='".$mylesson_location."';" .
109
-            "olms.session_time='".$mysession_time."';" .
110
-            "olms.suspend_data='".$mysuspend_data."';" .
111
-            "olms.total_time = '".$mytotal_time."';" .
112
-            "olms.mastery_score = '".$mymastery_score."';" .
113
-            "olms.max_time_allowed = '".$mymax_time_allowed."';" .
114
-            "olms.launch_data = '".$mylaunch_data."';" .
115
-            "olms.interactions = new Array(".$myistring.");" .
104
+            "olms.score=".$myscore.";".
105
+            "olms.max=".$mymax.";".
106
+            "olms.min=".$mymin.";".
107
+            "olms.lesson_status='".$mylesson_status."';".
108
+            "olms.lesson_location='".$mylesson_location."';".
109
+            "olms.session_time='".$mysession_time."';".
110
+            "olms.suspend_data='".$mysuspend_data."';".
111
+            "olms.total_time = '".$mytotal_time."';".
112
+            "olms.mastery_score = '".$mymastery_score."';".
113
+            "olms.max_time_allowed = '".$mymax_time_allowed."';".
114
+            "olms.launch_data = '".$mylaunch_data."';".
115
+            "olms.interactions = new Array(".$myistring.");".
116 116
             //"olms.item_objectives = new Array();" .
117
-            "olms.item_objectives = ".$myobjectives.";" .
118
-            "olms.G_lastError = 0;" .
117
+            "olms.item_objectives = ".$myobjectives.";".
118
+            "olms.G_lastError = 0;".
119 119
             "olms.G_LastErrorMessage = 'No error';".
120 120
             "olms.finishSignalReceived = 0;";
121 121
     /*
@@ -144,22 +144,22 @@  discard block
 block discarded – undo
144 144
     $mycore_exit = $mylpi->get_core_exit();
145 145
 
146 146
     $return .=
147
-            "olms.lms_lp_id=".$lp_id.";" .
148
-            "olms.lms_item_id=".$next_item.";" .
149
-            "olms.lms_old_item_id=0;" .
150
-            "olms.lms_initialized=0;" .
151
-            "olms.lms_view_id=".$view_id.";" .
152
-            "olms.lms_user_id=".$user_id.";" .
153
-            "olms.next_item=".$next_item.";" . // This one is very important to replace possible literal strings.
154
-            "olms.lms_next_item=".$mynext.";" .
155
-            "olms.lms_previous_item=".$myprevious.";" .
156
-            "olms.lms_item_type = '".$myitemtype."';" .
157
-            "olms.lms_item_credit = '".$mycredit."';" .
158
-            "olms.lms_item_lesson_mode = '".$mylesson_mode."';" .
159
-            "olms.lms_item_launch_data = '".$mylaunch_data."';" .
160
-            "olms.lms_item_interactions_count = '".$myinteractions_count."';" .
161
-            "olms.lms_item_objectives_count = '".$myinteractions_count."';" .
162
-            "olms.lms_item_core_exit = '".$mycore_exit."';" .
147
+            "olms.lms_lp_id=".$lp_id.";".
148
+            "olms.lms_item_id=".$next_item.";".
149
+            "olms.lms_old_item_id=0;".
150
+            "olms.lms_initialized=0;".
151
+            "olms.lms_view_id=".$view_id.";".
152
+            "olms.lms_user_id=".$user_id.";".
153
+            "olms.next_item=".$next_item.";".// This one is very important to replace possible literal strings.
154
+            "olms.lms_next_item=".$mynext.";".
155
+            "olms.lms_previous_item=".$myprevious.";".
156
+            "olms.lms_item_type = '".$myitemtype."';".
157
+            "olms.lms_item_credit = '".$mycredit."';".
158
+            "olms.lms_item_lesson_mode = '".$mylesson_mode."';".
159
+            "olms.lms_item_launch_data = '".$mylaunch_data."';".
160
+            "olms.lms_item_interactions_count = '".$myinteractions_count."';".
161
+            "olms.lms_item_objectives_count = '".$myinteractions_count."';".
162
+            "olms.lms_item_core_exit = '".$mycore_exit."';".
163 163
             "olms.asset_timer = 0;";
164 164
 
165 165
     $mylp->set_error_msg('');
Please login to merge, or discard this patch.