skala
Juan Carlos Raña 13 years ago
commit 45ea8c331d
  1. 3
      main/admin/session_import.php
  2. 2
      main/document/download_scorm.php
  3. 25
      main/gradebook/index.php
  4. 4
      main/gradebook/lib/be/abstractlink.class.php
  5. 4
      main/gradebook/lib/be/category.class.php
  6. 4
      main/gradebook/lib/be/evaluation.class.php
  7. 2
      main/gradebook/lib/be/linkfactory.class.php
  8. 4
      main/gradebook/lib/fe/catform.class.php
  9. 4
      main/gradebook/lib/fe/dataform.class.php
  10. 4
      main/gradebook/lib/fe/evalform.class.php
  11. 11
      main/gradebook/lib/fe/gradebooktable.class.php
  12. 4
      main/gradebook/lib/fe/userform.class.php
  13. 34
      main/inc/lib/course.lib.php
  14. 6
      main/inc/lib/display.lib.php
  15. 4
      main/inc/lib/document.lib.php
  16. 35
      main/inc/lib/events.lib.inc.php
  17. 2
      main/inc/lib/formvalidator/Element/style_submit_button.php
  18. 3
      main/inc/lib/grade_model.lib.php
  19. 92
      main/inc/lib/pear/HTML/QuickForm/RuleRegistry.php
  20. 69
      main/inc/lib/pear/HTML/QuickForm/hidden.php
  21. 4
      main/inc/lib/pear/PEAR.php
  22. 4
      main/inc/lib/tracking.lib.php
  23. 10
      main/install/version.php
  24. 18
      main/lang/english/admin.inc.php
  25. 72
      main/lang/spanish/admin.inc.php
  26. 26
      main/lang/spanish/trad4all.inc.php
  27. 2
      main/newscorm/download.php
  28. 41
      main/newscorm/learnpath.class.php
  29. 13
      main/newscorm/learnpathItem.class.php
  30. 7
      main/newscorm/lp_list.php
  31. 2
      main/survey/survey.lib.php
  32. 30
      main/work/work.php
  33. 4
      tests/main/inc/lib/tracking.lib.test.php

@ -788,8 +788,11 @@ $form->addElement('button', 'submit', get_lang('ImportSession'));
$defaults = array('sendMail' => 'true','file_type' => 'csv');
$form->setDefaults($defaults);
Display::display_normal_message('TheXMLImportLetYouAddMoreInfoAndCreateResources');
$form->display();
?>
<font color="gray">
<p><?php echo get_lang('CSVMustLookLike').' ('.get_lang('MandatoryFields').')'; ?> :</p>

@ -29,7 +29,7 @@ if (isset($_SESSION['oLP'])) {
}
//If is visible for the current user
if (!$obj->is_lp_visible_for_student($obj->get_id(), api_get_user_id())) {
if (!learnpath::is_lp_visible_for_student($obj->get_id(), api_get_user_id())) {
api_not_allowed();
}

@ -831,7 +831,8 @@ if (isset($first_time) && $first_time==1 && api_is_allowed_to_edit(null,true)) {
if (!empty($cats)) {
if ( (api_get_setting('gradebook_enable_grade_model') == 'true') && (api_is_platform_admin() || (api_is_allowed_to_edit(null, true) && api_get_setting('teachers_can_change_grade_model_settings') == 'true'))) {
if ( (api_get_setting('gradebook_enable_grade_model') == 'true') &&
(api_is_platform_admin() || (api_is_allowed_to_edit(null, true) && api_get_setting('teachers_can_change_grade_model_settings') == 'true'))) {
//Getting grade models
$obj = new GradeModel();
@ -840,14 +841,14 @@ if (isset($first_time) && $first_time==1 && api_is_allowed_to_edit(null,true)) {
//No children
if (count($cats) == 1 && empty($grade_model_id)) {
if (!empty($grade_models)) {
$form = new FormValidator('grade_model_settings');
$obj->fill_grade_model_select_in_form();
$form->addElement('style_submit_button', 'submit', get_lang('Save'), 'class="save"');
if ($form->validate()) {
$value = $form->exportValue('grade_model_id');
if (!empty($grade_models)) {
$form_grade = new FormValidator('grade_model_settings');
$obj->fill_grade_model_select_in_form($form_grade, 'grade_model_id');
$form_grade->addElement('style_submit_button', 'submit', get_lang('Save'), 'class="save"');
if ($form_grade->validate()) {
$value = $form_grade->exportValue('grade_model_id');
$gradebook = new Gradebook();
$gradebook->update(array('id'=> $cats[0]->get_id(), 'grade_model_id' => $value), true);
@ -871,10 +872,10 @@ if (isset($first_time) && $first_time==1 && api_is_allowed_to_edit(null,true)) {
$gradebook->save($params);
}
//Reloading cats
$cats = Category :: load(null, null, $course_code, null, null, $session_id, false); //already init
$cats = Category :: load(null, null, $course_code, null, null, $session_id, false);
} else {
$form->display();
}
$form_grade->display();
}
}
}
}

@ -129,7 +129,7 @@ abstract class AbstractLink implements GradebookItem {
* Retrieve links and return them as an array of extensions of AbstractLink.
* To keep consistency, do not call this method but LinkFactory::load instead.
*/
public function load ($id = null, $type = null, $ref_id = null, $user_id = null, $course_code = null, $category_id = null, $visible = null) {
public static function load ($id = null, $type = null, $ref_id = null, $user_id = null, $course_code = null, $category_id = null, $visible = null) {
$tbl_grade_links = Database :: get_main_table(TABLE_MAIN_GRADEBOOK_LINK);
$sql='SELECT * FROM '.$tbl_grade_links;
$paramcount = 0;
@ -191,7 +191,7 @@ abstract class AbstractLink implements GradebookItem {
return $links;
}
private function create_objects_from_sql_result($result) {
private static function create_objects_from_sql_result($result) {
$links=array();
while ($data=Database::fetch_array($result)) {
$link = LinkFactory::create(intval($data['type']));

@ -172,7 +172,7 @@ class Category implements GradebookItem
*/
public function load($id = null, $user_id = null, $course_code = null, $parent_id = null, $visible = null, $session_id = null, $order_by = null) {
public static function load($id = null, $user_id = null, $course_code = null, $parent_id = null, $visible = null, $session_id = null, $order_by = null) {
//if the category given is explicitly 0 (not null), then create
// a root category object (in memory)
if ( isset($id) && (int)$id === 0 ) {
@ -277,7 +277,7 @@ class Category implements GradebookItem
return $cat;
}
private function create_category_objects_from_sql_result($result) {
private static function create_category_objects_from_sql_result($result) {
$allcat=array();
while ($data=Database::fetch_array($result)) {
$cat= new Category();

@ -142,7 +142,7 @@ class Evaluation implements GradebookItem
* @param $category_id parent category
* @param $visible visible
*/
public function load ($id = null, $user_id = null, $course_code = null, $category_id = null, $visible = null, $locked = null) {
public static function load ($id = null, $user_id = null, $course_code = null, $category_id = null, $visible = null, $locked = null) {
$tbl_grade_evaluations = Database :: get_main_table(TABLE_MAIN_GRADEBOOK_EVALUATION);
$sql = 'SELECT * FROM '.$tbl_grade_evaluations;
$paramcount = 0;
@ -185,7 +185,7 @@ class Evaluation implements GradebookItem
return $alleval;
}
private function create_evaluation_objects_from_sql_result($result) {
private static function create_evaluation_objects_from_sql_result($result) {
$alleval=array();
if (Database::num_rows($result)) {
while ($data = Database::fetch_array($result)) {

@ -50,7 +50,7 @@ class LinkFactory
* @param $category_id parent category
* @param $visible visible
*/
public function load ($id = null, $type = null, $ref_id = null, $user_id = null, $course_code = null, $category_id = null, $visible = null) {
public static function load ($id = null, $type = null, $ref_id = null, $user_id = null, $course_code = null, $category_id = null, $visible = null) {
return AbstractLink::load($id, $type, $ref_id, $user_id, $course_code, $category_id, $visible);
}

@ -266,7 +266,7 @@ class CatForm extends FormValidator {
parent :: display();
}
function setDefaults($defaults = array ()) {
parent :: setDefaults($defaults);
function setDefaults($defaults = array(), $filter = null) {
parent :: setDefaults($defaults, $filter);
}
}

@ -111,7 +111,7 @@ class DataForm extends FormValidator {
parent :: display();
}
function setDefaults($defaults = array ()) {
parent :: setDefaults($defaults);
function setDefaults($defaults = array(), $filter = null) {
parent :: setDefaults($defaults, $filter);
}
}

@ -521,8 +521,8 @@ class EvalForm extends FormValidator
parent :: display();
}
function setDefaults($defaults= array ()) {
parent :: setDefaults($defaults);
function setDefaults($defaults= array(), $filter = null) {
parent :: setDefaults($defaults, $filter);
}
private function build_stud_label ($id, $username,$lastname, $firstname) {

@ -71,7 +71,7 @@ class GradebookTable extends SortableTable {
//admins get an edit column
if (api_is_allowed_to_edit(null, true)) {
$this->set_header($column++, get_lang('Modify'), false, 'width="180px"');
$this->set_header($column++, get_lang('Modify'), false, 'width="195px"');
//actions on multiple selected documents
$this->set_form_actions(array (
'setvisible' => get_lang('SetVisible'),
@ -104,7 +104,8 @@ class GradebookTable extends SortableTable {
/**
* Function used by SortableTable to generate the data to display
*/
function get_table_data($from = 1) {
function get_table_data($from = 1, $per_page = null, $column = null, $direction = null, $sort = null) {
//variables load in index.php
global $my_score_in_gradebook, $certificate_min_score;
$scoretotal = 0;
@ -198,7 +199,7 @@ class GradebookTable extends SortableTable {
//$row[] = $invisibility_span_open .Display::tag('h4', $data['3'] .' / '.$this->currentcat->get_weight()).$invisibility_span_close;
//$average = $data['3']/$this->currentcat->get_weight()*100;
$average = $scoredisplay->display_score(array($data['3'], $this->currentcat->get_weight()), SCORE_PERCENT, SCORE_BOTH, true);
$average = $scoredisplay->display_score(array($data['3'], $this->currentcat->get_weight()), SCORE_SIMPLE, SCORE_BOTH, true);
if (api_is_allowed_to_edit(null, true)) {
$row[] = $invisibility_span_open .Display::tag('h4', $average).$invisibility_span_close;
@ -359,7 +360,7 @@ class GradebookTable extends SortableTable {
$main_weight = intval($main_cat[0]->get_weight());
if (intval($total_weight) == $main_weight) {
$label = null;
$total = score_badges(array($total_weight.' / '.$main_weight, '100%'));
$total = score_badges(array($total_weight.' / '.$main_weight, '100'));
} else {
$label = Display::return_icon('warning.png', sprintf(get_lang('TotalWeightMustBeX'), $main_weight) );
$total = Display::badge($total_weight.' / '.$main_weight, 'warning');
@ -375,7 +376,7 @@ class GradebookTable extends SortableTable {
if (count($main_cat) > 1) {
$main_weight = intval($main_cat[0]->get_weight());
if (intval($total_categories_weight) == $main_weight) {
$total = score_badges(array($total_categories_weight.' / '.$main_weight, '100%'));
$total = score_badges(array($total_categories_weight.' / '.$main_weight, '100'));
} else {
$total = Display::badge($total_categories_weight.' / '.$main_weight, 'warning');
}

@ -76,7 +76,7 @@ class UserForm extends FormValidator
function display() {
parent :: display();
}
function setDefaults($defaults= array ()) {
parent :: setDefaults($defaults);
function setDefaults($defaults= array(), $filter = null) {
parent :: setDefaults($defaults, $filter);
}
}

@ -1386,7 +1386,7 @@ class CourseManager {
* @return array - array containing user_id, lastname, firstname, username
*
*/
function get_coachs_from_course($session_id=0, $course_code='') {
public static function get_coachs_from_course($session_id=0, $course_code='') {
if (!empty($session_id)) {
$session_id = intval($session_id);
@ -1418,7 +1418,7 @@ class CourseManager {
}
}
function get_coachs_from_course_to_string($session_id = 0, $course_code = null, $separator = self::USER_SEPARATOR, $add_link_to_profile = false) {
public static function get_coachs_from_course_to_string($session_id = 0, $course_code = null, $separator = self::USER_SEPARATOR, $add_link_to_profile = false) {
$coachs_course = self::get_coachs_from_course($session_id, $course_code);
$course_coachs = array();
@ -1439,7 +1439,7 @@ class CourseManager {
return $coaches_to_string;
}
function get_coach_list_from_course_code_to_string($course_code, $session_id) {
public static function get_coach_list_from_course_code_to_string($course_code, $session_id) {
$tutor_data = '';
if ($session_id != 0) {
$coaches = self::get_email_of_tutor_to_session($session_id, $course_code);
@ -2772,7 +2772,7 @@ class CourseManager {
* Builds the course block in user_portal.php
* @todo use Twig
*/
public function course_item_html($params, $is_sub_content = false) {
public static function course_item_html($params, $is_sub_content = false) {
$html = '';
$class = "well";
if ($is_sub_content) {
@ -2816,7 +2816,7 @@ class CourseManager {
}
public function course_item_parent($main_content, $sub_content, $sub_sub_content = null) {
public static function course_item_parent($main_content, $sub_content, $sub_sub_content = null) {
return '<div class="well">'.$main_content.$sub_content.$sub_sub_content.'</div>';
}
@ -2829,7 +2829,7 @@ class CourseManager {
* @param bool Whether to show the document quick-loader or not
* @return void
*/
function display_special_courses($user_id, $load_dirs = false) {
public static function display_special_courses($user_id, $load_dirs = false) {
$user_id = intval($user_id);
$tbl_course = Database::get_main_table(TABLE_MAIN_COURSE);
$tbl_course_user = Database::get_main_table(TABLE_MAIN_COURSE_USER);
@ -2931,7 +2931,7 @@ class CourseManager {
* @param bool Whether to show the document quick-loader or not
* @return void
*/
function display_courses($user_id, $load_dirs = false) {
public static function display_courses($user_id, $load_dirs = false) {
$user_id = intval($user_id);
if (empty($user_id)) {
$user_id = api_get_user_id();
@ -2961,7 +2961,7 @@ class CourseManager {
* @param bool Whether to show the document quick-loader or not
* @return void
*/
function display_courses_in_category($user_category_id, $load_dirs = false) {
public static function display_courses_in_category($user_category_id, $load_dirs = false) {
$user_id = api_get_user_id();
// Table definitions
$TABLECOURS = Database :: get_main_table(TABLE_MAIN_COURSE);
@ -3134,7 +3134,7 @@ class CourseManager {
* @todo move code for what's new icons to a separate function to clear things up
* @todo add a parameter user_id so that it is possible to show the courselist of other users (=generalisation). This will prevent having to write a new function for this.
*/
function get_logged_user_course_html($course, $session_id = 0, $class = 'courses', $session_accessible = true, $load_dirs = false) {
public static function get_logged_user_course_html($course, $session_id = 0, $class = 'courses', $session_accessible = true, $load_dirs = false) {
global $nosession, $nbDigestEntries, $digest, $thisCourseSysCode, $orderKey;
$user_id = api_get_user_id();
$course_info = api_get_course_info($course['code']);
@ -3288,7 +3288,7 @@ class CourseManager {
* @param int destination session id
* @return bool
*/
function copy_course($source_course_code, $source_session_id, $destination_course_code, $destination_session_id, $params = array()) {
public static function copy_course($source_course_code, $source_session_id, $destination_course_code, $destination_session_id, $params = array()) {
require_once api_get_path(SYS_CODE_PATH).'coursecopy/classes/CourseBuilder.class.php';
require_once api_get_path(SYS_CODE_PATH).'coursecopy/classes/CourseRestorer.class.php';
require_once api_get_path(SYS_CODE_PATH).'coursecopy/classes/CourseSelectForm.class.php';
@ -3318,7 +3318,7 @@ class CourseManager {
*
* @return array
*/
function copy_course_simple($new_title, $source_course_code, $source_session_id = 0, $destination_session_id = 0, $params = array()) {
public static function copy_course_simple($new_title, $source_course_code, $source_session_id = 0, $destination_session_id = 0, $params = array()) {
$source_course_info = api_get_course_info($source_course_code);
if (!empty($source_course_info)) {
$new_course_code = self::generate_nice_next_course_code($source_course_code);
@ -3343,7 +3343,7 @@ class CourseManager {
* if the course code doest not exist in the DB the same course code will be returned
* @return string wanted unused code
*/
function generate_nice_next_course_code($wanted_code) {
public static function generate_nice_next_course_code($wanted_code) {
require_once api_get_path(LIBRARY_PATH).'add_course.lib.inc.php';
$course_code_ok = !self::course_code_exists($wanted_code);
if (!$course_code_ok) {
@ -3431,7 +3431,7 @@ class CourseManager {
}
}
public function get_user_course_vote($user_id, $course_id, $session_id = null, $url_id = null) {
public static function get_user_course_vote($user_id, $course_id, $session_id = null, $url_id = null) {
$table_user_course_vote = Database::get_main_table(TABLE_MAIN_USER_REL_COURSE_VOTE);
$session_id = !isset($session_id) ? api_get_session_id() : intval($session_id);
@ -3457,7 +3457,7 @@ class CourseManager {
return false;
}
public function get_course_ranking($course_id, $session_id = null, $url_id = null) {
public static function get_course_ranking($course_id, $session_id = null, $url_id = null) {
$table_course_ranking = Database::get_main_table(TABLE_STATISTIC_TRACK_COURSE_RANKING);
$session_id = !isset($session_id) ? api_get_session_id() : intval($session_id);
@ -3647,7 +3647,7 @@ class CourseManager {
* @param int number of days
* @param int number of hottest courses
*/
public function return_hot_courses($days = 30, $limit = 5) {
public static function return_hot_courses($days = 30, $limit = 5) {
$limit = intval($limit);
//Getting my courses
@ -3763,7 +3763,7 @@ class CourseManager {
* @param int Access URL ID (optional)
* @return int Number of courses
*/
public function count_courses($access_url_id=null) {
public static function count_courses($access_url_id=null) {
$table_course = Database::get_main_table(TABLE_MAIN_COURSE);
$table_course_rel_access_url = Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE);
$sql = "SELECT count(id) FROM $table_course c";
@ -3778,7 +3778,7 @@ class CourseManager {
/*
* This code was originaly in local.inc.php
*/
static function get_course_info_with_category($course_code) {
public static function get_course_info_with_category($course_code) {
global $_configuration;
$course_table = Database::get_main_table(TABLE_MAIN_COURSE);
$course_cat_table = Database::get_main_table(TABLE_MAIN_CATEGORY);

@ -1017,7 +1017,7 @@ class Display {
* @param array Course information array, containing at least elements 'db' and 'k'
* @return string The HTML link to be shown next to the course
*/
function show_notification($course_info) {
public static function show_notification($course_info) {
$t_track_e_access = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_LASTACCESS);
$user_id = api_get_user_id();
@ -1144,7 +1144,7 @@ class Display {
*
* @version 1.0
*/
function display_digest($toolsList, $digest, $orderKey, $courses) {
public static function display_digest($toolsList, $digest, $orderKey, $courses) {
$html = '';
if (is_array($digest) && (CONFVAL_showExtractInfo == SCRIPTVAL_UnderCourseList || CONFVAL_showExtractInfo == SCRIPTVAL_Both)) {
// // // LEVEL 1 // // //
@ -1217,7 +1217,7 @@ class Display {
* @param int Session ID
* @return array Empty array or session array ['title'=>'...','category'=>'','dates'=>'...','coach'=>'...','active'=>true/false,'session_category_id'=>int]
*/
function get_session_title_box($session_id) {
public static function get_session_title_box($session_id) {
global $nosession;
if (!$nosession) {

@ -1481,7 +1481,7 @@ class DocumentManager {
* @param string The course id
* @return void()
*/
function create_directory_certificate_in_course ($course_id) {
static function create_directory_certificate_in_course ($course_id) {
$course_info = api_get_course_info($course_id);
if (!empty($course_info)) {
$to_group_id=0;
@ -1521,7 +1521,7 @@ class DocumentManager {
* @param string path of directory
* @return bool true if is a certificate or false otherwise
*/
function is_certificate_mode($dir) {
static function is_certificate_mode($dir) {
//I'm in the certification module?
$is_certificate_mode = false;
$is_certificate_array = explode('/',$dir);

@ -846,6 +846,7 @@ function delete_student_lp_events($user_id, $lp_id, $course, $session_id) {
$lp_view_table = Database::get_course_table(TABLE_LP_VIEW);
$lp_item_view_table = Database::get_course_table(TABLE_LP_ITEM_VIEW);
$course_id = $course['real_id'];
if (empty($course_id)) {
$course_id = api_get_course_int_id();
}
@ -858,37 +859,37 @@ function delete_student_lp_events($user_id, $lp_id, $course, $session_id) {
$lp_id = intval($lp_id);
$session_id = intval($session_id);
//make sure we have the exact lp_view_id
$sqlview = "SELECT id FROM $lp_view_table WHERE c_id = $course_id AND user_id = $user_id AND lp_id = $lp_id AND session_id = $session_id ";
$resultview = Database::query($sqlview);
//Make sure we have the exact lp_view_id
$sql = "SELECT id FROM $lp_view_table WHERE c_id = $course_id AND user_id = $user_id AND lp_id = $lp_id AND session_id = $session_id ";
$result = Database::query($sql);
if (Database::num_rows($sqlview)) {
$view = Database::fetch_array($resultview, 'ASSOC');
if (Database::num_rows($result)) {
$view = Database::fetch_array($result, 'ASSOC');
$lp_view_id = $view['id'];
$sql_delete = "DELETE FROM $lp_item_view_table WHERE c_id = $course_id AND lp_view_id = $lp_view_id ";
$result = Database::query($sql_delete);
$sql = "DELETE FROM $lp_item_view_table WHERE c_id = $course_id AND lp_view_id = $lp_view_id ";
Database::query($sql);
}
$sql_delete = "DELETE FROM $lp_view_table WHERE c_id = $course_id AND user_id = $user_id AND lp_id= $lp_id AND session_id= $session_id ";
$result = Database::query($sql_delete);
$sql = "DELETE FROM $lp_view_table WHERE c_id = $course_id AND user_id = $user_id AND lp_id= $lp_id AND session_id = $session_id ";
Database::query($sql);
$select_all_attempts = "SELECT exe_id FROM $track_e_exercises WHERE exe_user_id = $user_id AND session_id= $session_id AND exe_cours_id = '{$course['code']}' AND orig_lp_id = $lp_id";
$result = Database::query($select_all_attempts);
$sql = "SELECT exe_id FROM $track_e_exercises WHERE exe_user_id = $user_id AND session_id = $session_id AND exe_cours_id = '{$course['code']}' AND orig_lp_id = $lp_id";
$result = Database::query($sql);
$exe_list = array();
while ($row = Database::fetch_array($result, 'ASSOC')) {
$exe_list[] = $row['exe_id'];
}
if (!empty($exe_list) && is_array($exe_list) && count($exe_list) > 0) {
$sql_delete = "DELETE FROM $track_e_exercises WHERE exe_id IN (".implode(',',$exe_list).")";
$result = Database::query($sql_delete);
$sql_delete = "DELETE FROM $track_e_exercises WHERE exe_id IN (".implode(',',$exe_list).")";
Database::query($sql_delete);
$sql_delete = "DELETE FROM $track_attempts WHERE exe_id IN (".implode(',',$exe_list).")";
$result = Database::query($sql_delete);
$sql_delete = "DELETE FROM $track_attempts WHERE exe_id IN (".implode(',',$exe_list).")";
Database::query($sql_delete);
$sql_delete = "DELETE FROM $recording_table WHERE exe_id IN (".implode(',',$exe_list).")";
$result = Database::query($sql_delete);
$sql_delete = "DELETE FROM $recording_table WHERE exe_id IN (".implode(',',$exe_list).")";
Database::query($sql_delete);
}
}

@ -51,7 +51,7 @@ class HTML_QuickForm_stylesubmitbutton extends HTML_QuickForm_stylebutton
* @access public
* @return void
*/
function HTML_QuickForm_stylesubmitbutton($elementName=null, $value=null, $attributes=null,$img=null) {
function HTML_QuickForm_stylesubmitbutton($elementName = null, $value = null, $attributes = array(), $img=null) {
if (!isset($attributes['class'])) {
$attributes['class'] = 'btn';
}

@ -217,7 +217,8 @@ class GradeModel extends Model {
parent::delete($id);
//event_system(LOG_CAREER_DELETE, LOG_CAREER_ID, $id, api_get_utc_datetime(), api_get_user_id());
}
public function fill_grade_model_select_in_form($form, $name = 'gradebook_model_id') {
public function fill_grade_model_select_in_form(&$form, $name = 'gradebook_model_id') {
if (api_get_setting('gradebook_enable_grade_model') == 'false') {
return false;
}

@ -1,39 +1,39 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* Registers rule objects and uses them for validation
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @author Alexey Borzov <avb@php.net>
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: RuleRegistry.php,v 1.19 2009/04/04 21:34:02 avb Exp $
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* Registers rule objects and uses them for validation
*
* @category HTML
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @author Alexey Borzov <avb@php.net>
* @version Release: 3.2.11
* @since 3.2
*/
* Registers rule objects and uses them for validation
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @author Alexey Borzov <avb@php.net>
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: RuleRegistry.php,v 1.19 2009/04/04 21:34:02 avb Exp $
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* Registers rule objects and uses them for validation
*
* @category HTML
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @author Alexey Borzov <avb@php.net>
* @version Release: 3.2.11
* @since 3.2
*/
class HTML_QuickForm_RuleRegistry
{
/**
@ -52,9 +52,9 @@ class HTML_QuickForm_RuleRegistry
*
* @access public
* @static
* @return HTML_QuickForm_RuleRegistry
* @return HTML_QuickForm_RuleRegistry
*/
function &singleton()
static function &singleton()
{
static $obj;
if (!isset($obj)) {
@ -115,7 +115,7 @@ class HTML_QuickForm_RuleRegistry
*
* @param string $ruleName Name of the requested rule
* @access public
* @return HTML_QuickForm_Rule
* @return HTML_QuickForm_Rule
*/
function &getRule($ruleName)
{
@ -165,10 +165,10 @@ class HTML_QuickForm_RuleRegistry
/**
* Returns the validation test in javascript code
*
* @param array|HTML_QuickForm_element Element(s) the rule applies to
* @param string Element name, in case $element is
* not an array
* @param array Rule data
* @param array|HTML_QuickForm_element Element(s) the rule applies to
* @param string Element name, in case $element is
* not an array
* @param array Rule data
* @access public
* @return string JavaScript for the rule
*/
@ -218,12 +218,12 @@ class HTML_QuickForm_RuleRegistry
* Returns JavaScript to get and to reset the element's value
*
* @access private
* @param HTML_QuickForm_element element being processed
* @param string element's name
* @param bool whether to generate JavaScript to reset
* the value
* @param integer value's index in the array (only used for
* multielement rules)
* @param HTML_QuickForm_element element being processed
* @param string element's name
* @param bool whether to generate JavaScript to reset
* the value
* @param integer value's index in the array (only used for
* multielement rules)
* @return array first item is value javascript, second is reset
*/
function _getJsValue(&$element, $elementName, $reset = false, $index = null)

@ -1,41 +1,41 @@
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* HTML class for a hidden type element
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: hidden.php,v 1.12 2009/04/04 21:34:03 avb Exp $
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* Base class for <input /> form elements
*/
require_once 'HTML/QuickForm/input.php';
/**
* HTML class for a hidden type element
*
* PHP versions 4 and 5
*
* LICENSE: This source file is subject to version 3.01 of the PHP license
* that is available through the world-wide-web at the following URI:
* http://www.php.net/license/3_01.txt If you did not receive a copy of
* the PHP License and are unable to obtain it through the web, please
* send a note to license@php.net so we can mail you a copy immediately.
*
* @category HTML
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @copyright 2001-2009 The PHP Group
* @license http://www.php.net/license/3_01.txt PHP License 3.01
* @version CVS: $Id: hidden.php,v 1.12 2009/04/04 21:34:03 avb Exp $
* @link http://pear.php.net/package/HTML_QuickForm
*/
/**
* Base class for <input /> form elements
*/
require_once 'HTML/QuickForm/input.php';
/**
* HTML class for a hidden type element
*
* @category HTML
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @version Release: 3.2.11
* @since 1.0
* @category HTML
* @package HTML_QuickForm
* @author Adam Daniel <adaniel1@eesus.jnj.com>
* @author Bertrand Mansion <bmansion@mamasam.com>
* @version Release: 3.2.11
* @since 1.0
*/
class HTML_QuickForm_hidden extends HTML_QuickForm_input
{
@ -79,11 +79,12 @@ class HTML_QuickForm_hidden extends HTML_QuickForm_input
/**
* Accepts a renderer
*
* @param HTML_QuickForm_Renderer renderer object
* @param HTML_QuickForm_Renderer renderer object
* @access public
* @return void
*/
function accept(&$renderer)
//function accept(&$renderer)
function accept(&$renderer, $required=false, $error=null)
{
$renderer->renderHidden($this);
} // end func accept

@ -253,7 +253,7 @@ class PEAR
$GLOBALS['_PEAR_shutdown_funcs'][] = array($func, $args);
}
// }}}
// }}}
// {{{ isError()
/**
@ -267,7 +267,7 @@ class PEAR
* @access public
* @return bool true if parameter is an error
*/
function isError($data, $code = null)
static function isError($data, $code = null)
{
if (!is_a($data, 'PEAR_Error')) {
return false;

@ -439,7 +439,7 @@ class Tracking {
* @param int Learning path item id (optional), for showing attempts inside a learning path $lp_id and $lp_item_id params are required.
* @return int count of attempts
*/
public function count_student_exercise_attempts($student_id, $course_code, $exercise_id, $lp_id = 0, $lp_item_id = 0, $session_id = 0) {
public static function count_student_exercise_attempts($student_id, $course_code, $exercise_id, $lp_id = 0, $lp_item_id = 0, $session_id = 0) {
$course_code = Database::escape_string($course_code);
$student_id = intval($student_id);
$exercise_id = intval($exercise_id);
@ -1511,7 +1511,7 @@ class Tracking {
* @param int Session id (optional), if param $session_id is null(default) return count of messages including sessions, 0 = session is not filtered
* @return int Count of messages
*/
function count_student_messages($student_id, $course_code, $session_id = null) {
public static function count_student_messages($student_id, $course_code, $session_id = null) {
// protect datas
$student_id = intval($student_id);

@ -11,10 +11,10 @@
/**
* Variables used from the main/install/index.php
*/
$new_version = '1.9.0';
$new_version_status = 'beta';
$new_version = '1.9.0';
$new_version_status = 'RC';
$new_version_last_id = 1;
$new_version_stable = false;
$new_version_major = true;
$software_name = 'Chamilo';
$software_url = 'http://www.chamilo.org/';
$new_version_major = true;
$software_name = 'Chamilo';
$software_url = 'http://www.chamilo.org/';

@ -8,10 +8,10 @@ $ShowHotCoursesComment = "The hot courses list will be added in the index page";
$ShowHotCoursesTitle = "Show hot courses";
$EnableIframeInclusionComment = "Allowing arbitrary iframes in the HTML Editor will enhance the edition capabilities of the users, but it can represent a security risk. Please make sure you can rely on your users (i.e. you know who they are) before enabling this feature.";
$EnableIframeInclusionTitle = "Allow iframes in HTML Editor";
$MailTemplateRegistrationMessage = "Dear ((firstname)) ((lastname)),\n\nYou are registered on
((sitename)) with the following settings:\n\nUsername :
((username))\nPass : ((password))\n\nThe address of ((sitename)) is :
((url))\n\nIn case of trouble, contact us.\n\nYours sincerely
$MailTemplateRegistrationMessage = "Dear ((firstname)) ((lastname)),\n\nYou are registered on
((sitename)) with the following settings:\n\nUsername :
((username))\nPass : ((password))\n\nThe address of ((sitename)) is :
((url))\n\nIn case of trouble, contact us.\n\nYours sincerely
\n((admin_name)) ((admin_surname)).";
$MailTemplateRegistrationTitle = "New user on ((sitename))";
$AdminBy = "Administration by";
@ -1318,7 +1318,7 @@ $EnabledImageMapsTitle = "Activate Image maps";
$EnabledImageMapsComment = "Activate the button to insert Image maps. This allows you to associate URLs to areas of an image, creating hotspots.";
$CourseTool = "Course tool";
$BigBlueButtonEnableTitle = "BigBlueButton videoconference tool";
$BigBlueButtonEnableComment = "Choose whether you want to enable the BigBlueButton videoconference tool. Once enabled, it will show as an additional course tool in all courses' homepage, and teachers will be able to launch a conference at any time. Learners will not be able to launch a conference, only join one. If you don't have a BigBlueButton server, please <a href=\"http://bigbluebutton.org/\" target=\"_blank\">set one up</a> or ask the <a href=\"http://www.chamilo.org/en/providers\" target=\"_blank\">Chamilo official providers</a> for a quote.
$BigBlueButtonEnableComment = "Choose whether you want to enable the BigBlueButton videoconference tool. Once enabled, it will show as an additional course tool in all courses' homepage, and teachers will be able to launch a conference at any time. Learners will not be able to launch a conference, only join one. If you don't have a BigBlueButton server, please <a href=\"http://bigbluebutton.org/\" target=\"_blank\">set one up</a> or ask the <a href=\"http://www.chamilo.org/en/providers\" target=\"_blank\">Chamilo official providers</a> for a quote.
BigBlueButton is a free (as in freedom *and* beer), but its installation requires a set of technical skills that might not be immediately available to all. You can install it on your own or seek professional help to assist you or do it for you. This help, however, will generate a certain cost. In the pure logic of the free software, we offer you the tools to make your work easier and recommend professionals (the Chamilo Official Providers) that will be able to help you if this were too difficult.";
$BigBlueButtonHostTitle = "BigBlueButton server host";
$BigBlueButtonHostComment = "This is the name of the server where your BigBlueButton server is running. Might be <i>localhost</i>, an IP address (e.g. 192.168.13.54) or a domain name (e.g. my.video.com).";
@ -1343,8 +1343,8 @@ $IncludeAsciiMathMlComment = "Activate this setting if you want to show ASCIIMat
$CourseHideToolsTitle = "Hide tools from teachers";
$CourseHideToolsComment = "Check the tools you want to hide from teachers. This will prohibit access to the tool.";
$MoveUserStats = "Move users results from/to a session";
$CompareUserResultsBetweenCoursesAndCoursesInASession = "This advanced tool allows you to manually improve the tracking of users results when moving from courses methodology to sessions methodology. In most cases, you won't need to use it.<br />
On this screen, you can compare results of users between the context of a standalone course, and the context of the same course inside a session.<br />
$CompareUserResultsBetweenCoursesAndCoursesInASession = "This advanced tool allows you to manually improve the tracking of users results when moving from courses methodology to sessions methodology. In most cases, you won't need to use it.<br />
On this screen, you can compare results of users between the context of a standalone course, and the context of the same course inside a session.<br />
Once you are sure about what to do, you can choose to move the tracking data of the students (exercises results and learning paths tracking) from a course to a session.";
$PDFExportWatermarkEnableTitle = "Enable watermark in PDF export";
$PDFExportWatermarkEnableComment = "By enabling this option, you can upload an image or a text that will be automatically added as watermark to all PDF exports of documents on the system.";
@ -1399,8 +1399,8 @@ $EnableAccessibilityFontResizeTitle = "Font resize accessibility feature";
$EnableAccessibilityFontResizeComment = "Enable this option to show a set of font resize options on the top-right side of your campus. This will allow visually impaired to read their course contents more easily.";
$GlobalEvent = "Platform event";
$SearchEnabledTitle = "Fulltext search";
$SearchEnabledComment = "This feature allows you to index most of the documents uploaded to your portal, then provide a search feature for users.<br />
This feature will not index documents that have already been uploaded, so it is important to enable (if wanted) at the beginning of your implementation.<br />
$SearchEnabledComment = "This feature allows you to index most of the documents uploaded to your portal, then provide a search feature for users.<br />
This feature will not index documents that have already been uploaded, so it is important to enable (if wanted) at the beginning of your implementation.<br />
Once enabled, a search box will appear in the courses list of every user. Searching for a specific term will bring a list of corresponding documents, exercises or forum topics, filtered depending on the availability of these contents to the user.";
$SpecificSearchFieldsAvailable = "Available custom search fields";
$XapianModuleInstalled = "Xapian module installed";

@ -1314,9 +1314,9 @@ $EnabledImageMapsTitle = "Activar Mapas de imagen";
$EnabledImageMapsComment = "Activar el botón para insertar Mapas de imagen. Esto le permitirá asociar direcciones url a zonas de una imagen, generando zonas interactivas.";
$CourseTool = "Herramienta del curso";
$BigBlueButtonEnableTitle = "Herramienta de videoconferencia BigBlueButton";
$BigBlueButtonEnableComment = "Seleccione si desea habilitar la herramienta de videoconferencia BigBlueButton. Una vez activada, se mostrará como una herramienta en la página principal todos los curso. Los profesores podrán lanzar una videoconferencia en cualquier momento, pero los estudiantes sólo podrán unirse a una ya lanzada.
Si no dispone de un servidor BigBlueButton, pruebe a
<a href=\"http://bigbluebutton.org/\" target=\"_blank\">configurar uno</a> o pida ayuda a los <a href=\"http://www.chamilo.org/en/providers\" target=\"_blank\">proveedores oficiales de Chamilo</a>.
$BigBlueButtonEnableComment = "Seleccione si desea habilitar la herramienta de videoconferencia BigBlueButton. Una vez activada, se mostrará como una herramienta en la página principal todos los curso. Los profesores podrán lanzar una videoconferencia en cualquier momento, pero los estudiantes sólo podrán unirse a una ya lanzada.
Si no dispone de un servidor BigBlueButton, pruebe a
<a href=\"http://bigbluebutton.org/\" target=\"_blank\">configurar uno</a> o pida ayuda a los <a href=\"http://www.chamilo.org/en/providers\" target=\"_blank\">proveedores oficiales de Chamilo</a>.
BigBlueButton es libre, pero su instalación requiere ciertas habilidades técnicas que no todo el mundo posee. Puede instalarlo por su cuenta o buscar ayuda profesional con el consiguiente costo. En la lógica del software libre, nosotros le ofrecemos las herramientas para hacer más fácil su trabajo y le recomendamos profesionales (los proveedores oficiales de Chamilo) que serán capaces de ayudarle.";
$BigBlueButtonHostTitle = "Servidor BigBlueButton";
$BigBlueButtonHostComment = "Este es el nombre del servidor donde su servidor BigBlueButton está ejecutándose. Puede ser localhost, una dirección IP (ej., 192.168.14.54) o un nombre de dominio (por ej., my.video.com).";
@ -1327,7 +1327,7 @@ $AsciiSvgComment = "Activación del editor de gráficos matemáticos (ASCIIsvg)"
$Text2AudioTitle = "Activar servicios de conversión de texto en audio";
$Text2AudioComment = "Herramienta on-line para convertir texto en voz. Utiliza tecnología y sistemas de síntesis del habla para ofrecer recursos de voz.";
$ShowUsersFoldersTitle = "Mostrar las carpetas de los usuarios en la herramienta documentos";
$ShowUsersFoldersComment = "
$ShowUsersFoldersComment = "
Esta opción le permitirá mostrar u ocultar a los profesores las carpetas que el sistema genera para cada usuario que visita la herramienta documentos o envía un archivo a través del editor web. Si muestra estas carpetas a los profesores, éstos podrán hacerlas visibles o no a los estudiantes y permitirán a cada estudiante tener un lugar específico en el curso donde, no sólo almacenar documentos, sino donde también podrán crear y modificar páginas web y poder exportarlas a pdf, realizar dibujos, realizar plantillas web personales, enviar archivos, así como crear, mover y eliminar subdirectorios y archivos, y sacar copias de seguridad de sus carpetas. Cada usuario del curso dispondrá de un completo gestor de documentos. Además, recuerde que cualquier usuario podrá copiar un archivo, que sea visible, de cualquier carpeta de la herramienta documentos (sea o no la suya) a su portafolios o área personal de documentos de la red social, donde estará disponible para que lo pueda usar en otros cursos.";
$ShowDefaultFoldersTitle = "Mostrar en la herramienta documentos las carpetas que contienen los recursos multimedia suministrados por defecto.";
$ShowDefaultFoldersComment = "Las carpetas de archivos multimedia suministradas por defecto contienen archivos de libre distribución organizados en las categorías de video, audio, imagen y animaciones flash que para utilizar en sus cursos. Aunque las oculte en la herramienta documentos, podrá seguir usándolas en el editor web de la plataforma.";
@ -1342,8 +1342,8 @@ $IncludeAsciiMathMlComment = "Active este parámetro si desea mostrar fórmulas
$CourseHideToolsTitle = "Ocultar las herramientas a los docentes";
$CourseHideToolsComment = "Seleccione las herramientas que desea esconder del docente. Esto prohibirá el acceso a la herramienta.";
$MoveUserStats = "Mover los resultados de los usuarios desde/hacia una sesión de formación";
$CompareUserResultsBetweenCoursesAndCoursesInASession = "Esta herramienta avanzada le permite mejorar manualmente el seguimiento de los resultados de los usuarios cuando cambia de un modelo de cursos a un modelo de sesiones de formación. En una mayoría de casos, no necesitará usarla.<br />
En esta pantalla, puede comparar los resultados que los usuarios tienen en el contexto de un curso y en el contexto del mismo curso dentro de una sesión de formación.<br />
$CompareUserResultsBetweenCoursesAndCoursesInASession = "Esta herramienta avanzada le permite mejorar manualmente el seguimiento de los resultados de los usuarios cuando cambia de un modelo de cursos a un modelo de sesiones de formación. En una mayoría de casos, no necesitará usarla.<br />
En esta pantalla, puede comparar los resultados que los usuarios tienen en el contexto de un curso y en el contexto del mismo curso dentro de una sesión de formación.<br />
Una vez que decidida cuál es el mejor contexto para el seguimiento (resultados de ejercicios y seguimiento de lecciones), podrá moverlo de un curso a una sesión.";
$PDFExportWatermarkEnableTitle = "Marcas de agua en las exportaciones a PDF";
$PDFExportWatermarkEnableComment = "Si activa esta opción podrá cargar una imagen o un texto que serán automáticamente añadidos como marca de agua en los documentos resultantes de todas las exportaciones a PDF que realice el sistema.";
@ -1398,8 +1398,8 @@ $EnableAccessibilityFontResizeTitle = "Funcionalidad de redimensionamiento de fu
$EnableAccessibilityFontResizeComment = "Activar esta opción mostrará una serie de opciones de redimensionamiento de fuentes en la parte superior derecha de su campus. Esto permitirá a las personas con problemas de vista leer más fácilmente los contenidos de sus cursos.";
$GlobalEvent = "Evento de la plataforma";
$SearchEnabledTitle = "Búsqueda a texto completo";
$SearchEnabledComment = "Esta funcionalidad permite la indexación de la mayoría de los documentos subidos a su portal, con lo que permite la búsqueda para los usuarios.<br />
Esta funcionalidad no indexa los documentos que ya fueron subidos, por lo que es importante (si se quiere) activarla al comienzo de su implementación.<br />
$SearchEnabledComment = "Esta funcionalidad permite la indexación de la mayoría de los documentos subidos a su portal, con lo que permite la búsqueda para los usuarios.<br />
Esta funcionalidad no indexa los documentos que ya fueron subidos, por lo que es importante (si se quiere) activarla al comienzo de su implementación.<br />
Una vez activada, una caja de búsqueda aparecerá en la lista de cursos de cada usuario. Buscar un término específico suministra una lista de documentos, ejercicios o temas de foro correspondientes, filtrados dependiendo de su disponibilidad para el usuario.";
$SpecificSearchFieldsAvailable = "Campos de búsqueda personalizados disponibles";
$XapianModuleInstalled = "Módulo Xapian instalado";
@ -1557,37 +1557,37 @@ $GradebookEnableLockingTitle = "Activar bloqueo de Evaluaciones por los profesor
$GradebookEnableLockingComment = "Una vez activada, esta opción permitirá a los profesores bloquear cualquier evaluación dentro de su curso. Esto prohibirá al profesor cualquier modificación posterior de los resultados de sus alumnos en los recursos usados para esta evaluación: exámenes, lecciones, tareas, etc. El único rol autorizado a desbloquear una evaluación es el administrador. El profesor estará informado de esta posibilidad al intentar desbloquear la evaluación. El bloqueo como el desbloqueo estarán guardados en el registro de actividades importantes del sistema.";
$LdapDescriptionComment = "<div class='normal-message'> <br /><ul><li>LDAP authentication : <br />See I. below to configure LDAP <br />See II. below to activate LDAP authentication </li><br /><br /><li> Update user attributes, with LDAP data, after CAS authentication(see <a href='settings.php?category=CAS'>CAS configuration </a>) : <br />See I. below to configure LDAP <br />CAS manage user authentication, LDAP activation isn't required. </li><br /></ul></div><br /><h4>I. LDAP configuration</h4><h5>Edit file main/auth/external_login/ldap.conf.php </h5>-&gt; Edit values of array <code>&#36;extldap_config</code> <br /><br />Parameters are <br /><ul><li>base domain string (ex : 'base_dn' =&gt; 'DC=cblue,DC=be') </li><li>admin distinguished name (ex : 'admin_dn' =&gt;'CN=admin,dc=cblue,dc=be') </li><li>admin password (ex : 'admin_password' =&gt; '123456') </li><li>ldap host (ex : 'host' =&gt; array('1.2.3.4', '2.3.4.5', '3.4.5.6')) </li><li>filter (ex : 'filter' =&gt; '') </li><li>port (ex : 'port' =&gt; 389) </li><li>protocol version (2 or 3) (ex : 'protocol_version' =&gt; 3) </li><li>user_search (ex : 'user_search' =&gt; 'sAMAccountName=%username%') </li><li>encoding (ex : 'encoding' =&gt; 'UTF-8') </li><li>update_userinfo (ex : 'update_userinfo' =&gt; true) </li></ul>-&gt; To update correspondences between user and LDAP attributes, edit array <code>&#36;extldap_user_correspondance</code> <br />Array values are &lt;chamilo_field&gt; =&gt; &gt;ldap_field&gt; <br />Array structure is explained in file main/auth/external_login/ldap.conf.php<br /><br /><br /><h4>II. Activate LDAP authentication </h4><h5>Edit file main/inc/conf/configuration.php </h5>-&gt; Uncomment lines <br />&#36;extAuthSource[&quot;extldap&quot;][&quot;login&quot;] =&#36;_configuration['root_sys'].&#36;_configuration['code_append'].&quot;auth/external_login/login.ldap.php&quot;;<br />&#36;extAuthSource[&quot;extldap&quot;][&quot;newUser&quot;] =&#36;_configuration['root_sys'].&#36;_configuration['code_append'].&quot;auth/external_login/newUser.ldap.php&quot;;<br /><br />N.B. : LDAP users use same fields than platform users to login. <br />N.B. : LDAP activation adds a menu External authentication [LDAP] in &quot;add or modify&quot; user pages.</div>";
$ShibbolethMainActivateTitle = "<h3>Autenticación Shibboleth</h3>";
$ShibbolethMainActivateComment = "En primer lugar, tiene que configurar Shibboleth para su servidor web.
Para configurarlo en Chamilo:
editar el archivo <strong> main/auth/shibboleth/config/aai.class.php</strong>
Modificar valores de \$result con el nombre de los atributos de Shibboleth
\$result->unique_id = 'mail';
\$result->firstname = 'cn';
\$result->lastname = 'uid';
\$result->email = 'mail';
\$result->language = '-';
\$result->gender = '-';
\$result->address = '-';
\$result->staff_category = '-';
\$result->home_organization_type = '-';
\$result->home_organization = '-';
\$result->affiliation = '-';
\$result->persistent_id = '-';
...
$ShibbolethMainActivateComment = "En primer lugar, tiene que configurar Shibboleth para su servidor web.
Para configurarlo en Chamilo:
editar el archivo <strong> main/auth/shibboleth/config/aai.class.php</strong>
Modificar valores de \$result con el nombre de los atributos de Shibboleth
\$result->unique_id = 'mail';
\$result->firstname = 'cn';
\$result->lastname = 'uid';
\$result->email = 'mail';
\$result->language = '-';
\$result->gender = '-';
\$result->address = '-';
\$result->staff_category = '-';
\$result->home_organization_type = '-';
\$result->home_organization = '-';
\$result->affiliation = '-';
\$result->persistent_id = '-';
...
Ir a Plug-in para añadir el botón 'Shibboleth Login' en su campus de Chamilo.";
$LdapDescriptionTitle = "<h3>Autentificacion LDAP</h3>";
$FacebookMainActivateTitle = "Autenticación con Facebook";
$FacebookMainActivateComment = "En primer lugar, se tiene que crear una aplicación de Facebook (ver https://developers.facebook.com/apps) con una cuenta de Facebook. En los parámetros de aplicaciones de Facebook, el valor de dirección URL del sitio debe tener \"una acción = fbconnect\" un parámetro GET (http://mychamilo.com/?action=fbconnect, por ejemplo).
Entonces, editar el archivo <strong> main/auth/external_login/facebook.conf.php </strong>
e ingresar en \"appId\" y \"secret\" los valores de \$facebook_config.
$FacebookMainActivateComment = "En primer lugar, se tiene que crear una aplicación de Facebook (ver https://developers.facebook.com/apps) con una cuenta de Facebook. En los parámetros de aplicaciones de Facebook, el valor de dirección URL del sitio debe tener \"una acción = fbconnect\" un parámetro GET (http://mychamilo.com/?action=fbconnect, por ejemplo).
Entonces, editar el archivo <strong> main/auth/external_login/facebook.conf.php </strong>
e ingresar en \"appId\" y \"secret\" los valores de \$facebook_config.
Ir a Plug-in para añadir un botón configurable \"Facebook Login\" para el campus de Chamilo.";
$LanguagePriority1Title = "Prioridad del idioma 1";
$LanguagePriority2Title = "Prioridad del idioma 2";

@ -819,7 +819,7 @@ $AssignSessions = "Asignar sesiones de formación";
$Timezone = "Zona horaria";
$DashboardPluginsHaveBeenUpdatedSucesslly = "Los plugins del panel de control han sido actualizados correctamente";
$LoginEnter = "Entrar";
$AttendanceSheetDescription = "Las listas de asistencia permiten registrar las faltas de asistencia de los estudiantes. En caso de ausencia de un estudiante, el profesor deberá registrarlo manualmente en la casilla correspondiente.
$AttendanceSheetDescription = "Las listas de asistencia permiten registrar las faltas de asistencia de los estudiantes. En caso de ausencia de un estudiante, el profesor deberá registrarlo manualmente en la casilla correspondiente.
Es posible crear más de una lista de asistencia por cada curso; así por ejemplo, podrá registrar separadamente la asistencia a las clases teóricas y prácticas.";
$ThereAreNoRegisteredLearnersInsidetheCourse = "No hay estudiantes inscritos en este curso";
$GoToAttendanceCalendarList = "Ir al calendario de asistencia";
@ -930,14 +930,14 @@ $SendInformation = "Enviar la información";
$YouMustAcceptLicence = "Debe aceptar la licencia para poder usar este software";
$SelectOne = "Seleccione uno";
$ContactInformationHasBeenSent = "Información de contacto enviada";
$ContactInformationDescription = "Estimado usuario,
está a punto de instalar una de las mejores plataformas e-learning de código abierto que existen en el mercado. Al igual de muchos otros proyectos de código abierto, Chamilo está respaldado por una amplia comunidad de profesores, estudiantes, desarrolladores y creadores de contenido.
Si sabemos algo más de quien va a gestionar este sistema e-learning, podremos dar a conocer a otros que nuestro software lo utiliza y a usted podremos informarle sobre eventos que pueden ser de su interés.
Cumplimentar este formulario, implica la aceptación de que la asociación Chamilo o sus miembros puedan enviarle información por correo electrónico sobre eventos importantes o actualizaciones en el software Chamilo. Esto ayudará a crecer a la comunidad como una entidad organizada, donde el flujo de información, se haga con respeto permanente a su tiempo y su privacidad.
$ContactInformationDescription = "Estimado usuario,
está a punto de instalar una de las mejores plataformas e-learning de código abierto que existen en el mercado. Al igual de muchos otros proyectos de código abierto, Chamilo está respaldado por una amplia comunidad de profesores, estudiantes, desarrolladores y creadores de contenido.
Si sabemos algo más de quien va a gestionar este sistema e-learning, podremos dar a conocer a otros que nuestro software lo utiliza y a usted podremos informarle sobre eventos que pueden ser de su interés.
Cumplimentar este formulario, implica la aceptación de que la asociación Chamilo o sus miembros puedan enviarle información por correo electrónico sobre eventos importantes o actualizaciones en el software Chamilo. Esto ayudará a crecer a la comunidad como una entidad organizada, donde el flujo de información, se haga con respeto permanente a su tiempo y su privacidad.
De cualquier forma, tenga en cuenta que no tiene la obligación de rellenar este formulario. Si desea permanecer en el anonimato, perderemos la oportunidad de ofrecerle todos los privilegios de ser un administrador de portal registrado, pero respetaremos su decisión. Basta con dejar vacío este formulario y hacer clic en \"Siguiente\" para seguir instalando Chamilo.";
$CompanyActivity = "Sector";
$DateUnLock = "Desbloquear fecha";
@ -1135,11 +1135,11 @@ $CertificateOnlineLink = "Vínculo al certificado en línea";
$NewExercises = "Nuevo ejercicio";
$MyAverage = "Mi promedio";
$AllAttempts = "Todos los intentos";
$NoCookies = "Las cookies no están activadas en su navegador.
$NoCookies = "Las cookies no están activadas en su navegador.
Chamilo utiliza \"cookies\" para almacenar sus datos de conexión, por lo que no le será posible entrar si las cookies no están habilitadas. Por favor, cambie la configuración de su navegador y recargue esta página.";
$NoJavascript = "Su navegador no tiene activado JavaScript.
$NoJavascript = "Su navegador no tiene activado JavaScript.
Chamilo se sirve de JavaScript para proporcionar un interfaz más dinámico. Es probable que muchas prestaciones sigan funcionando pero otras no lo harán, especialmente las relacionadas con la usabilidad. Le recomendamos que cambie la configuración de su navegador y recargue esta página.";
$NoFlash = "Su navegador no tiene activado el soporte de Flash.
$NoFlash = "Su navegador no tiene activado el soporte de Flash.
Chamilo sólo se apoya en Flash para algunas de sus funciones por lo que su ausencia no le impedirá continuar. Pero si quiere beneficiarse del conjunto de las herramientas de Chamilo, le recomendamos que instale-active el plugin de Flash y reinicialice su navegador.";
$Attempt = "Intento";
$SaveForNow = "Guardar y continuar más tarde";
@ -1219,7 +1219,7 @@ $LoginX = "Nombre de usuario: %s";
$ChatConnected = "Chat (Conectado)";
$ChatDisconnected = "Chat (Desconectado)";
$ThingsToDo = "Actividades por realizar";
$WamiFlashDialog = "Se mostrará un cuadro de diálogo en el que se le pedirá permiso para poder acceder al micrófono, responda afirmativamente y cierre el cuadro de diálogo (si no desea que vuelva a aparecer, antes de cerrar marque la opción
$WamiFlashDialog = "Se mostrará un cuadro de diálogo en el que se le pedirá permiso para poder acceder al micrófono, responda afirmativamente y cierre el cuadro de diálogo (si no desea que vuelva a aparecer, antes de cerrar marque la opción
recordar)";
$WamiStartRecorder = "Inicie la grabación pulsando el micrófono y deténgala pulsándolo de nuevo. Cada vez que haga esto se generará un archivo.";
$InputNameHere = "Escriba el nombre aquí";

@ -41,7 +41,7 @@ if ($_SESSION['oLP']) {
$lp_item_info = new learnpathItem($lp_item_id);
if (!empty($lp_item_info)) {
//if (basename($lp_item_info->path) == basename($doc_url)) {
$visible = $_SESSION['oLP']->is_lp_visible_for_student($lp_id, $user_id);
$visible = learnpath::is_lp_visible_for_student($lp_id, $user_id);
if ($visible) {
event_download($doc_url);

@ -174,16 +174,10 @@ class learnpath {
if (empty($user_id)) {
$this->error = 'User ID is empty';
return false;
} else {
//$main_table = Database::get_main_user_table();
$main_table = Database::get_main_table(TABLE_MAIN_USER);
//$user_id = Database::escape_integer($user_id);
$user_id = $this->escape_string($user_id);
$sql = "SELECT * FROM $main_table WHERE user_id = '$user_id'";
if ($this->debug > 2) { error_log('New LP - learnpath::__construct() '.__LINE__.' - Querying user: '.$sql, 0); }
$res = Database::query($sql);
if (Database::num_rows($res) > 0) {
$this->user_id = $user_id;
} else {
$user_info = api_get_user_info($user_id);
if (!empty($user_info)) {
$this->user_id = $user_info['user_id'];
} else {
$this->error = 'User ID does not exist in database ('.$sql.')';
return false;
@ -197,7 +191,8 @@ class learnpath {
// Now get the latest attempt from this user on this LP, if available, otherwise create a new one.
$lp_table = Database::get_course_table(TABLE_LP_VIEW);
// Selecting by view_count descending allows to get the highest view_count first.
$sql = "SELECT * FROM $lp_table WHERE c_id = $course_id AND lp_id = '$lp_id' AND user_id = '$user_id' $session ORDER BY view_count DESC";
$sql = "SELECT * FROM $lp_table WHERE c_id = $course_id AND lp_id = '$lp_id' AND user_id = '$user_id' $session ORDER BY view_count DESC";
if ($this->debug > 2) { error_log('New LP - learnpath::__construct() ' . __LINE__ . ' - querying lp_view: ' . $sql, 0); }
$res = Database::query($sql);
$view_id = 0; // Used later to query lp_item_view.
@ -206,17 +201,17 @@ class learnpath {
error_log('New LP - learnpath::__construct() ' . __LINE__ . ' - Found previous view', 0);
}
$row = Database :: fetch_array($res);
$this->attempt = $row['view_count'];
$this->lp_view_id = $row['id'];
$this->last_item_seen = $row['last_item'];
$this->progress_db = $row['progress'];
$this->lp_view_session_id = $row['session_id'];
$this->attempt = $row['view_count'];
$this->lp_view_id = $row['id'];
$this->last_item_seen = $row['last_item'];
$this->progress_db = $row['progress'];
$this->lp_view_session_id = $row['session_id'];
} else {
if ($this->debug > 2) {
error_log('New LP - learnpath::__construct() ' . __LINE__ . ' - NOT Found previous view', 0);
}
$this->attempt = 1;
$sql_ins = "INSERT INTO $lp_table (c_id, lp_id,user_id,view_count, session_id) VALUES ($course_id, $lp_id, $user_id, 1, $session_id)";
$sql_ins = "INSERT INTO $lp_table (c_id, lp_id, user_id, view_count, session_id) VALUES ($course_id, $lp_id, $user_id, 1, $session_id)";
$res_ins = Database::query($sql_ins);
$this->lp_view_id = Database :: insert_id();
if ($this->debug > 2) {
@ -226,7 +221,7 @@ class learnpath {
// Initialise items.
$lp_item_table = Database::get_course_table(TABLE_LP_ITEM);
$sql = "SELECT * FROM $lp_item_table WHERE c_id = $course_id AND lp_id = '".$this->lp_id."' ORDER BY parent_item_id, display_order";
$sql = "SELECT * FROM $lp_item_table WHERE c_id = $course_id AND lp_id = '".$this->lp_id."' ORDER BY parent_item_id, display_order";
$res = Database::query($sql);
while ($row = Database::fetch_array($res)) {
$oItem = '';
@ -264,7 +259,6 @@ class learnpath {
}
break;
case 1:
default:
require_once 'learnpathItem.class.php';
$oItem = new learnpathItem($row['id'], $user_id, $course_id);
@ -299,6 +293,7 @@ class learnpath {
}
}
}
// Get last viewing vars.
$lp_item_view_table = Database :: get_course_table(TABLE_LP_ITEM_VIEW);
// This query should only return one or zero result.
@ -1874,7 +1869,7 @@ class learnpath {
* @param boolean Whether to return null if no record was found (true), or 0 (false) (optional, defaults to false)
* @return integer Current progress value as found in the database
*/
public function get_db_progress($lp_id, $user_id, $mode = '%', $course_code = '', $sincere = false,$session_id = 0) {
public static function get_db_progress($lp_id, $user_id, $mode = '%', $course_code = '', $sincere = false,$session_id = 0) {
//if ($this->debug > 0) { error_log('New LP - In learnpath::get_db_progress()', 0); }
$session_id = intval($session_id);
@ -2000,7 +1995,7 @@ class learnpath {
* @param string Course code (optional)
* @return bool True if
*/
public function is_lp_visible_for_student($lp_id, $student_id, $course = null) {
public static function is_lp_visible_for_student($lp_id, $student_id, $course = null) {
$lp_id = (int)$lp_id;
$course = api_get_course_info($course);
$tbl_learnpath = Database :: get_course_table(TABLE_LP_MAIN);
@ -2049,7 +2044,6 @@ class learnpath {
}
}
}
return $is_visible;
}
return false;
@ -2620,7 +2614,7 @@ class learnpath {
* @param boolean Return the name? If false, return the ID. Default is false.
* @return mixed Type ID or name, depending on the parameter
*/
public function get_type_static($lp_id = 0) {
public static function get_type_static($lp_id = 0) {
$course_id = api_get_course_int_id();
$tbl_lp = Database :: get_course_table(TABLE_LP_MAIN);
$sql = "SELECT lp_type FROM $tbl_lp WHERE c_id = $course_id AND id = '" . $lp_id . "'";
@ -2716,6 +2710,7 @@ class learnpath {
$mycurrentitemid = $this->get_current_item_id();
$color_counter = 0;
$i = 0;
foreach ($list as $item) {
if ($this->debug > 2) {
error_log('New LP - learnpath::get_html_toc(): using item ' . $item['id'], 0);

@ -2302,11 +2302,14 @@ class learnpathItem {
$rs_verified = Database::query($sql_verified);
$row_verified = Database::fetch_array($rs_verified);
$my_case_completed = array('completed', 'passed', 'browsed', 'failed'); // Added by Isaac Flores.
if (in_array($sql_verified['status'], $my_case_completed)) {
$save = false;
} else {
$save = true;
}
$save = true;
if (isset($sql_verified['status'])) {
if (in_array($sql_verified['status'], $my_case_completed)) {
$save = false;
}
}
if ((($save===false && $this->type == 'sco') ||(($this->type == 'sco') && ($credit == 'no-credit' OR $mode == 'review' OR $mode == 'browse'))) && ($this->seriousgame_mode!=1 && $this->type == 'sco'))
{

@ -9,7 +9,10 @@
* @package chamilo.learnpath
* @author Yannick Warnier <ywarnier@beeznest.org>
*/
//use \ChamiloSession as Session;
$this_section = SECTION_COURSES;
//@todo who turns on $lp_controller_touched?
if (empty($lp_controller_touched) || $lp_controller_touched != 1) {
header('location: lp_controller.php?action=list');
}
@ -505,4 +508,8 @@ if (!empty($flat_list)) {
}
$course_info = api_get_course_info();
$result = learnpath::generate_learning_path_folder($course_info);
//Deleting the objects
//Session::erase('oLP');
//Session::erase('lpobject');
Display::display_footer();

@ -27,7 +27,7 @@ $htmlHeadXtra[] = '<script type="text/javascript">
*/
class survey_manager {
function get_surveys($course_code, $session_id = 0) {
public static function get_surveys($course_code, $session_id = 0) {
$table_survey = Database :: get_course_table(TABLE_SURVEY);
$course_info = api_get_course_info($course_code);
$session_condition = api_get_session_condition($session_id, true, true);

@ -527,7 +527,8 @@ switch ($action) {
}
break;
case 'upload':
$check = Security::check_token('post');
$check = Security::check_token('post');
if ($student_can_edit_in_session && $check) {
//check the token inserted into the form
@ -593,7 +594,7 @@ switch ($action) {
parent_id = '".$work_id."' ,
session_id = '".intval($id_session)."' ,
user_id = '".$user_id."'";
//var_dump($sql_add_publication);
//var_dump($sql_add_publication);exit;
Database::query($sql_add_publication);
$id = Database::insert_id();
if ($id) {
@ -632,7 +633,7 @@ switch ($action) {
$insertId = Database::insert_id();
api_item_property_update($_course, 'work', $insertId, 'DocumentAdded', $user_id, $group_id);
$succeed = true;*/
} elseif (isset($_POST['editWork'])) {
} elseif (isset($_POST['editWork'])) {
/*
* SPECIAL CASE ! For a work edited
*/
@ -669,9 +670,14 @@ switch ($action) {
} else {
$error_message = get_lang('IsNotPosibleSaveTheDocument');
}
}
} else {
$error_message = get_lang('IsNotPosibleSaveTheDocument');
}
Security::clear_token();
}
} else {
//Bad token or can't add works
$error_message = get_lang('IsNotPosibleSaveTheDocument');
}
if (!empty($succeed) && !empty($id)) {
//last value is to check this is not "just" an edit
@ -691,7 +697,7 @@ switch ($action) {
$emailto[$row_email['myemail']] = $row_email['myemail'];
}
}
} else {
} else {
// coachs of the session
$sql_resp = 'SELECT user.email as myemail
FROM ' . $table_session . ' session INNER JOIN ' . $table_user . ' user
@ -718,7 +724,7 @@ switch ($action) {
}
}
if (count($emailto) > 0) {
if (count($emailto) > 0) {
$emailto = implode(',', $emailto);
$emailsubject = "[" . api_get_setting('siteName') . "] ";
$sender_name = api_get_setting('administratorName').' '.api_get_setting('administratorSurname');
@ -755,7 +761,11 @@ switch ($action) {
}
event_upload($Id);
Display :: display_confirmation_message(get_lang('DocAdd'), false);
}
} else {
if (!empty($error_message)) {
Display :: display_warning_message($error_message, false);
}
}
case 'create_dir':
case 'add':
//$check = Security::check_token('post');
@ -950,7 +960,7 @@ switch ($action) {
case 'move_to':
case 'list':
/* Move file command */
if ($is_allowed_to_edit && $action == 'move_to') {
if ($is_allowed_to_edit && $action == 'move_to') {
$move_to_path = get_work_path($_REQUEST['move_to_id']);
if ($move_to_path==-1) {
@ -1139,7 +1149,7 @@ switch ($action) {
}
//User works
if (isset($work_id) && !empty($work_id) && !$display_list_users_without_publication) {
if (isset($work_id) && !empty($work_id) && !$display_list_users_without_publication) {
$work_data = get_work_assignment_by_id($work_id);
$check_qualification = intval($my_folder_data['qualification']);

@ -113,8 +113,8 @@ class TestTracking extends UnitTestCase {
$student_id=$_user;
$course_code=$_course;
$a_course = CourseManager :: get_course_information($course_code);
$this->tracking = new Tracking();
$res=$this->tracking->count_student_messages($student_id, $course_code);
$res=Tracking::count_student_messages($student_id, $course_code);
$this->assertTrue(is_object($this->tracking));
if(!is_numeric($res))$this->assertTrue(is_null($res));
//var_dump($res);

Loading…
Cancel
Save