skala
Juan Carlos Raña 13 years ago
commit ed911c317f
  1. 3
      documentation/changelog.html
  2. 3
      documentation/credits.html
  3. 17
      license.txt
  4. 4
      main/admin/archive_cleanup.php
  5. 2
      main/admin/configure_plugin.php
  6. 2
      main/admin/grade_models.php
  7. 19
      main/admin/index.php
  8. 27
      main/admin/settings.lib.php
  9. 48
      main/admin/settings.php
  10. 5
      main/attendance/attendance_add.php
  11. 4
      main/attendance/attendance_controller.php
  12. 9
      main/attendance/attendance_edit.php
  13. 7
      main/attendance/attendance_sheet.php
  14. 2
      main/attendance/index.php
  15. 22
      main/auth/cas/authcas.php
  16. 6
      main/auth/cas/logincas.php
  17. 1
      main/auth/shibboleth/login.php
  18. 8
      main/auth/shibboleth/test/shibboleth_test_helper.class.php
  19. 12
      main/calendar/agenda.lib.php
  20. 2
      main/course_info/infocours.php
  21. 6
      main/coursecopy/classes/Document.class.php
  22. 6
      main/coursecopy/classes/ScormDocument.class.php
  23. 8
      main/css/academica/default.css
  24. 2
      main/css/academica/scorm.css
  25. 8
      main/css/baby_orange/default.css
  26. 2
      main/css/baby_orange/scorm.css
  27. 197
      main/css/base.css
  28. 74
      main/css/base_chamilo.css
  29. 16
      main/css/blue_lagoon/default.css
  30. 4
      main/css/blue_lagoon/scorm.css
  31. 26
      main/css/chamilo/scorm.css
  32. 4
      main/css/chamilo_electric_blue/scorm.css
  33. 4
      main/css/chamilo_green/scorm.css
  34. 3
      main/css/chamilo_orange/scorm.css
  35. 3
      main/css/chamilo_red/scorm.css
  36. 7
      main/css/chamilo_sport_red/scorm.css
  37. 16
      main/css/cool_blue/default.css
  38. 4
      main/css/cool_blue/scorm.css
  39. 8
      main/css/corporate/default.css
  40. 2
      main/css/corporate/scorm.css
  41. 8
      main/css/cosmic_campus/default.css
  42. 2
      main/css/cosmic_campus/scorm.css
  43. 18
      main/css/delicious_bordeaux/default.css
  44. 6
      main/css/delicious_bordeaux/scorm.css
  45. 16
      main/css/dokeos_blue/default.css
  46. 4
      main/css/dokeos_blue/scorm.css
  47. 18
      main/css/dokeos_classic/default.css
  48. 3
      main/css/dokeos_classic/scorm.css
  49. 18
      main/css/dokeos_classic_2D/default.css
  50. 2
      main/css/dokeos_classic_2D/scorm.css
  51. 16
      main/css/empire_green/default.css
  52. 6
      main/css/empire_green/scorm.css
  53. 16
      main/css/fruity_orange/default.css
  54. 4
      main/css/fruity_orange/scorm.css
  55. 4166
      main/css/journal/bootstrap.css
  56. 8
      main/css/journal/default.css
  57. 12
      main/css/medical/default.css
  58. 2
      main/css/medical/scorm.css
  59. 16
      main/css/public_admin/default.css
  60. 4
      main/css/public_admin/scorm.css
  61. 16
      main/css/royal_purple/default.css
  62. 4
      main/css/royal_purple/scorm.css
  63. 9
      main/css/silver_line/default.css
  64. 2
      main/css/silver_line/scorm.css
  65. 4369
      main/css/simplex/bootstrap.css
  66. 8
      main/css/simplex/default.css
  67. 18
      main/css/sober_brown/default.css
  68. 2
      main/css/sober_brown/scorm.css
  69. 4361
      main/css/spacelab/bootstrap.css
  70. 8
      main/css/spacelab/default.css
  71. 8
      main/css/steel_grey/default.css
  72. 22
      main/css/tasty_olive/default.css
  73. 4
      main/css/tasty_olive/scorm.css
  74. 107
      main/document/create_document.php
  75. 18
      main/document/document.inc.php
  76. 6
      main/document/document.php
  77. 6
      main/document/document_lite.php
  78. 6
      main/document/edit_document.php
  79. 2
      main/document/upload.php
  80. 27
      main/exercice/exercice.php
  81. 8
      main/exercice/exercise.lib.php
  82. 6
      main/exercice/exercise_report.php
  83. 23
      main/exercice/exercise_show.php
  84. 24
      main/exercice/fill_blanks.class.php
  85. 26
      main/exercice/matching.class.php
  86. 10
      main/exercice/multiple_answer.class.php
  87. 11
      main/exercice/multiple_answer_combination.class.php
  88. 16
      main/exercice/multiple_answer_true_false.class.php
  89. 12
      main/exercice/unique_answer.class.php
  90. 11
      main/exercice/unique_answer_no_option.class.php
  91. 11
      main/forum/editpost.php
  92. 53
      main/forum/forumfunction.inc.php
  93. 31
      main/forum/newthread.php
  94. 21
      main/forum/viewforum.php
  95. 15
      main/gradebook/gradebook_add_cat.php
  96. 2
      main/gradebook/gradebook_add_link.php
  97. 13
      main/gradebook/gradebook_edit_eval.php
  98. 31
      main/gradebook/gradebook_edit_link.php
  99. 4
      main/gradebook/gradebook_edit_result.php
  100. 154
      main/gradebook/gradebook_flatview.php
  101. Some files were not shown because too many files have changed in this diff Show More

@ -198,6 +198,9 @@ This version of Chamilo only includes new features:
</ul>
<h3>Known issues</h3>
<ul>
<li>
<b>Document title:</b> The option to NOT use a document title different than the filename in the documents tool has been removed. This means that if this setting was not set to the default option in your Chamilo option or if you have a very old installation that you have been upgrading over the years, you might experience problems accessing the documents. In this case, we recommend contacting an official provider of Chamilo to take this migration in charge.
</li>
</ul>
<h3>Third-Party Libraries additions/updates</h3>

@ -592,6 +592,8 @@ There are too much translators to list them all. Please check http://translate.c
<li>Erik Das (FKS), for bug reports to 1.8.8</li>
<li>Marc De Caluwé, for patches to 1.8.8.4</li>
<li>Alberto Montes, Contidos Dixitais, for CSS "sport_red" in 1.9</li>
<li>Bart Mollet, Hogeschool Gent, for patches in 1.6 &amp; 1.8</li>
<li>Kristof Van Steenkiste &amp; Sebastien Jacobs (initial Reservation plugin, 2007)</li>
<li>All the supporting parents, partners, children, friends, colleagues and sometimes students, of the very special geeks that we are, for their continous support and inspiration</li>
</ul>
@ -626,6 +628,7 @@ These institutions and companies have either contributed to the Chamilo project
<li>Table of contents<br />
now removed, replaced by learning path<br />
</li>
<li>Facultad de Matematicas, UADY (México) (original asynchronous Message plugin, was later dumped)</li>
</ul>
</div>
<br />

@ -1,15 +1,16 @@
Chamilo - elearning and course management software
Copyright (c) 2008-2010 Dokeos Latinoamérica SAC / BeezNest Latino SAC
Copyright (c) 2004-2009 Dokeos SPRL
Chamilo LMS - elearning and course management software
Copyright (c) 2008-2012 BeezNest Latino SAC, Peru & BeezNest Belgium SPRL, Belgium
Copyright (c) 2012 Université de Genève, Switzerland
Copyright (c) 2010-2012 Université de Grenoble, France
Copyright (c) 2011-2012 CBlue SPRL, Belgium
Copyright (c) Juan Carlos Raña (independent), Spain
Copyright (c) 2004-2009 Dokeos SPRL, Belgium
Copyright (c) 2003-2007 Ghent University (UGent)
Copyright (c) 2001 Universite catholique de Louvain (UCL)
Copyright (c) 2001-2004 Universite catholique de Louvain (UCL)
Copyright (c) 2003-2008 Vrije Universiteit Brussel (VUB)
Copyright (c) 2004-2008 Hoogeschool Gent (HoGent)
Copyright (c) Bart Mollet, Hogeschool Gent
Copyright (c) Facultad de Matematicas, UADY (México) (Message plugin)
Copyright (c) Kristof Van Steenkiste & Sebastien Jacobs (Reservation plugin)
For a full list of contributors detaining copyrights over parts of
the Chamilo software, see "documentation/credits.html".

@ -16,8 +16,8 @@ require_once '../inc/global.inc.php';
$this_section = SECTION_PLATFORM_ADMIN;
// Access restrictions
//api_protect_admin_script(true);
api_protect_global_admin_script();
api_protect_admin_script(true);
//api_protect_global_admin_script();
// setting breadcrumbs
$interbreadcrumb[]=array('url' => 'index.php','name' => get_lang('PlatformAdmin'));

@ -24,7 +24,6 @@ if (empty($plugin_info)) {
$installed_plugins = $plugin_obj->get_installed_plugins();
if (!in_array($plugin_name, $installed_plugins)) {
api_not_allowed();
}
@ -49,6 +48,7 @@ if (isset($plugin_info['settings_form'])) {
if (isset($form)) {
if ($form->validate()) {
$values = $form->exportValues();
//api_delete_category_settings_by_subkey($plugin_name);
$access_url_id = api_get_current_access_url_id();
api_delete_settings_params(array('category = ? AND access_url = ? AND subkey = ? AND type = ? and variable <> ?' =>

@ -6,7 +6,7 @@
*/
// Language files that need to be included.
$language_file = array('admin');
$language_file = array('admin', 'gradebook');
$cidReset = true;
require_once '../inc/global.inc.php';

@ -91,6 +91,7 @@ if (api_is_platform_admin()) {
);
}
$blocks['users']['items'] = $items;
$blocks['users']['extra'] = null;
if (api_is_platform_admin()) {
/* Courses */
@ -126,6 +127,7 @@ if (api_is_platform_admin()) {
$items[] = array('url'=>'ldap_import_students.php', 'label' => get_lang('ImportLDAPUsersIntoCourse'));
}
$blocks['courses']['items'] = $items;
$blocks['courses']['extra'] = null;
/* Platform */
$blocks['platform']['icon'] = Display::return_icon('platform.png', get_lang('Platform'), array(), ICON_SIZE_MEDIUM, false);
@ -162,6 +164,7 @@ if (api_is_platform_admin()) {
$items[] = array('url'=>'legal_add.php', 'label' => get_lang('TermsAndConditions'));
}
$blocks['platform']['items'] = $items;
$blocks['platform']['extra'] = null;
}
/* Sessions */
@ -195,6 +198,7 @@ if (api_get_setting('use_session_mode') == 'true') {
$items[] = array('url'=>'usergroups.php', 'label' => get_lang('Classes'));
$blocks['sessions']['items'] = $items;
$blocks['sessions']['extra'] = null;
} elseif (api_is_platform_admin()) {
@ -215,6 +219,8 @@ if (api_get_setting('use_session_mode') == 'true') {
$items[] = array('url'=>'subscribe_class2course.php', 'label' => get_lang('AddClassesToACourse'));
$blocks['classes']['items'] = $items;
$blocks['classes']['extra'] = null;
}
/* Settings */
@ -232,13 +238,16 @@ if (api_is_platform_admin()) {
if (is_dir(api_get_path(SYS_TEST_PATH).'datafiller/')) {
$items[] = array('url'=>'filler.php', 'label' => get_lang('DataFiller'));
}
if (api_is_global_platform_admin()) {
//if (api_is_global_platform_admin()) {
$items[] = array('url'=>'archive_cleanup.php', 'label' => get_lang('ArchiveDirCleanup'));
}
//}
//$items[] = array('url'=>'statistics/index.php?action=activities', 'label' => get_lang('ImportantActivities'));
$blocks['settings']['items'] = $items;
$blocks['settings']['extra'] = null;
$blocks['settings']['search_form'] = null;
/* Extensions */
/*
@ -266,6 +275,8 @@ if (api_is_platform_admin()) {
$items[] = array('url'=>'skills_gradebook.php', 'label' => get_lang('SkillsAndGradebooks'));
$blocks['skills']['items'] = $items;
$blocks['skills']['extra'] = null;
$blocks['skills']['search_form'] = null;
@ -286,6 +297,8 @@ if (api_is_platform_admin()) {
$items[] = array('url'=>'http://www.chamilo.org/extensions', 'label' => get_lang('ChamiloExtensions'));
$blocks['chamilo']['items'] = $items;
$blocks['chamilo']['extra'] = null;
$blocks['chamilo']['search_form'] = null;
// Try to display a maximum before we check the chamilo version and all that.
//session_write_close(); //close session to avoid blocking concurrent access
@ -296,6 +309,8 @@ if (api_is_platform_admin()) {
$blocks['version_check']['icon'] = Display::return_icon('logo.gif', 'Chamilo.org', array(), ICON_SIZE_SMALL, false);
$blocks['version_check']['label'] = get_lang('VersionCheck');
$blocks['version_check']['extra'] = version_check();
$blocks['version_check']['search_form'] = null;
$blocks['version_check']['items'] = null;
}
$tpl = new Template();

@ -81,7 +81,7 @@ function handle_regions() {
}
function handle_extensions() {
echo '<div class="page-header"><h2>'.get_lang('ConfigureExtensions').'</h2></div>';
echo Display::page_subheader(get_lang('ConfigureExtensions'));
echo '<a class="btn" href="configure_extensions.php?display=ppt2lp">'.get_lang('Ppt2lp').'</a>';
}
@ -105,10 +105,10 @@ function handle_plugins() {
$all_plugins = $plugin_obj->read_plugins_from_path();
$installed_plugins = $plugin_obj->get_installed_plugins();
$not_installed = array_diff($all_plugins, $installed_plugins);
//Plugins NOT installed
echo '<div class="page-header"><h2>'.get_lang('Plugins').'</h2></div>';
echo Display::page_subheader(get_lang('Plugins'));
echo '<form name="plugins" method="post" action="'.api_get_self().'?category='.Security::remove_XSS($_GET['category']).'">';
echo '<table class="data_table">';
echo '<tr>';
@ -167,7 +167,6 @@ function handle_plugins() {
echo '</table>';
echo '<br />';
echo '<button class="save" type="submit" name="submit_plugins">'.get_lang('EnablePlugins').'</button></form>';
echo '<br />';
}
/**
@ -179,6 +178,7 @@ function handle_stylesheets() {
global $_configuration;
// Current style.
$currentstyle = api_get_setting('stylesheets');
$is_style_changeable = false;
if ($_configuration['access_url'] != 1) {
@ -1149,7 +1149,7 @@ function generate_settings_form($settings, $settings_by_access_list) {
if (file_exists($file)) {
$value = file_get_contents($file);
}
$form->addElement('textarea', $row['variable'], array(get_lang($row['title']), get_lang($row['comment'])) , array('rows'=>'10','cols'=>'50'), $hideme);
$form->addElement('textarea', $row['variable'], array(get_lang($row['title']), get_lang($row['comment'])) , array('class'=>'span6','rows'=>'10'), $hideme);
$default_values[$row['variable']] = $value;
} elseif ($row['variable'] == 'footer_extra_content') {
$file = api_get_path(SYS_PATH).api_get_home_path().'footer_extra_content.txt';
@ -1157,10 +1157,10 @@ function generate_settings_form($settings, $settings_by_access_list) {
if (file_exists($file)) {
$value = file_get_contents($file);
}
$form->addElement('textarea', $row['variable'], array(get_lang($row['title']), get_lang($row['comment'])) , array('rows'=>'10','cols'=>'50'), $hideme);
$form->addElement('textarea', $row['variable'], array(get_lang($row['title']), get_lang($row['comment'])) , array('rows'=>'10', 'class'=>'span6'), $hideme);
$default_values[$row['variable']] = $value;
} else {
$form->addElement('textarea', $row['variable'], array(get_lang($row['title']), get_lang($row['comment'])) , array('rows'=>'10','cols'=>'50'), $hideme);
$form->addElement('textarea', $row['variable'], array(get_lang($row['title']), get_lang($row['comment'])) , array('rows'=>'10','class'=>'span6'), $hideme);
$default_values[$row['variable']] = $row['selected_value'];
}
break;
@ -1230,16 +1230,6 @@ function generate_settings_form($settings, $settings_by_access_list) {
$form->addElement('select', $row['variable'], array(get_lang($row['title']), get_lang($row['comment'])), call_user_func('select_'.$row['variable']), $hideme);
$default_values[$row['variable']] = $row['selected_value'];
break;
case 'gradebook_ranking':
$value = explode('::', $row['selected_value']);
$form->addElement('text', 'gradebook_display['.$row['variable'].'][text]', array(get_lang($row['title']), get_lang($row['comment'])), array('class' => 'span1', 'value' => $value[0]), $hideme);
$form->addElement('text', 'gradebook_display['.$row['variable'].'][score]', array(get_lang($row['title']), get_lang($row['comment'])), array('class' => 'span3','value' => $value[1]), $hideme);
$renderer = $form -> defaultRenderer();
$renderer->setElementTemplate(' {label}<div class="controls"> {element} %= ', 'gradebook_display['.$row['variable'].'][text]');
$renderer->setElementTemplate(' {element}</div><br />', 'gradebook_display['.$row['variable'].'][score]');
break;
case 'custom':
break;
}
@ -1280,6 +1270,9 @@ function generate_settings_form($settings, $settings_by_access_list) {
* @return array
*/
function search_setting($search) {
if (empty($search)) {
return array();
}
$table_settings_current = Database :: get_main_table(TABLE_MAIN_SETTINGS_CURRENT);
$sql = "SELECT * FROM $table_settings_current WHERE category <> 'Plugins' GROUP BY variable ORDER BY id ASC ";
$result = Database::store_result(Database::query($sql), 'ASSOC');

@ -44,7 +44,6 @@ api_protect_admin_script();
// Settings to avoid
$settings_to_avoid = array(
'gradebook_enable' => 'false',
'use_document_title' => 'true',
'example_material_course_creation' => 'true' // ON by default - now we have this option when we create a course
);
@ -53,7 +52,7 @@ $convert_byte_to_mega_list = array('dropbox_max_filesize', 'message_max_upload_f
// Submit stylesheets.
if (isset($_POST['submit_stylesheets'])) {
$message = store_stylesheets();
header("Location: ".api_get_self()."?category=stylesheets");
header("Location: ".api_get_self()."?category=Stylesheets");
exit;
}
@ -180,14 +179,6 @@ if (!empty($_GET['category']) && !in_array($_GET['category'], array('Plugins', '
foreach ($values as $key => $value) {
if (in_array($key, $settings_to_avoid)) { continue; }
//Gradebook fix
if ($key == 'gradebook_display') {
foreach ($value as $new_key => $item) {
$final_value = $item['text'].'::'.$item['score'];
$result = api_set_setting($new_key, $final_value, 'ranking', null, $_configuration['access_url']);
}
}
//
// Treat gradebook values in separate function.
//if (strpos($key, 'gradebook_score_display_custom_values') === false) {
@ -307,8 +298,6 @@ $action_images['cas'] = 'user_access.png';
$action_images['security'] = 'security.png';
$action_images['languages'] = 'languages.png';
$action_images['tuning'] = 'tuning.png';
$action_images['plugins'] = 'plugins.png';
$action_images['stylesheets'] = 'stylesheets.png';
$action_images['templates'] = 'template.png';
$action_images['search'] = 'search.png';
$action_images['editor'] = 'html_editor.png';
@ -321,16 +310,19 @@ $action_images['search'] = 'search.png';
$action_images['stylesheets'] = 'stylesheets.png';
$action_images['templates'] = 'template.png';
$action_images['plugins'] = 'plugins.png';
$action_images['shibboleth'] = 'shibboleth.png';
$action_images['facebook'] = 'facebook.png';
// Grabbing the categories.
$resultcategories = api_get_settings_categories(array('stylesheets', 'Plugins', 'Templates', 'Search'));
$action_array = array();
$resultcategories[] = array('category' => 'search');
$resultcategories[] = array('category' => 'stylesheets');
$resultcategories[] = array('category' => 'templates');
$resultcategories[] = array('category' => 'plugins');
$resultcategories[] = array('category' => 'Search');
$resultcategories[] = array('category' => 'Stylesheets');
$resultcategories[] = array('category' => 'Templates');
$resultcategories[] = array('category' => 'Plugins');
foreach ($resultcategories as $row) {
$url = array();
$url['url'] = api_get_self()."?category=".$row['category'];
@ -385,11 +377,32 @@ if (!empty($_GET['category'])) {
Display :: display_confirmation_message(get_lang('DashboardPluginsHaveBeenUpdatedSucesslly'));
}
}
echo '<script>
$(function(){
$("#tabs").tabs();
});
</script>';
echo '<div id="tabs">';
echo '<ul>';
echo '<li><a href="#tabs-1">'.get_lang('Plugins').'</a></li>';
echo '<li><a href="#tabs-2">'.get_lang('DashboardPlugins').'</a></li>';
echo '<li><a href="#tabs-3">'.get_lang('ConfigureExtensions').'</a></li>';
echo '</ul>';
echo '<div id="tabs-1">';
handle_plugins();
echo '</div>';
echo '<div id="tabs-2">';
DashboardManager::handle_dashboard_plugins();
echo '</div>';
echo '<div id="tabs-3">';
handle_extensions();
echo '</div>';
echo '</div>';
break;
case 'stylesheets':
case 'Stylesheets':
// Displaying the extensions: Stylesheets.
handle_stylesheets();
break;
@ -406,6 +419,7 @@ if (!empty($_GET['category'])) {
}
break;
default:
if (isset($form))
$form->display();
}
}

@ -24,7 +24,7 @@ if (!$error) {
$token = Security::get_token();
}
// display form
$form = new FormValidator('attendance_add','POST','index.php?action=attendance_add&'.api_get_cidreq().$param_gradebook,'','style="width: 100%;"');
$form = new FormValidator('attendance_add','POST','index.php?action=attendance_add&'.api_get_cidreq().$param_gradebook);
$form->addElement('header', '', get_lang('CreateANewAttendance'));
$form->addElement('hidden', 'sec_token', $token);
@ -42,6 +42,9 @@ $form->addElement('html','<div id="id_qualify" style="display:none">');
// Qualify Attendance for gradebook option
$form->addElement('checkbox', 'attendance_qualify_gradebook', '', get_lang('QualifyAttendanceGradebook'),'onclick="javascript: if(this.checked){document.getElementById(\'options_field\').style.display = \'block\';}else{document.getElementById(\'options_field\').style.display = \'none\';}"');
$form->addElement('html','<div id="options_field" style="display:none">');
load_gradebook_select_in_tool($form);
$form->addElement('text', 'attendance_qualify_title', get_lang('TitleColumnGradebook'));
$form->applyFilter('attendance_qualify_title', 'html_filter');
$form->addElement('text', 'attendance_weight', get_lang('QualifyWeight'),'value="0.00" Style="width:40px" onfocus="javascript: this.select();"');

@ -68,6 +68,7 @@
if ( isset($_POST['attendance_qualify_gradebook']) && $_POST['attendance_qualify_gradebook'] == 1 ) {
$link_to_gradebook = true;
}
$attendance->category_id = $_POST['category_id'];
$last_id = $attendance->attendance_add($link_to_gradebook);
Security::clear_token();
}
@ -84,8 +85,6 @@
$this->view->set_template('attendance_add');
$this->view->render();
}
} else {
$this->view->set_data($data);
$this->view->set_layout('layout');
@ -115,6 +114,7 @@
$attendance->set_attendance_qualify_title($_POST['attendance_qualify_title']);
$attendance->set_attendance_weight($_POST['attendance_weight']);
$attendance->category_id = $_POST['category_id'];
$link_to_gradebook = false;
if ( isset($_POST['attendance_qualify_gradebook']) && $_POST['attendance_qualify_gradebook'] == 1 ) {
$link_to_gradebook = true;

@ -27,7 +27,7 @@ if (!$error) {
$attendance_weight = floatval($attendance_weight);
// display form
$form = new FormValidator('attendance_edit','POST','index.php?action=attendance_edit&'.api_get_cidreq().'&attendance_id='.$attendance_id.$param_gradebook,'','style="width: 100%;"');
$form = new FormValidator('attendance_edit','POST','index.php?action=attendance_edit&'.api_get_cidreq().'&attendance_id='.$attendance_id.$param_gradebook);
$form->addElement('header', '', get_lang('Edit'));
$form->addElement('hidden', 'sec_token',$token);
$form->addElement('hidden', 'attendance_id', $attendance_id);
@ -52,6 +52,7 @@ if (!empty($attendance_qualify_title) || !empty($attendance_weight)) {
$form->addElement('checkbox', 'attendance_qualify_gradebook', '', get_lang('QualifyAttendanceGradebook'),'onclick="javascript: if(this.checked){document.getElementById(\'options_field\').style.display = \'block\';}else{document.getElementById(\'options_field\').style.display = \'none\';}"');
$form -> addElement('html','<div id="options_field" style="display:none">');
}
load_gradebook_select_in_tool($form);
$form->addElement('text', 'attendance_qualify_title', get_lang('TitleColumnGradebook'));
$form->applyFilter('attendance_qualify_title', 'html_filter');
$form->addElement('text', 'attendance_weight', get_lang('QualifyWeight'),'value="0.00" Style="width:40px" onfocus="javascript: this.select();"');
@ -59,7 +60,7 @@ $form->applyFilter('attendance_weight', 'html_filter');
$form->addElement('html','</div>');
$form->addElement('html','</div>');
//$form->addElement('html','<div class="clear" style="margin-top:50px;"></div>');
$form->addElement('style_submit_button', null, get_lang('Save'), 'class="save"');
// set default values
@ -67,6 +68,8 @@ $default['title'] = Security::remove_XSS($title);
$default['description'] = Security::remove_XSS($description,STUDENT);
$default['attendance_qualify_title'] = $attendance_qualify_title;
$default['attendance_weight'] = $attendance_weight;
$link_info = is_resource_in_course_gradebook(api_get_course_id(), 7, $attendance_id, api_get_session_id());
$default['category_id'] = $link_info['category_id'];
$form->setDefaults($default);
$form->display();
?>

@ -205,8 +205,11 @@ if (api_is_allowed_to_edit(null, true)) {
$result .= '<th height="80px" width="800px">';
$result .= '<center><div style="font-size:10px;width:80px;">'.$datetime.'&nbsp;';
$result .= '<span id="attendance_lock" style="cursor:pointer">'.(!$is_locked_attendance || api_is_platform_admin()?$img_lock:'').'</span>';
if ($is_locked_attendance == false) {
$result .= '<br /><input type="checkbox" class="checkbox_head_'.$calendar['id'].'" id="checkbox_head_'.$calendar['id'].'" '.$disabled_check.' checked="checked" />'.$input_hidden.'</div></center></th>';
}
}
} else {
$result = '<th width="2000px"><span><a href="index.php?'.api_get_cidreq().'&action=calendar_list&attendance_id='.$attendance_id.$param_gradebook.'">';
$result .= Display::return_icon('attendance_calendar.png',get_lang('AttendanceCalendar'),'',ICON_SIZE_MEDIUM).' '.get_lang('GoToAttendanceCalendar').'</a></span></th>';
@ -220,7 +223,6 @@ if (api_is_allowed_to_edit(null, true)) {
<tr class="tableWithFloatingHeader row_odd">
<?php echo $result; ?>
</tr>
</thead>
<tbody>
<?php
@ -233,8 +235,11 @@ if (api_is_allowed_to_edit(null, true)) {
<tr class="<?php echo $class ?>">
<?php
if (count($attendant_calendar) > 0 ) {
foreach ($attendant_calendar as $calendar) {
$checked = 'checked';
$presence = null;
if (isset($users_presence[$user['user_id']][$calendar['id']]['presence'])) {
$presence = $users_presence[$user['user_id']][$calendar['id']]['presence'];
if (intval($presence) == 1) {

@ -10,7 +10,7 @@
*/
// name of the language file that needs to be included
$language_file = array ('course_description', 'course_info', 'pedaSuggest', 'userInfo', 'admin', 'agenda','tracking', 'trad4all');
$language_file = array ('course_description', 'course_info', 'pedaSuggest', 'userInfo', 'admin', 'agenda','tracking', 'gradebook');
// including files
require_once '../inc/global.inc.php';

@ -9,18 +9,38 @@ require_once(api_get_path(SYS_PATH).'main/auth/cas/cas_var.inc.php');
require_once(api_get_path(SYS_PATH).'main/auth/external_login/ldap.inc.php');
require_once(api_get_path(SYS_PATH).'main/auth/external_login/functions.inc.php');
/**
* @return true if cas is configured
*
**/
function cas_configured() {
global $cas_auth_ver, $cas_auth_server, $cas_auth_port, $cas_auth_uri;
$res = false;
if (!empty($cas_auth_ver) && !empty($cas_auth_server) && !empty($cas_auth_port)) {
$res = true;
}
return $res;
}
/**
* checks if the user already get a session
* @return the user login if the user already has a session ,false otherwise
**/
function cas_is_authenticated()
{
global $cas_auth_ver, $cas_auth_server, $cas_auth_port, $cas_auth_uri;
global $PHPCAS_CLIENT;
global $logout;
if (!cas_configured()) {
return;
}
if (!is_object($PHPCAS_CLIENT) )
{

@ -16,9 +16,15 @@ require_once (api_get_path(LIBRARY_PATH).'events.lib.inc.php');
require_once('authcas.php');
global $cas_auth_ver, $cas_auth_server, $cas_auth_port, $cas_auth_uri;
// phpCAS
if (cas_configured()) {
if (!is_object($PHPCAS_CLIENT) ) {
phpCAS::client($cas_auth_ver,$cas_auth_server,$cas_auth_port,$cas_auth_uri);
phpCAS::setNoCasServerValidation();
}
phpCAS::forceAuthentication();
header('Location: '.api_get_path(WEB_PATH).api_get_setting('page_after_login'));
}
else {
header('Location: '.api_get_path(WEB_PATH));
}

@ -28,5 +28,6 @@ include_once(dirname(__FILE__) . '/init.php');
//ShibbolethTest::helper()->setup_new_staff();
//ShibbolethTest::helper()->setup_new_teacher();
//ShibbolethTest::helper()->setup_new_student();
//ShibbolethTest::helper()->setup_new_minimal_data();
ShibbolethController::instance()->login();

@ -109,4 +109,12 @@ class ShibbolethTestHelper
$_SERVER['persistent-id'] = 'idp!viewer!' . md5($id);
}
public function setup_new_minimal_data()
{
$id = uniqid();
$_SERVER['Shib-SwissEP-UniqueID'] = 'usr_' . $id;
$_SERVER['Shib-InetOrgPerson-givenName'] = 'John';
$_SERVER['Shib-Person-surname'] = 'Doe' . $id;
}
}

@ -39,11 +39,17 @@ class Agenda {
/**
*
* Adds an event
* Adds an event to the calendar
*
* @param int start tms
* @param int end tms
* @param string agendaDay, agendaWeek, month
* @param string personal, course or global (only works for personal by now)
* @param string all day (true, false)
* @param string view agendaDay, agendaWeek, month @todo seems not to be used
* @param string title
* @param string content
* @param array users to send array('everyone') or a list of user ids
* @param bool add event as a *course* announcement
*
*/
function add_event($start, $end, $all_day, $view, $title, $content, $users_to_send = array(), $add_as_announcement = false) {

@ -42,7 +42,7 @@ $course_code = $_course['sysCode'];
$course_access_settings = CourseManager :: get_access_settings($course_code);
$video_conference_enabled = false;
if (api_get_setting('bbb_plugin') == 'true') {
if (api_get_setting('bbb_tool_enable') == 'true') {
$video_conference_enabled = true;
}

@ -49,10 +49,8 @@ class Document extends Resource
{
parent::show();
echo preg_replace('@^document@', '', $this->path);
if (!empty($this->title) && (api_get_setting('use_document_title') == 'true'))
{
if (strpos($this->path, $this->title) === false)
{
if (!empty($this->title)) {
if (strpos($this->path, $this->title) === false) {
echo " - ".$this->title;
}
}

@ -39,10 +39,8 @@ class ScormDocument extends Resource
parent::show();
$path = preg_replace('@^scorm/@', '', $this->path);
echo $path;
if (!empty($this->title) && (api_get_setting('use_document_title') == 'true'))
{
if (strpos($path, $this->title) === false)
{
if (!empty($this->title)) {
if (strpos($path, $this->title) === false) {
echo " - ".$this->title;
}
}

@ -327,18 +327,10 @@ form span.form_error {
border-bottom:1px solid #4171b5;
border-top:1px solid #4171b5;
height:29px;
padding-left: -17px;
margin: 5px 2px 1px 12px;
vertical-align:middle;
width: 90%;
}
.actions_lp img {
vertical-align:middle;
}
.actions_lp a {
margin-right: 10px;
vertical-align:middle;
}
.actions_lp span {
margin-right: 10px;
vertical-align:middle;

@ -20,8 +20,6 @@
overflow: auto;
background-color: white;
height: 210px;
width: 94%;
border-left: 10px #FFF solid;
}
.inner_lp_toc .scorm_item {
font-size: 11px;

@ -307,19 +307,11 @@ form span.form_error {
border-bottom:1px solid #EE4C03;
border-top:1px solid #EE4C03;
height:29px;
padding-left: -17px;
margin-bottom: 1px;
vertical-align:middle;
width: 90%;
margin-left:17px;
}
.actions_lp img {
vertical-align:middle;
}
.actions_lp a {
margin-right: 10px;
vertical-align:middle;
}
.actions_lp span {
margin-right: 10px;
vertical-align:middle;

@ -20,8 +20,6 @@
overflow: auto;
background-color: white;
height: 210px;
width: 96%;
border-left: 10px #FFF solid;
}
.inner_lp_toc .scorm_item {
font-size: 11px;

@ -19,16 +19,6 @@ select {
visibility: visible;
}
form .label {
padding: 1px 3px 2px;
font-size: 100%;
font-weight: normal;
color: #ffffff;
text-transform: none;
background: none;
border-radius: none;
}
legend {
margin-bottom: 10px;
}
@ -90,15 +80,12 @@ button.arrowl:hover, button.arrowr:hover , input.arrowl:hover, input.arrowr:hove
}
/* Fixing old chamilo forms */
form .label {
color: #404040;
float: left;
line-height: 18px;
padding-top: 6px;
text-align: right;
width: 150px;
text-shadow:none;
/* fixes the * */
span.form_required {
padding-right:5px;
}
form .formw {
margin-left: 170px;
}
@ -3458,11 +3445,11 @@ a.forum_group_link {
/* actions */
.actions_lp {
background:#F8F8F8;
height: 40px;
padding-left: -17px;
margin: 5px 2px 1px 12px;
vertical-align:middle;
width: 90%;
margin: 0px;
padding:9px 0px 9px 0px;
width:100%;
text-align: center;
}
.actions_lp .btn-group {
margin-left: 25px;
@ -3644,7 +3631,169 @@ footer {
background-image: -webkit-linear-gradient(top, #F5F5F5 0%, #EEEEEE 100%); /* Chrome 10+,Safari 5.1+ */
background-image: -ms-linear-gradient(top, #F5F5F5 0%,#EEEEEE 100%); /* IE10+ */
background-image: -o-linear-gradient(top, #F5F5F5 0%,#EEEEEE 100%); /* Opera 11.10+ */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#F5F5F5', endColorstr='#EEEEEE',GradientType=0 ); /* IE6-9 */
/* Fixes bug in ie8 */
/* filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#F5F5F5', endColorstr='#EEEEEE',GradientType=0 ); */ /* IE6-9 */
background-image: linear-gradient(top, #F5F5F5 0%, #EEEEEE 100%); /* W3C */
}
/* Default LP left column values */
#learning_path_left_zone {
float:left;
width:280px;
height:100%;
padding-left: 8px;
padding-right: 4px;
}
#learning_path_left_zone #header {
font-size:14px;
}
#author_icon {
float:left;
}
#lp_navigation_elem {
float:left;
}
#author_image {
border: 1px solid #CCCCCC;
float: left;
margin: 0;
padding: 8px;
position: relative;
width: 94%;
}
#author_name {
float: left;
text-align:center;
width: 100%;
font-size: 11px;
color: #888;
margin-top: 2px;
}
#learning_path_toc {
font-size:9pt;
margin:0;
}
#scorm_title {
background: none repeat scroll 0 0 #EEEEEE;
color: #444444;
font-size: 16px;
font-weight: bold;
padding: 1px 5px 3px 8px;
}
.progresstext {
text-align: center;
}
.inner_lp_toc {
overflow: auto;
background-color: white;
height: 210px;
}
.inner_lp_toc .scorm_item a {
font-weight: bold;
font-size: 14px;
margin-right: 1px;
padding-bottom: 2px;
text-decoration: none;
color: #2F3E46;
}
.inner_lp_toc .scorm_item a.chapter_module {
font-weight: normal;
margin-right: 10px;
}
.inner_lp_toc .scorm_item_highlight {
border: 1px solid #999;
background:#999;
font-weight:bold;
text-shadow:0 -1px 1px #666;
background-image:-webkit-gradient(linear,left top,left bottom,from(#666),to(#999));
background-image:-webkit-linear-gradient(top,#666,#999);
background-image:-moz-linear-gradient(top,#666,#999);
background-image:-ms-linear-gradient(top,#666,#999);
background-image:-o-linear-gradient(top,#666,#999);
background-image:linear-gradient(top,#666,#999);
margin-right: 0px;
padding: 10px 0px 10px 0px;
text-decoration: none;
}
.inner_lp_toc .scorm_item_highlight a {
color:#fff;
margin-right: 1px;
text-decoration: none;
font-weight: bold;
}
.inner_lp_toc .scorm_item_section {
border:1px solid #222;
background:#333;
font-weight:bold;
color:#fff;
text-shadow:0 -1px 1px #000;
background-image:-webkit-gradient(linear,left top,left bottom,from(#555),to(#333));
background-image:-webkit-linear-gradient(top,#555,#333);
background-image:-moz-linear-gradient(top,#555,#333);
background-image:-ms-linear-gradient(top,#555,#333);
background-image:-o-linear-gradient(top,#555,#333);
background-image:linear-gradient(top,#555,#333);
margin-right: 1px;
padding: 10px 0px 10px 0px;
text-decoration: none;
}
.inner_lp_toc .scorm_item {
font-size: 16px;
margin-left: 10px;
margin-right:10px;
text-decoration: none;
border-color: rgba(255, 255, 255, 0.3);
}
.inner_lp_toc .scorm_item_1 {
border-bottom: 1px solid #CCCCCC;
background:#eee;
font-weight:bold;
color:#444;
text-shadow:0 1px 1px #f6f6f6;
background-image:-webkit-gradient(linear,left top,left bottom,from(#fdfdfd),to(#eee));
background-image:-webkit-linear-gradient(top,#fdfdfd,#eee);
background-image:-moz-linear-gradient(top,#fdfdfd,#eee);
background-image:-ms-linear-gradient(top,#fdfdfd,#eee);
background-image:-o-linear-gradient(top,#fdfdfd,#eee);
background-image:linear-gradient(top,#fdfdfd,#eee);
margin-right: 1px;
padding: 10px 0px 10px 0px;
text-decoration: none;
font-weight: normal;
/* background:#FDFDFD; */
}
.inner_lp_toc .scorm_item_2 {
background-image:-webkit-gradient(linear,left top,left bottom,from(#fdfdfd),to(#eee));
background-image:-webkit-linear-gradient(top,#fdfdfd,#eee);
background-image:-moz-linear-gradient(top,#fdfdfd,#eee);
background-image:-ms-linear-gradient(top,#fdfdfd,#eee);
background-image:-o-linear-gradient(top,#fdfdfd,#eee);
background-image:linear-gradient(top,#fdfdfd,#eee);
border-bottom: 1px solid #CCCCCC;
color: #444444;
font-weight: bold;
text-shadow: 0 1px 1px #F6F6F6;
margin-right: 1px;
padding: 10px 0px 10px 0px;
text-decoration: none;
font-weight: normal;
}

@ -186,56 +186,6 @@ a.invisible:link, a.invisible:visited {
line-height: 0px;
height: 0;
}
input.link_alike {
background-color: #FFFFFF;
border-width: 0px;
color: #4171b5;
font-weight: bold;
text-align: left;
padding: 0px;
margin: 0px;
-moz-border-radius-bottomleft:5px;
-moz-border-radius-bottomright:5px;
-moz-border-radius-topleft:5px;
-moz-border-radius-topright:5px;
border:1px solid #E1E1E0;
}
input.link_alike:hover {
background-color: #FFFFFF;
border-width: 0px;
color: #f3840d;
font-weight: bold;
text-align: left;
padding: 0px;
margin: 0px;
-moz-border-radius-bottomleft:5px;
-moz-border-radius-bottomright:5px;
-moz-border-radius-topleft:5px;
-moz-border-radius-topright:5px;
border:1px solid #E1E1E0;
}
/*****************************************************
* HEADER STYLES *
*****************************************************/
#header {
}
/********************************************************
* HEADER 1: Title, portal, organisation, course title *
********************************************************/
#header1 a {
font-size:12px;
font-weight:normal;
color: #666666;
text-decoration: none;
}
#header1 a:hover {
text-decoration: underline;
}
#sitename {
margin: 0;
}
@ -1100,20 +1050,7 @@ padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0p
.skip {
display: none;
}
/*
Document title
*/
.input_titles {
width: 400px;
-moz-border-radius-bottomleft:5px;
-moz-border-radius-bottomright:5px;
-moz-border-radius-topleft:5px;
-moz-border-radius-topright:5px;
border:1px solid #E1E1E0;
}
/*
Survey
*/
/* Survey */
#survey_title {
background-color:#dcdcdc;
color:#000;
@ -1661,11 +1598,6 @@ a.read {
padding: 2px 0px 5px 5px;
}
/* fixes the * */
span.form_required {
padding-right:5px;
}
.courseadminview-activity-3col, .platformadminview-activity-3col {
-moz-border-radius:5px 5px 5px 5px;
border:1px solid #E1E1E0;
@ -1822,10 +1754,6 @@ span.form_required {
cursor: pointer;
}
.progresstext {
text-align:center;
}
/* tips Abbr-plugin for FCKeditor */
abbr {
border-bottom: 1px dotted rgb(102, 102, 102);

@ -1802,14 +1802,6 @@ div.comments {
height: 180px;
}
/*
------------------------------------------------------------------------------
OTHERS
------------------------------------------------------------------------------
*/
.input_titles {
width: 300px;
}
/*
------------------------------------------------------------------------------
Survey
------------------------------------------------------------------------------
@ -2064,18 +2056,10 @@ div.comments {
.actions_lp {
background:#F8F8F8;
height:29px;
padding-left: -17px;
margin: 5px 2px 1px 12px;
vertical-align:middle;
width: 90%;
}
.actions_lp img {
vertical-align:middle;
}
.actions_lp a {
margin-right: 10px;
vertical-align:middle;
}
.actions_lp span {
margin-right: 10px;
vertical-align:middle;

@ -20,15 +20,11 @@
overflow: auto;
background-color: white;
height: 210px;
width: 94%;
border-left: 10px #FFF solid;
}
.inner_lp_toc .scorm_item {
font-size: 11px;
margin-left: 10px;
margin-right:10px;
//it was 20px padding-bottom: 2px;
text-decoration: none;
}
.inner_lp_toc .scorm_item A {
font-size: 11px;

@ -16,18 +16,15 @@
width: 99%;
border-right: 1px none;
}
.inner_lp_toc {
overflow: auto;
background-color: white;
height: 210px;
width: 94%;
border-left: 5px #FFF solid;
}
.inner_lp_toc .scorm_item a {
font-weight: bold;
/* text-shadow: 0 1px 1px #F6F6F6; */
font-size: 14px;
margin-right: 1px;
padding-bottom: 2px;
@ -35,6 +32,7 @@
font-family: Helvetica,Arial,sans-serif;
color: #2F3E46;
}
.inner_lp_toc .scorm_item a.chapter_module {
font-weight: normal;
margin-right: 10px;
@ -50,12 +48,12 @@
background-image:-moz-linear-gradient(top,#72b0d4,#4b88b6);
background-image:-ms-linear-gradient(top,#72b0d4,#4b88b6);
background-image:-o-linear-gradient(top,#72b0d4,#4b88b6);
background-image:linear-gradient(top,#72b0d4,#4b88b6)
margin-right: 1px;
background-image:linear-gradient(top,#72b0d4,#4b88b6);
margin-right: 0px;
padding: 10px 0px 10px 0px;
text-decoration: none;
}
.inner_lp_toc .scorm_item_highlight a {
color:#fff;
margin-right: 1px;
@ -111,26 +109,22 @@
}
.inner_lp_toc .scorm_item_2 {
background-image:-webkit-gradient(linear,left top,left bottom,from(#fdfdfd),to(#eee));
background-image:-webkit-linear-gradient(top,#fdfdfd,#eee);
background-image:-moz-linear-gradient(top,#fdfdfd,#eee);
background-image:-ms-linear-gradient(top,#fdfdfd,#eee);
background-image:-o-linear-gradient(top,#fdfdfd,#eee);
background-image:linear-gradient(top,#fdfdfd,#eee);
border-bottom: 1px solid #CCCCCC;
color: #444444;
font-weight: bold;
text-shadow: 0 1px 1px #F6F6F6;
margin-right: 1px;
padding: 10px 0px 10px 0px;
text-decoration: none;
font-weight: normal;
}
.inner_lp_toc .scorm_title {
font-weight: bold;
background:#ccc;
@ -164,8 +158,6 @@
/*.scormpage .menu */
.lp_navigation_elem .progresstext {
margin-top: -20px;
// margin-left: 40%;
//em font-size: normal;
}
/*.scormpage .menu */
.lp_navigation_elem .buttons {
@ -206,12 +198,6 @@
#image_preview {
padding-left: 17px;
}
#author_name {
padding-left: 5px;
padding-top: 5px;
font-size: 11px;
color:#888;
}
#msg_div_id {
padding-left: 17px;
padding-top: 4px;

@ -20,15 +20,11 @@
overflow: auto;
background-color: white;
height: 210px;
width: 94%;
border-left: 10px #FFF solid;
}
.inner_lp_toc .scorm_item {
font-size: 11px;
margin-left: 10px;
margin-right:10px;
//cambiado era 20 padding-bottom: 2px;
text-decoration: none;
}
.inner_lp_toc .scorm_item A {
font-size: 11px;

@ -20,15 +20,11 @@
overflow: auto;
background-color: white;
height: 210px;
width: 94%;
border-left: 10px #FFF solid;
}
.inner_lp_toc .scorm_item {
font-size: 11px;
margin-left: 10px;
margin-right:10px;
//cambiado era 20 padding-bottom: 2px;
text-decoration: none;
}
.inner_lp_toc .scorm_item A {
font-size: 11px;

@ -20,14 +20,11 @@
overflow: auto;
background-color: white;
height: 210px;
width: 94%;
border-left: 10px #FFF solid;
}
.inner_lp_toc .scorm_item {
font-size: 11px;
margin-left: 10px;
margin-right:10px;
//cambiado era 20 padding-bottom: 2px;
text-decoration: none;
}
.inner_lp_toc .scorm_item A {

@ -20,14 +20,11 @@
overflow: auto;
background-color: white;
height: 210px;
width: 94%;
border-left: 10px #FFF solid;
}
.inner_lp_toc .scorm_item {
font-size: 11px;
margin-left: 10px;
margin-right:10px;
//cambiado era 20 padding-bottom: 2px;
text-decoration: none;
}
.inner_lp_toc .scorm_item A {

@ -20,14 +20,11 @@
overflow: auto;
background-color: white;
height: 210px;
width: 94%;
border-left: 10px #FFF solid;
}
.inner_lp_toc .scorm_item {
font-size: 11px;
margin-left: 10px;
margin-right:10px;
//cambiado era 20 padding-bottom: 2px;
text-decoration: none;
}
.inner_lp_toc .scorm_item A {
@ -79,8 +76,6 @@
}
.inner_lp_toc .scorm_title_text {
margin-left: 10px;
//padding: 2px;
//cambiado no existe
}
.inner_lp_toc .scorm_status_img {
margin:0px;
@ -106,8 +101,6 @@
/*.scormpage .menu */
.lp_navigation_elem .progresstext {
margin-top: -20px;
//margin-left: 40%;
//em font-size: normal;
}
/*.scormpage .menu */
.lp_navigation_elem .buttons {

@ -1750,14 +1750,6 @@ div.comments {
height: 180px;
}
/*
------------------------------------------------------------------------------
OTHERS
------------------------------------------------------------------------------
*/
.input_titles {
width: 300px;
}
/*
------------------------------------------------------------------------------
Survey
------------------------------------------------------------------------------
@ -2012,18 +2004,10 @@ div.comments {
.actions_lp {
background:#F8F8F8;
height:29px;
padding-left: -17px;
margin: 5px 2px 1px 12px;
vertical-align:middle;
width: 90%;
}
.actions_lp img {
vertical-align:middle;
}
.actions_lp a {
margin-right: 10px;
vertical-align:middle;
}
.actions_lp span {
margin-right: 10px;
vertical-align:middle;

@ -20,14 +20,11 @@
overflow: auto;
background-color: white;
height: 210px;
width: 94%;
border-left: 10px #FFF solid;
}
.inner_lp_toc .scorm_item {
font-size: 11px;
margin-left: 10px;
margin-right:10px;
//cambiado era 20 padding-bottom: 2px;
text-decoration: none;
}
.inner_lp_toc .scorm_item A {
@ -107,7 +104,6 @@
.lp_navigation_elem .progresstext {
margin-top: -20px;
margin-left: 40%;
//em font-size: normal;
}
/*.scormpage .menu */
.lp_navigation_elem .buttons {

@ -416,18 +416,10 @@ ul#navigation .help a{
.actions_lp {
background:#F8F8F8;
height:29px;
padding-left: -17px;
margin: 5px 2px 1px 12px;
vertical-align:middle;
width: 90%;
}
.actions_lp img {
vertical-align:middle;
}
.actions_lp a {
margin-right: 10px;
vertical-align:middle;
}
.actions_lp span {
margin-right: 10px;
vertical-align:middle;

@ -20,8 +20,6 @@
overflow: auto;
background-color: white;
height: 210px;
width: 94%;
border-left: 10px #FFF solid;
}
.inner_lp_toc .scorm_item {
font-size: 11px;

@ -353,18 +353,10 @@ form span.form_error {
.actions_lp {
background:#F8F8F8;
height:29px;
padding-left: -17px;
margin: 5px 2px 1px 12px;
vertical-align:middle;
width: 90%;
}
.actions_lp img {
vertical-align:middle;
}
.actions_lp a {
margin-right: 10px;
vertical-align:middle;
}
.actions_lp span {
margin-right: 10px;
vertical-align:middle;

@ -20,8 +20,6 @@
overflow: auto;
background-color: white;
height: 210px;
width: 94%;
border-left: 10px #FFF solid;
}
.inner_lp_toc .scorm_item {
font-size: 11px;

@ -16,8 +16,6 @@ body {
background-color: #fff;
height: 100%; /* stick */
}
/*
-----------------------------------------------------------------------------
Side-Menu Slider (JQuery) see banner.inc.php
@ -1764,14 +1762,6 @@ div.comments {
height: 180px;
}
/*
------------------------------------------------------------------------------
OTHERS
------------------------------------------------------------------------------
*/
.input_titles {
width: 300px;
}
/*
------------------------------------------------------------------------------
Survey
------------------------------------------------------------------------------
@ -2026,18 +2016,10 @@ div.comments {
.actions_lp {
background:#F8F8F8;
height:29px;
padding-left: -17px;
margin: 5px 2px 1px 12px;
vertical-align:middle;
width: 90%;
}
.actions_lp img {
vertical-align:middle;
}
.actions_lp a {
margin-right: 10px;
vertical-align:middle;
}
.actions_lp span {
margin-right: 10px;
vertical-align:middle;

@ -20,14 +20,11 @@
overflow: auto;
background-color: white;
height: 210px;
width: 94%;
border-left: 10px #FFF solid;
}
.inner_lp_toc .scorm_item {
font-size: 11px;
margin-left: 10px;
margin-right:10px;
//cambiado era 20 padding-bottom: 2px;
text-decoration: none;
}
.inner_lp_toc .scorm_item A {
@ -79,8 +76,6 @@
}
.inner_lp_toc .scorm_title_text {
margin-left: 10px;
//padding: 2px;
//cambiado no existe
}
.inner_lp_toc .scorm_status_img {
margin:0px;
@ -107,7 +102,6 @@
.lp_navigation_elem .progresstext {
margin-top: -20px;
margin-left: 40%;
//em font-size: normal;
}
/*.scormpage .menu */
.lp_navigation_elem .buttons {

@ -1772,14 +1772,6 @@ div.comments {
height: 180px;
}
/*
------------------------------------------------------------------------------
OTHERS
------------------------------------------------------------------------------
*/
.input_titles {
width: 300px;
}
/*
------------------------------------------------------------------------------
Survey
------------------------------------------------------------------------------
@ -2034,18 +2026,10 @@ div.comments {
.actions_lp {
background:#F8F8F8;
height:29px;
padding-left: -17px;
margin: 5px 2px 1px 12px;
vertical-align:middle;
width: 90%;
}
.actions_lp img {
vertical-align:middle;
}
.actions_lp a {
margin-right: 10px;
vertical-align:middle;
}
.actions_lp span {
margin-right: 10px;
vertical-align:middle;

@ -20,14 +20,11 @@
overflow: auto;
background-color: white;
height: 210px;
width: 94%;
border-left: 10px #FFF solid;
}
.inner_lp_toc .scorm_item {
font-size: 11px;
margin-left: 10px;
margin-right:10px;
//cambiado era 20 padding-bottom: 2px;
text-decoration: none;
}
.inner_lp_toc .scorm_item A {
@ -107,7 +104,6 @@
.lp_navigation_elem .progresstext {
margin-top: -20px;
margin-left: 40%;
//em font-size: normal;
}
/*.scormpage .menu */
.lp_navigation_elem .buttons {

@ -1663,14 +1663,6 @@ padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;}
height: 180px;
}
/*
------------------------------------------------------------------------------
OTHERS
------------------------------------------------------------------------------
*/
.input_titles {
width: 300px;
}
/*
------------------------------------------------------------------------------
Survey
------------------------------------------------------------------------------
@ -1906,21 +1898,11 @@ padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;}
/* actions */
.actions_lp {
background:#F8F8F8;
//border-bottom:1px solid #999999;
//border-top:1px solid #999999;
height:29px;
padding-left: -17px;
margin: 5px 2px 1px 12px;
vertical-align:middle;
width: 90%;
}
.actions_lp img {
vertical-align:middle;
}
.actions_lp a {
margin-right: 10px;
vertical-align:middle;
}
.actions_lp span {
margin-right: 10px;
vertical-align:middle;

@ -20,8 +20,6 @@
overflow: auto;
background-color: white;
height: 210px;
width: 94%;
border-left: 10px #FFF solid;
}
.inner_lp_toc .scorm_item {
font-size: 11px;
@ -105,7 +103,6 @@
.lp_navigation_elem .progresstext {
margin-top: -20px;
margin-left: 40%;
//em font-size: normal;
}
/*.scormpage .menu */
.lp_navigation_elem .buttons {

@ -1782,14 +1782,6 @@ input.forms {
display: none;
}
/*
------------------------------------------------------------------------------
OTHERS
------------------------------------------------------------------------------
*/
.input_titles {
width: 300px;
}
/*
------------------------------------------------------------------------------
Survey
------------------------------------------------------------------------------
@ -2025,21 +2017,11 @@ input.forms {
/* actions */
.actions_lp {
background:#F8F8F8;
/*border-bottom:1px solid #999999; */
/*border-top:1px solid #999999; */
height:29px;
padding-left: -17px;
margin: 5px 2px 1px 12px;
vertical-align:middle;
width: 90%;
}
.actions_lp img {
vertical-align:middle;
}
.actions_lp a {
margin-right: 10px;
vertical-align:middle;
}
.actions_lp span {
margin-right: 10px;
vertical-align:middle;

@ -20,8 +20,6 @@
overflow: auto;
background-color: white;
height: 210px;
width: 94%;
border-left: 10px #FFF solid;
}
.inner_lp_toc .scorm_item {
font-size: 11px;

@ -1760,14 +1760,6 @@ div.comments {
height: 180px;
}
/*
------------------------------------------------------------------------------
OTHERS
------------------------------------------------------------------------------
*/
.input_titles {
width: 300px;
}
/*
------------------------------------------------------------------------------
Survey
------------------------------------------------------------------------------
@ -2022,18 +2014,10 @@ div.comments {
.actions_lp {
background:#F8F8F8;
height:29px;
padding-left: -17px;
margin: 5px 2px 1px 12px;
vertical-align:middle;
width: 90%;
}
.actions_lp img {
vertical-align:middle;
}
.actions_lp a {
margin-right: 10px;
vertical-align:middle;
}
.actions_lp span {
margin-right: 10px;
vertical-align:middle;

@ -20,14 +20,11 @@
overflow: auto;
background-color: white;
height: 210px;
width: 94%;
border-left: 10px #FFF solid;
}
.inner_lp_toc .scorm_item {
font-size: 11px;
margin-left: 10px;
margin-right:10px;
//cambiado era 20 padding-bottom: 2px;
text-decoration: none;
}
.inner_lp_toc .scorm_item A {
@ -79,8 +76,6 @@
}
.inner_lp_toc .scorm_title_text {
margin-left: 10px;
//padding: 2px;
//cambiado no existe
}
.inner_lp_toc .scorm_status_img {
margin:0px;
@ -107,7 +102,6 @@
.lp_navigation_elem .progresstext {
margin-top: -20px;
margin-left: 40%;
//em font-size: normal;
}
/*.scormpage .menu */
.lp_navigation_elem .buttons {

@ -1768,14 +1768,6 @@ div.comments {
height: 180px;
}
/*
------------------------------------------------------------------------------
OTHERS
------------------------------------------------------------------------------
*/
.input_titles {
width: 300px;
}
/*
------------------------------------------------------------------------------
Survey
------------------------------------------------------------------------------
@ -2030,18 +2022,10 @@ div.comments {
.actions_lp {
background:#F8F8F8;
height:29px;
padding-left: -17px;
margin: 5px 2px 1px 12px;
vertical-align:middle;
width: 90%;
}
.actions_lp img {
vertical-align:middle;
}
.actions_lp a {
margin-right: 10px;
vertical-align:middle;
}
.actions_lp span {
margin-right: 10px;
vertical-align:middle;

@ -20,14 +20,11 @@
overflow: auto;
background-color: white;
height: 210px;
width: 94%;
border-left: 10px #FFF solid;
}
.inner_lp_toc .scorm_item {
font-size: 11px;
margin-left: 10px;
margin-right:10px;
//cambiado era 20 padding-bottom: 2px;
text-decoration: none;
}
.inner_lp_toc .scorm_item A {
@ -107,7 +104,6 @@
.lp_navigation_elem .progresstext {
margin-top: -20px;
margin-left: 40%;
//em font-size: normal;
}
/*.scormpage .menu */
.lp_navigation_elem .buttons {

File diff suppressed because it is too large Load Diff

@ -0,0 +1,8 @@
@import url('bootstrap.css');
/* Adding default style for the chamilo_X themes */
@import url('../base_chamilo.css');
footer a:link, footer a:visited {
color:black;
}

@ -1749,14 +1749,6 @@ padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;}
display: none;
}
/*
------------------------------------------------------------------------------
OTHERS
------------------------------------------------------------------------------
*/
.input_titles {
width: 300px;
}
/*
------------------------------------------------------------------------------
Survey
------------------------------------------------------------------------------
@ -1979,10 +1971,6 @@ padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;}
.actions_lp {
background:#F8F8F8;
height:29px;
padding-left: -17px;
margin: 5px 2px 1px 12px;
vertical-align:middle;
width: 90%;
}
.actions_lp img {
vertical-align:middle;

@ -20,8 +20,6 @@
overflow: auto;
background-color: white;
height: 210px;
width: 94%;
border-left: 10px #FFF solid;
}
.inner_lp_toc .scorm_item {
font-size: 11px;

@ -1518,14 +1518,6 @@ padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;}
display: none;
}
/*
------------------------------------------------------------------------------
OTHERS
------------------------------------------------------------------------------
*/
.input_titles {
width: 300px;
}
/*
------------------------------------------------------------------------------
Survey
------------------------------------------------------------------------------
@ -1755,18 +1747,10 @@ padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;}
.actions_lp {
background:#F8F8F8;
height:29px;
padding-left: -17px;
margin: 5px 2px 1px 12px;
vertical-align:middle;
width: 90%;
}
.actions_lp img {
vertical-align:middle;
}
.actions_lp a {
margin-right: 10px;
vertical-align:middle;
}
.actions_lp span {
margin-right: 10px;
vertical-align:middle;

@ -20,14 +20,11 @@
overflow: auto;
background-color: white;
height: 210px;
width: 94%;
border-left: 10px #FFF solid;
}
.inner_lp_toc .scorm_item {
font-size: 11px;
margin-left: 10px;
margin-right:10px;
//cambiado era 20 padding-bottom: 2px;
text-decoration: none;
}
.inner_lp_toc .scorm_item A {
@ -102,7 +99,6 @@
.lp_navigation_elem .progresstext {
margin-top: -20px;
margin-left: 40%;
//em font-size: normal;
}
/*.scormpage .menu */
.lp_navigation_elem .buttons {

@ -1721,14 +1721,6 @@ div.comments {
height: 180px;
}
/*
------------------------------------------------------------------------------
OTHERS
------------------------------------------------------------------------------
*/
.input_titles {
width: 300px;
}
/*
------------------------------------------------------------------------------
Survey
------------------------------------------------------------------------------
@ -1982,18 +1974,10 @@ div.comments {
.actions_lp {
background:#F8F8F8;
height:29px;
padding-left: -17px;
margin: 5px 2px 1px 12px;
vertical-align:middle;
width: 90%;
}
.actions_lp img {
vertical-align:middle;
}
.actions_lp a {
margin-right: 10px;
vertical-align:middle;
}
.actions_lp span {
margin-right: 10px;
vertical-align:middle;

@ -20,14 +20,11 @@
overflow: auto;
background-color: white;
height: 210px;
width: 94%;
border-left: 10px #FFF solid;
}
.inner_lp_toc .scorm_item {
font-size: 11px;
margin-left: 10px;
margin-right:10px;
//cambiado era 20 padding-bottom: 2px;
text-decoration: none;
}
.inner_lp_toc .scorm_item A {
@ -107,7 +104,6 @@
.lp_navigation_elem .progresstext {
margin-top: -20px;
margin-left: 40%;
//em font-size: normal;
}
/*.scormpage .menu */
.lp_navigation_elem .buttons {

@ -1468,19 +1468,10 @@ div.system_announcement {
.actions_lp {
background:#F8F8F8;
height:29px;
padding-left: -17px;
margin-bottom: 1px;
vertical-align:middle;
width: 90%;
margin-left:17px;
}
.actions_lp img {
vertical-align:middle;
}
.actions_lp a {
margin-right: 10px;
vertical-align:middle;
}
.actions_lp span {
margin-right: 10px;
vertical-align:middle;

@ -20,8 +20,6 @@
overflow: auto;
background-color: white;
height: 210px;
width: 94%;
border-left: 10px #FFF solid;
}
.inner_lp_toc .scorm_item {
font-size: 11px;

File diff suppressed because it is too large Load Diff

@ -0,0 +1,8 @@
@import url('bootstrap.css');
/* Adding default style for the chamilo_X themes */
@import url('../base_chamilo.css');
footer a:link, footer a:visited {
color:#366DDC;
}

@ -1407,14 +1407,6 @@ padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;}
display: none;
}
/*
------------------------------------------------------------------------------
OTHERS
------------------------------------------------------------------------------
*/
.input_titles {
width: 300px;
}
/*
------------------------------------------------------------------------------
Survey
------------------------------------------------------------------------------
@ -1694,21 +1686,11 @@ padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px;}
/* actions */
.actions_lp {
background:#F8F8F8;
//border-bottom:1px solid #999999;
//border-top:1px solid #999999;
height:29px;
padding-left: -17px;
margin: 5px 2px 1px 12px;
vertical-align:middle;
width: 90%;
}
.actions_lp img {
vertical-align:middle;
}
.actions_lp a {
margin-right: 10px;
vertical-align:middle;
}
.actions_lp span {
margin-right: 10px;
vertical-align:middle;

@ -20,8 +20,6 @@
overflow: auto;
background-color: white;
height: 210px;
width: 94%;
border-left: 10px #FFF solid;
}
.inner_lp_toc .scorm_item {
font-size: 11px;

File diff suppressed because it is too large Load Diff

@ -0,0 +1,8 @@
@import url('bootstrap.css');
/* Adding default style for the chamilo_X themes */
@import url('../base_chamilo.css');
footer a:link, footer a:visited {
color: #4183C4;
}

@ -1752,14 +1752,6 @@ div.comments {
height: 180px;
}
/*
------------------------------------------------------------------------------
OTHERS
------------------------------------------------------------------------------
*/
.input_titles {
width: 300px;
}
/*
------------------------------------------------------------------------------
Survey
------------------------------------------------------------------------------

@ -1696,19 +1696,7 @@ div.comments {
width: 100%;
height: 180px;
}
/*
------------------------------------------------------------------------------
OTHERS
------------------------------------------------------------------------------
*/
.input_titles {
width: 300px;
}
/*
------------------------------------------------------------------------------
Survey
------------------------------------------------------------------------------
*/
/* Survey */
#survey_title {
background-color:#264269;
color:#FFF;
@ -1959,18 +1947,10 @@ div.comments {
.actions_lp {
background:#F8F8F8;
height:29px;
padding-left: -17px;
margin: 5px 2px 1px 12px;
vertical-align:middle;
width: 90%;
}
.actions_lp img {
vertical-align:middle;
}
.actions_lp a {
margin-right: 10px;
vertical-align:middle;
}
.actions_lp span {
margin-right: 10px;
vertical-align:middle;

@ -20,14 +20,11 @@
overflow: auto;
background-color: white;
height: 210px;
width: 94%;
border-left: 10px #FFF solid;
}
.inner_lp_toc .scorm_item {
font-size: 11px;
margin-left: 10px;
margin-right:10px;
//cambiado era 20 padding-bottom: 2px;
text-decoration: none;
}
.inner_lp_toc .scorm_item A {
@ -107,7 +104,6 @@
.lp_navigation_elem .progresstext {
margin-top: -20px;
margin-left: 40%;
//em font-size: normal;
}
/*.scormpage .menu */
.lp_navigation_elem .buttons {

@ -59,15 +59,8 @@ function InnerDialogLoaded() {
var temp=false;
var temp2=false;
var use_document_title='.api_get_setting('use_document_title').';
var load_default_template = '. ((isset($_POST['submit']) || empty($_SERVER['QUERY_STRING'])) ? 'false' : 'true' ) .';
function launch_templates() {
//document.getElementById(\'frmModel\').style.display="block";
//document.getElementById(\'content___Frame\').width=\'70%\';
//window.frames[0].FCKToolbarItems.GetItem("Template").Click;
}
function FCKeditor_OnComplete( editorInstance ) {
editorInstance.Events.AttachEvent( \'OnSelectionChange\', check_for_title ) ;
document.getElementById(\'frmModel\').innerHTML = "<iframe style=\'height: 525px; width: 180px;\' scrolling=\'no\' frameborder=\'0\' src=\''.api_get_path(WEB_LIBRARY_PATH).'fckeditor/editor/fckdialogframe.html \'>";
@ -121,16 +114,6 @@ function InnerDialogLoaded() {
bestandsnaamNieuw += contentTextArray[x];
}
}
// comment see FS#3335
// if(document.getElementById(\'title_edited\').value == "false")
// {
// document.getElementById(\'filename\').value = bestandsnaamNieuw;
// if(use_document_title){
// document.getElementById(\'title\').value = bestandsnaamNieuw;
// }
// }
}
temp=true;
}
@ -144,13 +127,6 @@ function InnerDialogLoaded() {
}
return s;
}
function check_if_still_empty() {
if(trim(document.getElementById(\'filename\').value) != "") {
document.getElementById(\'title_edited\').value = "true";
}
}
function setFocus() {
$("#document_title").focus();
}
@ -165,7 +141,6 @@ require_once api_get_path(LIBRARY_PATH).'document.lib.php';
require_once api_get_path(SYS_CODE_PATH).'document/document.inc.php';
require_once api_get_path(LIBRARY_PATH).'groupmanager.lib.php';
//I'm in the certification module?
$is_certificate_mode = false;
@ -330,7 +305,8 @@ $renderer = & $form->defaultRenderer();
// Hidden element with current directory
$form->addElement('hidden', 'id');
$default['id'] = $folder_id;
$defaults = array();
$defaults['id'] = $folder_id;
// Filename
$form->addElement('hidden', 'title_edited', 'false', 'id="title_edited"');
@ -347,23 +323,11 @@ function document_exists($filename) {
return !file_exists($filepath.$filename.'.html');
}
$filename_template = str_replace('{element}', '{element}', $renderer->_elementTemplate); // TODO: What is the point of this statement?
$renderer->setElementTemplate($filename_template, 'filename');
// Initialize group array
$group = array();
// If allowed, add element for document title
if (api_get_setting('use_document_title') == 'true') {
$group[]=$form->createElement('text','title',get_lang('Title'),'class="input_titles" id="document_title"');
// Added by Ivan Tcholakov, 10-OCT-2009.
$form->addElement('hidden', 'filename', '', array('id' => 'filename'));
//
// Add group to the form
if ($is_certificate_mode) {
$form->addElement('text', 'title', get_lang('CertificateName'), 'class="span4" id="document_title"');
} else {
// replace the add_textfield with this
$group[]=$form->createElement('text', 'filename', get_lang('FileName'), 'class="input_titles" id="document_title" onblur="javascript: check_if_still_empty();"');
// Added by Ivan Tcholakov, 10-OCT-2009.
$form->addElement('hidden', 'title', '', array('id' => 'title'));
$form->addElement('text', 'title', get_lang('Title'), 'class="span4" id="document_title"');
}
// Show read-only box only in groups
@ -371,29 +335,9 @@ if (!empty($_SESSION['_gid'])) {
$group[]= $form->createElement('checkbox', 'readonly', '', get_lang('ReadOnly'));
}
// Add group to the form
if ($is_certificate_mode)
$form->addGroup($group, 'filename_group', get_lang('CertificateName') ,'&nbsp;&nbsp;&nbsp;', false);
else
$form->addGroup($group, 'filename_group', api_get_setting('use_document_title') == 'true' ? get_lang('Title') : get_lang('FileName') ,'&nbsp;&nbsp;&nbsp;', false);
$form->addRule('filename_group', get_lang('ThisFieldIsRequired'), 'required');
if (api_get_setting('use_document_title') == 'true') {
$form->addGroupRule('filename_group', array(
'title' => array(
array(get_lang('ThisFieldIsRequired'), 'required'),
array(get_lang('FileExists'),'callback', 'document_exists')
)
));
} else {
$form->addGroupRule('filename_group', array(
'filename' => array(
array(get_lang('ThisFieldIsRequired'), 'required'),
array(get_lang('FileExists'),'callback', 'document_exists')
)
));
}
$form->addRule('title', get_lang('ThisFieldIsRequired'), 'required');
$form->addRule('title', get_lang('FileExists'), 'callback', 'document_exists');
$current_session_id = api_get_session_id();
@ -415,7 +359,7 @@ if (!$is_certificate_mode && !is_my_shared_folder($_user['user_id'], $dir, $curr
// Following two conditions copied from document.inc.php::build_directory_selector()
$folder_titles = array();
if (api_get_setting('use_document_title') == 'true') {
if (is_array($folders)) {
$escaped_folders = array();
foreach ($folders as $key => & $val) {
@ -447,13 +391,6 @@ if (!$is_certificate_mode && !is_my_shared_folder($_user['user_id'], $dir, $curr
$folder_titles[$obj->path] = $obj->title;
}
}
} else {
if (is_array($folders)) {
foreach ($folders as & $folder) {
$folder_titles[$folder] = basename($folder);
}
}
}
if (empty($group_dir)) {
$parent_select -> addOption(get_lang('HomeDirectory'), '/');
@ -504,15 +441,13 @@ if (!$is_certificate_mode && !is_my_shared_folder($_user['user_id'], $dir, $curr
}
}
}
//$form->addElement('textarea', 'comment', get_lang('Comment'), array ('rows' => 5, 'cols' => 50));
if ($is_certificate_mode)
$form->addElement('style_submit_button', 'submit', get_lang('CreateCertificate'), 'class="save"');
else
$form->addElement('style_submit_button', 'submit', get_lang('langCreateDoc'), 'class="save"');
$form->setDefaults($default);
$form->setDefaults($defaults);
// If form validates -> save the new document
if ($form->validate()) {
@ -524,24 +459,22 @@ if ($form->validate()) {
if (!empty($values['curdirpath'])) {
$dir = $values['curdirpath'];
}
if ($dir[strlen($dir) - 1] != '/') {
$dir .= '/';
}
if (api_get_setting('use_document_title') != 'true') {
$values['title'] = $values['filename'];
} else {
$values['filename'] = $values['title'];
}
$values['filename'] = addslashes(trim($values['filename']));
$values['filename'] = Security::remove_XSS($values['filename']);
$values['filename'] = replace_dangerous_char($values['filename']);
$values['filename'] = disable_dangerous_file($values['filename']);
//Setting the filename
$filename = $values['title'];
$filename = addslashes(trim($filename));
$filename = Security::remove_XSS($filename);
$filename = replace_dangerous_char($filename);
$filename = disable_dangerous_file($filename);
$filename = $values['filename'];
//Setting the title
$title = $values['title'];
//Setting the extension
$extension = 'html';
$content = Security::remove_XSS($values['content'], COURSEMANAGERLOWSECURITY);

@ -20,7 +20,7 @@ function build_directory_selector($folders, $document_id, $group_dir = '', $chan
$doc_table = Database::get_course_table(TABLE_DOCUMENT);
$course_id = api_get_course_int_id();
$folder_titles = array();
if (api_get_setting('use_document_title') == 'true') {
if (is_array($folders)) {
$escaped_folders = array();
foreach ($folders as $key => & $val) {
@ -35,13 +35,7 @@ function build_directory_selector($folders, $document_id, $group_dir = '', $chan
$folder_titles[$obj->path] = $obj->title;
}
}
} else {
if (is_array($folders)) {
foreach ($folders as & $folder) {
$folder_titles[$folder] = basename($folder);
}
}
}
$form = new FormValidator('selector', 'GET', api_get_self().'?'.api_get_cidreq());
$form->addElement('hidden', 'cidReq', api_get_course_id());
@ -111,10 +105,9 @@ function create_document_link($document_data, $show_as_icon = false, $counter =
}
$course_info = api_get_course_info();
$www = api_get_path(WEB_COURSE_PATH).$course_info['path'].'/document';
$use_document_title = api_get_setting('use_document_title');
// Get the title or the basename depending on what we're using
if ($use_document_title == 'true' && $document_data['title'] != '') {
if ($document_data['title'] != '') {
$title = $document_data['title'];
} else {
$title = basename($document_data['path']);
@ -684,9 +677,8 @@ function build_move_to_selector($folders, $curdirpath, $move_file, $group_dir =
if (($curdirpath != $folder) && ($folder != $move_file) && (substr($folder, 0, strlen($move_file) + 1) != $move_file.'/')) {
$path_displayed = $folder;
// If document title is used, we have to display titles instead of real paths...
if (api_get_setting('use_document_title')) {
$path_displayed = get_titles_of_path($folder);
}
if (empty($path_displayed)) {
$path_displayed = get_lang('Untitled');
}
@ -697,9 +689,7 @@ function build_move_to_selector($folders, $curdirpath, $move_file, $group_dir =
} else {
foreach ($folders as $folder) {
if (($curdirpath != $folder) && ($folder != $move_file) && (substr($folder, 0, strlen($move_file) + 1) != $move_file.'/')) { // Cannot copy dir into his own subdir
if (api_get_setting('use_document_title')) {
$path_displayed = get_titles_of_path($folder);
}
$display_folder = substr($path_displayed,strlen($group_dir));
$display_folder = ($display_folder == '') ? get_lang('Documents') : $display_folder;
$form .= '<option value="'.$folder.'">'.$display_folder.'</option>';

@ -921,10 +921,6 @@ $table_footer = '';
$total_size = 0;
if (isset($docs_and_folders) && is_array($docs_and_folders)) {
// Do we need the title field for the document name or not?
// We get the setting here, so we only have to do it once
$use_document_title = api_get_setting('use_document_title');
// Create a sortable table with our data
$sortable_data = array();
@ -946,7 +942,7 @@ if (isset($docs_and_folders) && is_array($docs_and_folders)) {
$size = $document_data['filetype'] == 'folder' ? get_total_folder_size($document_data['path'], $is_allowed_to_edit) : $document_data['size'];
// Get the title or the basename depending on what we're using
if ($use_document_title == 'true' && $document_data['title'] != '') {
if ($document_data['title'] != '') {
$document_name = $document_data['title'];
} else {
$document_name = basename($document_data['path']);

@ -717,10 +717,6 @@ $table_footer = '';
$total_size = 0;
if (isset($docs_and_folders) && is_array($docs_and_folders)) {
// Do we need the title field for the document name or not?
// We get the setting here, so we only have to do it once
$use_document_title = api_get_setting('use_document_title');
// Create a sortable table with our data
$sortable_data = array();
@ -744,7 +740,7 @@ if (isset($docs_and_folders) && is_array($docs_and_folders)) {
$row['size'] = format_file_size($size);
// Get the title or the basename depending on what we're using
if ($use_document_title == 'true' && $document_data['title'] != '') {
if ($document_data['title'] != '') {
$document_name = $document_data['title'];
} else {
$document_name = basename($document_data['path']);

@ -153,8 +153,6 @@ if ($is_certificate_mode) {
}
$is_allowed_to_edit = api_is_allowed_to_edit(null, true) || $_SESSION['group_member_with_upload_rights']|| is_my_shared_folder(api_get_user_id(), $dir, $current_session_id);
$use_document_title = api_get_setting('use_document_title') == 'true';
$noPHP_SELF = true;
/* Other initialization code */
@ -371,11 +369,7 @@ if ($owner_id == api_get_user_id() || api_is_platform_admin() || $is_allowed_to_
$form->add_textfield('title', get_lang('Title'));
if ($use_document_title) {
$defaults['title'] = $document_data['title'];
} else {
$form->addElement('hidden', 'renameTo');
}
$form->addElement('hidden', 'formSent');
$defaults['formSent'] = 1;

@ -228,10 +228,8 @@ $label = get_lang('MaxFileSize').': '.ini_get('upload_max_filesize').'<br/>'.get
$form->addElement('file', 'file', array(get_lang('File'), $label), 'id="user_upload" size="45"');
if (api_get_setting('use_document_title') == 'true') {
$form->addElement('text', 'title', get_lang('Title'), array('size' => '20', 'style' => 'width:300px', 'id' => 'title_file'));
$form->addElement('textarea', 'comment', get_lang('Comment'), 'wrap="virtual" style="width:300px;"');
}
$advanced = '<a href="javascript://" onclick=" return advanced_parameters()"><span id="img_plus_and_minus"><div style="vertical-align:top;" ><img style="vertical-align:middle;" src="../img/div_show.gif" alt="" />&nbsp;'.get_lang('AdvancedParameters').'</div></span></a>';
// Advanced parameters

@ -115,8 +115,6 @@ if ($page < 0) {
$page = 1;
}
if (!empty($_GET['gradebook']) && $_GET['gradebook']=='view' ) {
$_SESSION['gradebook']=Security::remove_XSS($_GET['gradebook']);
$gradebook= $_SESSION['gradebook'];
@ -216,26 +214,28 @@ if ($is_allowedToEdit) {
$objExerciseTmp = new Exercise();
$check = Security::check_token('get');
$exercise_action_locked = api_resource_is_locked_by_gradebook($exerciseId);
if ($objExerciseTmp->read($exerciseId)) {
if ($check) {
switch ($choice) {
case 'delete' : // deletes an exercise
if ($exercise_action_locked == false) {
$objExerciseTmp->delete();
require_once api_get_path(SYS_CODE_PATH).'gradebook/lib/gradebook_functions.inc.php';
$link_id = is_resource_in_course_gradebook(api_get_course_id(), 1 , $exerciseId, api_get_session_id());
if ($link_id !== false) {
remove_resource_from_course_gradebook($link_id);
$link_info = is_resource_in_course_gradebook(api_get_course_id(), 1 , $exerciseId, api_get_session_id());
if ($link_info !== false) {
remove_resource_from_course_gradebook($link_info['id']);
}
Display :: display_confirmation_message(get_lang('ExerciseDeleted'));
}
break;
case 'enable' : // enables an exercise
$objExerciseTmp->enable();
$objExerciseTmp->save();
api_item_property_update($course_info, TOOL_QUIZ, $objExerciseTmp->id,'visible', api_get_user_id());
// "WHAT'S NEW" notification: update table item_property (previously last_tooledit)
Display :: display_confirmation_message(get_lang('VisibilityChanged'));
break;
case 'disable' : // disables an exercise
$objExerciseTmp->disable();
@ -254,8 +254,10 @@ if ($is_allowedToEdit) {
Display :: display_confirmation_message(get_lang('ResultsEnabled'));
break;
case 'clean_results' : //clean student results
if ($exercise_action_locked == false) {
$quantity_results_deleted= $objExerciseTmp->clean_results();
Display :: display_confirmation_message(sprintf(get_lang('XResultsCleaned'),$quantity_results_deleted));
}
break;
case 'copy_exercise' : //copy an exercise
$objExerciseTmp->copy_exercise();
@ -453,6 +455,9 @@ if (!empty($exercise_list)) {
if (!empty($exercise_list))
foreach ($exercise_list as $row) {
$my_exercise_id = $row['id'];
$locked = api_resource_is_locked_by_gradebook($my_exercise_id);
//echo '<div id="tabs-'.$i.'">';
$i++;
//validacion when belongs to a session
@ -571,7 +576,11 @@ if (!empty($exercise_list)) {
//Export
$actions .= Display::url(Display::return_icon('cd.gif', get_lang('CopyExercise')), '', array('onclick'=>"javascript:if(!confirm('".addslashes(api_htmlentities(get_lang('AreYouSureToCopy'),ENT_QUOTES,$charset))." ".addslashes($row['title'])."?"."')) return false;",'href'=>'exercice.php?'.api_get_cidreq().'&choice=copy_exercise&sec_token='.$token.'&exerciseId='.$row['id']));
//Clean exercise
if ($locked == false) {
$actions .= Display::url(Display::return_icon('clean.png', get_lang('CleanStudentResults'),'',ICON_SIZE_SMALL),'', array('onclick'=>"javascript:if(!confirm('".addslashes(api_htmlentities(get_lang('AreYouSureToDeleteResults'),ENT_QUOTES,$charset))." ".addslashes($row['title'])."?"."')) return false;",'href'=>'exercice.php?'.api_get_cidreq().'&choice=clean_results&sec_token='.$token.'&exerciseId='.$row['id']));
} else {
$actions .= Display::return_icon('clean_na.png', get_lang('ResourceLockedByGradebook'),'',ICON_SIZE_SMALL);
}
//Visible / invisible
if ($row['active']) {
$actions .= Display::url(Display::return_icon('visible.png', get_lang('Deactivate'),'',ICON_SIZE_SMALL) , 'exercice.php?'.api_get_cidreq().'&choice=disable&sec_token='.$token.'&page='.$page.'&exerciseId='.$row['id']);
@ -589,7 +598,11 @@ if (!empty($exercise_list)) {
//Delete
if ($session_id == $row['session_id']) {
if ($locked == false) {
$actions .= Display::url(Display::return_icon('delete.png', get_lang('Delete'),'',ICON_SIZE_SMALL), '', array('onclick'=>"javascript:if(!confirm('".addslashes(api_htmlentities(get_lang('AreYouSureToDelete'),ENT_QUOTES,$charset))." ".addslashes($row['title'])."?"."')) return false;",'href'=>'exercice.php?'.api_get_cidreq().'&choice=delete&sec_token='.$token.'&exerciseId='.$row['id']));
} else {
$actions .= Display::return_icon('delete_na.png', get_lang('ResourceLockedByGradebook'),'',ICON_SIZE_SMALL);
}
}
// Number of questions

@ -1028,6 +1028,8 @@ function get_exam_results_data($from, $number_of_items, $column, $direction, $ex
$user_list_id = array ();
$duration_list = '';
$locked = api_resource_is_locked_by_gradebook($exercise_id);
for ($i = 0; $i < $sizeof; $i++) {
$revised = $results[$i]['revised'];
@ -1120,9 +1122,11 @@ function get_exam_results_data($from, $number_of_items, $column, $direction, $ex
}
}
if (api_is_platform_admin() || $is_tutor) {
if ($locked == false) {
$actions .=' <a href="exercise_report.php?'.api_get_cidreq().'&filter_by_user='.intval($_GET['filter_by_user']).'&filter=' . $filter . '&exerciseId='.$exercise_id.'&delete=delete&did=' . $id . '" onclick="javascript:if(!confirm(\'' . sprintf(get_lang('DeleteAttempt'), $user, $dt) . '\')) return false;">'.Display :: return_icon('delete.png', get_lang('Delete')).'</a>';
$actions .='&nbsp;';
}
}
} else {
$attempt_url = api_get_path(WEB_CODE_PATH).'exercice/result.php?'.api_get_cidreq().'&id='.$results[$i]['exe_id'].'&id_session='.api_get_session_id().'&height=500&width=750';
$attempt_link = Display::url(get_lang('Show'), $attempt_url, array('class'=>'ajax btn'));
@ -1333,7 +1337,7 @@ function get_all_exercises_for_course_id($course_info = null, $session_id = 0, $
* @param int session id
* @return int the position of the user between his friends in a course (or course within a session)
*/
function get_exercise_result_ranking($my_score, $my_exe_id, $exercise_id, $course_code, $session_id = 0, $user_list, $return_string = true) {
function get_exercise_result_ranking($my_score, $my_exe_id, $exercise_id, $course_code, $session_id = 0, $user_list = array(), $return_string = true) {
//No score given we return
if (is_null($my_score)) {
return '-';
@ -1341,8 +1345,8 @@ function get_exercise_result_ranking($my_score, $my_exe_id, $exercise_id, $cours
if (empty($user_list)) {
return '-';
}
$best_attempts = array();
$best_attempts = array();
foreach ($user_list as $user_data) {
$user_id = $user_data['user_id'];
$best_attempts[$user_id]= get_best_attempt_by_user($user_id, $exercise_id, $course_code, $session_id);

@ -58,6 +58,9 @@ $TBL_LP_ITEM_VIEW = Database :: get_course_table(TABLE_LP_ITEM_VIEW);
$course_id = api_get_course_int_id();
$exercise_id = isset($_REQUEST['exerciseId']) ? intval($_REQUEST['exerciseId']) : null;
$locked = api_resource_is_locked_by_gradebook($exercise_id);
if (empty($exercise_id)) {
api_not_allowed();
}
@ -222,7 +225,7 @@ if ($is_allowedToEdit && $origin != 'learnpath') {
}
//Deleting an attempt
if ( ($is_allowedToEdit || $is_tutor || api_is_coach()) && $_GET['delete'] == 'delete' && !empty ($_GET['did'])) {
if ( ($is_allowedToEdit || $is_tutor || api_is_coach()) && $_GET['delete'] == 'delete' && !empty ($_GET['did']) && $locked == false) {
$exe_id = intval($_GET['did']);
if (!empty($exe_id)) {
$sql = 'DELETE FROM '.$TBL_TRACK_EXERCICES.' WHERE exe_id = '.$exe_id;
@ -231,6 +234,7 @@ if ( ($is_allowedToEdit || $is_tutor || api_is_coach()) && $_GET['delete'] == 'd
Database::query($sql);
header('Location: exercise_report.php?cidReq=' . Security::remove_XSS($_GET['cidReq']) . '&exerciseId='.$exercise_id);
exit;
}
}

@ -36,11 +36,7 @@ else
// Database table definitions
$TBL_EXERCICE_QUESTION = Database::get_course_table(TABLE_QUIZ_TEST_QUESTION);
$TBL_EXERCICES = Database::get_course_table(TABLE_QUIZ_TEST);
$TBL_QUESTIONS = Database::get_course_table(TABLE_QUIZ_QUESTION);
$TBL_REPONSES = Database::get_course_table(TABLE_QUIZ_ANSWER);
$main_user_table = Database::get_main_table(TABLE_MAIN_USER);
$main_course_user_table = Database::get_main_table(TABLE_MAIN_COURSE_USER);
$TBL_TRACK_EXERCICES = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_EXERCICES);
$TBL_TRACK_ATTEMPT = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_ATTEMPT);
@ -58,9 +54,7 @@ if ( empty ( $objExercise ) ) { $objExercise = $_SESSION['objExercise
if ( empty ( $exeId ) ) { $exeId = $_REQUEST['id'];}
if ( empty ( $action ) ) { $action = $_REQUEST['action']; }
//$emailId = $_REQUEST['email'];
$id = intval($_REQUEST['id']); //exe id
$current_time = time();
if (empty($id)) {
api_not_allowed();
@ -83,9 +77,10 @@ $student_id = $track_exercise_info['exe_user_id'];
$learnpath_id = $track_exercise_info['orig_lp_id'];
$learnpath_item_id = $track_exercise_info['orig_lp_item_id'];
$lp_item_view_id = $track_exercise_info['orig_lp_item_view_id'];
$course_code = api_get_course_id();
$current_user_id = api_get_user_id();
$locked = api_resource_is_locked_by_gradebook($exercise_id);
if (empty($objExercise)) {
$objExercise = new Exercise();
$objExercise->read($exercise_id);
@ -161,7 +156,6 @@ function getFCK(vals,marksid) {
oHidden.value = oEditor.GetXHTML(true);
f.appendChild(oHidden);
}
//f.submit();
}
</script>
<?php
@ -211,7 +205,7 @@ if (!empty($track_exercise_info)) {
if ($origin == 'learnpath' && !isset($_GET['fb_type']) ) {
$show_results = false;
}
$html = '';
if ($show_results || $show_only_total_score) {
$user_info = api_get_user_info($student_id);
//Shows exercise header
@ -280,11 +274,9 @@ foreach ($questionList as $questionId) {
// creates a temporary Question object
$objQuestionTmp = Question::read($questionId);
$questionName = $objQuestionTmp->selectTitle();
$questionDescription= $objQuestionTmp->selectDescription();
$questionWeighting = $objQuestionTmp->selectWeighting();
$answerType = $objQuestionTmp->selectType();
$quesId = $objQuestionTmp->selectId();
if ($show_results) {
// display question category, if any
@ -493,10 +485,10 @@ foreach ($questionList as $questionId) {
}
if ($show_results) {
echo '<table width="100%" border="0" cellspacing="3" cellpadding="0">';
if ($is_allowedToEdit) {
if ($is_allowedToEdit && $locked == false) {
echo '<tr><td>';
$name = "fckdiv".$questionId;
$marksname = "marksName".$questionId;
@ -536,6 +528,7 @@ foreach ($questionList as $questionId) {
$feedback_form->setDefaults(${user.$questionId});
$feedback_form->display();
echo '</div>';
} else {
$comnt = get_comments($id,$questionId);
echo '<tr><td><br />';
@ -616,7 +609,7 @@ if (is_array($arrid) && is_array($arrmarks)) {
$marksid = implode(",",$arrmarks);
}
if ($is_allowedToEdit) {
if ($is_allowedToEdit && $locked == false) {
if (in_array($origin, array('tracking_course','user_course','correct_exercise_in_lp'))) {
echo ' <form name="myform" id="myform" action="exercise_report.php?exerciseId='.$exercise_id.'&filter=2&comments=update&exeid='.$id.'&origin='.$origin.'&details=true&course='.Security::remove_XSS($_GET['cidReq']).$fromlink.'" method="post">';
//echo ' <input type = "hidden" name="totalWeighting" value="'.$totalWeighting.'">';

@ -78,9 +78,7 @@ class FillBlanks extends Question
}
// javascript
echo '
<script type="text/javascript">
echo '<script type="text/javascript">
function FCKeditor_OnComplete( editorInstance )
{
if (window.attachEvent) {
@ -90,10 +88,8 @@ class FillBlanks extends Question
}
}
var firstTime = true;
function updateBlanks()
{
function updateBlanks() {
if (firstTime) {
field = document.getElementById("answer");
var answer = field.value; }
@ -103,8 +99,7 @@ class FillBlanks extends Question
}
var blanks = answer.match(/\[[^\]]*\]/g);
var fields = "<div class=\"row\"><div class=\"label\">'.get_lang('Weighting').'</div><div class=\"formw\"><table>";
var fields = "<div class=\"control-group\"><label class=\"control-label\">'.get_lang('Weighting').'</label><div class=\"controls\"><table>";
if(blanks!=null){
for(i=0 ; i<blanks.length ; i++){
if(document.getElementById("weighting["+i+"]"))
@ -119,23 +114,18 @@ class FillBlanks extends Question
if(firstTime){
firstTime = false;
';
if(count($a_weightings)>0)
{
foreach($a_weightings as $i=>$weighting)
{
if(count($a_weightings)>0) {
foreach($a_weightings as $i=>$weighting) {
echo 'document.getElementById("weighting['.$i.']").value = "'.$weighting.'";';
}
}
echo '}
}
window.onload = updateBlanks;
</script>
';
</script>';
// answer
$form -> addElement ('html', '<br /><br /><div class="row"><div class="label"></div><div class="formw">'.get_lang('TypeTextBelow').', '.get_lang('And').' '.get_lang('UseTagForBlank').'</div></div>');
$form -> addElement ('label', null, '<br /><br />'.get_lang('TypeTextBelow').', '.get_lang('And').' '.get_lang('UseTagForBlank'));
$form -> addElement ('html_editor', 'answer', '<img src="../img/fill_field.png">','id="answer" cols="122" rows="6" onkeyup="javascript: updateBlanks(this);"', array('ToolbarSet' => 'TestQuestionDescription', 'Width' => '100%', 'Height' => '350'));
$form -> addRule ('answer',get_lang('GiveText'),'required');

@ -89,14 +89,7 @@ class Matching extends Question {
$form -> addElement('hidden', 'nb_options', $nb_options);
// DISPLAY MATCHES
$html='
<div class="row">
<div class="label">
'.get_lang('Answers').' <br /> <img src="../img/fill_field.png">
</div>
<div class="formw">
'.get_lang('MakeCorrespond').'
<table class="data_table">
$html='<table class="data_table">
<tr>
<th width="10px">
'.get_lang('Number').'
@ -110,9 +103,9 @@ class Matching extends Question {
<th width="50px">
'.get_lang('Weighting').'
</th>
</tr>';
$form -> addElement ('html', $html);
$form -> addElement ('label', get_lang('MakeCorrespond').'<br /> <img src="../img/fill_field.png">', $html);
if ($nb_matches < 1) {
$nb_matches = 1;
@ -146,13 +139,8 @@ class Matching extends Question {
$form -> addGroup($group);
// DISPLAY OPTIONS ////
$html='
<div class="row">
<div class="label">
</div>
<div class="formw"><br /><br />
<table class="data_table">
// DISPLAY OPTIONS
$html='<table class="data_table">
<tr style="text-align: center;">
<th width="10px">
'.get_lang('Number').'
@ -160,9 +148,9 @@ class Matching extends Question {
<th width="90%"
'.get_lang('Answer').'
</th>
</tr>';
$form -> addElement ('html', $html);
//$form -> addElement ('html', $html);
$form -> addElement ('label', null, $html);
if ($nb_options < 1) {
$nb_options = 1;

@ -46,13 +46,7 @@ class MultipleAnswer extends Question {
$obj_ex = $_SESSION['objExercise'];
$html='
<div class="row">
<div class="label">
'.get_lang('Answers').'<br /><img src="../img/fill_field.png">
</div>
<div class="formw">
<table class="data_table">
$html='<table class="data_table">
<tr>
<th width="10px">
'.get_lang('Number').'
@ -73,7 +67,7 @@ class MultipleAnswer extends Question {
'.get_lang('Weighting').'
</th>
</tr>';
$form -> addElement ('html', $html);
$form -> addElement ('label', get_lang('Answers').'<br /> <img src="../img/fill_field.png">', $html);
$defaults = array();
$correct = 0;

@ -44,13 +44,7 @@ class MultipleAnswerCombination extends Question {
$nb_answers = isset($_POST['nb_answers']) ? $_POST['nb_answers'] : 2;
$nb_answers += (isset($_POST['lessAnswers']) ? -1 : (isset($_POST['moreAnswers']) ? 1 : 0));
$obj_ex = $_SESSION['objExercise'];
$html='
<div class="row">
<div class="label">
'.get_lang('Answers').'<br /><img src="../img/fill_field.png">
</div>
<div class="formw">
<table class="data_table">
$html= '<table class="data_table">
<tr style="text-align: center;">
<th width="10px">
'.get_lang('Number').'
@ -66,8 +60,7 @@ class MultipleAnswerCombination extends Question {
$html .='<th>'.get_lang('Comment').'</th>';
}
$html .= '</tr>';
$form -> addElement ('html', $html);
$form -> addElement ('label', get_lang('Answers').'<br /> <img src="../img/fill_field.png">', $html);
$defaults = array();
$correct = 0;

@ -43,18 +43,6 @@ class MultipleAnswerTrueFalse extends Question {
$obj_ex = $_SESSION['objExercise'];
$html.='<div class="row">
<div class="label">
'.get_lang('Answers').'<br /><img src="../img/fill_field.png">
</div>
<div class="formw">';
$html2 ='<div class="row">
<div class="label">
</div>
<div class="formw">';
$form -> addElement ('html', $html2);
$form -> addElement ('html', '<table><tr>');
$renderer = & $form->defaultRenderer();
$defaults = array();
@ -77,7 +65,6 @@ class MultipleAnswerTrueFalse extends Question {
$form -> addElement('hidden', 'options_count', 3);
$form -> addElement ('html', '</tr></table>');
$form -> addElement ('html', '</div></div>');
$html.='<table class="data_table">
<tr style="text-align: center;">
@ -98,8 +85,7 @@ class MultipleAnswerTrueFalse extends Question {
$html .='<th>'.get_lang('Comment').'</th>';
}
$html .= '</tr>';
$form -> addElement ('html', $html);
$form -> addElement ('label', get_lang('Answers').'<br /> <img src="../img/fill_field.png">', $html);
$correct = 0;
if (!empty($this -> id)) {

@ -72,13 +72,7 @@ class UniqueAnswer extends Question {
$feedback_title = '<th width="350px" >'.get_lang('Scenario').'</th>';
}
$html='
<div class="row">
<div class="label">
'.get_lang('Answers').' <br /> <img src="../img/fill_field.png">
</div>
<div class="formw">
<table class="data_table">
$html='<table class="data_table">
<tr style="text-align: center;">
<th width="10px">
'.get_lang('Number').'
@ -96,7 +90,7 @@ class UniqueAnswer extends Question {
</th>
</tr>';
$form -> addElement ('html', $html);
$form -> addElement ('label', get_lang('Answers').'<br /> <img src="../img/fill_field.png">', $html);
$defaults = array();
$correct = 0;
@ -219,7 +213,6 @@ class UniqueAnswer extends Question {
$renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'lp'.$i);
$renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'try'.$i);
$form -> addGroup($group, 'scenario', 'scenario');
$renderer->setGroupElementTemplate('<div class="exercise_scenario_label">{label}</div><div class="exercise_scenario_element">{element}</div>','scenario');
}
@ -229,6 +222,7 @@ class UniqueAnswer extends Question {
$form -> addElement ('html', '</table>');
$form -> addElement ('html', '<br />');
$navigator_info = api_get_navigator();
global $text, $class, $show_quiz_edition;

@ -73,13 +73,7 @@ class UniqueAnswerNoOption extends Question {
$feedback_title = '<th width="350px" >'.get_lang('Scenario').'</th>';
}
$html='
<div class="row">
<div class="label">
'.get_lang('Answers').' <br /> <img src="../img/fill_field.png">
</div>
<div class="formw">
<table class="data_table">
$html='<table class="data_table">
<tr style="text-align: center;">
<th width="10px">
'.get_lang('Number').'
@ -96,8 +90,7 @@ class UniqueAnswerNoOption extends Question {
'.get_lang('Weighting').'
</th>
</tr>';
$form -> addElement ('html', $html);
$form -> addElement ('label', get_lang('Answers').'<br /> <img src="../img/fill_field.png">', $html);
$defaults = array();
$correct = 0;

@ -25,7 +25,7 @@
/* INIT SECTION */
// Language files that need to be included.
$language_file = array ('forum', 'group');
$language_file = array ('forum', 'group', 'gradebook');
// Including the global initialization file.
require_once '../inc/global.inc.php';
@ -81,6 +81,8 @@ $current_forum = get_forum_information($_GET['forum']); // Note: This h
$current_forum_category = get_forumcategory_information($current_forum['forum_category']);
$current_post = get_post_information($_GET['post']);
block_course_item_locked_by_gradebook($_GET['thread']);
/* Header and Breadcrumbs */
if (isset($_SESSION['gradebook'])) {
@ -211,9 +213,10 @@ if (!empty($values) and isset($_POST['SubmitPost'])) {
$weight_calification = $values['weight_calification'];
$description = '';
$session_id = api_get_session_id();
$link_id = is_resource_in_course_gradebook(api_get_course_id(), 5, $id, $session_id);
if (!$link_id) {
add_resource_to_course_gradebook(api_get_course_id(), 5, $id, $title_gradebook, $weight_calification, $value_calification, $description, time(), 1, api_get_session_id());
$link_info = is_resource_in_course_gradebook(api_get_course_id(), 5, $id, $session_id);
$link_id = $link_info['id'];
if (!$link_info) {
add_resource_to_course_gradebook($values['category_id'], api_get_course_id(), 5, $id, $title_gradebook, $weight_calification, $value_calification, $description, 1, api_get_session_id());
} else {
Database::query('UPDATE '.$table_link.' SET weight='.$weight_calification.' WHERE id='.$link_id.'');
}

@ -84,9 +84,9 @@ function handle_forum_and_forumcategories($lp_id = null) {
for ($i = 0; $i < count($list_threads); $i++) {
delete_forum_forumcategory_thread('thread', $list_threads[$i]['thread_id']);
require_once api_get_path(SYS_CODE_PATH).'gradebook/lib/gradebook_functions.inc.php';
$link_id = is_resource_in_course_gradebook(api_get_course_id(), 5 , intval($list_threads[$i]['thread_id']), api_get_session_id());
if ($link_id !== false) {
remove_resource_from_course_gradebook($link_id);
$link_info = is_resource_in_course_gradebook(api_get_course_id(), 5 , intval($list_threads[$i]['thread_id']), api_get_session_id());
if ($link_info !== false) {
remove_resource_from_course_gradebook($link_info['id']);
}
}
$return_message = delete_forum_forumcategory_thread($_GET['content'], $_GET['id']);
@ -1905,9 +1905,7 @@ function store_thread($values) {
$maxqualify = $values['numeric_calification'];
$weigthqualify = $values['weight_calification'];
$resourcedescription = '';
$date = time();
//is_resource_in_course_gradebook($course_code, $resource_type, $resource_id);
add_resource_to_course_gradebook($coursecode, $resourcetype, $resourceid, $resourcename, $weigthqualify, $maxqualify, $resourcedescription, $date, 0, api_get_session_id());
add_resource_to_course_gradebook($values['category_id'], $coursecode, $resourcetype, $resourceid, $resourcename, $weigthqualify, $maxqualify, $resourcedescription, 0, api_get_session_id());
}
api_item_property_update($_course, TOOL_FORUM_THREAD, $last_thread_id, 'ForumThreadAdded', api_get_user_id());
@ -2007,7 +2005,6 @@ function show_add_post_form($action = '', $id = '', $form_values = '') {
global $current_forum;
global $_user;
global $origin;
global $charset;
$gradebook = Security::remove_XSS($_GET['gradebook']);
// Setting the class and text of the form title and submit button.
@ -2065,6 +2062,9 @@ function show_add_post_form($action = '', $id = '', $form_values = '') {
if( (api_is_course_admin() || api_is_course_coach() || api_is_course_tutor()) && !($my_thread) ) {
//Loading gradebook select
load_gradebook_select_in_tool($form);
// Thread qualify
$form->applyFilter('numeric_calification', 'html_filter');
$form->addElement('checkbox', 'thread_qualify_gradebook', '', get_lang('QualifyThreadGradebook'), 'onclick="javascript:if(this.checked==true){document.getElementById(\'options_field\').style.display = \'block\';}else{document.getElementById(\'options_field\').style.display = \'none\';}"');
@ -2097,9 +2097,6 @@ function show_add_post_form($action = '', $id = '', $form_values = '') {
$form->addElement('textarea', 'file_comment', get_lang('FileComment'), array ('rows' => 4, 'cols' => 34));
$form->applyFilter('file_comment', 'html_filter');
$form->addElement('html', '</div>');
$userid = api_get_user_id();
$info = api_get_user_info($userid);
$courseid = api_get_course_id();
$form->addElement('style_submit_button', 'SubmitPost', $text, 'class="'.$class.'"');
$form->add_real_progress_bar('DocumentUpload', 'user_upload');
@ -2496,17 +2493,26 @@ function show_edit_post_form($current_post, $current_thread, $current_forum, $fo
$form->addElement('static', 'Group', '<strong>'.get_lang('AlterQualifyThread').'</strong>');
$form->applyFilter('numeric_calification', 'html_filter');
$form->addElement('checkbox', 'thread_qualify_gradebook', '', get_lang('QualifyThreadGradebook'), 'onclick="javascript: if(this.checked){document.getElementById(\'options_field\').style.display = \'block\';}else{document.getElementById(\'options_field\').style.display = \'none\';}"');
$defaults['thread_qualify_gradebook'] = is_resource_in_course_gradebook(api_get_course_id(), 5, $_GET['thread'], api_get_session_id());
$link_info = is_resource_in_course_gradebook(api_get_course_id(), 5, $_GET['thread'], api_get_session_id());
if (!empty($link_info)) {
$defaults['thread_qualify_gradebook'] = true;
$defaults['category_id'] = $link_info['category_id'];
}
if (!empty($defaults['thread_qualify_gradebook'])) {
$form -> addElement('html', '<div id="options_field" style="display:block">');
} else {
$form -> addElement('html', '<div id="options_field" style="display:none">');
}
//Loading gradebook select
load_gradebook_select_in_tool($form);
$form->addElement('text', 'numeric_calification', get_lang('QualificationNumeric'), 'value="'.$current_thread['thread_qualify_max'].'" style="width:40px"');
$form->addElement('text', 'calification_notebook_title', get_lang('TitleColumnGradebook'), 'value="'.$current_thread['thread_title_qualify'].'"');
$form->applyFilter('calification_notebook_title', 'html_filter');
$form->addElement('text', 'weight_calification', get_lang('QualifyWeight'), 'value="'.$current_thread['thread_weight'].'" style="width:40px"');
$form->addElement('text', 'weight_calification', array(get_lang('QualifyWeight'), null, '') , 'value="'.$current_thread['thread_weight'].'" style="width:40px"');
$form->applyFilter('weight_calification', 'html_filter');
$form->addElement('html', '</div>');
}
@ -2529,11 +2535,10 @@ function show_edit_post_form($current_post, $current_thread, $current_forum, $fo
$form->addElement('checkbox', 'remove_attach', null, get_lang('DeleteAttachmentFile'));
}
// User upload
$form->addElement('html', '<br /><b><div class="row"><div class="label">'.$message.'</div></div></b><br /><br />');
$form->addElement('label', $message);
$form->addElement('file', 'user_upload', get_lang('FileName'), '');
$form->addElement('textarea', 'file_comment', get_lang('FileComment'), array ('rows' => 4, 'cols' => 34));
$form->applyFilter('file_comment', 'html_filter');
$form->addElement('html', '</div><br /><br />');
if ($current_forum['allow_attachments'] == '1' || api_is_allowed_to_edit(null, true)) {
if (empty($form_values) && !isset($_POST['SubmitPost'])) {
//edit_added_resources('forum_post', $current_post['post_id']);
@ -2551,8 +2556,6 @@ function show_edit_post_form($current_post, $current_thread, $current_forum, $fo
}
if (!empty($form_values)) {
//$defaults['post_title']=Security::remove_XSS($form_values['post_title']);
//$defaults['post_text']=Security::remove_XSS($form_values['post_text']);
$defaults['post_notification'] = Security::remove_XSS($form_values['post_notification']);
$defaults['thread_sticky'] = Security::remove_XSS($form_values['thread_sticky']);
}
@ -2631,18 +2634,20 @@ function store_edit_post($values) {
if (api_is_course_admin() == true) {
$ccode = api_get_course_id();
$sid = api_get_session_id();
$link_id = is_resource_in_course_gradebook($ccode, 5, $values['thread_id'], $sid);
$link_info = is_resource_in_course_gradebook($ccode, 5, $values['thread_id'], $sid);
$link_id = $link_info['id'];
$thread_qualify_gradebook = isset($values['thread_qualify_gradebook']) ? $values['thread_qualify_gradebook'] : null;
if ($thread_qualify_gradebook != 1) {
if ($link_id !== false) {
if ($link_info !== false) {
remove_resource_from_course_gradebook($link_id);
}
} else {
if ($link_id === false && !$_GET['thread']) {
//$date_in_gradebook = date('Y-m-d H:i:s');
$date_in_gradebook = null;
if ($link_info === false && !$_GET['thread']) {
$weigthqualify = $values['weight_calification'];
add_resource_to_course_gradebook($ccode, 5, $values['thread_id'], Database::escape_string(stripslashes($values['calification_notebook_title'])), $weigthqualify, $values['numeric_calification'], null, $date_in_gradebook, 0, $sid);
add_resource_to_course_gradebook($values['category_id'], $ccode, 5, $values['thread_id'], Database::escape_string(stripslashes($values['calification_notebook_title'])), $weigthqualify, $values['numeric_calification'], null, 0, $sid);
}
}
}
@ -3359,9 +3364,9 @@ function prepare4display($input) {
if (!isset($search)) {
if (isset($_POST['search_term'])) {
$search = html_filter($_POST['search_term']); // No html at all.
$search = $_POST['search_term']; // No html at all.
} elseif (isset($_GET['search'])) {
$search = html_filter($_GET['search']);
$search = $_GET['search'];
} else {
$search = '';
}

@ -89,7 +89,6 @@ if (!empty($_GET['gidReq'])) {
api_session_register('toolgroup');
}
/* Is the user allowed here? */
// The user is not allowed here if:
@ -121,7 +120,6 @@ if ($current_forum['forum_of_group'] != 0) {
api_not_allowed();
}
}
$session_toolgroup = 0;
if ($origin == 'group') {
$session_toolgroup = intval($_SESSION['toolgroup']);
@ -146,8 +144,6 @@ if (isset($_POST['add_resources']) AND $_POST['add_resources'] == get_lang('Reso
header('Location: ../resourcelinker/resourcelinker.php');
}
/* Header */
if ($origin == 'learnpath') {
@ -163,36 +159,9 @@ handle_forum_and_forumcategories();
// Action links
echo '<div class="actions">';
echo '<span style="float:right;">'.search_link().'</span>';
/*
if ($origin == 'group') {
echo '<a href="../group/group_space.php?'.api_get_cidreq().'&amp;gidReq='.Security::remove_XSS($_GET['gidReq']).'&amp;gradebook='.$gradebook.'">'.Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('Groups'),'',ICON_SIZE_MEDIUM).'</a>';
} else {
echo '<a href="index.php?gradebook='.$gradebook.'">'.Display::return_icon('back.png',get_lang('BackToForumOverview'),'',ICON_SIZE_MEDIUM).'</a>';
}*/
echo '<a href="viewforum.php?origin='.$origin.'&forum='.Security::remove_XSS($_GET['forum']).'&amp;gidReq='.Security::remove_XSS($_GET['gidReq']).'">'.Display::return_icon('back.png',get_lang('BackToForum'),'',ICON_SIZE_MEDIUM).'</a>';
echo '</div>';
/* Display Forum Category and the Forum information */
/*
echo "<table class=\"data_table\" width=\"100%\">\n";
if ($origin != 'learnpath') {
echo "<tr>\n<th align=\"left\" colspan=\"2\">";
echo '<span class="forum_title">'.prepare4display($current_forum['forum_title']).'</span>';
if (!empty($current_forum['forum_comment'])) {
echo '<br><span class="forum_description">'.prepare4display($current_forum['forum_comment']).'</span>';
}
if (!empty($current_forum_category['cat_title'])) {
echo '<br /><span class="forum_low_description">'.prepare4display($current_forum_category['cat_title'])."</span><br />";
}
echo "</th>\n";
echo "</tr>\n";
}
echo '</table>';
*/
$values = show_add_post_form('newthread', '', isset($_SESSION['formelements']) ? $_SESSION['formelements'] : null);
if (!empty($values) && isset($values['SubmitPost'])) {

@ -141,14 +141,19 @@ if (($my_action == 'lock' OR $my_action == 'unlock') AND isset($_GET['content'])
}
// Deleting.
if ($my_action == 'delete' AND isset($_GET['content']) AND isset($_GET['id']) AND api_is_allowed_to_edit(false, true) && api_is_allowed_to_session_edit(false, true)) {
$locked = api_resource_is_locked_by_gradebook($_GET['id']);
if ($locked == false) {
$message = delete_forum_forumcategory_thread($_GET['content'], $_GET['id']); // Note: This has to be cleaned first.
// Delete link
require_once api_get_path(SYS_CODE_PATH).'gradebook/lib/gradebook_functions.inc.php';
$link_id = is_resource_in_course_gradebook(api_get_course_id(), 5 , intval($_GET['id']), api_get_session_id());
if ($link_id !== false) {
$link_info = is_resource_in_course_gradebook(api_get_course_id(), 5 , intval($_GET['id']), api_get_session_id());
$link_id = $link_info['id'];
if ($link_info !== false) {
remove_resource_from_course_gradebook($link_id);
}
}
}
// Moving.
if ($my_action == 'move' AND isset($_GET['thread']) AND api_is_allowed_to_edit(false, true) && api_is_allowed_to_session_edit(false, true)) {
$message = move_thread_form();
@ -357,12 +362,6 @@ if (is_array($threads)) {
} else {
echo '<td>'.Display::tag('span', api_get_person_name($row['firstname'], $row['lastname']), array("title"=>api_htmlentities($poster_username, ENT_QUOTES))).'</td>';
}
// display the last post name
// if ($row['user_id'] == '0') {
// $name = prepare4display($row['thread_poster_name']);
// } else {
// $name = api_get_person_name($row['firstname'], $row['lastname']);
// }
if ($row['last_poster_user_id'] == '0') {
$name = $row['poster_name'];
@ -404,7 +403,13 @@ if (is_array($threads)) {
if ($origin != 'learnpath') {
if (api_is_allowed_to_edit(false, true) && !(api_is_course_coach() && $current_forum['session_id'] != $_SESSION['id_session'])) {
echo '<a href="editpost.php?'.api_get_cidreq().'&amp;forum='.Security::remove_XSS($my_forum).'&amp;thread='.Security::remove_XSS($row['thread_id']).'&amp;post='.$row_post_id['post_id'].'&amp;gidReq='.$_SESSION['toolgroup'].'&amp;origin='.$origin.'&amp;id_attach='.$id_attach.'">'.Display::return_icon('edit.png', get_lang('Edit'), array(), ICON_SIZE_SMALL).'</a>';
if (api_resource_is_locked_by_gradebook($row['thread_id'])) {
echo Display::return_icon('delete_na.png', get_lang('Delete'), array(), ICON_SIZE_SMALL);
} else {
echo '<a href="'.api_get_self().'?'.api_get_cidreq().'&amp;forum='.Security::remove_XSS($my_forum).'&amp;action=delete&amp;content=thread&amp;gidReq='.$_SESSION['toolgroup'].'&amp;id='.$row['thread_id'].$origin_string."\" onclick=\"javascript:if(!confirm('".addslashes(api_htmlentities(get_lang('DeleteCompleteThread'), ENT_QUOTES))."')) return false;\">".Display::return_icon('delete.png', get_lang('Delete'), array(), ICON_SIZE_SMALL).'</a>';
}
display_visible_invisible_icon('thread', $row['thread_id'], $row['visibility'], array('forum' => $my_forum, 'origin' => $origin, 'gidReq' => $_SESSION['toolgroup']));
display_lock_unlock_icon('thread', $row['thread_id'], $row['locked'], array('forum' => $my_forum, 'origin' => $origin, 'gidReq' => $_SESSION['toolgroup']));
echo '<a href="viewforum.php?'.api_get_cidreq().'&amp;forum='.Security::remove_XSS($my_forum).'&amp;action=move&amp;gidReq='.$_SESSION['toolgroup'].'&amp;thread='.$row['thread_id'].$origin_string.'">'.Display::return_icon('move.png', get_lang('MoveThread'), array(), ICON_SIZE_SMALL).'</a>';

@ -97,21 +97,6 @@ if ($_in_course) {
}
$catadd->set_course_code(api_get_course_id());
/*
$models = api_get_settings_options('grading_model');
$course_grading_model_id = api_get_course_setting('course_grading_model');
$grading_model = '';
if (!empty($course_grading_model_id)) {
foreach($models as $option) {
if (intval($option['id']) == $course_grading_model_id) {
$grading_model = $option['value'];
}
}
}
$grading_contents = api_grading_model_functions($grading_model, 'to_array');
*/
$form = new CatForm(CatForm :: TYPE_ADD, $catadd, 'add_cat_form', null, api_get_self() . '?selectcat='.$get_select_cat);

@ -93,7 +93,7 @@ if (isset($_GET['typeselected']) && $_GET['typeselected'] != '0') {
$res1 = Database::query($sql1);
$rowtit = Database::fetch_row($res1);
$course_id = api_get_course_id();
$sql_l='SELECT count(*) FROM '.$tbl_link.' WHERE c_id = '.$course_info['real_id'].' AND ref_id='.$addvalues['select_link'].' and course_code="'.$course_id.'" and type=5;';
$sql_l='SELECT count(*) FROM '.$tbl_link.' WHERE ref_id='.$addvalues['select_link'].' and course_code="'.$course_id.'" and type=5;';
$res_l=Database::query($sql_l);
$row=Database::fetch_row($res_l);
if ( $row[0]==0 ) {

@ -17,6 +17,9 @@ api_block_anonymous_users();
block_students();
$evaledit = Evaluation :: load($_GET['editeval']);
if ($evaledit[0]->is_locked() && !api_is_platform_admin()) {
api_not_allowed();
}
$form = new EvalForm(EvalForm :: TYPE_EDIT, $evaledit[0], null, 'edit_eval_form',null,api_get_self() . '?editeval=' . Security::remove_XSS($_GET['editeval']));
if ($form->validate()) {
$values = $form->exportValues();
@ -29,11 +32,17 @@ if ($form->validate()) {
$eval->set_category_id($values['hid_category_id']);
$parent_cat = Category :: load($values['hid_category_id']);
$final_weight = null;
if ($parent_cat[0]->get_parent_id() == 0) {
$final_weight = $values['weight_mask'];
} else {
$cat = Category :: load($parent_cat[0]->get_parent_id());
$global_weight = $cat[0]->get_weight();
$values['weight'] = $values['weight_mask']/$global_weight*$parent_cat[0]->get_weight();
$final_weight = $values['weight_mask']/$global_weight*$parent_cat[0]->get_weight();
}
$eval->set_weight($values['weight']);
$eval->set_weight($final_weight);
$eval->set_max($values['max']);
if (empty ($values['visible'])) {

@ -25,6 +25,11 @@ $tbl_work = Database :: get_course_table(TABLE_STUDENT_PUBLICATION);
$tbl_attendance = Database :: get_course_table(TABLE_ATTENDANCE);
$linkarray = LinkFactory :: load($_GET['editlink']);
$link = $linkarray[0];
if ($link->is_locked() && !api_is_platform_admin()) {
api_not_allowed();
}
$linkcat = isset($_GET['selectcat']) ? Security::remove_XSS($_GET['selectcat']):'';
$linkedit = isset($_GET['editlink']) ? Security::remove_XSS($_GET['editlink']):'';
@ -34,10 +39,17 @@ $form = new LinkAddEditForm(LinkAddEditForm :: TYPE_EDIT, $cats, null, $link, 'e
if ($form->validate()) {
$values = $form->exportValues();
$parent_cat = Category :: load($values['select_gradebook']);
$final_weight = null;
if ($parent_cat[0]->get_parent_id() == 0) {
$final_weight = $values['weight_mask'];
} else {
$cat = Category :: load($parent_cat[0]->get_parent_id());
$global_weight = $cat[0]->get_weight();
$values['weight'] = $values['weight_mask']/$global_weight*$parent_cat[0]->get_weight();
$link->set_weight($values['weight']);
$final_weight = $values['weight_mask']/$global_weight*$parent_cat[0]->get_weight();
}
$link->set_weight($final_weight);
if (!empty($values['select_gradebook'])) {
$link->set_category_id($values['select_gradebook']);
@ -46,23 +58,25 @@ if ($form->validate()) {
$link->save();
//Update weight for attendance
$sql = 'SELECT ref_id FROM '.$tbl_grade_links.' WHERE c_id = '.$course_id.' AND id = '.intval($_GET['editlink']).' AND type='.LINK_ATTENDANCE;
$sql = 'SELECT ref_id FROM '.$tbl_grade_links.' WHERE id = '.intval($_GET['editlink']).' AND type='.LINK_ATTENDANCE;
$rs_attendance = Database::query($sql);
if (Database::num_rows($rs_attendance) > 0) {
$row_attendance = Database::fetch_array($rs_attendance);
$attendance_id = $row_attendance['ref_id'];
$upd_attendance = 'UPDATE '.$tbl_attendance.' SET attendance_weight ='.floatval($values['weight']).' WHERE c_id = '.$course_id.' AND id = '.intval($attendance_id);
$upd_attendance = 'UPDATE '.$tbl_attendance.' SET attendance_weight ='.floatval($final_weight).' WHERE c_id = '.$course_id.' AND id = '.intval($attendance_id);
Database::query($upd_attendance);
}
//Update weight into forum thread
$sql_t = 'UPDATE '.$tbl_forum_thread.' SET thread_weight='.$values['weight'].'
WHERE c_id = '.$course_id.' AND thread_id=(SELECT ref_id FROM '.$tbl_grade_links.' WHERE id='.intval($_GET['editlink']).' and type=5 AND c_id = '.$course_id.' ) ';
$sql_t = 'UPDATE '.$tbl_forum_thread.' SET thread_weight='.$final_weight.'
WHERE c_id = '.$course_id.' AND thread_id=(SELECT ref_id FROM '.$tbl_grade_links.' WHERE id='.intval($_GET['editlink']).' and type=5) ';
Database::query($sql_t);
//Update weight into student publication(work)
$sql_t = 'UPDATE '.$tbl_work.' SET weight='.$values['weight'].'
WHERE c_id = '.$course_id.' AND id = (SELECT ref_id FROM '.$tbl_grade_links.' WHERE c_id = '.$course_id.' AND id='.intval($_GET['editlink'] ).' AND type=3 )';
$sql_t = 'UPDATE '.$tbl_work.' SET weight='.$final_weight.'
WHERE c_id = '.$course_id.' AND id = (SELECT ref_id FROM '.$tbl_grade_links.' WHERE id='.intval($_GET['editlink'] ).' AND type=3 )';
Database::query($sql_t);
header('Location: '.$_SESSION['gradebook_dest'].'?linkedited=&selectcat=' . $link->get_category_id());
exit;
@ -73,7 +87,6 @@ $htmlHeadXtra[] = '<script type="text/javascript">
$(document).ready( function() {
$("#hide_category_id").change(function(){
$("#hide_category_id option:selected").each(function () {
var cat_id = $(this).val();
$.ajax({

@ -21,9 +21,11 @@ $select_eval=Security::remove_XSS($_GET['selecteval']);
if (empty($select_eval)) {
api_not_allowed();
}
$resultedit = Result :: load (null,null,$select_eval);
$evaluation = Evaluation :: load ($select_eval);
$evaluation[0]->check_lock_permissions();
$edit_result_form = new EvalForm(EvalForm :: TYPE_ALL_RESULTS_EDIT, $evaluation[0], $resultedit, 'edit_result_form', null, api_get_self() . '?&selecteval='.$select_eval);
$table = $edit_result_form->toHtml();
if ($edit_result_form->validate()) {

@ -99,160 +99,22 @@ $flatviewtable = new FlatViewTable($cat[0], $users, $alleval, $alllinks, true, $
$parameters=array('selectcat'=>intval($_GET['selectcat']));
$flatviewtable->set_additional_parameters($parameters);
if (isset($_GET['export_pdf']) && $_GET['export_pdf'] == 'category') {
$params = array();
$params['only_total_category'] = true;
export_pdf_flatview($cat, $users, $alleval, $alllinks, $params);
}
if (isset($_GET['exportpdf'])) {
$interbreadcrumb[] = array (
'url' => api_get_self().'?selectcat=' . Security::remove_XSS($_GET['selectcat']),
'name' => get_lang('FlatView')
);
$export_pdf_form = new DataForm(DataForm::TYPE_EXPORT_PDF, 'export_pdf_form', null, api_get_self().'?exportpdf=&offset='.intval($_GET['offset']).'&selectcat='.intval($_GET['selectcat']), '_blank', '');
if ($export_pdf_form->validate()) {
// Beginning of PDF report creation
$printable_data = get_printable_data($cat[0], $users, $alleval, $alllinks);
$export = $export_pdf_form->exportValues();
// Reading report's CSS
//$css_file = api_get_path(TO_SYS, WEB_CSS_PATH).api_get_setting('stylesheets').'/print.css';
$css_file = api_get_path(SYS_CODE_PATH).'gradebook/print.css';
$css = file_exists($css_file) ? @file_get_contents($css_file) : '';
// HTML report creation first
$time = time();
$course_code = trim($cat[0]->get_course_code());
$organization = api_get_setting('Institution');
$displayscore = ScoreDisplay :: instance();
$customdisplays = $displayscore->get_custom_score_display_settings();
if (is_array($customdisplays) && count(($customdisplays))) {
$total = array();
foreach($customdisplays as $custom) {
$total[$custom['display']] = 0;
}
$user_results = $flatviewtable->datagen->get_data_to_graph2();
foreach($user_results as $user_result) {
$total[$user_result[count($user_result)-1][1]]++;
}
}
$html = '';
$img = api_get_path(SYS_CODE_PATH).'css/'.api_get_visual_theme().'/images/header-logo.png';
if (file_exists($img)) {
$img = api_get_path(WEB_CODE_PATH).'css/'.api_get_visual_theme().'/images/header-logo.png';
$html .= "<img src='$img'>";
} else {
if (!empty($organization)) {
$html .= '<h2 align="left">'.$organization.'</h2>';
}
}
$html .= '<h2 align="center">'.get_lang('FlatView').'</h2>';
$html .= '<table align="center" width="100%"><tr><td valign="top">';
$html .= '<table align="left" width="33%">';
$session_name = api_get_session_name(api_get_session_id());
$teacher_list = CourseManager::get_teacher_list_from_course_code_to_string($course_code);
if (!empty($session_name)) {
$html .= Display::tag('tr', Display::tag('td', get_lang('Session')).Display::tag('td', Display::tag('strong', $session_name)));
}
$html .= Display::tag('tr', Display::tag('td', get_lang('Course')).Display::tag('td', Display::tag('strong', $course_code)));
$html .= Display::tag('tr', Display::tag('td', get_lang('Date')).Display::tag('td', Display::tag('strong', api_convert_and_format_date(date('Y-m-d', time()), DATE_TIME_FORMAT_LONG))));
$html .= Display::tag('tr', Display::tag('td', get_lang('Teacher')).Display::tag('td', Display::tag('strong', $teacher_list)));
$html .= '</table></td>';
$html .= '<td valign="top"><table align="left" width="33%">';
if (!empty($total)) {
foreach($total as $label => $count) {
$total_custom_score = round($count/count($user_results), 2) *100;
$html .= Display::tag('tr', Display::tag('td', $label).': '.Display::tag('td', Display::tag('strong', $total_custom_score.' %')));
}
}
$html .= '</table></td>';
$html .= '<td valign="top"><table align="left" width="33%">';
$headers = $printable_data[0];
unset($headers[0]);
unset($headers[1]);
unset($headers[count($headers)+1]);
foreach ($headers as $head) {
//$html .= Display::tag('tr', Display::tag('td', 'P1').Display::tag('td', Display::tag('strong', $head)));
$html .= Display::tag('tr', Display::tag('td', Display::tag('strong', $head)));
}
$html .= '</table></td></table><br />';
$columns = count($printable_data[0]);
$has_data = is_array($printable_data[1]) && count($printable_data[1]) > 0;
if (api_is_western_name_order()) {
// Choosing the right person name order according to the current language.
list($printable_data[0][0], $printable_data[0][1]) = array($printable_data[0][1], $printable_data[0][0]);
if ($has_data) {
foreach ($printable_data[1] as &$printable_data_row) {
list($printable_data_row[0], $printable_data_row[1]) = array($printable_data_row[1], $printable_data_row[0]);
}
}
}
$table = new HTML_Table(array('class' => 'data_table'));
$row = 0;
$column = 0;
foreach ($printable_data[0] as $printable_data_cell) {
$table->setHeaderContents($row, $column, $printable_data_cell);
$column++;
}
$row++;
if ($has_data) {
foreach ($printable_data[1] as &$printable_data_row) {
$column = 0;
foreach ($printable_data_row as &$printable_data_cell) {
$table->setCellContents($row, $column, $printable_data_cell);
$table->updateCellAttributes($row, $column, 'align="center"');
$column++;
}
$table->updateRowAttributes($row, $row % 2 ? 'class="row_even"' : 'class="row_odd"', true);
$row++;
}
} else {
$column = 0;
$table->setCellContents($row, $column, get_lang('NoResults'));
$table->updateCellAttributes($row, $column, 'colspan="'.$columns.'" align="center" class="row_odd"');
}
$html .= $table->toHtml();
//echo $html;exit;
// Memory release
unset($printable_data);
unset($table);
// Conversion of the created HTML report to a PDF report
$html = api_utf8_encode($html);
//@todo this is really a must?
$creator_pdf = api_utf8_encode($creator);
$title_pdf = api_utf8_encode($report_name);
$subject_pdf = api_utf8_encode(get_lang('FlatView'));
$keywods_pdf = api_utf8_encode($course_code);
$page_format = $export['orientation'] == 'landscape' ? 'A4-L' : 'A4';
$pdf = new PDF($page_format, $export['orientation']);
// Sending the created PDF report to the client
$file_name = date('YmdHi_', $time);
if (!empty($course_code)) {
$file_name .= $course_code.'_';
}
$file_name .= get_lang('FlatView').'.pdf';
$pdf->content_to_pdf($html, $css, $file_name, api_get_course_id());
exit;
$params = $export_pdf_form->exportValues();
export_pdf_flatview($cat, $users, $alleval, $alllinks, $params);
} else {
Display :: display_header(get_lang('ExportPDF'));
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save