Replace function name.

get_user_personal_table to get_main_table
get_statistic_table to  get_main_table
1.10.x
Julio Montoya 10 years ago
parent aa4a022449
commit ab5244cf84
  1. 2
      main/calendar/agenda.inc.php
  2. 10
      main/calendar/myagenda.inc.php
  3. 2
      main/calendar/myagenda.php
  4. 2
      main/exercice/exercice.php
  5. 2
      main/exercice/exercise_result.php
  6. 4
      main/exercice/exercise_show.php
  7. 2
      main/exercice/exercise_submit.php
  8. 2
      main/exercice/hotpotatoes.lib.php
  9. 4
      main/exercice/hotpotatoes_exercise_report.php
  10. 2
      main/exercice/hotpotatoes_exercise_result.class.php
  11. 2
      main/exercice/hotspot_answers.as.php
  12. 2
      main/exercice/hotspot_updatescore.inc.php
  13. 2
      main/exercice/mark_free_answer.php
  14. 2
      main/exercice/savescores.php
  15. 2
      main/exercice/testcategory.class.php
  16. 2
      main/forum/forumfunction.inc.php
  17. 4
      main/gradebook/gradebook_result.class.php
  18. 4
      main/inc/ajax/exercise.ajax.php
  19. 2
      main/inc/ajax/message.ajax.php
  20. 2
      main/inc/lib/agenda.lib.php
  21. 2
      main/inc/lib/api.lib.php
  22. 12
      main/inc/lib/auth.lib.php
  23. 4
      main/inc/lib/course_description.lib.php
  24. 2
      main/inc/lib/display.lib.php
  25. 2
      main/inc/lib/events.lib.inc.php
  26. 4
      main/inc/lib/login.lib.php
  27. 2
      main/inc/lib/nanogong.lib.php
  28. 12
      main/inc/lib/sessionmanager.lib.php
  29. 2
      main/inc/lib/zombie/zombie_manager.class.php
  30. 2
      main/mySpace/coaches.php
  31. 2
      main/mySpace/myStudents.php
  32. 2
      main/mySpace/progression.php
  33. 2
      main/mySpace/reussite.php
  34. 4
      main/newscorm/learnpathItem.class.php
  35. 2
      main/newscorm/lp_ajax_save_item.php
  36. 2
      main/newscorm/lp_comm.server.php
  37. 2
      main/newscorm/lp_view.php
  38. 4
      main/newscorm/resourcelinker.inc.php
  39. 2
      main/tracking/course_access_details.php
  40. 2
      main/tracking/exams.php
  41. 2
      main/tracking/logins_details.php
  42. 2
      main/tracking/toolaccess_details.php
  43. 2
      plugin/buycourses/src/success.php
  44. 2
      tests/datafiller/fill_whoisonline.php
  45. 2
      tests/main/chat/chat_functions.lib.test.php
  46. 32
      tests/main/inc/lib/database.lib.test.php

@ -257,7 +257,7 @@ function get_calendar_items($select_month, $select_year, $select_day = false)
//Check my personal calendar items
if (api_get_setting('allow_personal_agenda') == 'true' && empty($_SESSION['user']) && empty($_SESSION['group'])) {
$tbl_personal_agenda = Database :: get_user_personal_table(TABLE_PERSONAL_AGENDA);
$tbl_personal_agenda = Database :: get_main_table(TABLE_PERSONAL_AGENDA);
// 1. creating the SQL statement for getting the personal agenda items in MONTH view
$sql = "SELECT id, title, text as content , date as start_date, enddate as end_date, parent_event_id FROM ".$tbl_personal_agenda."
WHERE user='".api_get_user_id()."' ".$show_all_current_personal;

@ -331,7 +331,7 @@ function display_myminimonthcalendar($agendaitems, $month, $year, $monthName) {
*/
function store_personal_item($day, $month, $year, $hour, $minute, $title, $content, $id = "") {
$tbl_personal_agenda = Database :: get_user_personal_table(TABLE_PERSONAL_AGENDA);
$tbl_personal_agenda = Database :: get_main_table(TABLE_PERSONAL_AGENDA);
//constructing the date
$date = $year."-".$month."-".$day." ".$hour.":".$minute.":00";
@ -415,7 +415,7 @@ function get_courses_of_user() {
* This function retrieves all the personal agenda items and add them to the agenda items found by the other functions.
*/
function get_personal_agenda_items($user_id, $agendaitems, $day = "", $month = "", $year = "", $week = "", $type) {
$tbl_personal_agenda = Database :: get_user_personal_table(TABLE_PERSONAL_AGENDA);
$tbl_personal_agenda = Database :: get_main_table(TABLE_PERSONAL_AGENDA);
$user_id = intval($user_id);
// 1. creating the SQL statement for getting the personal agenda items in MONTH view
@ -517,7 +517,7 @@ function get_personal_agenda_items($user_id, $agendaitems, $day = "", $month = "
* @return array The results of the database query, or null if not found
*/
function get_personal_agenda_item($id) {
$tbl_personal_agenda = Database :: get_user_personal_table(TABLE_PERSONAL_AGENDA);
$tbl_personal_agenda = Database :: get_main_table(TABLE_PERSONAL_AGENDA);
$id = intval($id);
// make sure events of the personal agenda can only be seen by the user himself
$user = api_get_user_id();
@ -537,7 +537,7 @@ function get_personal_agenda_item($id) {
function show_personal_agenda() {
global $MonthsLong, $charset;
$tbl_personal_agenda = Database :: get_user_personal_table(TABLE_PERSONAL_AGENDA);
$tbl_personal_agenda = Database :: get_main_table(TABLE_PERSONAL_AGENDA);
// The SQL statement that retrieves all the personal agenda items of this user
$sql = "SELECT * FROM ".$tbl_personal_agenda." WHERE user='".api_get_user_id()."' ORDER BY date DESC";
@ -641,7 +641,7 @@ function show_personal_agenda() {
function show_simple_personal_agenda($user_id) {
global $MonthsLong, $charset;
$tbl_personal_agenda = Database :: get_user_personal_table(TABLE_PERSONAL_AGENDA);
$tbl_personal_agenda = Database :: get_main_table(TABLE_PERSONAL_AGENDA);
// The SQL statement that retrieves all the personal agenda items of this user
$sql = "SELECT * FROM ".$tbl_personal_agenda." WHERE user='".$user_id."' ORDER BY date DESC";

@ -62,7 +62,7 @@ $TABLECOURS = Database :: get_main_table(TABLE_MAIN_COURSE);
$TABLECOURSUSER = Database :: get_main_table(TABLE_MAIN_COURSE_USER);
$TABLEAGENDA = Database :: get_course_table(TABLE_AGENDA);
$TABLE_ITEMPROPERTY = Database :: get_course_table(TABLE_ITEM_PROPERTY);
$tbl_personal_agenda= Database :: get_user_personal_table(TABLE_PERSONAL_AGENDA);
$tbl_personal_agenda= Database :: get_main_table(TABLE_PERSONAL_AGENDA);
// the variables for the days and the months
// Defining the shorts for the days

@ -51,7 +51,7 @@ $TBL_DOCUMENT = Database :: get_course_table(TABLE_DOCUMENT);
$TBL_ITEM_PROPERTY = Database :: get_course_table(TABLE_ITEM_PROPERTY);
$TBL_EXERCICE_QUESTION = Database :: get_course_table(TABLE_QUIZ_TEST_QUESTION);
$TBL_EXERCICES = Database :: get_course_table(TABLE_QUIZ_TEST);
$TBL_TRACK_EXERCICES = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
$TBL_TRACK_EXERCICES = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
// document path
$documentPath = api_get_path(SYS_COURSE_PATH).$courseInfo['path']."/document";

@ -140,7 +140,7 @@ ExerciseLib::display_question_list_by_attempt($objExercise, $exe_id, true);
/*
$session_control_key = ExerciseLib::get_session_time_control_key($objExercise->id, $learnpath_id, $learnpath_item_id);
if (isset($session_control_key) && !ExerciseLib::exercise_time_control_is_valid($objExercise->id, $learnpath_id, $learnpath_item_id)) {
$TBL_TRACK_ATTEMPT = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_ATTEMPT);
$TBL_TRACK_ATTEMPT = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ATTEMPT);
$sql_fraud = "UPDATE $TBL_TRACK_ATTEMPT SET answer = 0, marks = 0, position = 0 WHERE exe_id = $exe_id ";
Database::query($sql_fraud);
}*/

@ -33,8 +33,8 @@ if ($origin == 'learnpath') {
// Database table definitions
$TBL_EXERCICE_QUESTION = Database::get_course_table(TABLE_QUIZ_TEST_QUESTION);
$TBL_QUESTIONS = Database::get_course_table(TABLE_QUIZ_QUESTION);
$TBL_TRACK_EXERCICES = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
$TBL_TRACK_ATTEMPT = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_ATTEMPT);
$TBL_TRACK_EXERCICES = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
$TBL_TRACK_ATTEMPT = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ATTEMPT);
// General parameters passed via POST/GET
if ($debug) { error_log('Entered exercise_result.php: '.print_r($_POST,1)); }

@ -79,7 +79,7 @@ $currentAnswer = isset($_REQUEST['num_answer']) ? intval($_REQUEST['num_answer']
$error = '';
//Table calls
$exercice_attemp_table = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_ATTEMPT);
$exercice_attemp_table = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_ATTEMPT);
/* Teacher takes an exam and want to see a preview,
we delete the objExercise from the session in order to get the latest

@ -455,7 +455,7 @@ function HotPotGCt($folder, $flag, $user_id)
*/
function deleteAttempt($id)
{
$table = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_HOTPOTATOES);
$table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_HOTPOTATOES);
$id = intval($id);
$sql = "DELETE FROM $table WHERE id = $id";
Database::query($sql);

@ -35,8 +35,8 @@ $is_allowedToEdit = api_is_allowed_to_edit(null, true) || api_is_drh();
$is_tutor = api_is_allowed_to_edit(true);
$TBL_QUESTIONS = Database :: get_course_table(TABLE_QUIZ_QUESTION);
$TBL_TRACK_EXERCICES = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
$TBL_TRACK_HOTPOTATOES_EXERCICES = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_HOTPOTATOES);
$TBL_TRACK_EXERCICES = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
$TBL_TRACK_HOTPOTATOES_EXERCICES = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_HOTPOTATOES);
$TBL_LP_ITEM_VIEW = Database :: get_course_table(TABLE_LP_ITEM_VIEW);
$course_id = api_get_course_int_id();

@ -23,7 +23,7 @@ class HotpotatoesExerciseResult
{
$return = array();
$TBL_USER = Database::get_main_table(TABLE_MAIN_USER);
$TBL_TRACK_HOTPOTATOES = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_HOTPOTATOES);
$TBL_TRACK_HOTPOTATOES = Database::get_main_table(TABLE_STATISTIC_TRACK_E_HOTPOTATOES);
$cid = api_get_course_id();
$course_id = api_get_course_int_id();

@ -88,7 +88,7 @@ if(isset($_SESSION['exerciseResultCoordinates']) && $from_db==0) {
}
} else {
// get it from db
$tbl_track_e_hotspot = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_HOTSPOT);
$tbl_track_e_hotspot = Database::get_main_table(TABLE_STATISTIC_TRACK_E_HOTSPOT);
$sql = "SELECT hotspot_coordinate
FROM $tbl_track_e_hotspot
WHERE hotspot_question_id = $questionId AND

@ -47,7 +47,7 @@ foreach ($coords as $coord) {
}
$coordinates = substr($coordinates,0,-1);
$TBL_TRACK_E_HOTSPOT = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_HOTSPOT);
$TBL_TRACK_E_HOTSPOT = Database::get_main_table(TABLE_STATISTIC_TRACK_E_HOTSPOT);
// update db
$update_id = $_SESSION['exerciseResult'][$questionId]['ids'][$answerId];

@ -82,7 +82,7 @@ if ($action == 'mark') {
if (!empty($_POST['score']) AND $_POST['score'] < $obj_question->selectWeighting() AND $_POST['score'] >= 0) {
//mark the user mark into the database using something similar to the following function:
$exercise_table = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
$exercise_table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
#global $origin, $tbl_learnpath_user, $learnpath_id, $learnpath_item_id;
$sql = "SELECT * FROM $exercise_table
WHERE exe_user_id = ".intval($my_usr)." AND exe_cours_id = '".Database::escape_string($my_cid)."' AND exe_exo_id = ".intval($my_exe)."

@ -21,7 +21,7 @@ $full_file_path = $documentPath.$test;
my_delete($full_file_path.$_user['user_id'].".t.html");
$TABLETRACK_HOTPOTATOES = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_HOTPOTATOES);
$TABLETRACK_HOTPOTATOES = Database::get_main_table(TABLE_STATISTIC_TRACK_E_HOTPOTATOES);
$TABLE_LP_ITEM_VIEW = Database::get_course_table(TABLE_LP_ITEM_VIEW);
$score = $_REQUEST['score'];

@ -497,7 +497,7 @@ class Testcategory
*/
public static function getCatScoreForExeidForUserid($in_cat_id, $in_exe_id, $in_user_id)
{
$tbl_track_attempt = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_ATTEMPT);
$tbl_track_attempt = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ATTEMPT);
$tbl_question_rel_category = Database::get_course_table(TABLE_QUIZ_QUESTION_REL_CATEGORY);
$in_cat_id = intval($in_cat_id);
$in_exe_id = intval($in_exe_id);

@ -3138,7 +3138,7 @@ function get_whats_new()
$_course = api_get_course_info();
$table_posts = Database :: get_course_table(TABLE_FORUM_POST);
$tracking_last_tool_access = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_LASTACCESS);
$tracking_last_tool_access = Database::get_main_table(TABLE_STATISTIC_TRACK_E_LASTACCESS);
// Note: This has to be replaced by the tool constant later. But temporarily bb_forum is used since this is the only thing that is in the tracking currently.
//$tool = TOOL_FORUM;

@ -88,8 +88,8 @@ class GradeBookResult
$return = array();
$TBL_EXERCISES = Database::get_course_table(TABLE_QUIZ_TEST);
$TBL_USER = Database::get_main_table(TABLE_MAIN_USER);
$TBL_TRACK_EXERCISES = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
$TBL_TRACK_HOTPOTATOES = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_HOTPOTATOES);
$TBL_TRACK_EXERCISES = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
$TBL_TRACK_HOTPOTATOES = Database::get_main_table(TABLE_STATISTIC_TRACK_E_HOTPOTATOES);
$cid = api_get_course_id();
$course_id = api_get_course_int_id();

@ -42,9 +42,9 @@ switch ($action) {
$sidx = 1;
}
$track_exercise = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
$track_exercise = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
$user_table = Database::get_main_table(TABLE_MAIN_USER);
$track_attempt = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_ATTEMPT);
$track_attempt = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ATTEMPT);
$minutes = intval($_REQUEST['minutes']);
$now = time() - 60 * $minutes;

@ -29,7 +29,7 @@ switch ($action) {
echo '';
break;
}
$track_online_table = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_ONLINE);
$track_online_table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ONLINE);
$tbl_my_user = Database::get_main_table(TABLE_MAIN_USER);
$tbl_my_user_friend = Database::get_main_table(TABLE_MAIN_USER_REL_USER);
$tbl_user = Database::get_main_table(TABLE_MAIN_USER);

@ -25,7 +25,7 @@ class Agenda
{
//Table definitions
$this->tbl_global_agenda = Database::get_main_table(TABLE_MAIN_SYSTEM_CALENDAR);
$this->tbl_personal_agenda = Database::get_user_personal_table(TABLE_PERSONAL_AGENDA);
$this->tbl_personal_agenda = Database::get_main_table(TABLE_PERSONAL_AGENDA);
$this->tbl_course_agenda = Database::get_course_table(TABLE_AGENDA);
$this->table_repeat = Database::get_course_table(TABLE_AGENDA_REPEAT);

@ -3871,7 +3871,7 @@ function api_track_item_property_update($tool, $ref, $title, $content, $progress
*/
function api_get_track_item_property_history($tool, $ref)
{
$tbl_stats_item_property = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_ITEM_PROPERTY);
$tbl_stats_item_property = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ITEM_PROPERTY);
$course_id = api_get_real_course_id(); //numeric
$course_code = api_get_course_id(); //alphanumeric
$item_property_id = api_get_item_property_id($course_code, $tool, $ref);

@ -91,7 +91,7 @@ class Auth
public function get_user_course_categories()
{
$user_id = api_get_user_id();
$table_category = Database::get_user_personal_table(TABLE_USER_COURSE_CATEGORY);
$table_category = Database::get_main_table(TABLE_USER_COURSE_CATEGORY);
$sql = "SELECT * FROM " . $table_category . " WHERE user_id=$user_id ORDER BY sort ASC";
$result = Database::query($sql);
$output = array();
@ -246,7 +246,7 @@ class Auth
public function move_category($direction, $category2move)
{
// the database definition of the table that stores the user defined course categories
$table_user_defined_category = Database::get_user_personal_table(TABLE_USER_COURSE_CATEGORY);
$table_user_defined_category = Database::get_main_table(TABLE_USER_COURSE_CATEGORY);
$current_user_id = api_get_user_id();
$user_coursecategories = $this->get_user_course_categories();
@ -288,7 +288,7 @@ class Auth
public function get_user_course_categories_info()
{
$current_user_id = api_get_user_id();
$table_category = Database::get_user_personal_table(TABLE_USER_COURSE_CATEGORY);
$table_category = Database::get_main_table(TABLE_USER_COURSE_CATEGORY);
$sql = "SELECT * FROM " . $table_category . "
WHERE user_id='" . $current_user_id . "'
ORDER BY sort ASC";
@ -311,7 +311,7 @@ class Auth
$title = Database::escape_string($title);
$category_id = intval($category_id);
$result = false;
$tucc = Database::get_user_personal_table(TABLE_USER_COURSE_CATEGORY);
$tucc = Database::get_main_table(TABLE_USER_COURSE_CATEGORY);
$sql = "UPDATE $tucc
SET title='" . api_htmlentities($title, ENT_QUOTES, api_get_system_encoding()) . "'
WHERE id='" . $category_id . "'";
@ -330,7 +330,7 @@ class Auth
public function delete_course_category($category_id)
{
$current_user_id = api_get_user_id();
$tucc = Database::get_user_personal_table(TABLE_USER_COURSE_CATEGORY);
$tucc = Database::get_main_table(TABLE_USER_COURSE_CATEGORY);
$TABLECOURSUSER = Database::get_main_table(TABLE_MAIN_COURSE_USER);
$category_id = intval($category_id);
$result = false;
@ -383,7 +383,7 @@ class Auth
*/
public function store_course_category($category_title)
{
$tucc = Database::get_user_personal_table(TABLE_USER_COURSE_CATEGORY);
$tucc = Database::get_main_table(TABLE_USER_COURSE_CATEGORY);
// protect data
$current_user_id = api_get_user_id();

@ -89,7 +89,7 @@ class CourseDescription
* @return array
*/
public function get_description_history($description_type) {
$tbl_stats_item_property = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_ITEM_PROPERTY);
$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);
@ -226,7 +226,7 @@ class CourseDescription
*/
public function insert_stats($description_type)
{
$tbl_stats_item_property = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_ITEM_PROPERTY);
$tbl_stats_item_property = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ITEM_PROPERTY);
$description_id = $this->get_id_by_description_type($description_type);
$course_id = api_get_real_course_id();
$course_code = api_get_course_id();

@ -1254,7 +1254,7 @@ class Display
*/
public static function show_notification($course_info)
{
$t_track_e_access = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_LASTACCESS);
$t_track_e_access = Database::get_main_table(TABLE_STATISTIC_TRACK_E_LASTACCESS);
$course_tool_table = Database::get_course_table(TABLE_TOOL_LIST);
$tool_edit_table = Database::get_course_table(TABLE_ITEM_PROPERTY);
$course_code = Database::escape_string($course_info['code']);

@ -348,7 +348,7 @@ class Event
$status = Database::escape_string($status);
}
$TABLETRACK_EXERCICES = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
$TABLETRACK_EXERCICES = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
if (!empty($question_list)) {
$question_list = array_map('intval', $question_list);

@ -222,7 +222,7 @@ class Login
// a uid is given (log in succeeded)
$user_table = Database::get_main_table(TABLE_MAIN_USER);
$admin_table = Database::get_main_table(TABLE_MAIN_ADMIN);
$track_e_login = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_LOGIN);
$track_e_login = Database::get_main_table(TABLE_STATISTIC_TRACK_E_LOGIN);
$sql = "SELECT user.*, a.user_id is_admin, UNIX_TIMESTAMP(login.login_date) login_date
FROM $user_table
@ -452,7 +452,7 @@ class Login
}
if ($save_course_access) {
$course_tracking_table = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_COURSE_ACCESS);
$course_tracking_table = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_COURSE_ACCESS);
/*
* When $_configuration['session_lifetime'] is too big 100 hours (in order to let users take exercises with no problems)

@ -237,7 +237,7 @@ class Nanogong
if (isset($this->params['exe_id']) && isset($this->params['user_id']) &&
isset($this->params['question_id']) && isset($this->params['session_id']) && isset($this->params['course_id'])
) {
$attempt_table = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_ATTEMPT);
$attempt_table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ATTEMPT);
$sql = "SELECT filename FROM $attempt_table
WHERE
exe_id = ".$this->params['exe_id']." AND

@ -66,7 +66,7 @@ class SessionManager
* @param string $duration
* @param string $description Optional. The session description
* @param int $showDescription Optional. Whether show the session description
* @param array $extrafields
* @param array $extrafields
* @todo use an array to replace all this parameters or use the model.lib.php ...
* @return mixed Session ID on success, error message otherwise
* */
@ -825,8 +825,8 @@ class SessionManager
$forum_post = Database::get_course_table(TABLE_FORUM_POST);
$tbl_course_lp = Database::get_course_table(TABLE_LP_MAIN);
$wiki = Database::get_course_table(TABLE_WIKI);
$table_stats_default = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_DEFAULT);
$table_stats_access = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_ACCESS);
$table_stats_default = Database::get_main_table(TABLE_STATISTIC_TRACK_E_DEFAULT);
$table_stats_access = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ACCESS);
$course = api_get_course_info_by_id($courseId);
@ -5403,7 +5403,7 @@ class SessionManager
{
$userId = intval($userId);
$trackLoginTable = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_LOGIN);
$trackLoginTable = Database::get_main_table(TABLE_STATISTIC_TRACK_E_LOGIN);
$whereConditions = array(
'login_user_id = ? ' => $userId
@ -5446,8 +5446,8 @@ class SessionManager
}
/**
* Returns list of a few data from session (name, short description, start
* date, end date) and the given extra fields if defined based on a
* Returns list of a few data from session (name, short description, start
* date, end date) and the given extra fields if defined based on a
* session category Id.
* @param int $categoryId The internal ID of the session category
* @param string $target Value to search for in the session field values

@ -32,7 +32,7 @@ class ZombieManager
$ceiling = date('Y-m-d H:i:s', $ceiling);
$user_table = Database::get_main_table(TABLE_MAIN_USER);
$login_table = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_LOGIN);
$login_table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_LOGIN);
$sql = 'SELECT
user.user_id,

@ -38,7 +38,7 @@ $tbl_session = Database :: get_main_table(TABLE_MAIN_SESSION);
$tbl_session_rel_course = Database :: get_main_table(TABLE_MAIN_SESSION_COURSE);
$tbl_session_rel_course_rel_user = Database :: get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
$tbl_session_rel_user = Database :: get_main_table(TABLE_MAIN_SESSION_USER);
$tbl_track_login = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_LOGIN);
$tbl_track_login = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_LOGIN);
/**
* MAIN PART

@ -162,7 +162,7 @@ if (isset($_GET['details'])) {
// Database Table Definitions
$tbl_course_user = Database :: get_main_table(TABLE_MAIN_COURSE_USER);
$tbl_stats_exercices = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
$tbl_stats_exercices = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
if (isset($_GET['user_id']) && $_GET['user_id'] != "") {
$user_id = intval($_GET['user_id']);

@ -29,7 +29,7 @@ $tbl_course = Database :: get_main_table(TABLE_MAIN_COURSE);
$tbl_user = Database :: get_main_table(TABLE_MAIN_USER);
$tbl_session_course = Database :: get_main_table(TABLE_MAIN_SESSION_COURSE);
$tbl_session = Database :: get_main_table(TABLE_MAIN_SESSION);
$tbl_track_exercice = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
$tbl_track_exercice = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
/*
MAIN CODE

@ -27,7 +27,7 @@ $tbl_course = Database :: get_main_table(TABLE_MAIN_COURSE);
$tbl_user = Database :: get_main_table(TABLE_MAIN_USER);
$tbl_session_course = Database :: get_main_table(TABLE_MAIN_SESSION_COURSE);
$tbl_session = Database :: get_main_table(TABLE_MAIN_SESSION);
$tbl_track_exercice = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
$tbl_track_exercice = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
/*
===============================================================================

@ -2541,7 +2541,7 @@ class learnpathItem
// Checking in the database.
$sql = 'SELECT exe_result, exe_weighting
FROM ' . Database :: get_statistic_table(
FROM ' . Database :: get_main_table(
TABLE_STATISTIC_TRACK_E_EXERCISES
) . '
WHERE exe_exo_id = ' . $items[$refs_list[$prereqs_string]]->path . '
@ -3867,7 +3867,7 @@ class learnpathItem
$my_status = ' ';
$total_time = ' ';
if (!empty($_REQUEST['exeId'])) {
$TBL_TRACK_EXERCICES = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
$TBL_TRACK_EXERCICES = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
$safe_exe_id = intval($_REQUEST['exeId']);
$sql = "SELECT start_date,exe_date

@ -444,7 +444,7 @@ function save_item(
if (!isset($_SESSION['login_as'])) {
// If $_SESSION['login_as'] is set, then the user is an admin logged as the user.
$tbl_track_login = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_LOGIN);
$tbl_track_login = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_LOGIN);
$sql = "SELECT login_id, login_date
FROM $tbl_track_login

@ -143,7 +143,7 @@ function save_item($lp_id, $user_id, $view_id, $item_id, $score = -1, $max = -1,
if (!isset($_SESSION['login_as'])) {
// If $_SESSION['login_as'] is set, then the user is an admin logged as the user.
$tbl_track_login = Database :: get_statistic_table(TABLE_STATISTIC_TRACK_E_LOGIN);
$tbl_track_login = Database :: get_main_table(TABLE_STATISTIC_TRACK_E_LOGIN);
$sql_last_connection = "SELECT login_id, login_date FROM $tbl_track_login
WHERE login_user_id='".api_get_user_id()."' ORDER BY login_date DESC LIMIT 0,1";

@ -215,7 +215,7 @@ if (!empty($_REQUEST['exeId']) &&
global $src;
$_SESSION['oLP']->items[$_SESSION['oLP']->current]->write_to_db();
$TBL_TRACK_EXERCICES = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
$TBL_TRACK_EXERCICES = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
$TBL_LP_ITEM_VIEW = Database::get_course_table(TABLE_LP_ITEM_VIEW);
$TBL_LP_ITEM = Database::get_course_table(TABLE_LP_ITEM);
$safe_item_id = intval($_GET['lp_item_id']);

@ -1508,7 +1508,7 @@ function showorhide_addresourcelink($type, $id) {
* @todo use the constants for the type definitions.
*/
function rl_get_html_resource_link($course_code, $type, $id, $style='', $new_window = true) {
$_course = Database::get_course_info($course_code);
$_course = api_get_course_info($course_code);
$course_id = api_get_course_int_id();
@ -1741,7 +1741,7 @@ function rl_get_resource_link_for_learnpath($course_id, $learnpath_id, $id_in_pa
*/
function rl_get_resource_name($course_code, $learnpath_id, $id_in_path)
{
$_course = Database::get_course_info($course_code);
$_course = api_get_course_info($course_code);
$course_id = $_course['real_id'];
$tbl_lp_item = Database::get_course_table(TABLE_LP_ITEM);
$learnpath_id = intval($learnpath_id);

@ -39,7 +39,7 @@ td {border-bottom: thin dashed gray;}
/*]]>*/
</style>";
//@todo use Database library
$TABLETRACK_ACCESS = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_ACCESS);
$TABLETRACK_ACCESS = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ACCESS);
Display::display_header($nameTools,"Tracking");
// the variables for the days and the months

@ -468,7 +468,7 @@ function export_complete_report_xls($filename, $array)
function processStudentList($filter_score, $global, $exercise, $courseInfo, $sessionId, $newSessionList)
{
$exerciseStatsTable = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
$exerciseStatsTable = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
if (empty($sessionId)) {
$students = CourseManager::get_student_list_from_course_code(

@ -50,7 +50,7 @@ td {border-bottom: thin dashed gray;}
$TABLECOURSUSER = Database::get_main_table(TABLE_MAIN_COURSE_USER);
$TABLECOURSE_GROUPSUSER = Database::get_course_table(TABLE_GROUP_USER);
$TABLEUSER = Database::get_main_table(TABLE_MAIN_USER);
$TABLETRACK_ACCESS = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_ACCESS);
$TABLETRACK_ACCESS = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ACCESS);
Display::display_header($nameTools, "Tracking");
$courseId = api_get_course_int_id();

@ -68,7 +68,7 @@ $reqdate=$_REQUEST['reqdate'];
?>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<?php
$TABLETRACK_ACCESS = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_ACCESS);
$TABLETRACK_ACCESS = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ACCESS);
$courseId = api_get_course_int_id();
//stats for the current course
if(isset($_cid)) {

@ -261,7 +261,7 @@ if (!isset($_POST['paymentOption'])) {
$user_table = Database::get_main_table(TABLE_MAIN_USER);
$admin_table = Database::get_main_table(TABLE_MAIN_ADMIN);
$track_e_login = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_LOGIN);
$track_e_login = Database::get_main_table(TABLE_STATISTIC_TRACK_E_LOGIN);
$sql = "SELECT user.*, a.user_id is_admin, login.login_date
FROM $user_table

@ -12,7 +12,7 @@
*/
function fill_whoisonline()
{
$table_e_online = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_ONLINE);
$table_e_online = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ONLINE);
$max = 100;
//Cleaning the table

@ -37,7 +37,7 @@ class TestChatFunctions extends UnitTestCase {
function CreateChatConnection($database_name) {
$session_id = 1;
$tbl_chat_connected = Database::get_course_chat_connected_table($database_name);
$tbl_chat_connected = Database::get_main_table(TABLE_MAIN_CHAT);
$sql = "SELECT user_id FROM $tbl_chat_connected WHERE user_id = 1";
$result = Database::query($sql);
//The user_id exists so we must do an UPDATE and not a INSERT

@ -110,30 +110,12 @@ class TestDatabase extends UnitTestCase {
}
*/
function testGenerateAbstractCourseFieldNames() {
$result_array='';
$res=$this->dbase->generate_abstract_course_field_names($result_array);
$this->assertTrue(is_array($res));
}
function testGenerateAbstractUserFieldNames() {
$result_array='';
$res=$this->dbase->generate_abstract_user_field_names($result_array);
$this->assertTrue(is_array($res));
}
function get_course_by_category() {
$category_id='1';
$res=$this->dbase->get_course_by_category($category_id);
$this->assertTrue(is_string($res));
}
function testGetCourseChatConnectedTable() {
$database_name='dokeosla';
$res=$this->dbase->get_course_chat_connected_table($database_name);
$this->assertTrue(is_string($res));
}
function testGetCourseInfo() {
$course_code='AYDD';
$res=$this->dbase->get_course_info($course_code);
@ -217,20 +199,6 @@ class TestDatabase extends UnitTestCase {
$this->assertTrue(is_array($res));
}
function testGetUserPersonalDatabase() {
global $_configuration;
$res=$this->dbase->get_user_personal_database($_configuration);
$this->assertTrue(is_string($res));
$this->assertTrue($res);
}
function testGetUserPersonalTable(){
$short_table_name='';
$res=$this->dbase-> get_user_personal_table($short_table_name);
$this->assertTrue(is_string($res));
$this->assertTrue($res);
}
/* // Contains a private unaccessible method, Database::glue_course_database_name().
function testGlueCourseDatabaseName() {
$database_name='';

Loading…
Cancel
Save