Remove deprecated unused code.

1.10.x
Julio Montoya 10 years ago
parent b66a011f7e
commit 33fbb0eef9
  1. 180
      main/admin/style_preview.php
  2. 3
      main/auth/inscription.php
  3. 6
      main/auth/set_temp_password.php
  4. 4
      main/exercice/question_pool.php
  5. 4
      main/inc/lib/AnnouncementEmail.php
  6. 110
      main/inc/lib/course.lib.php
  7. 30
      main/inc/lib/course_description.lib.php
  8. 41
      main/inc/lib/events.lib.php
  9. 17
      main/inc/lib/exercise.lib.php
  10. 58
      main/inc/lib/fileManage.lib.php
  11. 41
      main/inc/lib/groupmanager.lib.php
  12. 81
      main/inc/lib/internationalization.lib.php
  13. 108
      main/inc/lib/statsUtils.lib.inc.php
  14. 177
      main/newscorm/learnpath.class.php
  15. 37
      main/newscorm/learnpath_functions.inc.php
  16. 1
      main/session/session_import.php
  17. 3
      main/webservices/cm_webservice_announcements.php
  18. 304
      main/work/work.lib.php
  19. 9
      tests/main/inc/lib/fileManage.lib.test.php
  20. 9
      tests/main/inc/lib/fileManager.lib.test.php
  21. 2
      tests/main/inc/lib/fileUpload.lib.test.php
  22. 28
      tests/main/inc/lib/statsUtils.lib.inc.test.php
  23. 27
      tests/main/newscorm/learnpath.class.test.php

@ -1,180 +0,0 @@
<?php
/* For licensing terms, see /chamilo_license.txt */
/**
* Deprecated - used to show a preview of a given stylesheet. Now replaced.
* @package chamilo.admin
*/
/**
* Code
*/
// @deprecated This page is not used
exit;
require_once '../inc/global.inc.php';
// Setting the section (for the tabs).
$this_section = SECTION_PLATFORM_ADMIN;
// Access restriction.
api_protect_admin_script();
// Manipulation of the platform-wide css setting.
if (isset($_GET['style']) && $_GET['style'] != '') {
$_setting['stylesheets'] = Security::remove_XSS($_GET['style']);
}
// Hiding the link "Teacher/Student view", it is not needed to be shown here.
$_setting['student_view_enabled'] = 'false';
require_once api_get_path(INCLUDE_PATH).'header.inc.php';
$week_days_short = api_get_week_days_short();
$months_long = api_get_months_long();
?>
<div class="maincontent" id="content">
<h3><?php echo get_lang('Title'); ?></h3>
<div id="courseintro">
<p><?php echo get_lang('IntroductionText'); ?></p>
</div>
<div id="courseintro_icons">
<a href="#"><?php Display::display_icon('edit.gif', get_lang('Edit')); ?></a><a href="#"><?php Display::display_icon('delete.gif', get_lang('Delete')); ?></a></div>
<div class="normal-message">Normal Message</div>
<div class="confirmation-message">Confirmation Message</div>
<div class="warning-message">Warning Message</div>
<div class="error-message">Error Message</div>
<table width="750">
<tr>
<td>
<table>
<tr>
<td width="220">
<table id="smallcalendar" class="data_table">
<tr id="title">
<td width="10%"><a href="#"><?php Display::display_icon('action_prev.png'); ?></a></td>
<td width="80%" colspan="5" align="center"><?php echo $months_long[6]; ?> 2010</td>
<td width="10%"><a href="#"><?php Display::display_icon('action_next.png'); ?></a></td>
</tr>
<tr>
<td class="weekdays"><?php echo $week_days_short[1]; ?></td>
<td class="weekdays"><?php echo $week_days_short[2]; ?></td>
<td class="weekdays"><?php echo $week_days_short[3]; ?></td>
<td class="weekdays"><?php echo $week_days_short[4]; ?></td>
<td class="weekdays"><?php echo $week_days_short[5]; ?></td>
<td class="weekdays"><?php echo $week_days_short[6]; ?></td>
<td class="weekdays"><?php echo $week_days_short[0]; ?></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td class="days_weekend">1</td>
</tr>
<tr>
<td class="days_week">2</td>
<td class="days_week">3</td>
<td class="days_week">4</td>
<td class="days_week">5</td>
<td class="days_week">6</td>
<td class="days_weekend">7</td>
<td class="days_weekend">8</td>
</tr>
<tr>
<td class="days_week">9</td>
<td class="days_week">10</td>
<td class="days_week">11</td>
<td class="days_week">12</td>
<td class="days_week">13</td>
<td class="days_weekend">14</td>
<td class="days_weekend">15</td>
</tr>
<tr>
<td class="days_week">16</td>
<td class="days_week">17</td>
<td class="days_week">18</td>
<td class="days_week">19</td>
<td class="days_week">20</td>
<td class="days_weekend">21</td>
<td class="days_weekend">22</td>
</tr>
<tr>
<td class="days_week">23</td>
<td class="days_today">24</td>
<td class="days_week">25</td>
<td class="days_week">26</td>
<td class="days_week">27</td>
<td class="days_weekend">28</td>
<td class="days_weekend">29</td>
</tr>
<tr>
<td class="days_week">30</td>
<td class="days_week">31</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
<td width="500">
<table width="100%">
<tr>
<td></td>
<td align="right"></td>
</tr>
</table>
<table class="data_table" style="width: 250px;">
<tr>
<th style="width: 50%;"><a href="#"><?php echo get_lang('FirstName'); ?></a>&nbsp;&#8595; </th>
<th><a href="#"><?php echo get_lang('LastName'); ?></a></th>
</tr>
<tr class="row_odd">
<td>Julio</td>
<td>Montoya</td>
</tr>
<tr class="row_even">
<td>Yannick</td>
<td>Warnier</td>
</tr>
</table>
<table width="100%">
<tr>
<td></td>
<td align="right"></td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<div class="menu" id="menu">
<form action="#" method="post" id="formLogin" name="formLogin"><br />
<label><?php echo get_lang('UserName'); ?></label><br />
<input type="text" name="login" id="login" size="15" value="" /><br />
<label><?php echo get_lang('Password'); ?></label><br />
<input type="password" name="password" id="password" size="15" /><br />
<button class="login" type="submit" name="submitAuth"disabled="disabled" ><?php echo get_lang('LoginEnter'); ?></button>
<div class="clear">
&nbsp;
</div>
</form>
<div class="menusection"><span class="menusectioncaption"><?php echo get_lang('User'); ?></span>
<ul class="menulist">
<li><a href="#"><?php echo get_lang('CourseManagement'); ?></a></li>
<li><a href="#"><?php echo get_lang('CourseCreate'); ?></a></li>
</ul>
</div>
<div class="note"><b>Example notice</b><br />
To modify this notice, go to the administration area of the portal.</div>
</div>
<?php
Display::display_footer();
?>

@ -221,9 +221,6 @@ if ($user_already_registered_show_terms == false) {
$form->addRule('openarea', get_lang('ThisFieldIsRequired'), 'required');
}
}
// EXTRA FIELDS
/*$extra_data = UserManager::get_extra_user_data(api_get_user_id(), true);
UserManager::set_extra_fields_in_form($form, $extra_data);*/
// EXTRA FIELDS
$extraField = new ExtraField('user');

@ -2,13 +2,13 @@
/* For license terms, see /license.txt */
/**
* This page aims at requesting a password from a user to access a course
* protected by password. If the password matches the course password, we
* protected by password. If the password matches the course password, we
* store the fact that user can access it during its session
*/
/**
* Initializing context
*/
use \ChamiloSession as Session;
use ChamiloSession as Session;
$cidReset = true;
require_once '../inc/global.inc.php';
@ -26,7 +26,7 @@ if (empty($course_id)) {
/**
* Code
*/
$course_info = CourseManager::get_course_information_by_id($course_id);
$course_info = api_get_course_info_by_id($course_id);
$tpl = new Template(null);

@ -13,7 +13,7 @@
// name of the language file that needs to be included
use \ChamiloSession as Session;
use ChamiloSession as Session;
require_once '../inc/global.inc.php';
@ -303,7 +303,7 @@ if (empty($selected_course) || $selected_course == '-1') {
// no course selected, reset menu test / difficult<EFBFBD> / type de reponse
reset_menu_exo_lvl_type();
} else {
$course_info = CourseManager::get_course_information_by_id($selected_course);
$course_info = api_get_course_info_by_id($selected_course);
}
// If course has changed, reset the menu default
if ($course_id_changed) {

@ -33,9 +33,9 @@ class AnnouncementEmail
{
if (empty($course)) {
$course = api_get_course_int_id();
$course = CourseManager::get_course_information_by_id($course);
$course = api_get_course_info_by_id($course);
} else if (is_numeric($course)) {
$course = CourseManager::get_course_information_by_id($course);
$course = api_get_course_info_by_id($course);
}
$this->course = $course;
$this->session_id = api_get_session_id();

@ -171,23 +171,6 @@ class CourseManager
);
}
/**
* Returns all the information of a given coursecode
* @param int the course id
* @return an array with all the fields of the course table
* @deprecated use api_get_course_info_by_id()
* @assert ('') === false
*/
public static function get_course_information_by_id($course_id)
{
return Database::select(
'*, id as real_id',
Database::get_main_table(TABLE_MAIN_COURSE),
array('where' => array('id = ?' => intval($course_id))),
'first'
);
}
/**
* Returns a list of courses. Should work with quickform syntax
* @param integer $from Offset (from the 7th = '6'). Optional.
@ -1009,27 +992,6 @@ class CourseManager
return $data;
}
/**
* Return an array of arrays, listing course info of all virtual course
* linked to the real course ID $real_course_code
*
* @param string The id of the real course which the virtual courses are linked to
* @return array List of courses details
* @deprecated virtual courses doesn't exist anymore
*/
public static function get_virtual_courses_linked_to_real_course($real_course_code)
{
$sql_result = Database::query(
"SELECT * FROM " . Database::get_main_table(TABLE_MAIN_COURSE) . "
WHERE target_course_code = '" . Database::get_main_table(TABLE_MAIN_COURSE) . "'"
);
$result_array = array();
while ($result = Database::fetch_array($sql_result)) {
$result_array[] = $result;
}
return $result_array;
}
/**
* @param int $userId
* @param array $courseInfo
@ -2014,8 +1976,6 @@ class CourseManager
*/
public static function get_real_and_linked_user_list($course_code, $with_sessions = true, $session_id = 0)
{
//get list of virtual courses
$virtual_course_list = self::get_virtual_courses_linked_to_real_course($course_code);
$complete_user_list = array();
//get users from real course
@ -2024,53 +1984,9 @@ class CourseManager
$complete_user_list[] = $this_user;
}
//get users from linked courses
foreach ($virtual_course_list as $this_course) {
$course_code = $this_course['code'];
$user_list = self::get_user_list_from_course_code($course_code, $session_id);
foreach ($user_list as $this_user) {
$complete_user_list[] = $this_user;
}
}
return $complete_user_list;
}
/**
* Return an array of arrays, listing course info of all courses in the list
* linked to the real course $real_course_code, to which the user $user_id is subscribed.
*
* @param $user_id , the id (int) of the user
* @param $real_course_code , the id (char) of the real course
*
* @return array of course info arrays
* @deprecated virtual course feature is not supported
*/
public static function get_list_of_virtual_courses_for_specific_user_and_real_course($user_id, $course_code)
{
$result_array = array();
if ($user_id != strval(intval($user_id))) {
return $result_array;
}
$course_code = Database::escape_string($course_code);
$sql = "SELECT *
FROM " . Database::get_main_table(TABLE_MAIN_COURSE) . " course
LEFT JOIN " . Database::get_main_table(TABLE_MAIN_COURSE_USER) . " course_user
ON course.id = course_user.c_id
WHERE
course.target_course_code = '$course_code' AND
course_user.user_id = '$user_id' AND
course_user.relation_type<>" . COURSE_RELATION_TYPE_RRHH . " ";
$sql_result = Database::query($sql);
while ($result = Database::fetch_array($sql_result)) {
$result_array[] = $result;
}
return $result_array;
}
/**
* Get the list of groups from the course
* @param string $course_code
@ -2403,24 +2319,6 @@ class CourseManager
return $course_sort;
}
/**
* create recursively all categories as option of the select passed in parameter.
*
* @param HTML_QuickForm_Element $element
* @param string $defaultCode the option value to select by default (used mainly for edition of courses)
* @param string $parentCode the parent category of the categories added (default=null for root category)
* @param string $padding the indent param (you shouldn't indicate something here)
* @deprecated use the select_ajax solution see admin/course_edit.php
*/
public static function select_and_sort_categories(
$element,
$defaultCode = null,
$parentCode = null,
$padding = null
) {
setCategoriesInForm($element, $defaultCode, $parentCode, $padding);
}
/**
* check if course exists
* @param string course_code
@ -3237,14 +3135,6 @@ class CourseManager
}
}
/**
* @deprecated See CourseManager::course_code_exists()
*/
public static function is_existing_course_code($wanted_course_code)
{
return self::course_code_exists($wanted_course_code);
}
/**
* Builds the course block in user_portal.php
* @todo use Twig

@ -88,36 +88,6 @@ class CourseDescription
return $data;
}
/**
* Get all data of course description by session id,
* first you must set session_id property with the object CourseDescription
* @deprecated
* @return array
*/
public function get_description_history($description_type)
{
$tbl_stats_item_property = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ITEM_PROPERTY);
$tbl_item_property = Database::get_course_table(TABLE_ITEM_PROPERTY);
$description_id = $this->get_id_by_description_type($description_type);
$item_property_id = api_get_item_property_id(api_get_course_id(), TOOL_COURSE_DESCRIPTION, $description_id);
$course_id = api_get_course_int_id();
$sql = "SELECT tip.id, tip.course_id, tip.item_property_id, tip.title, tip.content, tip.progress, tip.lastedit_date, tip.session_id
FROM $tbl_stats_item_property tip INNER JOIN $tbl_item_property ip
ON ip.tool = '" . TOOL_COURSE_DESCRIPTION . "' AND ip.id = tip.item_property_id
WHERE ip.c_id = $course_id AND tip.course_id = '$course_id' AND tip.session_id = '" . intval($this->session_id) . "'
ORDER BY tip.lastedit_date DESC";
$rs = Database::query($sql);
$data = array();
while ($description = Database::fetch_array($rs)) {
$data['descriptions'][] = $description;
}
return $data;
}
/**
* Get all data by description and session id,
* first you must set session_id property with the object CourseDescription

@ -779,20 +779,6 @@ class Event
return false;
}
/**
* @deprecated seems not to be use.
* @param $user_id
* @param $event_type
* @return mixed
*/
function get_latest_event_by_user_and_type($user_id, $event_type)
{
$result = self::get_events_by_user_and_type($user_id, $event_type);
if ($result && !empty($result)) {
return $result[0];
}
}
/**
* Save the new message for one event and for one language
*
@ -853,32 +839,6 @@ class Event
Database::query($sql);
}
/**
* @param $etId
* @param $users
* @param $message
* @param $subject
* @deprecated seem not to be use
*/
public static function eventTypeMod($etId, $users, $message, $subject) {
$etId = intval($etId);
$sql = 'DELETE FROM '.Database::get_main_table(TABLE_EVENT_TYPE_REL_USER).' WHERE event_type_id = '.$etId.' ';
Database::query($sql);
foreach ($users as $user) {
$sql = 'INSERT INTO '.Database::get_main_table(TABLE_EVENT_TYPE_REL_USER).' (user_id,event_type_id)
VALUES('.intval($user).','.$etId.') ';
Database::query($sql);
}
$sql = 'UPDATE '.Database::get_main_table(TABLE_MAIN_EVENT_TYPE_MESSAGE).'
SET message = "'.Database::escape_string($message).'",
subject = "'.Database::escape_string($subject).'"
WHERE event_type_id = '.$etId.'';
Database::query($sql);
}
/**
* Gets the last attempt of an exercise based in the exe_id
* @param int $exe_id
@ -892,6 +852,7 @@ class Event
$rs_last_attempt = Database::query($sql_track_attempt);
$row_last_attempt = Database::fetch_array($rs_last_attempt);
$last_attempt_date = $row_last_attempt['last_attempt_date']; //Get the date of last attempt
return $last_attempt_date;
}

@ -3493,23 +3493,6 @@ HTML;
return $res;
}
/**
* Return a list of group for user with user_id=in_userid separated with in_separator
* @deprecated ?
*/
public static function displayGroupsForUser($in_separator, $in_userid)
{
$res = implode(
$in_separator,
GroupManager::get_user_group_name($in_userid)
);
if ($res == "") {
$res = "<div style='text-align:center'>-</div>";
}
return $res;
}
/**
* @param int $exe_id
*/

@ -507,61 +507,3 @@ function mkdirs($path, $mode = '0770') {
return true;
}
}
/**
* @deprecated 06-FEB-2010. The function mkdir() is able to create directories recursively.
* @link http://php.net/manual/en/function.mkdir.php
*
* to create missing directory in a gived path
*
* @returns a resource identifier or FALSE if the query was not executed correctly.
* @author KilerCris@Mail.com original function from php manual
* @author Christophe Gesch<EFBFBD> gesche@ipm.ucl.ac.be Claroline Team
* @since 28-Aug-2001 09:12
* @param sting $path wanted path
* @param boolean $verbose fix if comments must be printed
* @param string $mode fix if chmod is same of parent or default (Note: This misterious parameter is not used).
* Note string $langCreatedIn string used to say "create in"
*/
function mkpath($path, $verbose = false, $mode = 'herit') {
global $langCreatedIn, $_configuration;
$path = str_replace('/', "\\", $path);
$dirs = explode("\\", $path);
$path = $dirs[0];
if ($verbose) {
echo '<ul>';
}
for ($i = 1; $i < sizeof($dirs); $i++) {
$path .= '/'.$dirs[$i];
if (ereg('^'.$path, $_configuration['root_sys']) && strlen($path) < strlen($_configuration['root_sys'])) {
continue;
}
if (!is_dir($path)) {
$ret = mkdir($path, api_get_permissions_for_new_directories());
if ($ret) {
if ($verbose) {
echo '<li><strong>'.basename($path).'</strong><br />'.$langCreatedIn.'<br /><strong>'.realpath($path.'/..').'</strong></li>';
}
} else {
if ($verbose) {
echo '</ul>error : '.$path.' not created';
}
$ret = false;
break;
}
}
}
if ($verbose) {
echo '</ul>';
}
return $ret;
}

@ -1783,23 +1783,23 @@ class GroupManager
}
/**
* Get a combined list of all users of the real course $course_code
* and all users in virtual courses linked to this course $course_code
* Filter user list: remove duplicate users; plus
* remove users that
* - are already in the current group $group_id;
* - do not have student status in these courses;
* - are not appointed as tutor (group assistent) for this group;
* - have already reached their maximum # of groups in this course.
* Get a combined list of all users of the real course $course_code
* and all users in virtual courses linked to this course $course_code
* Filter user list: remove duplicate users; plus
* remove users that
* - are already in the current group $group_id;
* - do not have student status in these courses;
* - are not appointed as tutor (group assistent) for this group;
* - have already reached their maximum # of groups in this course.
*
* Originally to get the correct list of users a big SQL statement was used,
* but this has become more complicated now there is not just one real course but many virtual courses.
* Still, that could have worked as well.
* Originally to get the correct list of users a big SQL statement was used,
* but this has become more complicated now there is not just one real course but many virtual courses.
* Still, that could have worked as well.
*
* @version 1.1.3
* @author Roan Embrechts
* @version 1.1.3
* @author Roan Embrechts
*/
public static function get_complete_list_of_users_that_can_be_added_to_group ($course_code, $group_id)
public static function get_complete_list_of_users_that_can_be_added_to_group($course_code, $group_id)
{
$_course = api_get_course_info();
$_user = api_get_user_info();
@ -1809,14 +1809,11 @@ class GroupManager
$real_course_code = $_course['sysCode'];
$real_course_info = api_get_course_info($real_course_code);
$real_course_user_list = CourseManager :: get_user_list_from_course_code($real_course_code);
//get list of all virtual courses
$user_subscribed_course_list = CourseManager :: get_list_of_virtual_courses_for_specific_user_and_real_course($_user['user_id'], $real_course_code);
//add real course to the list
$user_subscribed_course_list[] = $real_course_info;
if (!is_array($user_subscribed_course_list)) {
return;
}
//for all courses...
// add real course to the list
$user_subscribed_course_list = array($real_course_info);
// for all courses...
foreach ($user_subscribed_course_list as $this_course) {
$this_course_code = $this_course['code'];
$course_user_list = CourseManager :: get_user_list_from_course_code($this_course_code);

@ -51,9 +51,11 @@ define('PERSON_NAME_WESTERN_ORDER', 1);
define('PERSON_NAME_EASTERN_ORDER', 2);
// Contextual: formatting person's name in library order: last_name, first_name
define('PERSON_NAME_LIBRARY_ORDER', 3);
// Contextual: formatting a person's name assotiated with an email-address. Ivan: I am not sure how seems email servers an clients would interpret name order, so I assign the Western order.
// Contextual: formatting a person's name assotiated with an email-address.
// Ivan: I am not sure how seems email servers an clients would interpret name order, so I assign the Western order.
define('PERSON_NAME_EMAIL_ADDRESS', PERSON_NAME_WESTERN_ORDER);
// Contextual: formatting a person's name for data-exporting operations. For backward compatibility this format has been set to Eastern order.
// Contextual: formatting a person's name for data-exporting operations.
// For backward compatibility this format has been set to Eastern order.
define('PERSON_NAME_DATA_EXPORT', PERSON_NAME_EASTERN_ORDER);
// The following constants are used for tuning language detection functionality.
@ -169,7 +171,6 @@ function get_lang($variable, $reserved = null, $language = null) {
$used_lang_vars[$variable.$lang_postfix] = $ret;
return $ret;
}
/**
@ -324,11 +325,6 @@ function api_get_text_direction($language = null)
return $text_direction[$language];
}
/**
* Date and time conversions and formats
*/
/**
* Returns an alphabetized list of timezones in an associative array that can be used to populate a select
*
@ -390,7 +386,8 @@ function _api_get_timezone()
* @author Julio Montoya - Adding the 2nd parameter
* @author Guillaume Viguier <guillaume.viguier@beeznest.com>
*/
function api_get_utc_datetime($time = null, $return_null_if_invalid_date = false) {
function api_get_utc_datetime($time = null, $return_null_if_invalid_date = false)
{
$from_timezone = _api_get_timezone();
$to_timezone = 'UTC';
if (is_null($time) || empty($time) || $time == '0000-00-00 00:00:00') {
@ -893,7 +890,20 @@ function api_get_person_name(
$format = $valid[$format][$language];
$keywords = array('%firstname', '%f', '%F', '%lastname', '%l', '%L', '%title', '%t', '%T', '%username', '%u', '%U');
$keywords = array(
'%firstname',
'%f',
'%F',
'%lastname',
'%l',
'%L',
'%title',
'%t',
'%T',
'%username',
'%u',
'%U',
);
$values = array(
$first_name,
@ -1040,7 +1050,7 @@ function api_to_system_encoding($string, $from_encoding = null, $check_utf8_vali
*/
function api_htmlentities($string, $quote_style = ENT_COMPAT, $encoding = 'UTF-8')
{
switch($quote_style) {
switch ($quote_style) {
case ENT_COMPAT:
$string = str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $string);
break;
@ -1427,11 +1437,8 @@ function api_substr_replace($string, $replacement, $start, $length = null, $enco
* This function is aimed at replacing the function ucfirst() for human-language strings.
* @link http://php.net/manual/en/function.ucfirst
*/
function api_ucfirst($string, $encoding = null) {
/*if (empty($encoding)) {
$encoding = _api_mb_internal_encoding();
}
return api_strtoupper(api_substr($string, 0, 1, $encoding), $encoding) . api_substr($string, 1, api_strlen($string, $encoding), $encoding);*/
function api_ucfirst($string, $encoding = null)
{
return Utf8::ucfirst($string);
}
@ -1443,20 +1450,11 @@ function api_ucfirst($string, $encoding = null) {
* This function is aimed at replacing the function ucwords() for human-language strings.
* @link http://php.net/manual/en/function.ucwords
*/
function api_ucwords($string, $encoding = null) {
/*if (_api_mb_supports($encoding)) {
if (empty($encoding)) {
$encoding = _api_mb_internal_encoding();
}
return mb_convert_case($string, MB_CASE_TITLE, $encoding);
}*/
function api_ucwords($string, $encoding = null)
{
return Utf8::ucwords($string);
}
/**
* String operations using regular expressions
*/
/**
* Performs a regular expression match, UTF-8 aware when it is applicable.
* @param string $pattern The pattern to search for, as a string.
@ -1530,7 +1528,6 @@ function api_preg_replace($pattern, $replacement, $subject, $limit = -1, &$count
return preg_replace($pattern, $replacement, $subject, $limit, $count);
}
/**
* Splits a string by a regular expression, UTF-8 aware when it is applicable.
* @param string $pattern The pattern to search for, as a string.
@ -1705,6 +1702,7 @@ function api_is_utf8($encoding)
}
return $result[$encoding];
}
/**
* This function returns the encoding, currently used by the system.
* @return string The system's encoding.
@ -1804,8 +1802,29 @@ function &_api_get_day_month_names($language = null) {
$language = api_get_interface_language();
}
if (!isset($date_parts[$language])) {
$week_day = array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday');
$month = array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');
$week_day = array(
'Sunday',
'Monday',
'Tuesday',
'Wednesday',
'Thursday',
'Friday',
'Saturday',
);
$month = array(
'January',
'February',
'March',
'April',
'May',
'June',
'July',
'August',
'September',
'October',
'November',
'December',
);
for ($i = 0; $i < 7; $i++) {
$date_parts[$language]['days_short'][] = get_lang($week_day[$i].'Short', '', $language);
$date_parts[$language]['days_long'][] = get_lang($week_day[$i].'Long', '', $language);
@ -2007,5 +2026,3 @@ function _api_convert_encoding_supports($encoding) {
}
return $supports[$encoding];
}

@ -281,112 +281,4 @@ class StatsUtils
echo "</table>";
}
/**
* @author Sebastien Piraux <piraux_seb@hotmail.com>
* @param array_of_results : a 2 columns array
* @param title1 : string, title of the first column
* @param title2 : string, title of the ... second column
* @desc display a 2 column tab from an array
* @deprecated seem not to be use
* titles of columns are title1 and title2
*/
public static function buildTab2col($array_of_results, $title1, $title2)
{
echo "<table cellpadding='2' cellspacing='1' border='1' align='center'>\n";
echo "<tr>
<td bgcolor='#E6E6E6'>
$title1
</td>
<td bgcolor='#E6E6E6'>
$title2
</td>
</tr>\n";
if (is_array($array_of_results)) {
for ($j = 0; $j < count($array_of_results); $j++) {
echo '<tr>';
echo '<td bgcolor="#eeeeee">' . $array_of_results[$j][0] . '</td>';
echo '<td align="right">' . $array_of_results[$j][1] . '</td>';
echo "</tr>\n";
}
} else {
echo '<tr>';
echo '<td colspan="2" align="center">' . get_lang(
'NoResult'
) . '</td>';
echo "</tr>\n";
}
echo "</table>\n";
}
/**
* @author Sebastien Piraux <piraux_seb@hotmail.com>
* @param array_of_results : a 2 columns array
* @desc display a 2 column tab from an array
* this tab has no title
* @deprecated seem not to be use
*/
public static function buildTab2ColNoTitle($array_of_results)
{
echo "<table cellpadding='3' cellspacing='1' border='0' align='center'>\n";
if (is_array($array_of_results)) {
for ($j = 0; $j < count($array_of_results); $j++) {
echo '<tr>';
echo '<td bgcolor="#eeeeee">' . $array_of_results[$j][0] . '</td>';
echo '<td align="right">&nbsp;&nbsp;' . $array_of_results[$j][1] . '</td>';
echo "</tr>\n";
}
} else {
echo '<tr>';
echo '<td colspan="2" align="center">' . get_lang(
'NoResult'
) . '</td>';
echo "</tr>\n";
}
echo "</table>\n";
}
/**
* @author Sebastien Piraux <piraux_seb@hotmail.com>
* @param array_of_results : a 2 columns array
* @desc this function is used to display
* integrity errors in the platform
* if array_of_results is not an array there is
* no error, else errors are displayed
* @deprecated seem not to be use
*/
public static function buildTabDefcon($array_of_results)
{
echo "<table width='60%' cellpadding='2' cellspacing='1' border='0' align=center class='minitext'>\n";
if (is_array($array_of_results)) {
// there are some strange cases...
echo '<tr>';
echo '<td colspan="2" align="center" bgcolor="#eeeeee"><font color="#ff0000">' . get_lang(
'Defcon'
) . '</font></td>';
echo "</tr>\n";
for ($j = 0; $j < count($array_of_results); $j++) {
if ($array_of_results[$j][0] == "") {
$key = get_lang('NULLValue');
} else {
$key = $array_of_results[$j][0];
}
echo '<tr>';
echo '<td width="70%" class="content">' . $key . '</td>';
echo '<td width="30%" align="right">' . $array_of_results[$j][1] . '</td>';
echo "</tr>\n";
}
} else {
// all right
echo '<tr>';
echo '<td colspan="2" align="center"><font color="#00ff00">' . get_lang(
'AllRight'
) . '</font></td>';
echo "</tr>\n";
}
echo "</table>\n";
}
}

@ -2161,97 +2161,6 @@ class learnpath
return 0;
}
/**
* Gets the progress value from the progress field in the database (allows use as abstract method)
* @param integer $lp_id Learnpath ID
* @param integer $user_id User ID
* @param string $mode Mode of display ('%','abs' or 'both')
* @param string $course_code Course code (optional, defaults to '')
* @param boolean $sincere Whether to return null if no record
* was found (true), or 0 (false) (optional, defaults to false)
* @param int $session_id
* @return integer Current progress value as found in the database
* @deprecated
*/
public static function get_db_progress(
$lp_id,
$user_id,
$mode = '%',
$course_code = '',
$sincere = false,
$session_id = 0
) {
$table = Database :: get_course_table(TABLE_LP_VIEW);
$lp_id = intval($lp_id);
$session_id = intval($session_id);
$user_id = intval($user_id);
$course_info = api_get_course_info($course_code);
$session_condition = api_get_session_condition($session_id);
$course_id = $course_info['real_id'];
$sql = "SELECT * FROM $table
WHERE c_id = ".$course_id." AND lp_id = $lp_id AND user_id = $user_id $session_condition";
$res = Database::query($sql);
$view_id = 0;
if (Database :: num_rows($res) > 0) {
$row = Database :: fetch_array($res);
$progress = $row['progress'];
$view_id = $row['id'];
} else {
if ($sincere) {
return null;
}
}
if (empty($progress)) {
$progress = '0';
}
if ($mode == '%') {
return $progress . '%';
} else {
// Get the number of items completed and the number of items total.
$tbl = Database :: get_course_table(TABLE_LP_ITEM);
$sql = "SELECT count(*) FROM $tbl
WHERE
c_id = $course_id AND
c_id = ".$course_id." AND
lp_id = " . $lp_id . " AND
item_type NOT IN('dokeos_chapter','chapter','dir')";
$res = Database::query($sql);
$row = Database :: fetch_array($res);
$total = $row[0];
$tbl_item_view = Database :: get_course_table(TABLE_LP_ITEM_VIEW);
$tbl_item = Database :: get_course_table(TABLE_LP_ITEM);
// Trying as also counting browsed and failed items.
$sql = "SELECT count(distinct(lp_item_id))
FROM $tbl_item_view as item_view
INNER JOIN $tbl_item as item
ON
item.id = item_view.lp_item_id AND
item_type NOT IN('dokeos_chapter','chapter','dir')
WHERE
item_view.c_id = $course_id AND
item.c_id = $course_id AND
lp_view_id = $view_id AND
status IN ('passed','completed','succeeded','browsed','failed')";
$res = Database::query($sql);
$row = Database :: fetch_array($res);
$completed = $row[0];
if ($mode == 'abs') {
return $completed . '/' . $total;
} elseif ($mode == 'both') {
if ($progress < ($completed / ($total ? $total : 1))) {
$progress = number_format(($completed / ($total ? $total : 1)) * 100, 0);
}
return $progress . '% (' . $completed . '/' . $total . ')';
}
}
return $progress;
}
/**
* Returns the HTML necessary to print a mediaplayer block inside a page
* @return string The mediaplayer HTML
@ -5872,92 +5781,6 @@ class learnpath
echo $return;
}
/**
* This functions builds the LP tree based on data from the database.
* @return string
* @deprecated use the return_new_tree() function
* @uses dtree.js :: necessary javascript for building this tree
*/
public function build_tree()
{
$course_id = api_get_course_int_id();
$return = "<script type=\"text/javascript\">\n";
$return .= "\tm = new dTree('m');\n\n";
$return .= "\tm.config.folderLinks = true;\n";
$return .= "\tm.config.useCookies = true;\n";
$return .= "\tm.config.useIcons = true;\n";
$return .= "\tm.config.useLines = true;\n";
$return .= "\tm.config.useSelection = true;\n";
$return .= "\tm.config.useStatustext = false;\n\n";
$menu = 0;
$parent = '';
$return .= "\tm.add(" . $menu . ", -1, '" . addslashes(Security::remove_XSS(($this->name))) . "');\n";
$tbl_lp_item = Database :: get_course_table(TABLE_LP_ITEM);
$sql = " SELECT
id,
title,
description,
item_type,
path,
parent_item_id,
previous_item_id,
next_item_id,
max_score,
min_score,
mastery_score,
display_order
FROM $tbl_lp_item
WHERE c_id = ".$course_id." AND lp_id = " . intval($this->lp_id);
$result = Database::query($sql);
$arrLP = array ();
while ($row = Database :: fetch_array($result)) {
$row['title'] = Security :: remove_XSS($row['title']);
$row['description'] = Security :: remove_XSS($row['description']);
$arrLP[] = array(
'id' => $row['id'],
'item_type' => $row['item_type'],
'title' => $row['title'],
'path' => $row['path'],
'description' => $row['description'],
'parent_item_id' => $row['parent_item_id'],
'previous_item_id' => $row['previous_item_id'],
'next_item_id' => $row['next_item_id'],
'max_score' => $row['max_score'],
'min_score' => $row['min_score'],
'mastery_score' => $row['mastery_score'],
'display_order' => $row['display_order']
);
}
$this->tree_array($arrLP);
$arrLP = $this->arrMenu;
unset ($this->arrMenu);
for ($i = 0; $i < count($arrLP); $i++) {
$title = addslashes($arrLP[$i]['title']);
$menu_page = api_get_self() . '?cidReq=' . Security :: remove_XSS($_GET['cidReq']) . '&action=view_item&id=' . $arrLP[$i]['id'] . '&lp_id=' . $_SESSION['oLP']->lp_id;
$icon_name = str_replace(' ', '', $arrLP[$i]['item_type']);
if (file_exists('../img/lp_' . $icon_name . '.png')) {
$return .= "\tm.add(" . $arrLP[$i]['id'] . ", " . $arrLP[$i]['parent_item_id'] . ", '" . $title . "', '" . $menu_page . "', '', '', '../img/lp_" . $icon_name . ".png', '../img/lp_" . $icon_name . ".png');\n";
} else
if (file_exists('../img/lp_' . $icon_name . '.gif')) {
$return .= "\tm.add(" . $arrLP[$i]['id'] . ", " . $arrLP[$i]['parent_item_id'] . ", '" . $title . "', '" . $menu_page . "', '', '', '../img/lp_" . $icon_name . ".gif', '../img/lp_" . $icon_name . ".gif');\n";
} else {
$return .= "\tm.add(" . $arrLP[$i]['id'] . ", " . $arrLP[$i]['parent_item_id'] . ", '" . $title . "', '" . $menu_page . "', '', '', '../img/folder_document.gif', '../img/folder_document.gif');\n";
}
if ($menu < $arrLP[$i]['id'])
$menu = $arrLP[$i]['id'];
}
$return .= "\n\tdocument.write(m);\n";
$return .= "\t if(!m.selectedNode) m.s(1);";
$return .= "</script>\n";
return $return;
}
/**
* Creates the default learning path folder
* @param array $course

@ -1811,43 +1811,6 @@ function deldir($dir) {
return false;
}
/**
* Export SCORM content into a zip file
*
* Basically, all this function does is put the scorm directory back into a zip file (like the one
* that was most probably used to import the course at first)
* @deprecated this function is only called in the newscorm/scorm_admin.php which is deprecated
*
* @param string Name of the SCORM path (or the directory under which it resides)
* @param array Not used right now. Should replace the use of global $_course
* @return void
* @author imandak80
*/
function exportSCORM($scormname, $course) {
global $_course;
// Initialize.
$tmpname = api_get_path(SYS_COURSE_PATH).$_course['path'].'/scorm';
$zipfoldername = $tmpname.$scormname;
$zipfilename = $zipfoldername.'.zip';
// Create zipfile of given directory.
include_once api_get_path(LIBRARY_PATH).'pclzip/pclzip.lib.php';
$zip_folder = new PclZip($zipfilename);
$list = 1;
//$list = $zip_folder->create($zipfoldername.'/',PCLZIP_OPT_REMOVE_PATH,$tmpname.$scormname."/"); // whitout folder
$list = $zip_folder->create($zipfoldername.'/', PCLZIP_OPT_REMOVE_PATH, $tmpname);
if ($list == 0) {
//echo "Error : ".$zip_folder->errorInfo(true);
}
// Send to client.
DocumentManager :: file_send_for_download($zipfilename, false, basename($scormname.'.zip'));
// Clear.
my_delete($zipfilename);
}
/**
* This function returns an xml tag
* $data behaves as the content in case of full tags

@ -252,6 +252,7 @@ if (isset($_POST['formSent']) && $_POST['formSent']) {
$session_name .= $suffix;
}
}
// Creating the session.
$sql_session = "INSERT IGNORE INTO $tbl_session SET
name = '".Database::escape_string($session_name)."',

@ -83,9 +83,6 @@ class WSCMAnnouncements extends WSCM
$announcement_id = ($announcement_id == 0) ? "" : "AND announcement.id=".$announcement_id;
$user_id = UserManager::get_user_id_from_username($username);
//$listOfCourses = CourseManager::get_course_information_by_id($course_id);
$course_info = CourseManager::get_course_information($course_code);
$course_db = $course_info['db_name'];

@ -525,310 +525,6 @@ function getUniqueStudentAttempts(
return $row[0];
}
/**
* Display the list of student publications, taking into account the user status
* @deprecated
* @param $id
* @param $my_folder_data
* @param $work_parents
* @param $origin
* @param array $userList
*/
function display_student_publications_list(
$id,
$my_folder_data,
$work_parents,
$origin,
$userList = array()
) {
global $gradebook;
// Database table names
$work_table = Database::get_course_table(TABLE_STUDENT_PUBLICATION);
$iprop_table = Database::get_course_table(TABLE_ITEM_PROPERTY);
$work_assigment = Database::get_course_table(TABLE_STUDENT_PUBLICATION_ASSIGNMENT);
$is_allowed_to_edit = api_is_allowed_to_edit(null, true);
$session_id = api_get_session_id();
$condition_session = api_get_session_condition($session_id);
$course_info = api_get_course_info();
$course_id = $course_info['real_id'];
$sort_params = array();
if (isset($_GET['column'])) {
$sort_params[] = 'column='.Security::remove_XSS($_GET['column']);
}
if (isset($_GET['page_nr'])) {
$sort_params[] = 'page_nr='.Security::remove_XSS($_GET['page_nr']);
}
if (isset($_GET['per_page'])) {
$sort_params[] = 'per_page='.Security::remove_XSS($_GET['per_page']);
}
if (isset($_GET['direction'])) {
$sort_params[] = 'direction='.Security::remove_XSS($_GET['direction']);
}
$sort_params = implode('&amp;', $sort_params);
$my_params = $sort_params;
$origin = Security::remove_XSS($origin);
$qualification_exists = false;
if (!empty($my_folder_data['qualification']) && intval($my_folder_data['qualification']) > 0) {
$qualification_exists = true;
}
$table_header = array();
$table_has_actions_column = false;
$table_header[] = array(get_lang('Type'), false, 'style="width:40px"');
$table_header[] = array(get_lang('Title'), true);
if (!empty($id)) {
$table_header[] = array(get_lang('FirstName'), true);
$table_header[] = array(get_lang('LastName'), true);
}
$table_header[] = array(get_lang('HandOutDateLimit'), true, 'style="width:200px"');
if ($is_allowed_to_edit) {
$table_header[] = array(get_lang('HandedOut'), false);
$table_header[] = array(get_lang('Actions'), false, 'style="width:90px"', array('class'=>'td_actions'));
$table_has_actions_column = true;
if ($qualification_exists) {
$table_header[] = array(get_lang('Qualification'), true);
}
} else {
// All users
if ($course_info['show_score'] == 0) {
$table_header[] = array(get_lang('Others'), false);
}
}
$table_data = array();
// List of all folders if no id was provided
$group_id = api_get_group_id();
if (is_array($work_parents)) {
foreach ($work_parents as $work_parent) {
$sql_select_directory = "SELECT
title,
url,
prop.insert_date,
prop.lastedit_date,
work.id, author,
has_properties,
view_properties,
description,
qualification,
weight,
allow_text_assignment
FROM ".$iprop_table." prop
INNER JOIN ".$work_table." work
ON (prop.ref=work.id AND prop.c_id = $course_id)
WHERE active IN (0, 1) AND ";
if (!empty($group_id)) {
// set to select only messages posted by the user's group
$sql_select_directory .= " work.post_group_id = '".$group_id."' ";
} else {
$sql_select_directory .= " work.post_group_id = '0' ";
}
$sql_select_directory .= " AND
work.c_id = $course_id AND
work.id = ".$work_parent->id." AND
work.filetype = 'folder' AND
prop.tool='work' $condition_session";
$result = Database::query($sql_select_directory);
$row = Database::fetch_array($result, 'ASSOC');
if (!$row) {
// the folder belongs to another session
continue;
}
// form edit directory
$homework = array();
if (!empty($row['has_properties'])) {
$sql = 'SELECT *
FROM '.$work_assigment.'
WHERE
c_id = '.$course_id.' AND
id = "'.$row['has_properties'].'"
LIMIT 1';
$sql = Database::query($sql);
$homework = Database::fetch_array($sql);
}
// save original value for later
$utc_expiry_time = isset($homework['expires_on']) ? $homework['expires_on'] : null;
$work_data = get_work_data_by_id($work_parent->id);
$workId = $row['id'];
$action = '';
$row = array();
$class = '';
$course_id = api_get_course_int_id();
if (api_is_allowed_to_edit()) {
$cant_files = get_count_work($work_data['id']);
} else {
$isSubscribed = userIsSubscribedToWork(api_get_user_id(), $work_data['id'], $course_id);
if ($isSubscribed == false) {
continue;
}
$cant_files = get_count_work($work_data['id'], api_get_user_id());
}
$text_file = get_lang('FilesUpload');
if ($cant_files == 1) {
$text_file = api_strtolower(get_lang('FileUpload'));
}
$icon = Display::return_icon('work.png', get_lang('Assignment'), array(), ICON_SIZE_SMALL);
$row[] = '<a href="'.api_get_self().'?'.api_get_cidreq().'&origin='.$origin.'&gradebook='.$gradebook.'">'.$icon.'</a>';
$link_info = GradebookUtils::is_resource_in_course_gradebook(api_get_course_id(), 3, $workId, api_get_session_id());
$link_id = $link_info['id'];
$count = 0;
if ($link_info !== false) {
$gradebook_data = GradebookUtils::get_resource_from_course_gradebook($link_id);
$count = $gradebook_data['weight'];
}
if ($count > 0) {
$add_to_name = Display::label(get_lang('IncludedInEvaluation'), 'info');
} else {
$add_to_name = '';
}
$work_title = !empty($work_data['title']) ? $work_data['title'] : basename($work_data['url']);
// Work name
if ($cant_files > 0 ) {
$zip = '<a href="downloadfolder.inc.php?id='.$work_data['id'].'&'.api_get_cidreq().'">'.
Display::return_icon('save_pack.png', get_lang('Save'), array('style' => 'float:right;'), ICON_SIZE_SMALL).'</a>';
}
$link = 'work_list.php';
if (api_is_allowed_to_edit()) {
$link = 'work_list_all.php';
}
$url = $zip.'<a href="'.api_get_path(WEB_CODE_PATH).'work/'.$link.'?'.api_get_cidreq().'&origin='.$origin.'&gradebook='.Security::remove_XSS($_GET['gradebook']).'&id='.$work_data['id'].'"'.$class.'>'.
$work_title.'</a> '.$add_to_name.'<br />'.$cant_files.' '.$text_file;
$row[] = $url;
if (!empty($homework)) {
// use original utc value saved previously to avoid doubling the utc-to-local conversion ($homework['expires_on'] might have been tainted)
$row[] = !empty($utc_expiry_time) ? api_get_local_time($utc_expiry_time): '-';
} else {
$row[] = '-';
}
if (!$is_allowed_to_edit) {
if ($course_info['show_score'] == 0) {
$url = api_get_path(WEB_CODE_PATH).'work/work_list_others.php?'.api_get_cidreq().'&id='.$work_parent->id;
$row[] = Display::url(Display::return_icon('group.png', get_lang('Others')), $url);
}
}
if ($origin != 'learnpath') {
if ($is_allowed_to_edit) {
$cant_files_per_user = getUniqueStudentAttempts(
$work_data['id'],
$group_id,
$course_id,
api_get_session_id(),
null,
$userList
);
$row[] = $cant_files_per_user.'/'.count($userList);
if (api_resource_is_locked_by_gradebook($workId, LINK_STUDENTPUBLICATION)) {
$action .= Display::return_icon('edit_na.png', get_lang('Edit'), array(), ICON_SIZE_SMALL);
$action .= Display::return_icon('delete_na.png', get_lang('Delete'), array(), ICON_SIZE_SMALL);
} else {
$action .= '<a href="'.api_get_path(WEB_CODE_PATH).'work/edit_work.php?cidReq='.api_get_course_id().'&origin='.$origin.'&gradebook='.$gradebook.'&id='.$workId.'">'.
Display::return_icon('edit.png', get_lang('Modify'), array(), ICON_SIZE_SMALL).'</a>';
$action .= ' <a href="'.api_get_path(WEB_CODE_PATH).'work/work.php?'.api_get_cidreq().'&origin='.$origin.'&gradebook='.$gradebook.'&delete_dir='.$workId.'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang('ConfirmYourChoice'), ENT_QUOTES))."'".')) return false;" title="'.get_lang('DirDelete').'" >'.
Display::return_icon('delete.png',get_lang('DirDelete'),'',ICON_SIZE_SMALL).'</a>';
}
$row[] = $action;
} else {
$row[] = '';
}
}
$row[] = $work_data['title'];
$table_data[] = $row;
}
}
$sorting_options = array();
$sorting_options['column'] = 1;
// Here we change the way how the columns are going to be sorted
// in this case the the column of LastResent ( 4th element in $column_header) we will be order like the column RealDate
// because in the column RealDate we have the days in a correct format "2008-03-12 10:35:48"
$column_order = array();
$i=0;
foreach ($table_header as $item) {
$column_order[$i] = $i;
$i++;
}
if (empty($my_folder_data)) {
$column_order[1] = 5;
} else {
$column_order[2] = 2;
}
// An array with the setting of the columns -> 1: columns that we will show, 0:columns that will be hide
$column_show = array();
$column_show[] = 1; // type 0
$column_show[] = 1; // title 1
if (!empty($my_folder_data)) {
$column_show[] = 1; // 2
$column_show[] = 1; // 3
if ($qualification_exists) {
$column_show[] = 1; // 4
}
}
$column_show[] = 1; //date
if ($table_has_actions_column) {
$column_show[] = 1; // modify
}
$column_show[] = 1; //real date in correct format
$column_show[] = 0; //real date in correct format
$paging_options = array();
if (isset($_GET['curdirpath'])) {
$my_params = array ('curdirpath' => Security::remove_XSS($_GET['curdirpath']));
}
$my_params = array ('id' => isset($_GET['id']) ? $_GET['id'] : null);
if (isset($_GET['edit_dir'])) {
$my_params = array ('edit_dir' => intval($_GET['edit_dir']));
}
$my_params['origin'] = $origin;
Display::display_sortable_config_table(
'work',
$table_header,
$table_data,
$sorting_options,
$paging_options,
$my_params,
$column_show,
$column_order
);
}
/**
* Shows the work list (student view)
* @return string

@ -106,15 +106,6 @@ class TestFileManager extends UnitTestCase {
//var_dump($res);
}
public function testMkpath(){
$path=api_get_path(SYS_COURSE_PATH).'document/';
$res =mkpath($path, $verbose=false);
if(!is_null($res)) {
$this->assertTrue(is_bool($res));
}
//var_dump($res);
}
public function testGetextension(){
$filename='documents';
$res =getextension($filename);

@ -113,15 +113,6 @@ class TestFileManager extends UnitTestCase {
//var_dump($res);
}
public function testMkpath(){
$path='/var/www/path/';
$res =mkpath($path, $verbose=false);
$this->assertFalse($res);
$this->assertNull($res);
$this->assertTrue($res === null);
//var_dump($res);
}
public function testGetextension(){
$filename='documents';
$res =getextension($filename);

@ -224,7 +224,7 @@ class TestFileUpload extends UnitTestCase {
$upload_path='';
$user_id=1;
$to_group_id=0;
$to_user_id=NULL;
$to_user_id=NULL;
$unzip=0;
$what_if_file_exists='';
$output=true;

@ -7,34 +7,6 @@ class TestStatsUtils extends UnitTestCase
$this->UnitTestCase('Stats utilities library - main/inc/lib/statsUtil.lib.inc.test.php');
}
function testbuildTab2col() {
$array_of_results=array();
$title1='';
$title2='';
ob_start();
$res=StatsUtils::buildTab2col($array_of_results, $title1, $title2);
$this->assertTrue(is_null($res));
ob_end_clean();
//var_dump($res);
}
function testbuildTab2ColNoTitle() {
$array_of_results=array();
ob_start();
$res=StatsUtils::buildTab2ColNoTitle($array_of_results);
ob_end_clean();
$this->assertTrue(is_array($array_of_results));
//var_dump($array_of_results);
}
function testbuildTabDefcon() {
$array_of_results=array();
ob_start();
$res=StatsUtils::buildTabDefcon($array_of_results);
$this->assertTrue(is_array($array_of_results));
ob_end_clean();
//var_dump($array_of_results);
}
function testdaysTab() {
$sql='';
ob_start();

@ -77,19 +77,7 @@ class TestLearnpath extends UnitTestCase {
ob_end_clean();
//var_dump($res);
}
/*
public function testBuildTree() {
//ob_start();
$course = 'COURSETEST';
$lp_id = 0;
$user_id = 1;
$obj = new learnpath($course, $lp_id, $user_id);
$res = $obj->build_tree();
$this->assertTrue(is_string($res));
//ob_end_clean();
//var_dump($res);
}
*/
public function testClearMessage() {
//ob_start();
$res = learnpath::clear_message();
@ -469,19 +457,6 @@ class TestLearnpath extends UnitTestCase {
//var_dump($res);
}
public function testGetDbProgress() {
//ob_start();
$lp_id = 0;
$user_id = 1;
$mode = '%';
$course_db = '';
$sincere = false;
$res = learnpath::get_db_progress($lp_id, $user_id, $mode, $course_db, $sincere);
$this->assertTrue(is_string($res));
//ob_end_clean();
//var_dump($res);
}
public function testGetDocuments() {
//ob_start();
$lp_id=1;

Loading…
Cancel
Save