Minor - format

pull/2487/head
jmontoyaa 9 years ago
parent 6edc892129
commit ffbf8c0af1
  1. 36
      main/gradebook/lib/be/category.class.php
  2. 4
      main/gradebook/lib/be/studentpublicationlink.class.php
  3. 4
      main/inc/lib/pear/HTML/QuickForm/Rule/Regex.php
  4. 8
      main/inc/lib/pear/HTML/QuickForm/RuleRegistry.php
  5. 4
      main/inc/lib/pear/HTML/QuickForm/input.php
  6. 2
      main/inc/lib/pear/HTML/QuickForm/text.php

@ -330,8 +330,8 @@ class Category implements GradebookItem
return $cats;
}
$courseCode = api_get_course_info_by_id(api_get_course_int_id());
$courseCode = $courseCode['code'];
$courseInfo = api_get_course_info_by_id(api_get_course_int_id());
$courseCode = $courseInfo['code'];
$session_id = intval($session_id);
if (!empty($session_id)) {
@ -582,7 +582,6 @@ class Category implements GradebookItem
$this->set_id($id);
if (!empty($id)) {
$parent_id = $this->get_parent_id();
$grade_model_id = $this->get_grade_model_id();
if ($parent_id == 0) {
@ -614,7 +613,10 @@ class Category implements GradebookItem
}
$gradebook= new Gradebook();
$gradebook->update_skills_to_gradebook($this->id, $this->get_skills(false));
$gradebook->update_skills_to_gradebook(
$this->id,
$this->get_skills(false)
);
return $id;
}
@ -657,7 +659,6 @@ class Category implements GradebookItem
$parent_id = $this->get_parent_id();
$grade_model_id = $this->get_grade_model_id();
if ($parent_id == 0) {
if (isset($grade_model_id) && !empty($grade_model_id) && $grade_model_id != '-1') {
$obj = new GradeModel();
$components = $obj->get_components($grade_model_id);
@ -673,7 +674,6 @@ class Category implements GradebookItem
foreach ($components as $component) {
$gradebook = new Gradebook();
$params = array();
$params['name'] = $component['acronym'];
$params['description'] = $component['title'];
$params['user_id'] = api_get_user_id();
@ -681,7 +681,6 @@ class Category implements GradebookItem
$params['weight'] = $component['percentage'] / 100 * $default_weight;
$params['session_id'] = api_get_session_id();
$params['course_code'] = $this->get_course_code();
$gradebook->save($params);
}
}
@ -732,7 +731,8 @@ class Category implements GradebookItem
public function update_category_delete($course_id)
{
$tbl_grade_categories = Database :: get_main_table(TABLE_MAIN_GRADEBOOK_CATEGORY);
$sql = 'UPDATE '.$tbl_grade_categories.' SET visible=3
$sql = 'UPDATE '.$tbl_grade_categories.' SET
visible = 3
WHERE course_code ="'.Database::escape_string($course_id).'"';
Database::query($sql);
}
@ -743,7 +743,8 @@ class Category implements GradebookItem
public function show_message_resource_delete($course_id)
{
$tbl_grade_categories = Database :: get_main_table(TABLE_MAIN_GRADEBOOK_CATEGORY);
$sql = 'SELECT count(*) AS num from '.$tbl_grade_categories.'
$sql = 'SELECT count(*) AS num
FROM '.$tbl_grade_categories.'
WHERE
course_code = "'.Database::escape_string($course_id).'" AND
visible = 3';
@ -805,10 +806,10 @@ class Category implements GradebookItem
} else {
$sql .= ' AND user_id = '.api_get_user_id();
}
} else {
$sql .= ' AND user_id = '.api_get_user_id();
}
if (!isset($parent)) {
$sql.= ' AND parent_id is null';
} else {
@ -1195,7 +1196,11 @@ class Category implements GradebookItem
// course independent categories
if (empty($course_code)) {
$cats = Category::get_independent_categories_with_result_for_student (0, $stud_id, $cats);
$cats = Category::get_independent_categories_with_result_for_student(
0,
$stud_id,
$cats
);
}
return $cats;
@ -1241,7 +1246,14 @@ class Category implements GradebookItem
$cats = Category::create_category_objects_from_sql_result($result);
// course independent categories
if (isset($course_code)) {
$indcats = Category::load(null,$user_id,$course_code,0,null,$session_id);
$indcats = Category::load(
null,
$user_id,
$course_code,
0,
null,
$session_id
);
$cats = array_merge($cats, $indcats);
}

@ -433,10 +433,12 @@ class StudentPublicationLink extends AbstractLink
}
}
/**
* @return string
*/
public function delete_linked_data()
{
$data = $this->get_exercise_data();
if (empty($data)) {
return '';
}

@ -84,7 +84,6 @@ class HTML_QuickForm_Rule_Regex extends HTML_QuickForm_Rule
$this->_data[$name] = $pattern;
} // end func addData
function getValidationScript($options = null)
{
$regex = isset($this->_data[$this->name]) ? $this->_data[$this->name] : $options;
@ -96,6 +95,5 @@ class HTML_QuickForm_Rule_Regex extends HTML_QuickForm_Rule
}
return array(" var regex = " . $regex . ";\n", "{jsVar} != '' && !regex.test({jsVar})");
} // end func getValidationScript
}
}

@ -43,7 +43,6 @@ class HTML_QuickForm_RuleRegistry
*/
var $_rules = array();
/**
* Returns a singleton of HTML_QuickForm_RuleRegistry
*
@ -84,7 +83,7 @@ class HTML_QuickForm_RuleRegistry
* @access public
* @return void
*/
function registerRule($ruleName, $type, $data1, $data2 = null)
public function registerRule($ruleName, $type, $data1, $data2 = null)
{
$type = strtolower($type);
if ($type == 'regex') {
@ -109,7 +108,7 @@ class HTML_QuickForm_RuleRegistry
* @access public
* @return HTML_QuickForm_Rule
*/
function getRule($ruleName)
public function getRule($ruleName)
{
if (empty($ruleName)) {
return false;
@ -383,5 +382,4 @@ class HTML_QuickForm_RuleRegistry
}
return array($value, $tmp_reset);
}
} // end class HTML_QuickForm_RuleRegistry
?>
}

@ -111,7 +111,7 @@ class HTML_QuickForm_input extends HTML_QuickForm_element
* @access public
* @return void
*/
function setValue($value)
public function setValue($value)
{
$this->updateAttributes(array('value'=>$value));
} // end func setValue
@ -126,7 +126,7 @@ class HTML_QuickForm_input extends HTML_QuickForm_element
* @access public
* @return string
*/
function getValue()
public function getValue()
{
return $this->getAttribute('value');
} // end func getValue

@ -72,7 +72,6 @@ class HTML_QuickForm_text extends HTML_QuickForm_input
parent::__construct($elementName, $elementLabel, $attributes);
$this->_persistantFreeze = true;
$this->setType('text');
}
@ -124,7 +123,6 @@ class HTML_QuickForm_text extends HTML_QuickForm_input
}
}
switch ($layout) {
case FormValidator::LAYOUT_INLINE:
return '

Loading…
Cancel
Save