Minor - format code

pull/2487/head
jmontoyaa 7 years ago
parent 1c335a8101
commit 32fcc57fbd
  1. 60
      main/gradebook/lib/be/forumthreadlink.class.php
  2. 22
      main/lp/aicc_api.php

@ -51,9 +51,9 @@ class ForumThreadLink extends AbstractLink
$tbl_grade_links = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINK);
$sql = 'SELECT thread_id,thread_title,thread_title_qualify
FROM '.$this->get_forum_thread_table().'
forum_thread WHERE thread_id NOT IN
(
SELECT ref_id FROM '.$tbl_grade_links.'
forum_thread WHERE thread_id NOT IN
(
SELECT ref_id FROM '.$tbl_grade_links.'
WHERE
type = '.LINK_FORUM_THREAD.' AND
c_id = '.intval($this->course_id).'
@ -76,31 +76,31 @@ class ForumThreadLink extends AbstractLink
return $cats;
}
/**
* Generate an array of all exercises available.
* @return array 2-dimensional array - every element contains 2 subelements (id, name)
*/
public function get_all_links()
{
if (empty($this->course_code)) {
return [];
}
$tbl_grade_links = Database::get_course_table(TABLE_FORUM_THREAD);
$tbl_item_property = Database::get_course_table(TABLE_ITEM_PROPERTY);
$session_id = api_get_session_id();
if ($session_id) {
$session_condition = 'tl.session_id='.api_get_session_id();
} else {
$session_condition = '(tl.session_id = 0 OR tl.session_id IS NULL)';
}
$sql = 'SELECT tl.thread_id, tl.thread_title, tl.thread_title_qualify
FROM '.$tbl_grade_links.' tl INNER JOIN '.$tbl_item_property.' ip
ON (tl.thread_id = ip.ref AND tl.c_id = ip.c_id)
WHERE
tl.c_id = '.$this->course_id.' AND
/**
* Generate an array of all exercises available.
* @return array 2-dimensional array - every element contains 2 subelements (id, name)
*/
public function get_all_links()
{
if (empty($this->course_code)) {
return [];
}
$tbl_grade_links = Database::get_course_table(TABLE_FORUM_THREAD);
$tbl_item_property = Database::get_course_table(TABLE_ITEM_PROPERTY);
$session_id = api_get_session_id();
if ($session_id) {
$session_condition = 'tl.session_id='.api_get_session_id();
} else {
$session_condition = '(tl.session_id = 0 OR tl.session_id IS NULL)';
}
$sql = 'SELECT tl.thread_id, tl.thread_title, tl.thread_title_qualify
FROM '.$tbl_grade_links.' tl INNER JOIN '.$tbl_item_property.' ip
ON (tl.thread_id = ip.ref AND tl.c_id = ip.c_id)
WHERE
tl.c_id = '.$this->course_id.' AND
ip.c_id = '.$this->course_id.' AND
ip.tool = "forum_thread" AND
ip.visibility <> 2 AND
@ -359,7 +359,7 @@ class ForumThreadLink extends AbstractLink
return 'forum';
}
function save_linked_data()
public function save_linked_data()
{
$weight = $this->get_weight();
$ref_id = $this->get_ref_id();
@ -372,7 +372,7 @@ class ForumThreadLink extends AbstractLink
}
}
function delete_linked_data()
public function delete_linked_data()
{
$ref_id = $this->get_ref_id();
if (!empty($ref_id)) {

@ -4,14 +4,14 @@
use ChamiloSession as Session;
/**
* API event handler functions for AICC / CMIv4 in API communication mode
* API event handler functions for AICC / CMIv4 in API communication mode
*
* @author Denes Nagy <darkden@freemail.hu>
* @author Yannick Warnier <ywarnier@beeznest.org>
* @version v 1.0
* @access public
* @package chamilo.learnpath
* @license GNU/GPL
* @author Denes Nagy <darkden@freemail.hu>
* @author Yannick Warnier <ywarnier@beeznest.org>
* @version v 1.0
* @access public
* @package chamilo.learnpath
* @license GNU/GPL
*/
/**
@ -141,10 +141,10 @@ function LMSGetValue(param) {
}else if(param == 'cmi.core.student_id'){
result='<?php echo $_user['user_id']; ?>';
}else if(param == 'cmi.core.student_name'){
<?php
$who = addslashes(api_get_person_name($_user['firstName'], $_user['lastName']));
echo "result='$who';";
?>
<?php
$who = addslashes(api_get_person_name($_user['firstName'], $_user['lastName']));
echo "result='$who';";
?>
}else if(param == 'cmi.core.lesson_location'){
result=lesson_location;
}else if(param == 'cmi.core.total_time'){

Loading…
Cancel
Save