@@ -199,13 +199,13 @@ discard block |
||
199 | 199 | $res = Database::query($sql); |
200 | 200 | if (Database::num_rows($res) > 0) { |
201 | 201 | $se_ref = Database::fetch_array($res); |
202 | - $this->search_did = (int)$se_ref['search_did']; |
|
202 | + $this->search_did = (int) $se_ref['search_did']; |
|
203 | 203 | } |
204 | 204 | } |
205 | 205 | $this->audio = $row['audio']; |
206 | 206 | if (self::debug > 0) { |
207 | 207 | error_log( |
208 | - 'New LP - End of learnpathItem constructor for item ' . $id, |
|
208 | + 'New LP - End of learnpathItem constructor for item '.$id, |
|
209 | 209 | 0 |
210 | 210 | ); |
211 | 211 | } |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | public function delete() |
315 | 315 | { |
316 | 316 | if (self::debug > 0) { |
317 | - error_log('learnpath_item::delete() for item ' . $this->db_id, 0); |
|
317 | + error_log('learnpath_item::delete() for item '.$this->db_id, 0); |
|
318 | 318 | } |
319 | 319 | $lp_item_view = Database::get_course_table(TABLE_LP_ITEM_VIEW); |
320 | 320 | $lp_item = Database::get_course_table(TABLE_LP_ITEM); |
@@ -322,29 +322,29 @@ discard block |
||
322 | 322 | $course_id = api_get_course_int_id(); |
323 | 323 | |
324 | 324 | $sql = "DELETE FROM $lp_item_view |
325 | - WHERE c_id = $course_id AND lp_item_id = " . $this->db_id; |
|
325 | + WHERE c_id = $course_id AND lp_item_id = ".$this->db_id; |
|
326 | 326 | if (self::debug > 0) { |
327 | - error_log('Deleting from lp_item_view: ' . $sql, 0); |
|
327 | + error_log('Deleting from lp_item_view: '.$sql, 0); |
|
328 | 328 | } |
329 | 329 | Database::query($sql); |
330 | 330 | |
331 | 331 | $sql = "SELECT * FROM $lp_item |
332 | - WHERE c_id = $course_id AND id = " . $this->db_id; |
|
332 | + WHERE c_id = $course_id AND id = ".$this->db_id; |
|
333 | 333 | $res_sel = Database::query($sql); |
334 | 334 | if (Database::num_rows($res_sel) < 1) { |
335 | 335 | return false; |
336 | 336 | } |
337 | 337 | |
338 | 338 | $sql = "DELETE FROM $lp_item |
339 | - WHERE c_id = $course_id AND id = " . $this->db_id; |
|
339 | + WHERE c_id = $course_id AND id = ".$this->db_id; |
|
340 | 340 | Database::query($sql); |
341 | 341 | if (self::debug > 0) { |
342 | - error_log('Deleting from lp_item: ' . $sql); |
|
342 | + error_log('Deleting from lp_item: '.$sql); |
|
343 | 343 | } |
344 | 344 | |
345 | 345 | if (api_get_setting('search_enabled') == 'true') { |
346 | 346 | if (!is_null($this->search_did)) { |
347 | - require_once api_get_path(LIBRARY_PATH) . 'search/ChamiloIndexer.class.php'; |
|
347 | + require_once api_get_path(LIBRARY_PATH).'search/ChamiloIndexer.class.php'; |
|
348 | 348 | $di = new ChamiloIndexer(); |
349 | 349 | $di->remove_document($this->search_did); |
350 | 350 | } |
@@ -380,7 +380,7 @@ discard block |
||
380 | 380 | { |
381 | 381 | if (self::debug > 0) { |
382 | 382 | error_log( |
383 | - 'learnpathItem::get_attempt_id() on item ' . $this->db_id, |
|
383 | + 'learnpathItem::get_attempt_id() on item '.$this->db_id, |
|
384 | 384 | 0 |
385 | 385 | ); |
386 | 386 | } |
@@ -390,8 +390,8 @@ discard block |
||
390 | 390 | } |
391 | 391 | if (self::debug > 0) { |
392 | 392 | error_log( |
393 | - 'New LP - End of learnpathItem::get_attempt_id() on item ' . |
|
394 | - $this->db_id . ' - Returning ' . $res, |
|
393 | + 'New LP - End of learnpathItem::get_attempt_id() on item '. |
|
394 | + $this->db_id.' - Returning '.$res, |
|
395 | 395 | 0 |
396 | 396 | ); |
397 | 397 | } |
@@ -453,12 +453,12 @@ discard block |
||
453 | 453 | if (self::debug > 2) { |
454 | 454 | error_log( |
455 | 455 | 'learnpathItem::get_credit() - get_prevent_reinit!=0 and '. |
456 | - 'status is ' . $status, |
|
456 | + 'status is '.$status, |
|
457 | 457 | 0 |
458 | 458 | ); |
459 | 459 | } |
460 | 460 | //0=not attempted - 1 = incomplete |
461 | - if ($status != $this->possible_status[0]&& |
|
461 | + if ($status != $this->possible_status[0] && |
|
462 | 462 | $status != $this->possible_status[1] |
463 | 463 | ) { |
464 | 464 | $credit = 'no-credit'; |
@@ -530,13 +530,13 @@ discard block |
||
530 | 530 | case TOOL_DOCUMENT: |
531 | 531 | $table_doc = Database::get_course_table(TABLE_DOCUMENT); |
532 | 532 | $sql = 'SELECT path |
533 | - FROM ' . $table_doc . ' |
|
533 | + FROM ' . $table_doc.' |
|
534 | 534 | WHERE |
535 | - c_id = ' . $course_id . ' AND |
|
535 | + c_id = ' . $course_id.' AND |
|
536 | 536 | id = ' . $path; |
537 | 537 | $res = Database::query($sql); |
538 | 538 | $row = Database::fetch_array($res); |
539 | - $real_path = 'document' . $row['path']; |
|
539 | + $real_path = 'document'.$row['path']; |
|
540 | 540 | return $real_path; |
541 | 541 | case TOOL_STUDENTPUBLICATION: |
542 | 542 | case TOOL_QUIZ: |
@@ -548,7 +548,7 @@ discard block |
||
548 | 548 | } |
549 | 549 | } else { |
550 | 550 | if (!empty($path_to_scorm_dir)) { |
551 | - $path = $path_to_scorm_dir . $path; |
|
551 | + $path = $path_to_scorm_dir.$path; |
|
552 | 552 | } |
553 | 553 | return $path; |
554 | 554 | } |
@@ -584,8 +584,8 @@ discard block |
||
584 | 584 | $sql = "SELECT id FROM $tbl |
585 | 585 | WHERE |
586 | 586 | c_id = $course_id AND |
587 | - lp_item_id = " . $this->db_id . " AND |
|
588 | - lp_view_id = " . $this->view_id . " AND |
|
587 | + lp_item_id = ".$this->db_id." AND |
|
588 | + lp_view_id = " . $this->view_id." AND |
|
589 | 589 | view_count = " . $this->attempt_id; |
590 | 590 | $res = Database::query($sql); |
591 | 591 | if (Database::num_rows($res) > 0) { |
@@ -628,8 +628,8 @@ discard block |
||
628 | 628 | $sql = "SELECT id FROM $tbl |
629 | 629 | WHERE |
630 | 630 | c_id = $course_id AND |
631 | - lp_item_id = " . $this->db_id . " AND |
|
632 | - lp_view_id = " . $this->view_id ." AND |
|
631 | + lp_item_id = ".$this->db_id." AND |
|
632 | + lp_view_id = " . $this->view_id." AND |
|
633 | 633 | view_count = " . $this->get_attempt_id(); |
634 | 634 | $res = Database::query($sql); |
635 | 635 | if (Database::num_rows($res) > 0) { |
@@ -669,13 +669,13 @@ discard block |
||
669 | 669 | foreach ($this->interactions as $id => $in) { |
670 | 670 | $return .= "[ |
671 | 671 | '$id', |
672 | - '" . $in[1] . "', |
|
673 | - '" . $in[2] . "', |
|
674 | - '" . $in[3] . "', |
|
675 | - '" . $in[4] . "', |
|
676 | - '" . $in[5] . "', |
|
677 | - '" . $in[6] . "', |
|
678 | - '" . $in[7] . "'],"; |
|
672 | + '".$in[1]."', |
|
673 | + '" . $in[2]."', |
|
674 | + '" . $in[3]."', |
|
675 | + '" . $in[4]."', |
|
676 | + '" . $in[5]."', |
|
677 | + '" . $in[6]."', |
|
678 | + '" . $in[7]."'],"; |
|
679 | 679 | } |
680 | 680 | if (!empty($return)) { |
681 | 681 | $return = substr($return, 0, -1); |
@@ -917,7 +917,7 @@ discard block |
||
917 | 917 | $table = Database::get_course_table(TABLE_LP_MAIN); |
918 | 918 | $sql = "SELECT prevent_reinit |
919 | 919 | FROM $table |
920 | - WHERE c_id = $course_id AND id = " . $this->lp_id; |
|
920 | + WHERE c_id = $course_id AND id = ".$this->lp_id; |
|
921 | 921 | $res = Database::query($sql); |
922 | 922 | if (Database::num_rows($res) < 1) { |
923 | 923 | $this->error = "Could not find parent learnpath in lp table"; |
@@ -939,7 +939,7 @@ discard block |
||
939 | 939 | } |
940 | 940 | if (self::debug > 2) { |
941 | 941 | error_log( |
942 | - 'New LP - End of learnpathItem::get_prevent_reinit() - Returned ' . $this->prevent_reinit, |
|
942 | + 'New LP - End of learnpathItem::get_prevent_reinit() - Returned '.$this->prevent_reinit, |
|
943 | 943 | 0 |
944 | 944 | ); |
945 | 945 | } |
@@ -964,7 +964,7 @@ discard block |
||
964 | 964 | $table = Database::get_course_table(TABLE_LP_MAIN); |
965 | 965 | $sql = "SELECT seriousgame_mode |
966 | 966 | FROM $table |
967 | - WHERE c_id = $course_id AND id = " . $this->lp_id; |
|
967 | + WHERE c_id = $course_id AND id = ".$this->lp_id; |
|
968 | 968 | $res = Database::query($sql); |
969 | 969 | if (Database::num_rows($res) < 1) { |
970 | 970 | $this->error = "Could not find parent learnpath in learnpath table"; |
@@ -985,7 +985,7 @@ discard block |
||
985 | 985 | } |
986 | 986 | if (self::debug > 2) { |
987 | 987 | error_log( |
988 | - 'New LP - End of learnpathItem::get_seriousgame_mode() - Returned ' . $this->seriousgame_mode, |
|
988 | + 'New LP - End of learnpathItem::get_seriousgame_mode() - Returned '.$this->seriousgame_mode, |
|
989 | 989 | 0 |
990 | 990 | ); |
991 | 991 | } |
@@ -1030,7 +1030,7 @@ discard block |
||
1030 | 1030 | } |
1031 | 1031 | if (!isset($abs_path)) { |
1032 | 1032 | $path = $this->get_file_path(); |
1033 | - $abs_path = api_get_path(SYS_COURSE_PATH) . api_get_course_path() . '/' . $path; |
|
1033 | + $abs_path = api_get_path(SYS_COURSE_PATH).api_get_course_path().'/'.$path; |
|
1034 | 1034 | } |
1035 | 1035 | |
1036 | 1036 | $files_list = array(); |
@@ -1305,7 +1305,7 @@ discard block |
||
1305 | 1305 | $abs_path |
1306 | 1306 | ); |
1307 | 1307 | $new_abs_path = realpath( |
1308 | - $dir . '/' . $second_part |
|
1308 | + $dir.'/'.$second_part |
|
1309 | 1309 | ); |
1310 | 1310 | $in_files_list[] = learnpathItem::get_resources_from_source( |
1311 | 1311 | TOOL_DOCUMENT, |
@@ -1343,7 +1343,7 @@ discard block |
||
1343 | 1343 | $abs_path |
1344 | 1344 | ); |
1345 | 1345 | $new_abs_path = realpath( |
1346 | - $dir . '/' . $second_part |
|
1346 | + $dir.'/'.$second_part |
|
1347 | 1347 | ); |
1348 | 1348 | $in_files_list[] = learnpathItem::get_resources_from_source( |
1349 | 1349 | TOOL_DOCUMENT, |
@@ -1450,7 +1450,7 @@ discard block |
||
1450 | 1450 | $abs_path |
1451 | 1451 | ); |
1452 | 1452 | $new_abs_path = realpath( |
1453 | - $dir . '/' . $source |
|
1453 | + $dir.'/'.$source |
|
1454 | 1454 | ); |
1455 | 1455 | $in_files_list[] = learnpathItem::get_resources_from_source( |
1456 | 1456 | TOOL_DOCUMENT, |
@@ -1488,7 +1488,7 @@ discard block |
||
1488 | 1488 | $abs_path |
1489 | 1489 | ); |
1490 | 1490 | $new_abs_path = realpath( |
1491 | - $dir . '/' . $source |
|
1491 | + $dir.'/'.$source |
|
1492 | 1492 | ); |
1493 | 1493 | $in_files_list[] = learnpathItem::get_resources_from_source( |
1494 | 1494 | TOOL_DOCUMENT, |
@@ -1572,7 +1572,7 @@ discard block |
||
1572 | 1572 | ); |
1573 | 1573 | $dir = dirname($abs_path); |
1574 | 1574 | $new_abs_path = realpath( |
1575 | - $dir . '/' . $source |
|
1575 | + $dir.'/'.$source |
|
1576 | 1576 | ); |
1577 | 1577 | $in_files_list[] = learnpathItem::get_resources_from_source( |
1578 | 1578 | TOOL_DOCUMENT, |
@@ -1617,7 +1617,7 @@ discard block |
||
1617 | 1617 | ); |
1618 | 1618 | $dir = dirname($abs_path); |
1619 | 1619 | $new_abs_path = realpath( |
1620 | - $dir . '/' . $source |
|
1620 | + $dir.'/'.$source |
|
1621 | 1621 | ); |
1622 | 1622 | $in_files_list[] = learnpathItem::get_resources_from_source( |
1623 | 1623 | TOOL_DOCUMENT, |
@@ -1677,7 +1677,7 @@ discard block |
||
1677 | 1677 | } |
1678 | 1678 | if (self::debug > 1) { |
1679 | 1679 | error_log( |
1680 | - 'New LP - Out of learnpathItem::get_score() - returning ' . $res, |
|
1680 | + 'New LP - Out of learnpathItem::get_score() - returning '.$res, |
|
1681 | 1681 | 0 |
1682 | 1682 | ); |
1683 | 1683 | } |
@@ -1697,7 +1697,7 @@ discard block |
||
1697 | 1697 | $course_id = api_get_course_int_id(); |
1698 | 1698 | $debug = self::debug; |
1699 | 1699 | if ($debug > 0) { |
1700 | - error_log('learnpathItem::get_status() on item ' . $this->db_id, 0); |
|
1700 | + error_log('learnpathItem::get_status() on item '.$this->db_id, 0); |
|
1701 | 1701 | } |
1702 | 1702 | if ($check_db) { |
1703 | 1703 | if ($debug > 2) { |
@@ -1708,12 +1708,12 @@ discard block |
||
1708 | 1708 | $sql = "SELECT status FROM $table |
1709 | 1709 | WHERE |
1710 | 1710 | c_id = $course_id AND |
1711 | - id = '" . $this->db_item_view_id . "' AND |
|
1712 | - view_count = '" . $this->get_attempt_id() . "'"; |
|
1711 | + id = '".$this->db_item_view_id."' AND |
|
1712 | + view_count = '" . $this->get_attempt_id()."'"; |
|
1713 | 1713 | |
1714 | 1714 | if ($debug > 2) { |
1715 | 1715 | error_log( |
1716 | - 'learnpathItem::get_status() - Checking DB: ' . $sql, |
|
1716 | + 'learnpathItem::get_status() - Checking DB: '.$sql, |
|
1717 | 1717 | 0 |
1718 | 1718 | ); |
1719 | 1719 | } |
@@ -1724,7 +1724,7 @@ discard block |
||
1724 | 1724 | if ($update_local) { |
1725 | 1725 | if ($debug > 2) { |
1726 | 1726 | error_log( |
1727 | - 'learnpathItem::set_status() :' . $row['status'], |
|
1727 | + 'learnpathItem::set_status() :'.$row['status'], |
|
1728 | 1728 | 0 |
1729 | 1729 | ); |
1730 | 1730 | } |
@@ -1732,7 +1732,7 @@ discard block |
||
1732 | 1732 | } |
1733 | 1733 | if ($debug > 2) { |
1734 | 1734 | error_log( |
1735 | - 'learnpathItem::get_status() - Returning db value ' . $row['status'], |
|
1735 | + 'learnpathItem::get_status() - Returning db value '.$row['status'], |
|
1736 | 1736 | 0 |
1737 | 1737 | ); |
1738 | 1738 | } |
@@ -1749,7 +1749,7 @@ discard block |
||
1749 | 1749 | if (!empty($this->status)) { |
1750 | 1750 | if ($debug > 2) { |
1751 | 1751 | error_log( |
1752 | - 'learnpathItem::get_status() - Returning attrib: ' . $this->status, |
|
1752 | + 'learnpathItem::get_status() - Returning attrib: '.$this->status, |
|
1753 | 1753 | 0 |
1754 | 1754 | ); |
1755 | 1755 | } |
@@ -1759,7 +1759,7 @@ discard block |
||
1759 | 1759 | |
1760 | 1760 | if ($debug > 2) { |
1761 | 1761 | error_log( |
1762 | - 'learnpathItem::get_status() - Returning default ' . $this->possible_status[0], |
|
1762 | + 'learnpathItem::get_status() - Returning default '.$this->possible_status[0], |
|
1763 | 1763 | 0 |
1764 | 1764 | ); |
1765 | 1765 | } |
@@ -1799,7 +1799,7 @@ discard block |
||
1799 | 1799 | if ($origin == 'js') { |
1800 | 1800 | return '00 : 00: 00'; |
1801 | 1801 | } else { |
1802 | - return '00 ' . $h . ' 00 \' 00"'; |
|
1802 | + return '00 '.$h.' 00 \' 00"'; |
|
1803 | 1803 | } |
1804 | 1804 | } else { |
1805 | 1805 | return api_format_time($time, $origin); |
@@ -1824,7 +1824,7 @@ discard block |
||
1824 | 1824 | if (!isset($given_time)) { |
1825 | 1825 | if (self::debug > 2) { |
1826 | 1826 | error_log( |
1827 | - 'learnpathItem::get_scorm_time(): given time empty, current_start_time = ' . $this->current_start_time, |
|
1827 | + 'learnpathItem::get_scorm_time(): given time empty, current_start_time = '.$this->current_start_time, |
|
1828 | 1828 | 0 |
1829 | 1829 | ); |
1830 | 1830 | } |
@@ -1834,8 +1834,8 @@ discard block |
||
1834 | 1834 | FROM $table |
1835 | 1835 | WHERE |
1836 | 1836 | c_id = $course_id AND |
1837 | - id = '" . $this->db_item_view_id . "' AND |
|
1838 | - view_count = '" . $this->get_attempt_id() . "'"; |
|
1837 | + id = '".$this->db_item_view_id."' AND |
|
1838 | + view_count = '" . $this->get_attempt_id()."'"; |
|
1839 | 1839 | $res = Database::query($sql); |
1840 | 1840 | $row = Database::fetch_array($res); |
1841 | 1841 | $start = $row['start_time']; |
@@ -1856,7 +1856,7 @@ discard block |
||
1856 | 1856 | } |
1857 | 1857 | if (self::debug > 2) { |
1858 | 1858 | error_log( |
1859 | - 'learnpathItem::get_scorm_time(): intermediate = ' . $time, |
|
1859 | + 'learnpathItem::get_scorm_time(): intermediate = '.$time, |
|
1860 | 1860 | 0 |
1861 | 1861 | ); |
1862 | 1862 | } |
@@ -1876,7 +1876,7 @@ discard block |
||
1876 | 1876 | $sql = "SELECT * FROM $lp_item |
1877 | 1877 | WHERE |
1878 | 1878 | c_id = $course_id AND |
1879 | - id='" . intval($this->db_id) . "'"; |
|
1879 | + id='".intval($this->db_id)."'"; |
|
1880 | 1880 | $res = Database::query($sql); |
1881 | 1881 | $row = Database::fetch_array($res); |
1882 | 1882 | return $row['terms']; |
@@ -1905,9 +1905,9 @@ discard block |
||
1905 | 1905 | { |
1906 | 1906 | if (self::debug > 0) { |
1907 | 1907 | error_log( |
1908 | - 'learnpathItem::get_total_time() for item ' . $this->db_id . |
|
1909 | - ' - Initially, current_start_time = ' . $this->current_start_time . |
|
1910 | - ' and current_stop_time = ' . $this->current_stop_time, |
|
1908 | + 'learnpathItem::get_total_time() for item '.$this->db_id. |
|
1909 | + ' - Initially, current_start_time = '.$this->current_start_time. |
|
1910 | + ' and current_stop_time = '.$this->current_stop_time, |
|
1911 | 1911 | 0 |
1912 | 1912 | ); |
1913 | 1913 | } |
@@ -1948,9 +1948,9 @@ discard block |
||
1948 | 1948 | } else { |
1949 | 1949 | if (self::debug > 2) { |
1950 | 1950 | error_log( |
1951 | - 'learnpathItem::get_total_time() - Current start time = ' . |
|
1952 | - $this->current_start_time . ', current stop time = ' . |
|
1953 | - $this->current_stop_time . ' Returning ' . $time . "-----------\n", |
|
1951 | + 'learnpathItem::get_total_time() - Current start time = '. |
|
1952 | + $this->current_start_time.', current stop time = '. |
|
1953 | + $this->current_stop_time.' Returning '.$time."-----------\n", |
|
1954 | 1954 | 0 |
1955 | 1955 | ); |
1956 | 1956 | } |
@@ -1970,7 +1970,7 @@ discard block |
||
1970 | 1970 | } |
1971 | 1971 | if (self::debug > 2) { |
1972 | 1972 | error_log( |
1973 | - 'learnpathItem::get_type() - Returning ' . $res . ' for item ' . $this->db_id, |
|
1973 | + 'learnpathItem::get_type() - Returning '.$res.' for item '.$this->db_id, |
|
1974 | 1974 | 0 |
1975 | 1975 | ); |
1976 | 1976 | } |
@@ -2010,8 +2010,8 @@ discard block |
||
2010 | 2010 | if ($this->status_is($completedStatusList)) { |
2011 | 2011 | if (self::debug > 2) { |
2012 | 2012 | error_log( |
2013 | - 'learnpath::is_done() - Item ' . $this->get_id( |
|
2014 | - ) . ' is complete', |
|
2013 | + 'learnpath::is_done() - Item '.$this->get_id( |
|
2014 | + ).' is complete', |
|
2015 | 2015 | 0 |
2016 | 2016 | ); |
2017 | 2017 | } |
@@ -2020,8 +2020,8 @@ discard block |
||
2020 | 2020 | } else { |
2021 | 2021 | if (self::debug > 2) { |
2022 | 2022 | error_log( |
2023 | - 'learnpath::is_done() - Item ' . $this->get_id( |
|
2024 | - ) . ' is not complete', |
|
2023 | + 'learnpath::is_done() - Item '.$this->get_id( |
|
2024 | + ).' is not complete', |
|
2025 | 2025 | 0 |
2026 | 2026 | ); |
2027 | 2027 | } |
@@ -2058,7 +2058,7 @@ discard block |
||
2058 | 2058 | } |
2059 | 2059 | if (self::debug > 2) { |
2060 | 2060 | error_log( |
2061 | - 'New LP - End of learnpathItem::is_restart_allowed() - Returning ' . $restart, |
|
2061 | + 'New LP - End of learnpathItem::is_restart_allowed() - Returning '.$restart, |
|
2062 | 2062 | 0 |
2063 | 2063 | ); |
2064 | 2064 | } |
@@ -2137,7 +2137,7 @@ discard block |
||
2137 | 2137 | { |
2138 | 2138 | if (self::debug > 0) { |
2139 | 2139 | error_log( |
2140 | - 'learnpathItem::parse_prereq() for learnpath ' . $this->lp_id . ' with string ' . $prereqs_string, |
|
2140 | + 'learnpathItem::parse_prereq() for learnpath '.$this->lp_id.' with string '.$prereqs_string, |
|
2141 | 2141 | 0 |
2142 | 2142 | ); |
2143 | 2143 | } |
@@ -2338,7 +2338,7 @@ discard block |
||
2338 | 2338 | // Strange... |
2339 | 2339 | if (self::debug > 1) { |
2340 | 2340 | error_log( |
2341 | - 'New LP - Found ~ but strange string: ' . $prereqs_string, |
|
2341 | + 'New LP - Found ~ but strange string: '.$prereqs_string, |
|
2342 | 2342 | 0 |
2343 | 2343 | ); |
2344 | 2344 | } |
@@ -2366,7 +2366,7 @@ discard block |
||
2366 | 2366 | // the big brackets-enclosed condition. |
2367 | 2367 | if (self::debug > 1) { |
2368 | 2368 | error_log( |
2369 | - 'New LP - Dealing with group ' . $gr, |
|
2369 | + 'New LP - Dealing with group '.$gr, |
|
2370 | 2370 | 0 |
2371 | 2371 | ); |
2372 | 2372 | } |
@@ -2380,7 +2380,7 @@ discard block |
||
2380 | 2380 | ) { |
2381 | 2381 | if (self::debug > 1) { |
2382 | 2382 | error_log( |
2383 | - 'New LP - Found multiplier ' . $multi[0], |
|
2383 | + 'New LP - Found multiplier '.$multi[0], |
|
2384 | 2384 | 0 |
2385 | 2385 | ); |
2386 | 2386 | } |
@@ -2396,7 +2396,7 @@ discard block |
||
2396 | 2396 | $mytrue++; |
2397 | 2397 | if (self::debug > 1) { |
2398 | 2398 | error_log( |
2399 | - 'New LP - Found true item, counting.. (' . ($mytrue) . ')', |
|
2399 | + 'New LP - Found true item, counting.. ('.($mytrue).')', |
|
2400 | 2400 | 0 |
2401 | 2401 | ); |
2402 | 2402 | } |
@@ -2404,7 +2404,7 @@ discard block |
||
2404 | 2404 | } else { |
2405 | 2405 | if (self::debug > 1) { |
2406 | 2406 | error_log( |
2407 | - 'New LP - item ' . $cond . ' does not exist in items list', |
|
2407 | + 'New LP - item '.$cond.' does not exist in items list', |
|
2408 | 2408 | 0 |
2409 | 2409 | ); |
2410 | 2410 | } |
@@ -2451,7 +2451,7 @@ discard block |
||
2451 | 2451 | } else { |
2452 | 2452 | if (self::debug > 1) { |
2453 | 2453 | error_log( |
2454 | - 'New LP - ' . |
|
2454 | + 'New LP - '. |
|
2455 | 2455 | ' Found false item, the set is not true, return false', |
2456 | 2456 | 0 |
2457 | 2457 | ); |
@@ -2462,7 +2462,7 @@ discard block |
||
2462 | 2462 | } else { |
2463 | 2463 | if (self::debug > 1) { |
2464 | 2464 | error_log( |
2465 | - 'New LP - item ' . $cond . ' does not exist in items list', |
|
2465 | + 'New LP - item '.$cond.' does not exist in items list', |
|
2466 | 2466 | 0 |
2467 | 2467 | ); |
2468 | 2468 | } |
@@ -2488,7 +2488,7 @@ discard block |
||
2488 | 2488 | // value of the corresponding resource completion status. |
2489 | 2489 | if (self::debug > 1) { |
2490 | 2490 | error_log( |
2491 | - 'New LP - Didnt find any group, returning value for ' . $prereqs_string, |
|
2491 | + 'New LP - Didnt find any group, returning value for '.$prereqs_string, |
|
2492 | 2492 | 0 |
2493 | 2493 | ); |
2494 | 2494 | } |
@@ -2505,14 +2505,14 @@ discard block |
||
2505 | 2505 | if (!$returnstatus) { |
2506 | 2506 | if (self::debug > 1) { |
2507 | 2507 | error_log( |
2508 | - 'New LP - Prerequisite ' . $prereqs_string . ' not complete', |
|
2508 | + 'New LP - Prerequisite '.$prereqs_string.' not complete', |
|
2509 | 2509 | 0 |
2510 | 2510 | ); |
2511 | 2511 | } |
2512 | 2512 | } else { |
2513 | 2513 | if (self::debug > 1) { |
2514 | 2514 | error_log( |
2515 | - 'New LP - Prerequisite ' . $prereqs_string . ' complete', |
|
2515 | + 'New LP - Prerequisite '.$prereqs_string.' complete', |
|
2516 | 2516 | 0 |
2517 | 2517 | ); |
2518 | 2518 | } |
@@ -2524,12 +2524,12 @@ discard block |
||
2524 | 2524 | if ($returnstatus) { |
2525 | 2525 | //AND origin_lp_item_id = '.$user_id.' |
2526 | 2526 | $sql = 'SELECT exe_result, exe_weighting |
2527 | - FROM ' . Database :: get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES) . ' |
|
2527 | + FROM ' . Database :: get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES).' |
|
2528 | 2528 | WHERE |
2529 | - exe_exo_id = ' . $items[$refs_list[$prereqs_string]]->path . ' AND |
|
2530 | - exe_user_id = ' . $user_id . ' AND |
|
2531 | - orig_lp_id = ' . $this->lp_id . ' AND |
|
2532 | - orig_lp_item_id = ' . $prereqs_string . ' AND |
|
2529 | + exe_exo_id = ' . $items[$refs_list[$prereqs_string]]->path.' AND |
|
2530 | + exe_user_id = ' . $user_id.' AND |
|
2531 | + orig_lp_id = ' . $this->lp_id.' AND |
|
2532 | + orig_lp_item_id = ' . $prereqs_string.' AND |
|
2533 | 2533 | status <> "incomplete" |
2534 | 2534 | ORDER BY exe_date DESC |
2535 | 2535 | LIMIT 0, 1'; |
@@ -2567,12 +2567,12 @@ discard block |
||
2567 | 2567 | |
2568 | 2568 | // Checking in the database. |
2569 | 2569 | $sql = 'SELECT exe_result, exe_weighting |
2570 | - FROM ' . Database :: get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES) . ' |
|
2570 | + FROM ' . Database :: get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES).' |
|
2571 | 2571 | WHERE |
2572 | - exe_exo_id = ' . $items[$refs_list[$prereqs_string]]->path . ' AND |
|
2573 | - exe_user_id = ' . $user_id . ' AND |
|
2574 | - orig_lp_id = ' . $this->lp_id . ' AND |
|
2575 | - orig_lp_item_id = ' . $prereqs_string . ' '; |
|
2572 | + exe_exo_id = ' . $items[$refs_list[$prereqs_string]]->path.' AND |
|
2573 | + exe_user_id = ' . $user_id.' AND |
|
2574 | + orig_lp_id = ' . $this->lp_id.' AND |
|
2575 | + orig_lp_item_id = ' . $prereqs_string.' '; |
|
2576 | 2576 | |
2577 | 2577 | $rs_quiz = Database::query($sql); |
2578 | 2578 | if (Database::num_rows($rs_quiz) > 0) { |
@@ -2619,14 +2619,14 @@ discard block |
||
2619 | 2619 | if (!$returnstatus) { |
2620 | 2620 | if (self::debug > 1) { |
2621 | 2621 | error_log( |
2622 | - 'New LP - Prerequisite ' . $prereqs_string . ' not complete', |
|
2622 | + 'New LP - Prerequisite '.$prereqs_string.' not complete', |
|
2623 | 2623 | 0 |
2624 | 2624 | ); |
2625 | 2625 | } |
2626 | 2626 | } else { |
2627 | 2627 | if (self::debug > 1) { |
2628 | 2628 | error_log( |
2629 | - 'New LP - Prerequisite ' . $prereqs_string . ' complete', |
|
2629 | + 'New LP - Prerequisite '.$prereqs_string.' complete', |
|
2630 | 2630 | 0 |
2631 | 2631 | ); |
2632 | 2632 | } |
@@ -2641,11 +2641,11 @@ discard block |
||
2641 | 2641 | TABLE_LP_VIEW |
2642 | 2642 | ); |
2643 | 2643 | |
2644 | - $sql = 'SELECT id FROM ' . $lp_view . ' |
|
2644 | + $sql = 'SELECT id FROM '.$lp_view.' |
|
2645 | 2645 | WHERE |
2646 | - c_id = ' . $course_id . ' AND |
|
2647 | - user_id = ' . $user_id . ' AND |
|
2648 | - lp_id = ' . $this->lp_id . ' AND |
|
2646 | + c_id = ' . $course_id.' AND |
|
2647 | + user_id = ' . $user_id.' AND |
|
2648 | + lp_id = ' . $this->lp_id.' AND |
|
2649 | 2649 | session_id = '.$sessionId.' |
2650 | 2650 | LIMIT 0, 1'; |
2651 | 2651 | $rs_lp = Database::query($sql); |
@@ -2654,11 +2654,11 @@ discard block |
||
2654 | 2654 | ); |
2655 | 2655 | $my_lp_id = $lp_id[0]; |
2656 | 2656 | |
2657 | - $sql = 'SELECT status FROM ' . $lp_item_view . ' |
|
2657 | + $sql = 'SELECT status FROM '.$lp_item_view.' |
|
2658 | 2658 | WHERE |
2659 | - c_id = ' . $course_id . ' AND |
|
2660 | - lp_view_id = ' . $my_lp_id . ' AND |
|
2661 | - lp_item_id = ' . $refs_list[$prereqs_string] . ' |
|
2659 | + c_id = ' . $course_id.' AND |
|
2660 | + lp_view_id = ' . $my_lp_id.' AND |
|
2661 | + lp_item_id = ' . $refs_list[$prereqs_string].' |
|
2662 | 2662 | LIMIT 0, 1'; |
2663 | 2663 | $rs_lp = Database::query($sql); |
2664 | 2664 | $status_array = Database :: fetch_row( |
@@ -2675,14 +2675,14 @@ discard block |
||
2675 | 2675 | if (!$returnstatus) { |
2676 | 2676 | if (self::debug > 1) { |
2677 | 2677 | error_log( |
2678 | - 'New LP - Prerequisite ' . $prereqs_string . ' not complete', |
|
2678 | + 'New LP - Prerequisite '.$prereqs_string.' not complete', |
|
2679 | 2679 | 0 |
2680 | 2680 | ); |
2681 | 2681 | } |
2682 | 2682 | } else { |
2683 | 2683 | if (self::debug > 1) { |
2684 | 2684 | error_log( |
2685 | - 'New LP - Prerequisite ' . $prereqs_string . ' complete', |
|
2685 | + 'New LP - Prerequisite '.$prereqs_string.' complete', |
|
2686 | 2686 | 0 |
2687 | 2687 | ); |
2688 | 2688 | } |
@@ -2693,7 +2693,7 @@ discard block |
||
2693 | 2693 | } else { |
2694 | 2694 | if (self::debug > 1) { |
2695 | 2695 | error_log( |
2696 | - 'New LP - Could not find ' . $prereqs_string . ' in ' . print_r( |
|
2696 | + 'New LP - Could not find '.$prereqs_string.' in '.print_r( |
|
2697 | 2697 | $refs_list, |
2698 | 2698 | true |
2699 | 2699 | ), |
@@ -2716,7 +2716,7 @@ discard block |
||
2716 | 2716 | foreach ($list as $condition) { |
2717 | 2717 | if (self::debug > 1) { |
2718 | 2718 | error_log( |
2719 | - 'New LP - Found OR, adding it (' . $condition . ')', |
|
2719 | + 'New LP - Found OR, adding it ('.$condition.')', |
|
2720 | 2720 | 0 |
2721 | 2721 | ); |
2722 | 2722 | } |
@@ -2770,7 +2770,7 @@ discard block |
||
2770 | 2770 | |
2771 | 2771 | if (self::debug > 1) { |
2772 | 2772 | error_log( |
2773 | - 'New LP - End of parse_prereq. Error code is now ' . $this->prereq_alert, |
|
2773 | + 'New LP - End of parse_prereq. Error code is now '.$this->prereq_alert, |
|
2774 | 2774 | 0 |
2775 | 2775 | ); |
2776 | 2776 | } |
@@ -2888,7 +2888,7 @@ discard block |
||
2888 | 2888 | $this->set_score($value); |
2889 | 2889 | if (self::debug > 2) { |
2890 | 2890 | error_log( |
2891 | - 'learnpathItem::save() - setting score to ' . $value, |
|
2891 | + 'learnpathItem::save() - setting score to '.$value, |
|
2892 | 2892 | 0 |
2893 | 2893 | ); |
2894 | 2894 | } |
@@ -2897,7 +2897,7 @@ discard block |
||
2897 | 2897 | $this->set_max_score($value); |
2898 | 2898 | if (self::debug > 2) { |
2899 | 2899 | error_log( |
2900 | - 'learnpathItem::save() - setting view_max_score to ' . $value, |
|
2900 | + 'learnpathItem::save() - setting view_max_score to '.$value, |
|
2901 | 2901 | 0 |
2902 | 2902 | ); |
2903 | 2903 | } |
@@ -2906,7 +2906,7 @@ discard block |
||
2906 | 2906 | $this->min_score = $value; |
2907 | 2907 | if (self::debug > 2) { |
2908 | 2908 | error_log( |
2909 | - 'learnpathItem::save() - setting min_score to ' . $value, |
|
2909 | + 'learnpathItem::save() - setting min_score to '.$value, |
|
2910 | 2910 | 0 |
2911 | 2911 | ); |
2912 | 2912 | } |
@@ -2916,7 +2916,7 @@ discard block |
||
2916 | 2916 | $this->set_status($value); |
2917 | 2917 | if (self::debug > 2) { |
2918 | 2918 | error_log( |
2919 | - 'learnpathItem::save() - setting status to ' . $value, |
|
2919 | + 'learnpathItem::save() - setting status to '.$value, |
|
2920 | 2920 | 0 |
2921 | 2921 | ); |
2922 | 2922 | } |
@@ -2926,7 +2926,7 @@ discard block |
||
2926 | 2926 | $this->set_time($value); |
2927 | 2927 | if (self::debug > 2) { |
2928 | 2928 | error_log( |
2929 | - 'learnpathItem::save() - setting time to ' . $value, |
|
2929 | + 'learnpathItem::save() - setting time to '.$value, |
|
2930 | 2930 | 0 |
2931 | 2931 | ); |
2932 | 2932 | } |
@@ -2935,7 +2935,7 @@ discard block |
||
2935 | 2935 | $this->current_data = $value; |
2936 | 2936 | if (self::debug > 2) { |
2937 | 2937 | error_log( |
2938 | - 'learnpathItem::save() - setting suspend_data to ' . $value, |
|
2938 | + 'learnpathItem::save() - setting suspend_data to '.$value, |
|
2939 | 2939 | 0 |
2940 | 2940 | ); |
2941 | 2941 | } |
@@ -2944,7 +2944,7 @@ discard block |
||
2944 | 2944 | $this->set_lesson_location($value); |
2945 | 2945 | if (self::debug > 2) { |
2946 | 2946 | error_log( |
2947 | - 'learnpathItem::save() - setting lesson_location to ' . $value, |
|
2947 | + 'learnpathItem::save() - setting lesson_location to '.$value, |
|
2948 | 2948 | 0 |
2949 | 2949 | ); |
2950 | 2950 | } |
@@ -2953,7 +2953,7 @@ discard block |
||
2953 | 2953 | $this->set_core_exit($value); |
2954 | 2954 | if (self::debug > 2) { |
2955 | 2955 | error_log( |
2956 | - 'learnpathItem::save() - setting core_exit to ' . $value, |
|
2956 | + 'learnpathItem::save() - setting core_exit to '.$value, |
|
2957 | 2957 | 0 |
2958 | 2958 | ); |
2959 | 2959 | } |
@@ -3100,7 +3100,7 @@ discard block |
||
3100 | 3100 | public function set_level($int = 0) |
3101 | 3101 | { |
3102 | 3102 | if (self::debug > 0) { |
3103 | - error_log('learnpathItem::set_level(' . $int . ')', 0); |
|
3103 | + error_log('learnpathItem::set_level('.$int.')', 0); |
|
3104 | 3104 | } |
3105 | 3105 | if (!empty($int) AND $int == strval(intval($int))) { |
3106 | 3106 | $this->level = $int; |
@@ -3129,7 +3129,7 @@ discard block |
||
3129 | 3129 | if (empty($lpItemId)) { |
3130 | 3130 | if (self::debug > 0) { |
3131 | 3131 | error_log( |
3132 | - 'learnpathItem::set_lp_view(' . $lp_view_id . ') $lpItemId is empty', |
|
3132 | + 'learnpathItem::set_lp_view('.$lp_view_id.') $lpItemId is empty', |
|
3133 | 3133 | 0 |
3134 | 3134 | ); |
3135 | 3135 | } |
@@ -3140,7 +3140,7 @@ discard block |
||
3140 | 3140 | if (empty($lp_view_id)) { |
3141 | 3141 | if (self::debug > 0) { |
3142 | 3142 | error_log( |
3143 | - 'learnpathItem::set_lp_view(' . $lp_view_id . ') $lp_view_id is empty', |
|
3143 | + 'learnpathItem::set_lp_view('.$lp_view_id.') $lp_view_id is empty', |
|
3144 | 3144 | 0 |
3145 | 3145 | ); |
3146 | 3146 | } |
@@ -3149,7 +3149,7 @@ discard block |
||
3149 | 3149 | } |
3150 | 3150 | |
3151 | 3151 | if (self::debug > 0) { |
3152 | - error_log('learnpathItem::set_lp_view(' . $lp_view_id . ')', 0); |
|
3152 | + error_log('learnpathItem::set_lp_view('.$lp_view_id.')', 0); |
|
3153 | 3153 | } |
3154 | 3154 | |
3155 | 3155 | $this->view_id = $lp_view_id; |
@@ -3159,13 +3159,13 @@ discard block |
||
3159 | 3159 | $sql = "SELECT * FROM $item_view_table |
3160 | 3160 | WHERE |
3161 | 3161 | c_id = $course_id AND |
3162 | - lp_item_id = " . $lpItemId . " AND |
|
3163 | - lp_view_id = " . $lp_view_id . " |
|
3162 | + lp_item_id = ".$lpItemId." AND |
|
3163 | + lp_view_id = " . $lp_view_id." |
|
3164 | 3164 | ORDER BY view_count DESC"; |
3165 | 3165 | |
3166 | 3166 | if (self::debug > 2) { |
3167 | 3167 | error_log( |
3168 | - 'learnpathItem::set_lp_view() - Querying lp_item_view: ' . $sql, |
|
3168 | + 'learnpathItem::set_lp_view() - Querying lp_item_view: '.$sql, |
|
3169 | 3169 | 0 |
3170 | 3170 | ); |
3171 | 3171 | } |
@@ -3197,7 +3197,7 @@ discard block |
||
3197 | 3197 | $sql = "SELECT * FROM $item_view_interaction_table |
3198 | 3198 | WHERE |
3199 | 3199 | c_id = $course_id AND |
3200 | - lp_iv_id = '" . $this->db_item_view_id . "'"; |
|
3200 | + lp_iv_id = '".$this->db_item_view_id."'"; |
|
3201 | 3201 | |
3202 | 3202 | $res = Database::query($sql); |
3203 | 3203 | if ($res !== false) { |
@@ -3212,7 +3212,7 @@ discard block |
||
3212 | 3212 | $sql = "SELECT * FROM $item_view_objective_table |
3213 | 3213 | WHERE |
3214 | 3214 | c_id = $course_id AND |
3215 | - lp_iv_id = '" . $this->db_item_view_id . "'"; |
|
3215 | + lp_iv_id = '".$this->db_item_view_id."'"; |
|
3216 | 3216 | |
3217 | 3217 | $res = Database::query($sql); |
3218 | 3218 | if ($res !== false) { |
@@ -3273,7 +3273,7 @@ discard block |
||
3273 | 3273 | { |
3274 | 3274 | $debug = self::debug; |
3275 | 3275 | if ($debug > 0) { |
3276 | - error_log('learnpathItem::set_score(' . $score . ')', 0); |
|
3276 | + error_log('learnpathItem::set_score('.$score.')', 0); |
|
3277 | 3277 | } |
3278 | 3278 | if (($this->max_score <= 0 || $score <= $this->max_score) && ($score >= $this->min_score)) { |
3279 | 3279 | $this->current_score = $score; |
@@ -3286,9 +3286,9 @@ discard block |
||
3286 | 3286 | } |
3287 | 3287 | |
3288 | 3288 | if ($debug > 0) { |
3289 | - error_log('get_mastery_score: ' . $masteryScore); |
|
3290 | - error_log('current_status: ' . $current_status); |
|
3291 | - error_log('current score : ' . $this->current_score); |
|
3289 | + error_log('get_mastery_score: '.$masteryScore); |
|
3290 | + error_log('current_status: '.$current_status); |
|
3291 | + error_log('current score : '.$this->current_score); |
|
3292 | 3292 | } |
3293 | 3293 | |
3294 | 3294 | // If mastery_score is set AND the current score reaches the mastery |
@@ -3316,15 +3316,15 @@ discard block |
||
3316 | 3316 | public function set_max_score($score) |
3317 | 3317 | { |
3318 | 3318 | if (self::debug > 0) { |
3319 | - error_log('learnpathItem::set_max_score(' . $score . ')', 0); |
|
3319 | + error_log('learnpathItem::set_max_score('.$score.')', 0); |
|
3320 | 3320 | } |
3321 | 3321 | if (is_int($score) || $score == '') { |
3322 | 3322 | $this->view_max_score = $score; |
3323 | 3323 | if (self::debug > 1) { |
3324 | 3324 | error_log( |
3325 | - 'learnpathItem::set_max_score() - ' . |
|
3326 | - 'Updated object score of item ' . $this->db_id . |
|
3327 | - ' to ' . $this->view_max_score, |
|
3325 | + 'learnpathItem::set_max_score() - '. |
|
3326 | + 'Updated object score of item '.$this->db_id. |
|
3327 | + ' to '.$this->view_max_score, |
|
3328 | 3328 | 0 |
3329 | 3329 | ); |
3330 | 3330 | } |
@@ -3342,12 +3342,12 @@ discard block |
||
3342 | 3342 | public function set_status($status) |
3343 | 3343 | { |
3344 | 3344 | if (self::debug > 0) { |
3345 | - error_log('learnpathItem::set_status(' . $status . ')', 0); |
|
3345 | + error_log('learnpathItem::set_status('.$status.')', 0); |
|
3346 | 3346 | } |
3347 | 3347 | |
3348 | 3348 | $found = false; |
3349 | 3349 | foreach ($this->possible_status as $possible) { |
3350 | - if (preg_match('/^' . $possible . '$/i', $status)) { |
|
3350 | + if (preg_match('/^'.$possible.'$/i', $status)) { |
|
3351 | 3351 | $found = true; |
3352 | 3352 | } |
3353 | 3353 | } |
@@ -3357,8 +3357,8 @@ discard block |
||
3357 | 3357 | if (self::debug > 1) { |
3358 | 3358 | error_log( |
3359 | 3359 | 'learnpathItem::set_status() - '. |
3360 | - 'Updated object status of item ' . $this->db_id . |
|
3361 | - ' to ' . $this->status, |
|
3360 | + 'Updated object status of item '.$this->db_id. |
|
3361 | + ' to '.$this->status, |
|
3362 | 3362 | 0 |
3363 | 3363 | ); |
3364 | 3364 | } |
@@ -3382,7 +3382,7 @@ discard block |
||
3382 | 3382 | $lp_item = Database::get_course_table(TABLE_LP_ITEM); |
3383 | 3383 | require_once api_get_path( |
3384 | 3384 | LIBRARY_PATH |
3385 | - ) . 'search/ChamiloIndexer.class.php'; |
|
3385 | + ).'search/ChamiloIndexer.class.php'; |
|
3386 | 3386 | $a_terms = preg_split('/,/', $terms); |
3387 | 3387 | $i_terms = preg_split('/,/', $this->get_terms()); |
3388 | 3388 | foreach ($i_terms as $term) { |
@@ -3399,7 +3399,7 @@ discard block |
||
3399 | 3399 | SET terms = '$terms' |
3400 | 3400 | WHERE |
3401 | 3401 | c_id = $course_id AND |
3402 | - id=" . $this->get_id(); |
|
3402 | + id=".$this->get_id(); |
|
3403 | 3403 | Database::query($sql); |
3404 | 3404 | // Save it to search engine. |
3405 | 3405 | if (api_get_setting('search_enabled') == 'true') { |
@@ -3427,7 +3427,7 @@ discard block |
||
3427 | 3427 | public function set_time($scorm_time, $format = 'scorm') |
3428 | 3428 | { |
3429 | 3429 | if (self::debug > 0) { |
3430 | - error_log('learnpathItem::set_time(' . $scorm_time . ')', 0); |
|
3430 | + error_log('learnpathItem::set_time('.$scorm_time.')', 0); |
|
3431 | 3431 | } |
3432 | 3432 | if ($scorm_time == '0' |
3433 | 3433 | and ($this->type != 'sco') |
@@ -3438,8 +3438,8 @@ discard block |
||
3438 | 3438 | $this->update_time($my_time); |
3439 | 3439 | if (self::debug > 0) { |
3440 | 3440 | error_log( |
3441 | - 'learnpathItem::set_time(' . $scorm_time . ') - ' . |
|
3442 | - 'found asset - set time to ' . $my_time, |
|
3441 | + 'learnpathItem::set_time('.$scorm_time.') - '. |
|
3442 | + 'found asset - set time to '.$my_time, |
|
3443 | 3443 | 0 |
3444 | 3444 | ); |
3445 | 3445 | } |
@@ -3512,10 +3512,10 @@ discard block |
||
3512 | 3512 | { |
3513 | 3513 | if (self::debug > 1) { |
3514 | 3514 | error_log( |
3515 | - 'learnpathItem::status_is(' . print_r( |
|
3515 | + 'learnpathItem::status_is('.print_r( |
|
3516 | 3516 | $list, |
3517 | 3517 | true |
3518 | - ) . ') on item ' . $this->db_id, |
|
3518 | + ).') on item '.$this->db_id, |
|
3519 | 3519 | 0 |
3520 | 3520 | ); |
3521 | 3521 | } |
@@ -3525,11 +3525,11 @@ discard block |
||
3525 | 3525 | } |
3526 | 3526 | $found = false; |
3527 | 3527 | foreach ($list as $status) { |
3528 | - if (preg_match('/^' . $status . '$/i', $currentStatus)) { |
|
3528 | + if (preg_match('/^'.$status.'$/i', $currentStatus)) { |
|
3529 | 3529 | if (self::debug > 2) { |
3530 | 3530 | error_log( |
3531 | - 'New LP - learnpathItem::status_is() - Found status ' . |
|
3532 | - $status . ' corresponding to current status', |
|
3531 | + 'New LP - learnpathItem::status_is() - Found status '. |
|
3532 | + $status.' corresponding to current status', |
|
3533 | 3533 | 0 |
3534 | 3534 | ); |
3535 | 3535 | } |
@@ -3540,8 +3540,8 @@ discard block |
||
3540 | 3540 | } |
3541 | 3541 | if (self::debug > 2) { |
3542 | 3542 | error_log( |
3543 | - 'New LP - learnpathItem::status_is() - Status ' . |
|
3544 | - $currentStatus . ' did not match request', |
|
3543 | + 'New LP - learnpathItem::status_is() - Status '. |
|
3544 | + $currentStatus.' did not match request', |
|
3545 | 3545 | 0 |
3546 | 3546 | ); |
3547 | 3547 | } |
@@ -3558,7 +3558,7 @@ discard block |
||
3558 | 3558 | public function update_time($total_sec = 0) |
3559 | 3559 | { |
3560 | 3560 | if (self::debug > 0) { |
3561 | - error_log('learnpathItem::update_time(' . $total_sec . ')', 0); |
|
3561 | + error_log('learnpathItem::update_time('.$total_sec.')', 0); |
|
3562 | 3562 | } |
3563 | 3563 | if ($total_sec >= 0) { |
3564 | 3564 | // Getting start time from finish time. The only problem in the calculation is it might be |
@@ -3610,11 +3610,11 @@ discard block |
||
3610 | 3610 | $item_view_table = Database::get_course_table(TABLE_LP_ITEM_VIEW); |
3611 | 3611 | $course_id = api_get_course_int_id(); |
3612 | 3612 | |
3613 | - $get_view_sql = 'SELECT total_time, status FROM ' . $item_view_table . ' |
|
3614 | - WHERE c_id = ' . $course_id . ' |
|
3615 | - AND lp_item_id="' . $this->db_id . '" |
|
3616 | - AND lp_view_id="' . $this->view_id . '" |
|
3617 | - AND view_count="' . $this->attempt_id . '" ;'; |
|
3613 | + $get_view_sql = 'SELECT total_time, status FROM '.$item_view_table.' |
|
3614 | + WHERE c_id = ' . $course_id.' |
|
3615 | + AND lp_item_id="' . $this->db_id.'" |
|
3616 | + AND lp_view_id="' . $this->view_id.'" |
|
3617 | + AND view_count="' . $this->attempt_id.'" ;'; |
|
3618 | 3618 | $result = Database::query($get_view_sql); |
3619 | 3619 | $row = Database::fetch_array($result); |
3620 | 3620 | |
@@ -3678,12 +3678,12 @@ discard block |
||
3678 | 3678 | { |
3679 | 3679 | $item_view_table = Database::get_course_table(TABLE_LP_ITEM_VIEW); |
3680 | 3680 | $course_id = api_get_course_int_id(); |
3681 | - $sql = 'UPDATE ' . $item_view_table . ' |
|
3682 | - SET total_time = 0, start_time=' . time() . ' |
|
3683 | - WHERE c_id = ' . $course_id . ' |
|
3684 | - AND lp_item_id="' . $this->db_id . '" |
|
3685 | - AND lp_view_id="' . $this->view_id . '" |
|
3686 | - AND view_count="' . $this->attempt_id . '" ;'; |
|
3681 | + $sql = 'UPDATE '.$item_view_table.' |
|
3682 | + SET total_time = 0, start_time=' . time().' |
|
3683 | + WHERE c_id = ' . $course_id.' |
|
3684 | + AND lp_item_id="' . $this->db_id.'" |
|
3685 | + AND lp_view_id="' . $this->view_id.'" |
|
3686 | + AND view_count="' . $this->attempt_id.'" ;'; |
|
3687 | 3687 | Database::query($sql); |
3688 | 3688 | } |
3689 | 3689 | |
@@ -3705,8 +3705,8 @@ discard block |
||
3705 | 3705 | FROM $tbl |
3706 | 3706 | WHERE |
3707 | 3707 | c_id = $course_id AND |
3708 | - lp_item_id = " . $this->db_id . " AND |
|
3709 | - lp_view_id = " . $this->view_id . " AND |
|
3708 | + lp_item_id = ".$this->db_id." AND |
|
3709 | + lp_view_id = " . $this->view_id." AND |
|
3710 | 3710 | view_count = " . $this->attempt_id; |
3711 | 3711 | $res = Database::query($sql); |
3712 | 3712 | if (Database::num_rows($res) > 0) { |
@@ -3714,8 +3714,8 @@ discard block |
||
3714 | 3714 | $lp_iv_id = $row[0]; |
3715 | 3715 | if (self::debug > 2) { |
3716 | 3716 | error_log( |
3717 | - 'learnpathItem::write_to_db() - Got item_view_id ' . |
|
3718 | - $lp_iv_id . ', now checking objectives ', |
|
3717 | + 'learnpathItem::write_to_db() - Got item_view_id '. |
|
3718 | + $lp_iv_id.', now checking objectives ', |
|
3719 | 3719 | 0 |
3720 | 3720 | ); |
3721 | 3721 | } |
@@ -3727,7 +3727,7 @@ discard block |
||
3727 | 3727 | WHERE |
3728 | 3728 | c_id = $course_id AND |
3729 | 3729 | lp_iv_id = $lp_iv_id AND |
3730 | - objective_id = '" . Database::escape_string($objective[0]) . "'"; |
|
3730 | + objective_id = '".Database::escape_string($objective[0])."'"; |
|
3731 | 3731 | $iva_res = Database::query($iva_sql); |
3732 | 3732 | // id(0), type(1), time(2), weighting(3), |
3733 | 3733 | // correct_responses(4), student_response(5), |
@@ -3736,22 +3736,22 @@ discard block |
||
3736 | 3736 | // Update (or don't). |
3737 | 3737 | $iva_row = Database::fetch_array($iva_res); |
3738 | 3738 | $iva_id = $iva_row[0]; |
3739 | - $ivau_sql = "UPDATE $iva_table " . |
|
3740 | - "SET objective_id = '" . Database::escape_string( |
|
3739 | + $ivau_sql = "UPDATE $iva_table ". |
|
3740 | + "SET objective_id = '".Database::escape_string( |
|
3741 | 3741 | $objective[0] |
3742 | - ) . "'," . |
|
3743 | - "status = '" . Database::escape_string( |
|
3742 | + )."',". |
|
3743 | + "status = '".Database::escape_string( |
|
3744 | 3744 | $objective[1] |
3745 | - ) . "'," . |
|
3746 | - "score_raw = '" . Database::escape_string( |
|
3745 | + )."',". |
|
3746 | + "score_raw = '".Database::escape_string( |
|
3747 | 3747 | $objective[2] |
3748 | - ) . "'," . |
|
3749 | - "score_min = '" . Database::escape_string( |
|
3748 | + )."',". |
|
3749 | + "score_min = '".Database::escape_string( |
|
3750 | 3750 | $objective[4] |
3751 | - ) . "'," . |
|
3752 | - "score_max = '" . Database::escape_string( |
|
3751 | + )."',". |
|
3752 | + "score_max = '".Database::escape_string( |
|
3753 | 3753 | $objective[3] |
3754 | - ) . "' " . |
|
3754 | + )."' ". |
|
3755 | 3755 | "WHERE c_id = $course_id AND id = $iva_id"; |
3756 | 3756 | Database::query($ivau_sql); |
3757 | 3757 | } else { |
@@ -3803,12 +3803,12 @@ discard block |
||
3803 | 3803 | $my_status = ' '; |
3804 | 3804 | |
3805 | 3805 | $item_view_table = Database::get_course_table(TABLE_LP_ITEM_VIEW); |
3806 | - $sql = 'SELECT status FROM ' . $item_view_table . ' |
|
3806 | + $sql = 'SELECT status FROM '.$item_view_table.' |
|
3807 | 3807 | WHERE |
3808 | - c_id = ' . $course_id . ' AND |
|
3809 | - lp_item_id="' . $this->db_id . '" AND |
|
3810 | - lp_view_id="' . $this->view_id . '" AND |
|
3811 | - view_count="' . $this->get_attempt_id() . '" '; |
|
3808 | + c_id = ' . $course_id.' AND |
|
3809 | + lp_item_id="' . $this->db_id.'" AND |
|
3810 | + lp_view_id="' . $this->view_id.'" AND |
|
3811 | + view_count="' . $this->get_attempt_id().'" '; |
|
3812 | 3812 | $rs_verified = Database::query($sql); |
3813 | 3813 | $row_verified = Database::fetch_array($rs_verified); |
3814 | 3814 | |
@@ -3836,8 +3836,8 @@ discard block |
||
3836 | 3836 | "This info shouldn't be saved as the credit or lesson mode info prevent it" |
3837 | 3837 | ); |
3838 | 3838 | error_log( |
3839 | - 'learnpathItem::write_to_db() - credit(' . $credit . ') or'. |
|
3840 | - ' lesson_mode(' . $mode . ') prevent recording!', |
|
3839 | + 'learnpathItem::write_to_db() - credit('.$credit.') or'. |
|
3840 | + ' lesson_mode('.$mode.') prevent recording!', |
|
3841 | 3841 | 0 |
3842 | 3842 | ); |
3843 | 3843 | } |
@@ -3861,14 +3861,14 @@ discard block |
||
3861 | 3861 | "max_score" => $this->get_max(), |
3862 | 3862 | "lp_item_id" => $this->db_id, |
3863 | 3863 | "lp_view_id" => $this->view_id, |
3864 | - "view_count" => $this->get_attempt_id() , |
|
3864 | + "view_count" => $this->get_attempt_id(), |
|
3865 | 3865 | "suspend_data" => $this->current_data, |
3866 | 3866 | //"max_time_allowed" => , |
3867 | 3867 | "lesson_location" => $this->lesson_location |
3868 | 3868 | ); |
3869 | 3869 | if (self::debug > 2) { |
3870 | 3870 | error_log( |
3871 | - 'learnpathItem::write_to_db() - Inserting into item_view forced: ' . print_r($params, 1), |
|
3871 | + 'learnpathItem::write_to_db() - Inserting into item_view forced: '.print_r($params, 1), |
|
3872 | 3872 | 0 |
3873 | 3873 | ); |
3874 | 3874 | } |
@@ -3876,7 +3876,7 @@ discard block |
||
3876 | 3876 | |
3877 | 3877 | if ($this->db_item_view_id) { |
3878 | 3878 | $sql = "UPDATE $item_view_table SET id = iid |
3879 | - WHERE iid = " . $this->db_item_view_id; |
|
3879 | + WHERE iid = ".$this->db_item_view_id; |
|
3880 | 3880 | Database::query($sql); |
3881 | 3881 | $inserted = true; |
3882 | 3882 | } |
@@ -3886,12 +3886,12 @@ discard block |
||
3886 | 3886 | $sql = "SELECT * FROM $item_view_table |
3887 | 3887 | WHERE |
3888 | 3888 | c_id = $course_id AND |
3889 | - lp_item_id = " . $this->db_id . " AND |
|
3890 | - lp_view_id = " . $this->view_id . " AND |
|
3889 | + lp_item_id = ".$this->db_id." AND |
|
3890 | + lp_view_id = " . $this->view_id." AND |
|
3891 | 3891 | view_count = " . intval($this->get_attempt_id()); |
3892 | 3892 | if (self::debug > 2) { |
3893 | 3893 | error_log( |
3894 | - 'learnpathItem::write_to_db() - Querying item_view: ' . $sql, |
|
3894 | + 'learnpathItem::write_to_db() - Querying item_view: '.$sql, |
|
3895 | 3895 | 0 |
3896 | 3896 | ); |
3897 | 3897 | } |
@@ -3908,7 +3908,7 @@ discard block |
||
3908 | 3908 | "max_score" => $this->get_max(), |
3909 | 3909 | "lp_item_id" => $this->db_id, |
3910 | 3910 | "lp_view_id" => $this->view_id, |
3911 | - "view_count" => $this->get_attempt_id() , |
|
3911 | + "view_count" => $this->get_attempt_id(), |
|
3912 | 3912 | "suspend_data" => $this->current_data, |
3913 | 3913 | //"max_time_allowed" => ,$this->get_max_time_allowed() |
3914 | 3914 | "lesson_location" => $this->lesson_location |
@@ -3916,7 +3916,7 @@ discard block |
||
3916 | 3916 | |
3917 | 3917 | if (self::debug > 2) { |
3918 | 3918 | error_log( |
3919 | - 'learnpathItem::write_to_db() - Inserting into item_view forced: ' . print_r($params, 1), |
|
3919 | + 'learnpathItem::write_to_db() - Inserting into item_view forced: '.print_r($params, 1), |
|
3920 | 3920 | 0 |
3921 | 3921 | ); |
3922 | 3922 | } |
@@ -3925,7 +3925,7 @@ discard block |
||
3925 | 3925 | |
3926 | 3926 | if ($this->db_item_view_id) { |
3927 | 3927 | $sql = "UPDATE $item_view_table SET id = iid |
3928 | - WHERE iid = " . $this->db_item_view_id; |
|
3928 | + WHERE iid = ".$this->db_item_view_id; |
|
3929 | 3929 | Database::query($sql); |
3930 | 3930 | } |
3931 | 3931 | } else { |
@@ -3965,8 +3965,8 @@ discard block |
||
3965 | 3965 | $time_exe_date = convert_sql_date( |
3966 | 3966 | $row_dates['exe_date'] |
3967 | 3967 | ); |
3968 | - $mytime = ((int)$time_exe_date - (int)$time_start_date); |
|
3969 | - $total_time = " total_time = " . $mytime . ", "; |
|
3968 | + $mytime = ((int) $time_exe_date - (int) $time_start_date); |
|
3969 | + $total_time = " total_time = ".$mytime.", "; |
|
3970 | 3970 | } |
3971 | 3971 | } else { |
3972 | 3972 | $my_type_lp = learnpath::get_type_static($this->lp_id); |
@@ -3980,16 +3980,16 @@ discard block |
||
3980 | 3980 | |
3981 | 3981 | // Is not multiple attempts |
3982 | 3982 | if ($this->seriousgame_mode == 1 && $this->type == 'sco') { |
3983 | - $total_time = " total_time = total_time +" . $this->get_total_time() . ", "; |
|
3984 | - $my_status = " status = '" . $this->get_status(false) . "' ,"; |
|
3983 | + $total_time = " total_time = total_time +".$this->get_total_time().", "; |
|
3984 | + $my_status = " status = '".$this->get_status(false)."' ,"; |
|
3985 | 3985 | } elseif ($this->get_prevent_reinit() == 1) { |
3986 | 3986 | // Process of status verified into data base. |
3987 | - $sql = 'SELECT status FROM ' . $item_view_table . ' |
|
3987 | + $sql = 'SELECT status FROM '.$item_view_table.' |
|
3988 | 3988 | WHERE |
3989 | - c_id = ' . $course_id . ' AND |
|
3990 | - lp_item_id="' . $this->db_id . '" AND |
|
3991 | - lp_view_id="' . $this->view_id . '" AND |
|
3992 | - view_count="' . $this->get_attempt_id() . '" |
|
3989 | + c_id = ' . $course_id.' AND |
|
3990 | + lp_item_id="' . $this->db_id.'" AND |
|
3991 | + lp_view_id="' . $this->view_id.'" AND |
|
3992 | + view_count="' . $this->get_attempt_id().'" |
|
3993 | 3993 | '; |
3994 | 3994 | $rs_verified = Database::query($sql); |
3995 | 3995 | $row_verified = Database::fetch_array($rs_verified); |
@@ -3999,26 +3999,26 @@ discard block |
||
3999 | 3999 | if (!in_array($this->get_status(false), $case_completed) && |
4000 | 4000 | $my_type_lp == 2 |
4001 | 4001 | ) { |
4002 | - $total_time = " total_time = total_time +" . $this->get_total_time() . ", "; |
|
4003 | - $my_status = " status = '" . $this->get_status(false) . "' ,"; |
|
4002 | + $total_time = " total_time = total_time +".$this->get_total_time().", "; |
|
4003 | + $my_status = " status = '".$this->get_status(false)."' ,"; |
|
4004 | 4004 | } else { |
4005 | 4005 | // Verified into database. |
4006 | 4006 | if (!in_array($row_verified['status'], $case_completed) && |
4007 | 4007 | $my_type_lp == 2 |
4008 | 4008 | ) { |
4009 | - $total_time = " total_time = total_time +" . $this->get_total_time() . ", "; |
|
4010 | - $my_status = " status = '" . $this->get_status(false) . "' ,"; |
|
4011 | - } elseif (in_array($row_verified['status'], $case_completed ) && |
|
4009 | + $total_time = " total_time = total_time +".$this->get_total_time().", "; |
|
4010 | + $my_status = " status = '".$this->get_status(false)."' ,"; |
|
4011 | + } elseif (in_array($row_verified['status'], $case_completed) && |
|
4012 | 4012 | $my_type_lp == 2 && $this->type != 'sco' |
4013 | 4013 | ) { |
4014 | - $total_time = " total_time = total_time +" . $this->get_total_time() . ", "; |
|
4015 | - $my_status = " status = '" . $this->get_status(false) . "' ,"; |
|
4014 | + $total_time = " total_time = total_time +".$this->get_total_time().", "; |
|
4015 | + $my_status = " status = '".$this->get_status(false)."' ,"; |
|
4016 | 4016 | } else { |
4017 | 4017 | if (($my_type_lp == 3 && $this->type == 'au') || |
4018 | 4018 | ($my_type_lp == 1 && $this->type != 'dir')) { |
4019 | 4019 | // Is AICC or Chamilo LP |
4020 | - $total_time = " total_time = total_time + " . $this->get_total_time() . ", "; |
|
4021 | - $my_status = " status = '" . $this->get_status(false) . "' ,"; |
|
4020 | + $total_time = " total_time = total_time + ".$this->get_total_time().", "; |
|
4021 | + $my_status = " status = '".$this->get_status(false)."' ,"; |
|
4022 | 4022 | } |
4023 | 4023 | } |
4024 | 4024 | } |
@@ -4030,27 +4030,27 @@ discard block |
||
4030 | 4030 | ) && $my_type_lp == 2 |
4031 | 4031 | ) { |
4032 | 4032 | // Reset zero new attempt ? |
4033 | - $my_status = " status = '" . $this->get_status(false) . "' ,"; |
|
4033 | + $my_status = " status = '".$this->get_status(false)."' ,"; |
|
4034 | 4034 | } elseif (!in_array($this->get_status(false), $case_completed) && |
4035 | 4035 | $my_type_lp == 2 |
4036 | 4036 | ) { |
4037 | - $total_time = " total_time = " . $this->get_total_time() . ", "; |
|
4038 | - $my_status = " status = '" . $this->get_status(false) . "' ,"; |
|
4037 | + $total_time = " total_time = ".$this->get_total_time().", "; |
|
4038 | + $my_status = " status = '".$this->get_status(false)."' ,"; |
|
4039 | 4039 | } else { |
4040 | 4040 | // It is chamilo LP. |
4041 | - $total_time = " total_time = total_time +" . $this->get_total_time() . ", "; |
|
4042 | - $my_status = " status = '" . $this->get_status(false) . "' ,"; |
|
4041 | + $total_time = " total_time = total_time +".$this->get_total_time().", "; |
|
4042 | + $my_status = " status = '".$this->get_status(false)."' ,"; |
|
4043 | 4043 | } |
4044 | 4044 | |
4045 | 4045 | // This code line fixes the problem of wrong status. |
4046 | 4046 | if ($my_type_lp == 2) { |
4047 | 4047 | // Verify current status in multiples attempts. |
4048 | - $sql = 'SELECT status FROM ' . $item_view_table . ' |
|
4048 | + $sql = 'SELECT status FROM '.$item_view_table.' |
|
4049 | 4049 | WHERE |
4050 | - c_id = ' . $course_id . ' AND |
|
4051 | - lp_item_id="' . $this->db_id . '" AND |
|
4052 | - lp_view_id="' . $this->view_id . '" AND |
|
4053 | - view_count="' . $this->get_attempt_id() . '" '; |
|
4050 | + c_id = ' . $course_id.' AND |
|
4051 | + lp_item_id="' . $this->db_id.'" AND |
|
4052 | + lp_view_id="' . $this->view_id.'" AND |
|
4053 | + view_count="' . $this->get_attempt_id().'" '; |
|
4054 | 4054 | $rs_status = Database::query($sql); |
4055 | 4055 | $current_status = Database::result( |
4056 | 4056 | $rs_status, |
@@ -4061,7 +4061,7 @@ discard block |
||
4061 | 4061 | $my_status = ''; |
4062 | 4062 | $total_time = ''; |
4063 | 4063 | } else { |
4064 | - $total_time = " total_time = total_time +" . $this->get_total_time() . ", "; |
|
4064 | + $total_time = " total_time = total_time +".$this->get_total_time().", "; |
|
4065 | 4065 | } |
4066 | 4066 | } |
4067 | 4067 | } |
@@ -4072,38 +4072,38 @@ discard block |
||
4072 | 4072 | //" . //start_time = ".$this->get_current_start_time().", " . //scorm_init_time does it |
4073 | 4073 | ////" max_time_allowed = '".$this->get_max_time_allowed()."'," . |
4074 | 4074 | $sql = "UPDATE $item_view_table SET |
4075 | - score = " . $this->get_score() . ", |
|
4075 | + score = ".$this->get_score().", |
|
4076 | 4076 | $my_status |
4077 | - max_score = '" . $this->get_max() . "', |
|
4078 | - suspend_data = '" . Database::escape_string($this->current_data) . "', |
|
4079 | - lesson_location = '" . $this->lesson_location . "' |
|
4077 | + max_score = '".$this->get_max()."', |
|
4078 | + suspend_data = '" . Database::escape_string($this->current_data)."', |
|
4079 | + lesson_location = '" . $this->lesson_location."' |
|
4080 | 4080 | WHERE |
4081 | 4081 | c_id = $course_id AND |
4082 | - lp_item_id = " . $this->db_id . " AND |
|
4083 | - lp_view_id = " . $this->view_id . " AND |
|
4082 | + lp_item_id = ".$this->db_id." AND |
|
4083 | + lp_view_id = " . $this->view_id." AND |
|
4084 | 4084 | view_count = " . $this->get_attempt_id(); |
4085 | 4085 | |
4086 | 4086 | } else { |
4087 | 4087 | //" max_time_allowed = '".$this->get_max_time_allowed()."'," . |
4088 | 4088 | $sql = "UPDATE $item_view_table SET |
4089 | 4089 | $total_time |
4090 | - start_time = " . $this->get_current_start_time() . ", |
|
4091 | - score = " . $this->get_score() . ", |
|
4090 | + start_time = ".$this->get_current_start_time().", |
|
4091 | + score = " . $this->get_score().", |
|
4092 | 4092 | $my_status |
4093 | - max_score = '" . $this->get_max() . "', |
|
4094 | - suspend_data = '" . Database::escape_string($this->current_data) . "', |
|
4095 | - lesson_location = '" . $this->lesson_location . "' |
|
4093 | + max_score = '".$this->get_max()."', |
|
4094 | + suspend_data = '" . Database::escape_string($this->current_data)."', |
|
4095 | + lesson_location = '" . $this->lesson_location."' |
|
4096 | 4096 | WHERE |
4097 | 4097 | c_id = $course_id AND |
4098 | - lp_item_id = " . $this->db_id . " AND |
|
4099 | - lp_view_id = " . $this->view_id . " AND |
|
4098 | + lp_item_id = ".$this->db_id." AND |
|
4099 | + lp_view_id = " . $this->view_id." AND |
|
4100 | 4100 | view_count = " . $this->get_attempt_id(); |
4101 | 4101 | } |
4102 | 4102 | $this->current_start_time = time(); |
4103 | 4103 | } |
4104 | 4104 | if (self::debug > 2) { |
4105 | 4105 | error_log( |
4106 | - 'learnpathItem::write_to_db() - Updating item_view: ' . $sql, |
|
4106 | + 'learnpathItem::write_to_db() - Updating item_view: '.$sql, |
|
4107 | 4107 | 0 |
4108 | 4108 | ); |
4109 | 4109 | } |
@@ -4116,8 +4116,8 @@ discard block |
||
4116 | 4116 | $sql = "SELECT id FROM $tbl |
4117 | 4117 | WHERE |
4118 | 4118 | c_id = $course_id AND |
4119 | - lp_item_id = " . $this->db_id . " AND |
|
4120 | - lp_view_id = " . $this->view_id . " AND |
|
4119 | + lp_item_id = ".$this->db_id." AND |
|
4120 | + lp_view_id = " . $this->view_id." AND |
|
4121 | 4121 | view_count = " . $this->get_attempt_id(); |
4122 | 4122 | $res = Database::query($sql); |
4123 | 4123 | if (Database::num_rows($res) > 0) { |
@@ -4125,16 +4125,16 @@ discard block |
||
4125 | 4125 | $lp_iv_id = $row[0]; |
4126 | 4126 | if (self::debug > 2) { |
4127 | 4127 | error_log( |
4128 | - 'learnpathItem::write_to_db() - Got item_view_id ' . |
|
4129 | - $lp_iv_id . ', now checking interactions ', |
|
4128 | + 'learnpathItem::write_to_db() - Got item_view_id '. |
|
4129 | + $lp_iv_id.', now checking interactions ', |
|
4130 | 4130 | 0 |
4131 | 4131 | ); |
4132 | 4132 | } |
4133 | 4133 | foreach ($this->interactions as $index => $interaction) { |
4134 | 4134 | $correct_resp = ''; |
4135 | - if (is_array($interaction[4] ) && !empty($interaction[4][0])) { |
|
4135 | + if (is_array($interaction[4]) && !empty($interaction[4][0])) { |
|
4136 | 4136 | foreach ($interaction[4] as $resp) { |
4137 | - $correct_resp .= $resp . ','; |
|
4137 | + $correct_resp .= $resp.','; |
|
4138 | 4138 | } |
4139 | 4139 | $correct_resp = substr( |
4140 | 4140 | $correct_resp, |
@@ -4153,7 +4153,7 @@ discard block |
||
4153 | 4153 | lp_iv_id = $lp_iv_id AND |
4154 | 4154 | ( |
4155 | 4155 | order_id = $index OR |
4156 | - interaction_id = '" . Database::escape_string($interaction[0]) . "' |
|
4156 | + interaction_id = '".Database::escape_string($interaction[0])."' |
|
4157 | 4157 | ) |
4158 | 4158 | "; |
4159 | 4159 | $iva_res = Database::query($iva_sql); |
@@ -4225,11 +4225,11 @@ discard block |
||
4225 | 4225 | public function add_audio() |
4226 | 4226 | { |
4227 | 4227 | $course_info = api_get_course_info(); |
4228 | - $filepath = api_get_path(SYS_COURSE_PATH) . $course_info['path'] . '/document/'; |
|
4228 | + $filepath = api_get_path(SYS_COURSE_PATH).$course_info['path'].'/document/'; |
|
4229 | 4229 | |
4230 | - if (!is_dir($filepath . 'audio')) { |
|
4230 | + if (!is_dir($filepath.'audio')) { |
|
4231 | 4231 | mkdir( |
4232 | - $filepath . 'audio', |
|
4232 | + $filepath.'audio', |
|
4233 | 4233 | api_get_permissions_for_new_directories() |
4234 | 4234 | ); |
4235 | 4235 | $audio_id = add_document( |
@@ -4288,10 +4288,10 @@ discard block |
||
4288 | 4288 | // Store the mp3 file in the lp_item table. |
4289 | 4289 | $tbl_lp_item = Database::get_course_table(TABLE_LP_ITEM); |
4290 | 4290 | $sql = "UPDATE $tbl_lp_item SET |
4291 | - audio = '" . Database::escape_string($file_path) . "' |
|
4291 | + audio = '".Database::escape_string($file_path)."' |
|
4292 | 4292 | WHERE |
4293 | 4293 | c_id = {$course_info['real_id']} AND |
4294 | - id = '" . intval($this->db_id) . "'"; |
|
4294 | + id = '".intval($this->db_id)."'"; |
|
4295 | 4295 | Database::query($sql); |
4296 | 4296 | } |
4297 | 4297 | |
@@ -4316,10 +4316,10 @@ discard block |
||
4316 | 4316 | // Store the mp3 file in the lp_item table. |
4317 | 4317 | $tbl_lp_item = Database::get_course_table(TABLE_LP_ITEM); |
4318 | 4318 | $sql = "UPDATE $tbl_lp_item SET |
4319 | - audio = '" . Database::escape_string($file_path) . "' |
|
4319 | + audio = '".Database::escape_string($file_path)."' |
|
4320 | 4320 | WHERE |
4321 | 4321 | c_id = {$course_info['real_id']} AND |
4322 | - id = " . intval($this->db_id); |
|
4322 | + id = ".intval($this->db_id); |
|
4323 | 4323 | Database::query($sql); |
4324 | 4324 | } |
4325 | 4325 | return $file_path; |
@@ -4340,7 +4340,7 @@ discard block |
||
4340 | 4340 | } |
4341 | 4341 | $sql = "UPDATE $tbl_lp_item SET |
4342 | 4342 | audio = '' |
4343 | - WHERE c_id = $course_id AND id IN (" . $this->db_id . ")"; |
|
4343 | + WHERE c_id = $course_id AND id IN (".$this->db_id.")"; |
|
4344 | 4344 | Database::query($sql); |
4345 | 4345 | } |
4346 | 4346 | |
@@ -4386,7 +4386,7 @@ discard block |
||
4386 | 4386 | |
4387 | 4387 | if ($type == 'simple') { |
4388 | 4388 | if (in_array($status, array('failed', 'passed', 'browsed'))) { |
4389 | - $myLessonStatus = get_lang('ScormIncomplete');; |
|
4389 | + $myLessonStatus = get_lang('ScormIncomplete'); ; |
|
4390 | 4390 | $classStatus = 'warning'; |
4391 | 4391 | } |
4392 | 4392 | } |
@@ -4535,7 +4535,7 @@ discard block |
||
4535 | 4535 | */ |
4536 | 4536 | public function createForumThread($currentForumId) |
4537 | 4537 | { |
4538 | - require_once api_get_path(SYS_CODE_PATH) . '/forum/forumfunction.inc.php'; |
|
4538 | + require_once api_get_path(SYS_CODE_PATH).'/forum/forumfunction.inc.php'; |
|
4539 | 4539 | |
4540 | 4540 | $em = Database::getManager(); |
4541 | 4541 | $threadRepo = $em->getRepository('ChamiloCourseBundle:CForumThread'); |