Merge branch '1.9.x' of github.com:chamilo/chamilo-lms into 1.9.x

1.9.x
Yannick Warnier 11 years ago
commit bbae1ffdc5
  1. 2
      index.php
  2. 32
      main/exercice/exercise.class.php
  3. 29
      main/inc/lib/formvalidator/FormValidator.class.php
  4. 2
      main/inc/lib/main_api.lib.php

@ -10,7 +10,7 @@ use \ChamiloSession as Session;
define('CHAMILO_HOMEPAGE', true);
$language_file = array('courses', 'index');
$language_file = array('courses', 'index', 'userInfo');
/* Flag forcing the 'current course' reset, as we're not inside a course anymore. */
// Maybe we should change this into an api function? an example: CourseManager::unset();

@ -196,7 +196,10 @@ class Exercise
return false;
}
function getCutTitle()
/**
* @return string
*/
public function getCutTitle()
{
return cut($this->exercise, EXERCISE_MAX_NAME_SIZE);
}
@ -207,7 +210,8 @@ class Exercise
* @author Olivier Brouckaert
* @return int - exercise ID
*/
function selectId() {
public function selectId()
{
return $this->id;
}
@ -217,7 +221,8 @@ class Exercise
* @author Olivier Brouckaert
* @return string - exercise title
*/
function selectTitle() {
public function selectTitle()
{
return $this->exercise;
}
@ -226,7 +231,8 @@ class Exercise
*
* @return int - exercise attempts
*/
function selectAttempts() {
public function selectAttempts()
{
return $this->attempts;
}
@ -234,7 +240,8 @@ class Exercise
* 0=>Feedback , 1=>DirectFeedback, 2=>NoFeedback
* @return int - exercise attempts
*/
function selectFeedbackType() {
public function selectFeedbackType()
{
return $this->feedback_type;
}
@ -261,7 +268,8 @@ class Exercise
* @author Olivier Brouckaert
* @return string - exercise description
*/
function selectSound() {
public function selectSound()
{
return $this->sound;
}
@ -271,7 +279,8 @@ class Exercise
* @author Olivier Brouckaert
* @return integer - exercise type
*/
function selectType() {
public function selectType()
{
return $this->type;
}
@ -279,7 +288,8 @@ class Exercise
* @author hubert borderiou 30-11-11
* @return integer : do we display the question category name for students
*/
function selectDisplayCategoryName() {
public function selectDisplayCategoryName()
{
return $this->display_category_name;
}
@ -353,14 +363,14 @@ class Exercise
}
}
/**
* tells if questions are selected randomly, and if so returns the draws
* Tells if questions are selected randomly, and if so returns the draws
*
* @author Carlos Vargas
* @return integer - results disabled exercise
*/
function selectResultsDisabled() {
public function selectResultsDisabled()
{
return $this->results_disabled;
}

@ -284,22 +284,22 @@ EOT;
$this->addElement('hidden', $name, $value);
}
function add_textarea($name, $label, $attributes = array())
public function add_textarea($name, $label, $attributes = array())
{
$this->addElement('textarea', $name, $label, $attributes);
}
function add_button($name, $label, $attributes = array())
public function add_button($name, $label, $attributes = array())
{
$this->addElement('button', $name, $label, $attributes);
}
function add_checkbox($name, $label, $trailer = '', $attributes = array())
public function add_checkbox($name, $label, $trailer = '', $attributes = array())
{
$this->addElement('checkbox', $name, $label, $trailer, $attributes);
}
function add_radio($name, $label, $options = '')
public function add_radio($name, $label, $options = '')
{
$group = array();
foreach ($options as $key => $value) {
@ -308,27 +308,27 @@ EOT;
$this->addGroup($group, $name, $label);
}
function add_select($name, $label, $options = '', $attributes = array())
public function add_select($name, $label, $options = '', $attributes = array())
{
$this->addElement('select', $name, $label, $options, $attributes);
}
function add_label($label, $text)
public function add_label($label, $text)
{
$this->addElement('label', $label, $text);
}
function add_header($text)
public function add_header($text)
{
$this->addElement('header', $text);
}
function add_file($name, $label, $attributes = array())
public function add_file($name, $label, $attributes = array())
{
$this->addElement('file', $name, $label, $attributes);
}
function add_html($snippet)
public function add_html($snippet)
{
$this->addElement('html', $snippet);
}
@ -338,6 +338,7 @@ EOT;
* A trim-filter is attached to the field.
* A HTML-filter is attached to the field (cleans HTML)
* A rule is attached to check for unwanted HTML
* @param string $name
* @param string $label The label for the form-element
* @param string $name The element name
* @param boolean $required (optional) Is the form-element required (default=true)
@ -401,7 +402,7 @@ EOT;
* @param string $name The element name
* @deprecated
*/
function add_datepickerdate($name, $label)
public function add_datepickerdate($name, $label)
{
$this->addElement('datepickerdate', $name, $label, array('form_name' => $this->getAttribute('name')));
$this->_elements[$this->_elementIndex[$name]]->setLocalOption('minYear', 1900); // TODO: Now - 9 years
@ -416,7 +417,7 @@ EOT;
* @param string $name The element name
* @deprecated
*/
function add_timewindow($name_1, $name_2, $label_1, $label_2)
public function add_timewindow($name_1, $name_2, $label_1, $label_2)
{
$this->add_datepicker($name_1, $label_1);
$this->add_datepicker($name_2, $label_2);
@ -446,7 +447,7 @@ EOT;
* @param string $label (optional) Custom label to be shown
* submits the form and the start of the progress bar.
*/
function add_progress_bar($delay = 2, $label = '')
public function add_progress_bar($delay = 2, $label = '')
{
if (empty($label)) {
$label = get_lang('PleaseStandBy');
@ -464,7 +465,7 @@ EOT;
* @param int $delay (optional) The frequency of the xajax call
* @param bool $wait_after_upload (optional)
*/
function add_real_progress_bar($upload_id, $element_after, $delay = 2, $wait_after_upload = false)
public function add_real_progress_bar($upload_id, $element_after, $delay = 2, $wait_after_upload = false)
{
if (!function_exists('uploadprogress_get_info')) {
$this->add_progress_bar($delay);
@ -553,7 +554,7 @@ EOT;
*
* @author Patrick Cool <patrick.cool@UGent.be>, Ghent University, august 2006
*/
function return_form()
public function return_form()
{
$error = false;
$addDateLibraries = false;

@ -3927,6 +3927,7 @@ function api_get_themes() {
* @param int $width The width of the form element
* @param string $attributes (optional) attributes for the form element
* @param array $editor_config (optional) Configuration options for the html-editor
* @deprecated
*/
function api_disp_html_area($name, $content = '', $height = '', $width = '100%', $attributes = null, $editor_config = null) {
global $_configuration, $_course, $fck_attribute;
@ -3951,6 +3952,7 @@ function api_disp_html_area($name, $content = '', $height = '', $width = '100%',
* @param int $width The width of the form element
* @param string $attributes (optional) attributes for the form element
* @param array $editor_config (optional) Configuration options for the html-editor
* @deprecated
*/
function api_return_html_area($name, $content = '', $height = '', $width = '100%', $attributes = null, $editor_config = null) {
global $_configuration, $_course, $fck_attribute;

Loading…
Cancel
Save