skala
Juan Carlos Raña 13 years ago
commit 4f666a712b
  1. 67
      main/admin/course_information.php
  2. 24
      main/admin/settings.php
  3. 2
      main/coursecopy/classes/DummyCourseCreator.class.php
  4. 2
      main/coursecopy/classes/Event.class.php
  5. 3
      main/coursecopy/classes/ForumTopic.class.php
  6. 19
      main/css/base.css
  7. 19
      main/exercice/answer.class.php
  8. 2
      main/exercice/exercise.lib.php
  9. 19
      main/exercice/question.class.php
  10. 11
      main/gradebook/gradebook_edit_all.php
  11. 5
      main/gradebook/gradebook_scoring_system.php
  12. 2
      main/gradebook/lib/fe/displaygradebook.php
  13. 2
      main/gradebook/lib/fe/gradebooktable.class.php
  14. 58
      main/gradebook/lib/fe/scoredisplayform.class.php
  15. 3
      main/gradebook/lib/gradebook_functions.inc.php
  16. 34
      main/gradebook/lib/scoredisplay.class.php
  17. 2
      main/inc/lib/display.lib.php
  18. 2
      main/inc/lib/document.lib.php
  19. 5
      main/inc/lib/htmlpurifier/library/HTMLPurifier/Filter/AllowIframes.php
  20. BIN
      main/inc/lib/javascript/jquery-ui/smoothness/images/ui-icons_888888_256x240.png
  21. 356
      main/inc/lib/javascript/jquery-ui/smoothness/jquery-ui-1.8.17.custom.min.js
  22. 76
      main/inc/lib/javascript/jquery-ui/smoothness/jquery-ui-1.8.21.custom.css
  23. 125
      main/inc/lib/javascript/jquery-ui/smoothness/jquery-ui-1.8.21.custom.min.js
  24. 52
      main/inc/lib/javascript/jquery.lp_minipanel.js
  25. 8
      main/inc/lib/javascript/jquery.min.js
  26. 2
      main/inc/lib/main_api.lib.php
  27. 15
      main/inc/lib/message.lib.php
  28. 14
      main/inc/lib/sessionmanager.lib.php
  29. 3
      main/inc/lib/social.lib.php
  30. 22
      main/inc/lib/tracking.lib.php
  31. 4
      main/install/db_main.sql
  32. 2
      main/install/migrate-db-1.8.8-1.9.0-pre.sql
  33. 107
      main/mySpace/index.php
  34. 1
      main/newscorm/lp_view.php
  35. 2
      plugin/add_cas_login_button/template.tpl
  36. 51
      plugin/olpc_peru_filter/readme.txt

@ -13,8 +13,7 @@
$language_file = 'admin';
$cidReset = true;
require_once '../inc/global.inc.php';
require_once api_get_path(LIBRARY_PATH).'course.lib.php';
$this_section=SECTION_PLATFORM_ADMIN;
$this_section = SECTION_PLATFORM_ADMIN;
api_protect_admin_script();
/**
@ -64,22 +63,14 @@ $res = Database::query($sql);
$course = Database::fetch_object($res);
$tool_name = $course->title.' ('.$course->visual_code.')';
Display::display_header($tool_name);
/* <a href="course_create_content.php?course_code=<?php echo $course->code ?>"><?php echo get_lang('AddDummyContentToCourse') ?></a> */
?>
<div class="actions">
<a href="<?php echo api_get_path(WEB_COURSE_PATH).$course->directory; ?>"><?php Display::display_icon('course_home.gif', get_lang('CourseHomepage')); ?> <?php echo get_lang('CourseHomepage'); ?></a>
<a href="<?php echo api_get_path(WEB_COURSE_PATH).$course->directory; ?>"><?php Display::display_icon('home.png', get_lang('CourseHomepage'), array(), ICON_SIZE_MEDIUM); ?></a>
</div>
<?php
if(api_get_setting('server_type') == 'test') {
?>
<a href="course_create_content.php?course_code=<?php echo $course->code ?>"><?php echo get_lang('AddDummyContentToCourse') ?></a>
<?php
}
?>
</p>
<?php
<?php
echo '<h4>'.get_lang('CourseUsage').'</h4>';
echo Display::page_header(get_lang('CourseUsage'));
$id_session = intval($_GET['id_session']);
$table = new SortableTableFromArray(get_course_usage($course->code,$id_session),0,20,'usage_table');
@ -88,28 +79,25 @@ $table->set_other_tables(array('user_table','class_table'));
$table->set_header(0,get_lang('Tool'), true);
$table->set_header(1,get_lang('NumberOfItems'), true);
$table->display();
/**
* Show all users subscribed in this course
*/
echo '<h4>'.get_lang('Users').'</h4>';
echo Display::page_header(get_lang('Users'));
$table_course_user = Database :: get_main_table(TABLE_MAIN_COURSE_USER);
$table_user = Database :: get_main_table(TABLE_MAIN_USER);
$sql = "SELECT *,cu.status as course_status FROM $table_course_user cu, $table_user u WHERE cu.user_id = u.user_id AND cu.course_code = '".$code."' AND cu.relation_type <> ".COURSE_RELATION_TYPE_RRHH." ";
$res = Database::query($sql);
$is_western_name_order = api_is_western_name_order();
if (Database::num_rows($res) > 0)
{
if (Database::num_rows($res) > 0) {
$users = array ();
while ($obj = Database::fetch_object($res)) {
$user = array ();
$user[] = $obj->official_code;
if ($is_western_name_order)
{
if ($is_western_name_order) {
$user[] = $obj->firstname;
$user[] = $obj->lastname;
}
else
{
} else {
$user[] = $obj->lastname;
$user[] = $obj->firstname;
}
@ -122,13 +110,10 @@ if (Database::num_rows($res) > 0)
$table->set_additional_parameters(array ('code' => $code));
$table->set_other_tables(array('usage_table','class_table'));
$table->set_header(0,get_lang('OfficialCode'), true);
if ($is_western_name_order)
{
if ($is_western_name_order) {
$table->set_header(1,get_lang('FirstName'), true);
$table->set_header(2,get_lang('LastName'), true);
}
else
{
} else {
$table->set_header(1,get_lang('LastName'), true);
$table->set_header(2,get_lang('FirstName'), true);
}
@ -140,19 +125,31 @@ if (Database::num_rows($res) > 0)
echo get_lang('NoUsersInCourse');
}
$session_list = SessionManager::get_session_by_course($course->code);
$url = api_get_path(WEB_CODE_PATH);
foreach($session_list as &$session) {
$session[0] = Display::url($session[0], $url.'admin/resume_session.php?id_session='.$session['id'] );
unset($session[1]);
}
if (!empty($session_list)) {
echo Display::page_header(get_lang('Sessions'));
$table = new SortableTableFromArray($session_list, 0, 20,'user_table');
$table->display();
}
/*@todo This should be dissapear classes are a deprecated feature*/
/**
* Show all classes subscribed in this course
*/
/*
//Show all classes subscribed in this course
$table_course_class = Database :: get_main_table(TABLE_MAIN_COURSE_CLASS);
$table_class = Database :: get_main_table(TABLE_MAIN_CLASS);
$sql = "SELECT * FROM $table_course_class cc, $table_class c WHERE cc.class_id = c.id AND cc.course_code = '".$code."'";
$res = Database::query($sql);
if (Database::num_rows($res) > 0)
{
if (Database::num_rows($res) > 0) {
$data = array ();
while ($class = Database::fetch_object($res))
{
while ($class = Database::fetch_object($res)) {
$row = array ();
$row[] = $class->name;
$row[] = '<a href="class_information.php?id='.$class->id.'">'.Display::return_icon('synthese_view.gif', get_lang('Edit')).'</a>';
@ -169,6 +166,6 @@ if (Database::num_rows($res) > 0)
echo '</blockquote>';
} else {
echo '<p>'.get_lang('NoClassesForThisCourse').'</p>';
}
}*/
/* FOOTER */
Display::display_footer();

@ -136,7 +136,7 @@ if (!empty($_GET['category']) && !in_array($_GET['category'], array('Plugins', '
$settings = get_settings($my_category);
$form = generate_settings_form($settings, $settings_by_access_list);
$message = array();
if ($form->validate()) {
@ -213,16 +213,26 @@ if (!empty($_GET['category']) && !in_array($_GET['category'], array('Plugins', '
// will be set to false.
//$r = api_set_settings_category($my_category, 'false', $_configuration['access_url'], array('checkbox', 'radio'));
//This is a more accurate way of updating to false the checkboxes and radios the settings
//var_dump($settings);exit;
//This is amore accurate way of updating to false the checboxes and radios the settings
/*
foreach ($values as $key => $value) {
if (in_array($key, $settings_to_avoid)) { continue; }
if ($key == 'search_field' or $key == 'submit_fixed_in_bottom') { continue; }
$key = Database::escape_string($key);
$sql = "UPDATE $table_settings_current SET selected_value = 'false' WHERE variable = '".$key."' AND access_url = ".intval($url_id)." AND type IN ('checkbox', 'radio') ";
$res = Database::query($sql);
}*/
foreach ($settings as $item) {
$key = $item['variable'];
if (in_array($key, $settings_to_avoid)) { continue; }
if ($key == 'search_field' or $key == 'submit_fixed_in_bottom') { continue; }
$key = Database::escape_string($key);
$sql = "UPDATE $table_settings_current SET selected_value = 'false' WHERE variable = '".$key."' AND access_url = ".intval($url_id)." AND type IN ('checkbox', 'radio') ";
$res = Database::query($sql);
}
/*foreach($settings_to_avoid as $key => $value) {
@ -236,7 +246,7 @@ if (!empty($_GET['category']) && !in_array($_GET['category'], array('Plugins', '
if (in_array($key, $settings_to_avoid)) { continue; }
// Avoid form elements which have nothing to do with settings
if ($key == 'search_field' or $key == 'submit_fixed_in_bottom') { continue; }
//
// Treat gradebook values in separate function.
//if (strpos($key, 'gradebook_score_display_custom_values') === false) {
if (!is_array($value)) {
@ -277,7 +287,7 @@ if (!empty($_GET['category']) && !in_array($_GET['category'], array('Plugins', '
}
break;
}
if ($old_value != $value) $keys[] = $key;
if ($old_value != $value) $keys[] = $key;
$result = api_set_setting($key, $value, null, null, $url_id);
} else {
$sql = "SELECT subkey FROM $table_settings_current WHERE variable = '$key'";
@ -290,7 +300,7 @@ if (!empty($_GET['category']) && !in_array($_GET['category'], array('Plugins', '
break;
}
}
foreach ($value as $subkey => $subvalue) {
foreach ($value as $subkey => $subvalue) {
$result = api_set_setting($key, 'true', $subkey, null, $url_id);
}

@ -227,7 +227,7 @@ class DummyCourseCreator
// create forums
for ($forum_id = 1; $forum_id <= $number_of_forums; $forum_id ++)
{
$forum = new Forum($forum_id, $this->get_dummy_content('title'),$this->get_dummy_content('description') , rand(1, $number_of_categories), $last_forum_post[$forum_id]);
$forum = new Forum($forum_id, $this->get_dummy_content('title'),$this->get_dummy_content('description'), rand(1, $number_of_categories), $last_forum_post[$forum_id]);
$this->course->add_resource($forum);
}
}

@ -60,7 +60,7 @@ class Event extends Resource
* @param string $hour
* @param int $duration
*/
function Event($id,$title,$content,$start_date,$end_date, $attachment_path, $attachment_filename, $attachment_size, $attachment_comment) {
function Event($id,$title,$content,$start_date,$end_date, $attachment_path = null, $attachment_filename= null, $attachment_size= null, $attachment_comment= null) {
parent::Resource($id,RESOURCE_EVENT);
$this->title = $title;

@ -78,7 +78,7 @@ class ForumTopic extends Resource
/**
* Create a new ForumTopic
*/
function ForumTopic($id, $title, $time, $topic_poster_id, $topic_poster_name, $forum_id, $last_post, $replies, $views, $sticky, $locked, $time_closed, $weight, $title_qualify, $qualify_max)
function ForumTopic($id, $title, $time, $topic_poster_id, $topic_poster_name, $forum_id, $last_post, $replies, $views = 0, $sticky = 0, $locked = 0, $time_closed = null, $weight = 0, $title_qualify = null, $qualify_max = 0)
{
parent::Resource($id, RESOURCE_FORUMTOPIC);
$this->title = $title;
@ -96,6 +96,7 @@ class ForumTopic extends Resource
$this->title_qualify = $title_qualify;
$this->qualify_max = $qualify_max;
}
/**
* Show this resource
*/

@ -4288,4 +4288,23 @@ li.annoucement{
.link.invisible .description{
color: #999999;
}
#learning_path_main #control {
text-align: center;
background-image:-webkit-gradient(linear,left top,left bottom,from(#ececec),to(#fff));
background-image:-webkit-linear-gradient(top,#ececec,#fff);
background-image:-moz-linear-gradient(top,#ececec,#fff);
background-image:-ms-linear-gradient(top,#ececec,#fff);
background-image:-o-linear-gradient(top,#ececec,#fff);
background-image:linear-gradient(top,#ececec,#fff);
height:32px;
padding:8px 0px 8px 0px;
opacity:0.9;
bottom: 0px;
margin: auto;
width: 100%;
height: 34px;
position: absolute
}

@ -508,10 +508,9 @@ class Answer {
*
* @author Olivier Brouckaert
* @param int question id
* @param array course info (result of the function api_get_course_info() )
* @param array destination course info (result of the function api_get_course_info() )
*/
function duplicate($newQuestionId, $course_info = null) {
function duplicate($newQuestionId, $course_info = null) {
if (empty($course_info)) {
$course_info = $this->course;
} else {
@ -520,10 +519,11 @@ class Answer {
$TBL_REPONSES = Database :: get_course_table(TABLE_QUIZ_ANSWER);
if (self::getQuestionType() == MULTIPLE_ANSWER_TRUE_FALSE) {
if (self::getQuestionType() == MULTIPLE_ANSWER_TRUE_FALSE || self::getQuestionType() == MULTIPLE_ANSWER_TRUE_FALSE) {
//Selecting origin options
$origin_options = Question::readQuestionOption($this->selectQuestionId(), $course_info['real_id']);
$origin_options = Question::readQuestionOption($this->selectQuestionId(), $this->course['real_id']);
if (!empty($origin_options)) {
foreach($origin_options as $item) {
@ -548,8 +548,8 @@ class Answer {
$sql = "INSERT INTO $TBL_REPONSES (c_id, id,question_id,answer,correct,comment, ponderation,position,hotspot_coordinates,hotspot_type,destination) VALUES";
$c_id = $course_info['real_id'];
for($i=1;$i <= $this->nbrAnswers;$i++) {
if ($course_info['db_name'] != $this->course['db_name']) {
for ($i=1;$i <= $this->nbrAnswers;$i++) {
if ($this->course['id'] != $course_info['id']) {
$this->answer[$i] = DocumentManager::replace_urls_inside_content_html_from_copy_course($this->answer[$i],$this->course['id'], $course_info['id']) ;
$this->comment[$i] = DocumentManager::replace_urls_inside_content_html_from_copy_course($this->comment[$i],$this->course['id'], $course_info['id']) ;
}
@ -557,7 +557,7 @@ class Answer {
$answer = Database::escape_string($this->answer[$i]);
$correct = Database::escape_string($this->correct[$i]);
if (self::getQuestionType() == MULTIPLE_ANSWER_TRUE_FALSE) {
if (self::getQuestionType() == MULTIPLE_ANSWER_TRUE_FALSE || self::getQuestionType() == MULTIPLE_ANSWER_TRUE_FALSE ) {
$correct = $fixed_list[intval($correct)];
}
@ -570,7 +570,6 @@ class Answer {
$sql.="($c_id, '$i','$newQuestionId','$answer','$correct','$comment'," .
"'$weighting','$position','$hotspot_coordinates','$hotspot_type','$destination'),";
}
$sql = api_substr($sql,0,-1);
Database::query($sql);
}

@ -849,7 +849,7 @@ function get_exam_results_data($from, $number_of_items, $column, $direction, $ex
ON (ttte.exe_id = tr.exe_id)
WHERE exe_cours_id = '$course_code' AND
exe_exo_id = $exercise_id AND
session_id = ".api_get_session_id()."
ttte.session_id = ".api_get_session_id()."
)";
if ($is_allowedToEdit || $is_tutor) {
//Teacher view

@ -13,7 +13,7 @@
if(!class_exists('Question')):
// answer types
// Answer types
define('UNIQUE_ANSWER', 1);
define('MULTIPLE_ANSWER', 2);
define('FILL_IN_BLANKS', 3);
@ -65,18 +65,19 @@ abstract class Question
static $questionTypes = array(
UNIQUE_ANSWER => array('unique_answer.class.php' , 'UniqueAnswer'),
MULTIPLE_ANSWER => array('multiple_answer.class.php' , 'MultipleAnswer'),
GLOBAL_MULTIPLE_ANSWER => array('global_multiple_answer.class.php' , 'GlobalMultipleAnswer'),
MULTIPLE_ANSWER => array('multiple_answer.class.php' , 'MultipleAnswer'),
FILL_IN_BLANKS => array('fill_blanks.class.php' , 'FillBlanks'),
MATCHING => array('matching.class.php' , 'Matching'),
FREE_ANSWER => array('freeanswer.class.php' , 'FreeAnswer'),
ORAL_EXPRESSION => array('oral_expression.class.php' , 'OralExpression'),
HOT_SPOT => array('hotspot.class.php' , 'HotSpot'),
HOT_SPOT_DELINEATION => array('hotspot.class.php' , 'HotspotDelineation'),
MULTIPLE_ANSWER_COMBINATION => array('multiple_answer_combination.class.php' , 'MultipleAnswerCombination'),
UNIQUE_ANSWER_NO_OPTION => array('unique_answer_no_option.class.php' , 'UniqueAnswerNoOption'),
MULTIPLE_ANSWER_TRUE_FALSE => array('multiple_answer_true_false.class.php' , 'MultipleAnswerTrueFalse'),
MULTIPLE_ANSWER_COMBINATION_TRUE_FALSE => array('multiple_answer_combination_true_false.class.php' , 'MultipleAnswerCombinationTrueFalse')
MULTIPLE_ANSWER_COMBINATION => array('multiple_answer_combination.class.php', 'MultipleAnswerCombination'),
UNIQUE_ANSWER_NO_OPTION => array('unique_answer_no_option.class.php', 'UniqueAnswerNoOption'),
MULTIPLE_ANSWER_TRUE_FALSE => array('multiple_answer_true_false.class.php', 'MultipleAnswerTrueFalse'),
MULTIPLE_ANSWER_COMBINATION_TRUE_FALSE => array('multiple_answer_combination_true_false.class.php', 'MultipleAnswerCombinationTrueFalse'),
GLOBAL_MULTIPLE_ANSWER => array('global_multiple_answer.class.php' , 'GlobalMultipleAnswer'),
);
/**
@ -123,6 +124,10 @@ abstract class Question
}
$course_id = $course_info['real_id'];
if (empty($course_id) || $course_id == -1 ) {
return false;
}
$TBL_QUESTIONS = Database::get_course_table(TABLE_QUIZ_QUESTION);
$TBL_EXERCICE_QUESTION = Database::get_course_table(TABLE_QUIZ_TEST_QUESTION);

@ -104,11 +104,13 @@ $result = Database::query($sql);
while ($row = Database ::fetch_array($result)) {
$item_weight = $row['weight'];
$item_weight = $masked_total*$item_weight/$original_total;
//$item_weight = $masked_total*$item_weight/$original_total;
//update only if value changed
if (isset($_POST['link'][$row['id']])) {
$new_weight = trim($_POST['link'][$row['id']]*$original_total/$masked_total);
//$new_weight = trim($_POST['link'][$row['id']]*$original_total/$masked_total);
$new_weight = trim($_POST['link'][$row['id']]);
AbstractLink::add_link_log($row['id']);
Database::query('UPDATE '.$table_link.' SET weight = '."'".Database::escape_string($new_weight)."'".' WHERE id = '.$row['id']);
$item_weight = trim($_POST['link'][$row['id']]);
@ -148,12 +150,13 @@ while ($row = Database ::fetch_array($result)) {
$sql = Database::query('SELECT * FROM '.$table_evaluation.' WHERE category_id = '.$my_selectcat);
while ($row = Database ::fetch_array($sql)) {
$item_weight = $row['weight'];
$item_weight = $masked_total*$item_weight/$original_total;
//$item_weight = $masked_total*$item_weight/$original_total;
//update only if value changed
if (isset($_POST['evaluation'][$row['id']])) {
Evaluation::add_evaluation_log($row['id']);
$new_weight = trim($_POST['evaluation'][$row['id']]*$original_total/$masked_total);
//$new_weight = trim($_POST['evaluation'][$row['id']]*$original_total/$masked_total);
$new_weight = trim($_POST['evaluation'][$row['id']]);
$update_sql = 'UPDATE '.$table_evaluation.' SET weight = '."'".Database::escape_string($new_weight)."'".' WHERE id = '.$row['id'];
Database::query($update_sql);
$item_weight = trim($_POST['evaluation'][$row['id']]);

@ -91,10 +91,11 @@ if ($scoreform->validate()) {
}
$scorecolpercent = 0;
if ($displayscore->is_coloring_enabled()) {
if ($displayscore->is_coloring_enabled()) {
$scorecolpercent = $values['scorecolpercent'];
}
if ($displayscore->is_custom() && !empty($scoringdisplay)) {
$displayscore->update_custom_score_display_settings($scoringdisplay, $scorecolpercent);
}

@ -528,7 +528,7 @@ class DisplayGradebook
if (empty($categories)) {
$modify_icons .= '<a href="gradebook_edit_all.php?id_session='.api_get_session_id().'&amp;'.$my_api_cidreq.'&selectcat=' . $catobj->get_id() . '">'.Display::return_icon('percentage.png', get_lang('EditAllWeights'),'',ICON_SIZE_MEDIUM).'</a>';
}
}
if (api_get_setting('teachers_can_change_score_settings') == 'true') {
$modify_icons .= '<a href="gradebook_scoring_system.php?'.$my_api_cidreq.'&selectcat=' . $catobj->get_id() .'">'.Display::return_icon('ranking.png', get_lang('ScoreEdit'),'',ICON_SIZE_MEDIUM).'</a>';
}

@ -50,7 +50,7 @@ class GradebookTable extends SortableTable {
$this->set_header($column++, get_lang('Description'), false);
if (api_is_allowed_to_edit(null, true)) {
$this->set_header($column++, get_lang('Weight'),'','width="40px"');
$this->set_header($column++, get_lang('Weight'),'','width="20px"');
} else {
$this->set_header($column++, get_lang('Weight'), false);
$this->set_header($column++, get_lang('Result'), false);

@ -9,8 +9,7 @@
*/
require_once dirname(__FILE__).'/../../../inc/global.inc.php';
require_once dirname(__FILE__).'/../gradebook_functions.inc.php';
require_once api_get_path(LIBRARY_PATH) . 'groupmanager.lib.php';
require_once api_get_path(LIBRARY_PATH) . 'formvalidator/FormValidator.class.php';
/**
* Form for the score display dialog
* @author Stijn Konings
@ -22,11 +21,15 @@ class ScoreDisplayForm extends FormValidator
function ScoreDisplayForm($form_name, $action= null) {
parent :: __construct($form_name, 'post', $action);
$displayscore= ScoreDisplay :: instance();
$customdisplays= $displayscore->get_custom_score_display_settings();
$customdisplays = $displayscore->get_custom_score_display_settings();
$nr_items =(count($customdisplays)!='0')?count($customdisplays):'1';
$this->setDefaults(array (
'scorecolpercent' => $displayscore->get_color_split_value()
));
//var_dump($displayscore->get_color_split_value() );
$this->addElement('hidden', 'maxvalue', '100');
$this->addElement('hidden', 'minvalue', '0');
$counter= 1;
@ -42,27 +45,37 @@ class ScoreDisplayForm extends FormValidator
$counter++;
}
}
$scorecol= array ();
$scorecol = array ();
//settings for the colored score
$this->addElement('header', '', get_lang('ScoreEdit'));
$this->addElement('html', '<b>' . get_lang('ScoreColor') . '</b>');
$this->addElement('text', 'scorecolpercent', array(get_lang('Below'), get_lang('WillColorRed'), '%'), array (
'size' => 5,
'maxlength' => 5,
'class'=>'span1',
$this->addElement('header', get_lang('ScoreEdit'));
if ($displayscore->is_coloring_enabled()) {
));
$this->addRule('scorecolpercent', get_lang('OnlyNumbers'), 'numeric');
$this->addRule(array('scorecolpercent','maxvalue'), get_lang('Over100'), 'compare', '<=');
$this->addRule(array('scorecolpercent','minvalue'), get_lang('UnderMin'), 'compare', '>');
//settings for the scoring system
$this->addElement('html', '<b>' . get_lang('ScoreColor') . '</b>');
$this->addElement('text', 'scorecolpercent', array(get_lang('Below'), get_lang('WillColorRed'), '%'), array (
'size' => 5,
'maxlength' => 5,
'class'=>'span1',
));
if (api_get_setting('teachers_can_change_score_settings') != 'true') {
$this->freeze('scorecolpercent');
}
$this->addRule('scorecolpercent', get_lang('OnlyNumbers'), 'numeric');
$this->addRule(array('scorecolpercent','maxvalue'), get_lang('Over100'), 'compare', '<=');
$this->addRule(array('scorecolpercent','minvalue'), get_lang('UnderMin'), 'compare', '>');
}
$this->addElement('html', '<br /><b>' . get_lang('ScoringSystem') . '</b>');
//$this->addElement('checkbox', 'enablescore', null, get_lang('EnableScoringSystem'), null);
//Settings for the scoring system
if ($displayscore->is_custom()) {
if ($displayscore->is_custom()) {
$this->addElement('html', '<br /><b>' . get_lang('ScoringSystem') . '</b>');
//$this->addElement('checkbox', 'enablescore', null, get_lang('EnableScoringSystem'), null);
//$this->addElement('checkbox', 'includeupperlimit', null, get_lang('IncludeUpperLimit'), null);
$this->addElement('static', null, null, get_lang('ScoreInfo'));
$scorenull[]= & $this->CreateElement('static', null, null, get_lang('Between'));
@ -110,9 +123,12 @@ class ScoreDisplayForm extends FormValidator
$this->addRule(array ('endscore[' . $counter . ']', 'maxvalue'), get_lang('Over100'), 'compare', '<=');
$this->addRule(array ('endscore[' . $counter . ']', 'minvalue'), get_lang('UnderMin'), 'compare', '>');
}
}
$this->addElement('style_submit_button', 'submit', get_lang('Ok'),'class="save"');
}
if ($displayscore->is_custom())
$this->addElement('style_submit_button', 'submit', get_lang('Ok'),'class="save"');
}
function validate() {
return parent :: validate();
}

@ -695,7 +695,8 @@ function load_gradebook_select_in_tool($form) {
/**
* PDF report creation
*/
function export_pdf_flatview($cat, $users, $alleval, $alllinks, $params = array()) {
function export_pdf_flatview($cat, $users, $alleval, $alllinks, $params = array()) {
global $flatviewtable;
//Getting data
$printable_data = get_printable_data($cat[0], $users, $alleval, $alllinks, $params);

@ -107,9 +107,9 @@ class ScoreDisplay
}
//Setting custom enabled
$value = api_get_setting('gradebook_score_display_custom');
$value = api_get_setting('gradebook_score_display_custom');
$value = $value['my_display_custom'];
$this->custom_enabled = $value;
$this->custom_enabled = $value == 'true' ? true : false;
if ($this->custom_enabled) {
@ -143,6 +143,7 @@ class ScoreDisplay
$this->custom_display_conv = $this->convert_displays($this->custom_display);
}
}
if ($this->coloring_enabled) {
$this->color_split_value = $this->get_score_color_percent();
}
@ -155,17 +156,18 @@ class ScoreDisplay
public function is_coloring_enabled () {
return $this->coloring_enabled;
}
/**
* Is custom score display enabled ?
*/
public function is_custom() {
return $this->custom_enabled;
}
/**
* Is upperlimit included ?
*/
public function is_upperlimit_included ()
{
public function is_upperlimit_included () {
return $this->upperlimit_included;
}
@ -193,8 +195,8 @@ class ScoreDisplay
private function get_current_gradebook_category_id() {
$tbl_gradebook_category = Database :: get_main_table(TABLE_MAIN_GRADEBOOK_CATEGORY);
$curr_course_code = api_get_course_id();
$curr_session_id = api_get_session_id();
$curr_course_code = api_get_course_id();
$curr_session_id = api_get_session_id();
$session_condition = '';
if (empty($curr_session_id)) {
@ -244,6 +246,7 @@ class ScoreDisplay
$sql .= "(NULL, '".$display['score']."', '".Database::escape_string($display['display'])."', ".$category_id.", ".intval($scorecolpercent).")";
$count++;
}
Database::query($sql);
}
@ -291,11 +294,13 @@ class ScoreDisplay
} else {
// if no custom display set, use default display
$display = $this->display_default($my_score, $type);
}
}
if ($this->coloring_enabled && $no_color == false) {
$my_score_denom = ($score[1]==0)?1:$score[1];
if (($score[0] / $my_score_denom) < ($this->color_split_value / 100)) {
$display = Display::tag('font', $display, array('color'=>'red'));
$display = Display::tag('font', $display, array('color'=>'red'));
//$display = Display::label($display, 'important');
}
}
return $display;
@ -328,19 +333,22 @@ class ScoreDisplay
return $this->display_simple_score($score).$custom;
break;
case SCORE_DIV_SIMPLE_WITH_CUSTOM_LETTERS:
$custom = $this->display_custom($score);
$custom = $this->display_custom($score);
if (!empty($custom)) {
$custom = ' - '.$custom;
}
}
$score = $this->display_simple_score($score);
//needs sudo apt-get install php5-intl
if (class_exists(NumberFormatter)) {
$iso = api_get_language_isocode();
$iso = api_get_language_isocode();
$f = new NumberFormatter($iso, NumberFormatter::SPELLOUT);
$letters = $f->format($score[0]);
$letters = $f->format($score);
$letters = api_strtoupper($letters);
$letters = " ($letters) ";
}
return $this->display_simple_score($score).$letters.$custom;
return $score.$letters.$custom;
break;
case SCORE_CUSTOM: // Good!
return $this->display_custom($score);

@ -1515,6 +1515,6 @@ class Display {
if (empty($tip)) {
return $text;
}
return self::span($text, array('class' => 'boot-tooltip', 'title' => $tip));
return self::span($text, array('class' => 'boot-tooltip', 'title' => strip_tags($tip)));
}
} //end class Display

@ -1898,7 +1898,7 @@ class DocumentManager {
* @return string new content html with replaced urls or return false if content is not a string
*/
function replace_urls_inside_content_html_from_copy_course($content_html, $origin_course_code, $destination_course_directory) {
require_once api_get_path(LIBRARY_PATH).'fileUpload.lib.php';
if (!is_string($content_html)) {
return false;
}

@ -1,5 +1,8 @@
<?php
/**
* Class definition for HTMLPurifier that allows (but controls) iframes
* @package chamilo.lib
*/
/**
* Based on: http://stackoverflow.com/questions/4739284/htmlpurifier-iframe-vimeo-and-youtube-video
* Iframe filter that does some primitive whitelisting in a somewhat recognizable and tweakable way

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

File diff suppressed because one or more lines are too long

@ -1,7 +1,7 @@
/*
* jQuery UI CSS Framework 1.8.17
/*!
* jQuery UI CSS Framework 1.8.21
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
@ -38,10 +38,10 @@
.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
/*
* jQuery UI CSS Framework 1.8.17
/*!
* jQuery UI CSS Framework 1.8.21
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
@ -284,17 +284,17 @@
/* Overlays */
.ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); }
.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -khtml-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }/*
* jQuery UI Resizable 1.8.17
.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -khtml-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }/*!
* jQuery UI Resizable 1.8.21
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Resizable#theming
*/
.ui-resizable { position: relative;}
.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block; }
.ui-resizable-handle { position: absolute;font-size: 0.1px; display: block; }
.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; }
.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; }
@ -303,20 +303,20 @@
.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; }
.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/*
* jQuery UI Selectable 1.8.17
.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/*!
* jQuery UI Selectable 1.8.21
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* http://docs.jquery.com/UI/Selectable#theming
*/
.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; }
/*
* jQuery UI Accordion 1.8.17
/*!
* jQuery UI Accordion 1.8.21
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
@ -332,10 +332,10 @@
.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }
.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; }
.ui-accordion .ui-accordion-content-active { display: block; }
/*
* jQuery UI Autocomplete 1.8.17
/*!
* jQuery UI Autocomplete 1.8.21
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
@ -347,7 +347,7 @@
* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */
/*
* jQuery UI Menu 1.8.17
* jQuery UI Menu 1.8.21
*
* Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
@ -385,10 +385,10 @@
font-weight: normal;
margin: -1px;
}
/*
* jQuery UI Button 1.8.17
/*!
* jQuery UI Button 1.8.21
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
@ -423,10 +423,10 @@ input.ui-button { padding: .4em 1em; }
/* workarounds */
button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */
/*
* jQuery UI Dialog 1.8.17
/*!
* jQuery UI Dialog 1.8.21
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
@ -444,10 +444,10 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad
.ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; }
.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
.ui-draggable .ui-dialog-titlebar { cursor: move; }
/*
* jQuery UI Slider 1.8.17
/*!
* jQuery UI Slider 1.8.21
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
@ -467,10 +467,10 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad
.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; }
.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
.ui-slider-vertical .ui-slider-range-min { bottom: 0; }
.ui-slider-vertical .ui-slider-range-max { top: 0; }/*
* jQuery UI Tabs 1.8.17
.ui-slider-vertical .ui-slider-range-max { top: 0; }/*!
* jQuery UI Tabs 1.8.21
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
@ -485,10 +485,10 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad
.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */
.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; }
.ui-tabs .ui-tabs-hide { display: none !important; }
/*
* jQuery UI Datepicker 1.8.17
/*!
* jQuery UI Datepicker 1.8.21
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
@ -552,10 +552,10 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad
left: -4px; /*must have*/
width: 200px; /*must have*/
height: 200px; /*must have*/
}/*
* jQuery UI Progressbar 1.8.17
}/*!
* jQuery UI Progressbar 1.8.21
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
* Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*

File diff suppressed because one or more lines are too long

@ -5,8 +5,6 @@
Requirements: JQuery 1.4.4, JQuery UI 1.8.7
@author Alberto Torreblanca @albert1t0
@author Julio Montoya Cleaning/fixing some code
@todo this doesn't work due recent changes in this file I partially fixed now we can see the vertical bar
but the minipanel was removed
**/
// Copy little progress bar in <tr></tr>
@ -45,6 +43,8 @@ $(document).ready(function() {
$(this).css('backgroundImage','url(../img/hide2.png)').css('backgroundColor','#EEEEEE');
}
);
var original = $('#content_id').height();
// Adding funcionality
$( "#hide_bar" ).click(function() {
@ -55,52 +55,30 @@ $(document).ready(function() {
// Construct mini panel
var panel = $('#lp_navigation_elem div:first').clone();
$(panel).attr('id','control');
$(panel).attr('id', 'control');
$('#learning_path_main').append(panel);
minipb();
$('#learning_path_main #control .buttons').attr('text-align','center');
$('#learning_path_main #control').css({
margin: "auto",
width: "132px",
height: "34px",
position: "absolute",
top: "5px",
right:"15px",
backgroundColor: "white",
backgroundImage: "url(../img/minipanelback.png)",
paddingTop: "8px",
paddingBottom: "8px",
borderRadius: "4px 4px 4px 4px",
opacity: "0.8",
cursor: "move",
});
//$('#learning_path_main #control').css("text-align", "center");
$('#learning_path_main #control table').attr('align','center');
$('#learning_path_main #control').draggable({
iframeFix: true,
stack: "#learning_path_right_zone",
cursor: "move"
});
$('#learning_path_main #control .buttons img').click(function(){
$('#content_id').css({ height: $('#content_id').height() - ($('#control').height() + 10) });
$('#learning_path_main #control .buttons img').click(function(){
$('#learning_path_main #control tr:eq(1)').remove();
minipb();
});
// Hiding navigation left zone
$('#learning_path_left_zone').hide(50);
$('#learning_path_left_zone').hide(50);
$('#learning_path_right_zone').css('margin-left','10px');
$('#hide_bar table').css('backgroundImage','url(../img/hide2.png)').css('backgroundColor','#EEEEEE');
}
},
},
function(){
// Show navigation left zone
$('#hide_bar table').css('backgroundImage','url(../img/hide0.png)').css('backgroundColor','#EEEEEE');
$('#learning_path_right_zone').css('marginLeft','290px');
$('#learning_path_left_zone').show(50);
$('#learning_path_main #control').remove();
// Show navigation left zone
$('#learning_path_left_zone').show(50);
$('#learning_path_right_zone').css('marginLeft', left_width + 10 + 'px');
$('#hide_bar table').css('backgroundImage','url(../img/hide0.png)').css('backgroundColor','#EEEEEE');
$('#learning_path_main #control').remove();
$('#content_id').css({ height: original});
}
);
});

File diff suppressed because one or more lines are too long

@ -5710,7 +5710,7 @@ function api_get_jquery_libraries_js($libraries) {
//Jquery ui
$theme = 'smoothness'; // Current themes: cupertino, smoothness, ui-lightness. Find the themes folder in main/inc/lib/javascript/jquery-ui
$jquery_ui_version = '1.8.17';
$jquery_ui_version = '1.8.21';
//$js .= '<link rel="stylesheet" href="'.$js_path.'jquery-ui/'.$theme.'/jquery-ui-'.$jquery_ui_version.'.custom.css" type="text/css">';
$js .= api_get_css($js_path.'jquery-ui/'.$theme.'/jquery-ui-'.$jquery_ui_version.'.custom.css');

@ -17,14 +17,15 @@ require_once api_get_path(LIBRARY_PATH).'group_portal_manager.lib.php';
/*
* @todo use constants!
*/
define('MESSAGE_STATUS_NEW', '0');
define('MESSAGE_STATUS_UNREAD', '1');
define('MESSAGE_STATUS_NEW', '0');
define('MESSAGE_STATUS_UNREAD', '1');
//2 ??
define('MESSAGE_STATUS_DELETED', '3');
define('MESSAGE_STATUS_OUTBOX', '4');
define('MESSAGE_STATUS_INVITATION_PENDING', '5');
define('MESSAGE_STATUS_INVITATION_ACCEPTED','6');
define('MESSAGE_STATUS_INVITATION_DENIED', '7');
define('MESSAGE_STATUS_DELETED', '3');
define('MESSAGE_STATUS_OUTBOX', '4');
define('MESSAGE_STATUS_INVITATION_PENDING', '5');
define('MESSAGE_STATUS_INVITATION_ACCEPTED', '6');
define('MESSAGE_STATUS_INVITATION_DENIED', '7');
/**
* Class
* @package chamilo.library

@ -1521,7 +1521,7 @@ class SessionManager {
/**
* Get users by session
* @param int sesssion id
* @param int filter by status
* @param int filter by status
* @return array a list with an user list
*/
public static function get_users_by_session($id, $with_status = null) {
@ -1537,7 +1537,7 @@ class SessionManager {
ON $tbl_user.user_id = $tbl_session_rel_user.id_user
AND $tbl_session_rel_user.id_session = $id";
if (!empty($with_status)) {
if (isset($with_status) && $with_status != '') {
$with_status = intval($with_status);
$sql .= " WHERE relation_type = $with_status ";
}
@ -1789,4 +1789,14 @@ class SessionManager {
}
}
}
function get_session_by_course($course_code) {
$table_session_course = Database::get_main_table(TABLE_MAIN_SESSION_COURSE);
$table_session = Database::get_main_table(TABLE_MAIN_SESSION);
$course_code = Database::escape_string($course_code);
$sql = "SELECT name, s.id FROM $table_session_course sc INNER JOIN $table_session s ON (sc.id_session = s.id)
WHERE sc.course_code = '$course_code' ";
$result = Database::query($sql);
return Database::store_result($result);
}
}

@ -17,6 +17,9 @@ define('SOCIAL_RIGHT_PLUGIN', 3);
define('CUT_GROUP_NAME', 50);
//This require is necessary becas we use constants that need to be loaded before the SocialManager class
require_once api_get_path(LIBRARY_PATH).'message.lib.php';
/**
*
* @package chamilo.social

@ -1124,9 +1124,8 @@ class Tracking {
$a_students = array ();
//////////////////////////////////////////////////////////////
// At first, courses where $coach_id is coach of the course //
//////////////////////////////////////////////////////////////
$sql = 'SELECT course_code FROM ' . $tbl_session_course_user . ' WHERE id_session="' . $id_session . '" AND id_user=' . $coach_id.' AND status=2';
$result = Database::query($sql);
@ -1145,9 +1144,7 @@ class Tracking {
}
}
//////////////////////////////////////////////////////////////
// Then, courses where $coach_id is coach of the session //
//////////////////////////////////////////////////////////////
$dsl_session_coach = 'SELECT id_coach FROM ' . $tbl_session . ' WHERE id="' . $id_session . '" AND id_coach="' . $coach_id . '"';
$result = Database::query($dsl_session_coach);
@ -1176,9 +1173,8 @@ class Tracking {
$tbl_session_course = Database :: get_main_table(TABLE_MAIN_SESSION_COURSE);
$tbl_session = Database :: get_main_table(TABLE_MAIN_SESSION);
//////////////////////////////////////////////////////////////
// At first, courses where $coach_id is coach of the course //
//////////////////////////////////////////////////////////////
/*$sql = 'SELECT 1
FROM ' . $tbl_session_course_user . ' AS session_course_user
INNER JOIN ' . $tbl_session_course . ' AS session_course
@ -1193,9 +1189,7 @@ class Tracking {
return true;
}
//////////////////////////////////////////////////////////////
// Then, courses where $coach_id is coach of the session //
//////////////////////////////////////////////////////////////
$sql = 'SELECT session_course_user.id_user
FROM ' . $tbl_session_course_user . ' as session_course_user
@ -1232,9 +1226,8 @@ class Tracking {
$tbl_session = Database :: get_main_table(TABLE_MAIN_SESSION);
$tbl_course = Database :: get_main_table(TABLE_MAIN_COURSE);
//////////////////////////////////////////////////////////////
// At first, courses where $coach_id is coach of the course //
//////////////////////////////////////////////////////////////
// At first, courses where $coach_id is coach of the course
$sql = 'SELECT DISTINCT course_code FROM ' . $tbl_session_course_user . ' WHERE id_user=' . $coach_id.' AND status=2';
global $_configuration;
@ -1254,10 +1247,9 @@ class Tracking {
while ($row = Database::fetch_array($result)) {
$a_courses[$row['course_code']] = $row['course_code'];
}
//////////////////////////////////////////////////////////////
// Then, courses where $coach_id is coach of the session //
//////////////////////////////////////////////////////////////
// Then, courses where $coach_id is coach of the session
$sql = 'SELECT DISTINCT session_course.course_code
FROM ' . $tbl_session_course . ' as session_course
INNER JOIN ' . $tbl_session . ' as session

@ -714,7 +714,6 @@ VALUES
('extendedprofile_registrationrequired', 'mydiplomas', 'checkbox','User','false', 'ExtendedProfileRegistrationRequiredTitle','ExtendedProfileRegistrationRequiredComment', NULL, 'MyDiplomas', 0),
('extendedprofile_registrationrequired', 'myteach', 'checkbox','User','false', 'ExtendedProfileRegistrationRequiredTitle','ExtendedProfileRegistrationRequiredComment', NULL, 'MyTeach', 0),
('extendedprofile_registrationrequired', 'mypersonalopenarea', 'checkbox','User','false', 'ExtendedProfileRegistrationRequiredTitle','ExtendedProfileRegistrationRequiredComment', NULL, 'MyPersonalOpenArea', 0),
('ldap_description', NULL, 'radio', 'LDAP', NULL, 'LdapDescriptionTitle', 'LdapDescriptionComment', NULL, NULL, 0),
('registration','phone','textfield','User','false','RegistrationRequiredFormsTitle','RegistrationRequiredFormsComment',NULL,'Phone', 0),
('add_users_by_coach',NULL,'radio','Session','false','AddUsersByCoachTitle','AddUsersByCoachComment',NULL,NULL, 0),
('extend_rights_for_coach',NULL,'radio','Security','false','ExtendRightsForCoachTitle','ExtendRightsForCoachComment',NULL,NULL, 0),
@ -857,7 +856,6 @@ VALUES
('gradebook_enable_grade_model', NULL, 'radio', 'Gradebook', 'false', 'GradebookEnableGradeModelTitle', 'GradebookEnableGradeModelComment', NULL, NULL, 1),
('teachers_can_change_grade_model_settings', NULL, 'radio', 'Gradebook', 'true', 'TeachersCanChangeGradeModelSettingsTitle', 'TeachersCanChangeGradeModelSettingsComment', NULL, NULL, 1),
('gradebook_default_weight', NULL, 'textfield', 'Gradebook', '100', 'GradebookDefaultWeightTitle', 'GradebookDefaultWeightComment', NULL, NULL, 0),
('teachers_can_change_score_settings', NULL, 'radio', 'Gradebook', 'true', 'TeachersCanChangeScoreSettingsTitle', 'TeachersCanChangeScoreSettingsComment', NULL, NULL, 1),
('ldap_description', NULL, 'radio', 'LDAP', NULL, 'LdapDescriptionTitle', 'LdapDescriptionComment', NULL, NULL, 0),
('shibboleth_description', NULL, 'radio', 'Shibboleth', 'false', 'ShibbolethMainActivateTitle', 'ShibbolethMainActivateComment', NULL, NULL, 0),
('facebook_description', NULL, 'radio', 'Facebook', 'false', 'FacebookMainActivateTitle', 'FacebookMainActivateComment', NULL, NULL, 0),
@ -879,7 +877,7 @@ VALUES
('tool_visible_by_default_at_creation','forums','checkbox','Tools','true','ToolVisibleByDefaultAtCreationTitle','ToolVisibleByDefaultAtCreationComment',NULL,'Forums', 1),
('tool_visible_by_default_at_creation','quiz','checkbox','Tools','true','ToolVisibleByDefaultAtCreationTitle','ToolVisibleByDefaultAtCreationComment',NULL,'Quiz', 1),
('tool_visible_by_default_at_creation','gradebook','checkbox','Tools','true','ToolVisibleByDefaultAtCreationTitle','ToolVisibleByDefaultAtCreationComment',NULL,'Gradebook', 1),
('chamilo_database_version', NULL, 'textfield',NULL, '1.9.0.18407','DatabaseVersion','', NULL, NULL, 0);
('chamilo_database_version', NULL, 'textfield',NULL, '1.9.0.18715','DatabaseVersion','', NULL, NULL, 0);
UNLOCK TABLES;
/*!40000 ALTER TABLE settings_current ENABLE KEYS */;

@ -299,7 +299,7 @@ ALTER TABLE user_api_key ADD COLUMN validity_end_date datetime DEFAULT NULL;
ALTER TABLE user_api_key ADD COLUMN description text DEFAULT NULL;
-- Do not move this query
UPDATE settings_current SET selected_value = '1.9.0.18407' WHERE variable = 'chamilo_database_version';
UPDATE settings_current SET selected_value = '1.9.0.18715' WHERE variable = 'chamilo_database_version';
-- xxSTATSxx
ALTER TABLE track_e_default MODIFY COLUMN default_value TEXT;

@ -181,9 +181,9 @@ if (empty($session_id)) {
$courses = $courses[0];
}
//Getting students from courses and courses in sessions (For show the total students that the user follows)
//Getting students from courses and courses in sessions (To show the total students that the user follows)
$students = CourseManager::get_user_list_from_courses_as_coach($user_id);
// Sessions for the coach
$sessions = Tracking::get_sessions_coached_by_user($user_id);
@ -258,21 +258,41 @@ if (empty($session_id)) {
if ($nb_students > 0 && $view != 'admin') {
echo Display::page_subheader('<img src="'.api_get_path(WEB_IMG_PATH).'students.gif">&nbsp;'.get_lang('Students').' ('.$nb_students.')');
// average progress
$avg_total_progress = $avg_total_progress / $nb_students;
// average results to the tests
$avg_results_to_exercises = $avg_results_to_exercises / $nb_students;
// average courses by student
$avg_courses_per_student = round($total_courses / $nb_students, 2);
$avg_courses_per_student = round($count_courses / $nb_students, 2);
// average time spent on the platform
$avg_time_spent = $total_time_spent / $nb_students;
// average assignments
$nb_assignments = $nb_assignments / $nb_students;
// average posts
$nb_posts = $nb_posts / $nb_students;
echo Display::page_subheader('<img src="'.api_get_path(WEB_IMG_PATH).'teachers.gif">&nbsp;'.get_lang('Overview'));
echo '<div class="report_section">
<table class="table table-bordered">
<tr>
<td>'.get_lang('FollowedUsers').'</td>
<td align="right">'.$nb_students.'</td>
</tr>
<tr>
<td>'.get_lang('FollowedCourses').'</td>
<td align="right">'.$count_courses.'</td>
</tr>
<tr>
<td>'.get_lang('FollowedSessions').'</td>
<td align="right">'.$count_sessions.'</td>
</tr>
</table>';
echo '</div>';
echo Display::page_subheader('<img src="'.api_get_path(WEB_IMG_PATH).'students.gif">&nbsp;'.get_lang('Students').' ('.$nb_students.')');
if ($export_csv) {
//csv part
$csv_content[] = array(get_lang('Students', ''));
@ -287,19 +307,21 @@ if (empty($session_id)) {
} else {
// html part
echo '<div class="report_section">
<table class="table table-bordered">
<tr>
<table class="table table-bordered">
<tr>
<td>'.get_lang('AverageCoursePerStudent').'</td>
<td align="right">'.(is_null($avg_courses_per_student) ? '' : $avg_courses_per_student).'</td>
</tr>
<tr>
<td>'.get_lang('InactivesStudents').'</td>
<td align="right">'.$nb_inactive_students.'</td>
</tr>
<tr>
<td>'.get_lang('AverageTimeSpentOnThePlatform').'</td>
<td align="right">'.(is_null($avg_time_spent) ? '' : api_time_to_hms($avg_time_spent)).'</td>
</tr>
<tr>
<td>'.get_lang('AverageCoursePerStudent').'</td>
<td align="right">'.(is_null($avg_courses_per_student) ? '' : $avg_courses_per_student).'</td>
</tr>
<tr>
<td>'.get_lang('AverageProgressInLearnpath').'</td>
<td align="right">'.(is_null($avg_total_progress) ? '' : round($avg_total_progress, 2).'%').'</td>
@ -368,7 +390,7 @@ if (api_is_allowed_to_create_course() && $view == 'teacher') {
$table -> set_header(4, get_lang('AvgCourseScore').' '.Display :: return_icon('info3.gif', get_lang('AvgAllUsersInAllCourses'), array('align' => 'absmiddle', 'hspace' => '3px')), false);
$table -> set_header(5, get_lang('AvgExercisesScore').' '.Display :: return_icon('info3.gif', get_lang('AvgAllUsersInAllCourses'), array('align' => 'absmiddle', 'hspace' => '3px')), false);
$table -> set_header(6, get_lang('AvgMessages'), false);
$table -> set_header(7, get_lang('AvgAssignments'), false);
$table -> set_header(7, get_lang('AverageAssignments'), false);
$table -> set_header(8, get_lang('Details'), false);
$csv_content[] = array (
@ -379,7 +401,7 @@ if (api_is_allowed_to_create_course() && $view == 'teacher') {
get_lang('AvgCourseScore', ''),
get_lang('AvgExercisesScore', ''),
get_lang('AvgMessages', ''),
get_lang('AvgAssignments', '')
get_lang('AverageAssignments', '')
);
$table->display();
}
@ -387,16 +409,18 @@ if (api_is_allowed_to_create_course() && $view == 'teacher') {
// Display list of sessions
if ($count_sessions > 0 && !isset($_GET['session_id'])) {
echo Display::page_subheader('<img src="'.api_get_path(WEB_IMG_PATH).'session.png">&nbsp;'.get_lang('Sessions').' ('.$count_sessions.')');
$table = new SortableTable('tracking_sessions_myspace', 'count_sessions_coached');
$table->set_header(0, get_lang('Title'), false);
$table->set_header(1, get_lang('Date'), false);
$table->set_header(2, get_lang('NbCoursesPerSession'), false);
$table->set_header(3, get_lang('Details'), false);
$table->set_header(1, get_lang('Date'), false);
$table->set_header(2, get_lang('NbStudentPerSession'), false);
$table->set_header(3, get_lang('NbCoursesPerSession'), false);
$table->set_header(4, get_lang('Details'), false);
$all_data = array();
foreach ($sessions as $session) {
foreach ($sessions as $session) {
$count_courses_in_session = count(Tracking::get_courses_followed_by_coach($user_id, $session['id']));
$count_users_in_session = count(SessionManager::get_users_by_session($session['id'], 0));
$row = array();
$row[] = $session['name'];
@ -405,7 +429,10 @@ if (api_is_allowed_to_create_course() && $view == 'teacher') {
} else {
$row[] = ' - ';
}
$row[] = $count_courses_in_session;
$row[] = $count_courses_in_session;
$row[] = $count_users_in_session;
$row[] = '<a href="'.api_get_self().'?session_id='.$session['id'].'"><img src="'.api_get_path(WEB_IMG_PATH).'2rightarrow.gif" border="0" /></a>';
$all_data[] = $row;
}
@ -434,7 +461,7 @@ if (api_is_allowed_to_create_course() && $view == 'teacher') {
/* Start session over view stats */
$nb_sessions_past = $nb_sessions_future = $nb_sessions_current = 0;
$nb_sessions_past = $nb_sessions_current = 0;
$courses = array();
foreach ($sessions as $session) {
@ -447,22 +474,22 @@ if (api_is_allowed_to_create_course() && $view == 'teacher') {
$courses = array_merge($courses, Tracking::get_courses_list_from_session($session['id']));
}
if ($nb_sessions > 0) {
$nb_courses_per_session = round(count($courses) / $nb_sessions, 2);
$nb_students_per_session = round($nb_students / $nb_sessions, 2);
} else {
$nb_courses_per_session = null;
$nb_students_per_session = null;
}
$nb_courses_per_session = null;
$nb_students_per_session = null;
if ($count_sessions > 0) {
$nb_courses_per_session = round(count($courses) / $count_sessions, 2);
$nb_students_per_session = round($nb_students / $count_sessions, 2);
}
if ($export_csv) {
//csv part
$csv_content[] = array(get_lang('Sessions', ''));
$csv_content[] = array(get_lang('NbActiveSessions', '').';'.$nb_sessions_current);
$csv_content[] = array(get_lang('NbInactiveSessions', '').';'.$nb_sessions_past);
//$csv_content[] = array(get_lang('NbFutureSessions', '').';'.$nb_sessions_future);
$csv_content[] = array(get_lang('NbStudentPerSession', '').';'.$nb_students_per_session);
$csv_content[] = array(get_lang('NbCoursesPerSession', '').';'.$nb_courses_per_session);
$csv_content[] = array(get_lang('NbCoursesPerSession', '').';'.$nb_courses_per_session);
$csv_content[] = array(get_lang('NbStudentPerSession', '').';'.$nb_students_per_session);
$csv_content[] = array();
} else {
// html part
@ -482,14 +509,6 @@ if (api_is_allowed_to_create_course() && $view == 'teacher') {
<td>'.get_lang('NbInactiveSessions').'</td>
<td align="right">'.$nb_sessions_past.'</td>
</tr>
<tr>
<td>'.get_lang('NbStudentPerSession').'</td>
<td align="right">'.(is_null($nb_students_per_session) ? '' : $nb_students_per_session).'</td>
</tr>
<tr>
<td>'.get_lang('NbCoursesPerSession').'</td>
<td align="right">'.(is_null($nb_courses_per_session) ? '' : $nb_courses_per_session).'</td>
</tr>
</table>
</div>';
}
@ -629,11 +648,11 @@ if ($is_platform_admin && $view == 'admin' && $display != 'yourstudents') {
foreach ($global_coaches as $id_coach => $coaches) {
$time_on_platform = api_time_to_hms(Tracking :: get_time_spent_on_the_platform($coaches['user_id']));
$last_connection = Tracking :: get_last_connection_date($coaches['user_id']);
$nb_students = count(Tracking :: get_student_followed_by_coach($coaches['user_id']));
$nb_courses = count(Tracking :: get_courses_followed_by_coach($coaches['user_id']));
$nb_sessions = count(Tracking :: get_sessions_coached_by_user($coaches['user_id']));
$time_on_platform = api_time_to_hms(Tracking :: get_time_spent_on_the_platform($coaches['user_id']));
$last_connection = Tracking :: get_last_connection_date($coaches['user_id']);
$nb_students = count(Tracking :: get_student_followed_by_coach($coaches['user_id']));
$nb_courses = count(Tracking :: get_courses_followed_by_coach($coaches['user_id']));
$nb_sessions = count(Tracking :: get_sessions_coached_by_user($coaches['user_id']));
$table_row = array();
if ($is_western_name_order) {

@ -11,7 +11,6 @@
* @author Denes Nagy, principal author
* @author Isthvan Mandak, several new features
* @author Roan Embrechts, code improvements and refactoring
* @license GNU/GPL - See Chamilo license directory for details
*/
/**
* Code

@ -1,5 +1,5 @@
{% if add_cas_login_button.show_message %}
<link href="{{ _p.web_plugin }}add_cas_login_button/css.css" rel="stylesheet" type="text/css"> julio
<link href="{{ _p.web_plugin }}add_cas_login_button/css.css" rel="stylesheet" type="text/css">
<div class="well">
{% if add_cas_login_button.url_label %}
<img src="{{ add_cas_login_button.url_label }}" class='cas_plugin_image'/>

@ -1,4 +1,7 @@
This plugin will create administration settings to configure the content filtering on OLPC Peru's XS servers (uses Squid).
== English ==
This plugin will create administration settings to configure the content
filtering on OLPC Peru's XS servers (uses Squid).
In order to test this plugin, you should have a working version of the Squid
proxy system as well as a series of directories and files. Here is an example
@ -16,4 +19,48 @@ After that, enable the plugin, then go to some course's config screen and
check/uncheck the "Games" option. Now check that it updated the
/var/sqg/blacklists file... That's all folks!
The blacklists in /var/squidGuard/blacklists/ can be downloaded from http://dsi.ut-capitole.fr/blacklists/index_en.php
The blacklists in /var/squidGuard/blacklists/ can be downloaded from
http://dsi.ut-capitole.fr/blacklists/index_en.php
The SquidGuard software documentation can be found here:
http://www.squidguard.org/Doc/
The right way to install the filtering system (which should already be done
on the XS servers in Peru) is to install and configure Squid (yum install
squid) and add SquidGuard (see URL above), then finally change the permissions
on the configuration files as in the two last command lines above (with chmod)
== Spanish ==
Este plugin crea parámetros de administración para configurar el filtrado de
contenido en los servidores XS del proyecto Una Laptop Para Cada Niño en
Perú (usando Squid).
Para probar este plugin, debería tener una versión funcional del sistema de
proxy Squid y una serie de carpetas y ficheros. Le planteamos aquí un ejemplo
de como generar una estructura de simulación que funcionará con el plugin
predeterminado (*no* es una forma segura de hacerlo, así que por favor solo
usar en máquinas de desarrollo):
sudo mkdir /var/sqg
sudo mkdir /var/squidGuard
sudo mkdir /var/squidGuard/blacklists
sudo mkdir /var/squidGuard/blacklists/Games
sudo touch /var/sqg/blacklists
sudo chmod -R 0777 /var/sqg
sudo chmod -R 0777 /var/squidGuard/blacklists
Después de esto, activar el plugin e ir en alguna pantalla de configuración
de curso y marcar/desmarcar la opción "Games". Ahora verifique que se ha
actualizado el archivo /var/sqg/blacklists... Ya está!
Las listas negras (de exclusión) dentro de /var/squidGard/blacklists/ pueden
ser descargadas desde http://dsi.ut-capitole.fr/blacklists/index_en.php
La documentación del software SquidGuard puede ser encontrada aquí:
http://www.squidguard.org/Doc/
La forma correcta de instalar el sistema de filtrado (esto debería estar ya
preconfigurado en los servidores XS de Perú) es de instalar y configurar
Squid (yum install squid) y agregarle SquidGuard, y finalmente permitir
cambios de configuración a los archivos de configuración (ver dos últimas
líneas de comando, con chmod).

Loading…
Cancel
Save