Minor - format code, update docs

remotes/angel/1.11.x
jmontoyaa 8 years ago
parent 613a560bb3
commit 088769224c
  1. 4
      main/gradebook/gradebook_edit_eval.php
  2. 12
      main/gradebook/lib/be/evaluation.class.php
  3. 5
      main/gradebook/lib/fe/evalform.class.php
  4. 8
      main/inc/lib/formvalidator/FormValidator.class.php

@ -50,8 +50,8 @@ if ($form->validate()) {
$selectcat_inter = isset($_GET['selectcat']) ? (int) $_GET['selectcat'] : 0;
$interbreadcrumb[] = array(
'url' => $_SESSION['gradebook_dest'].'?selectcat='.$selectcat_inter,
'name' => get_lang('Gradebook'
));
'name' => get_lang('Gradebook')
);
$htmlHeadXtra[] = '<script>
$(document).ready( function() {

@ -440,6 +440,7 @@ class Evaluation implements GradebookItem
* Check if an evaluation name (with the same parent category) already exists
* @param $name name to check (if not given, the name property of this object will be checked)
* @param $parent parent category
* @return bool
*/
public function does_name_exist($name, $parent)
{
@ -487,17 +488,18 @@ class Evaluation implements GradebookItem
/**
* Are there any results for this evaluation yet ?
* The 'max' property should not be changed then.
* @return bool
*/
public function has_results()
{
$tbl_grade_results = Database::get_main_table(TABLE_MAIN_GRADEBOOK_RESULT);
$table = Database::get_main_table(TABLE_MAIN_GRADEBOOK_RESULT);
$sql = 'SELECT count(id) AS number
FROM '.$tbl_grade_results.'
FROM '.$table.'
WHERE evaluation_id = '.intval($this->id);
$result = Database::query($sql);
$number = Database::fetch_row($result);
return ($number[0] != 0);
return $number[0] != 0;
}
/**
@ -505,8 +507,8 @@ class Evaluation implements GradebookItem
*/
public function delete_results()
{
$tbl_grade_results = Database::get_main_table(TABLE_MAIN_GRADEBOOK_RESULT);
$sql = 'DELETE FROM '.$tbl_grade_results.'
$table = Database::get_main_table(TABLE_MAIN_GRADEBOOK_RESULT);
$sql = 'DELETE FROM '.$table.'
WHERE evaluation_id = '.intval($this->id);
Database::query($sql);
}

@ -25,7 +25,7 @@ class EvalForm extends FormValidator
/**
* Builds a form containing form items based on a given parameter
* @param int $form_type 1=add, 2=edit,3=move,4=result_add
* @param obj $evaluation_object the category object
* @param Evaluation $evaluation_object the category object
* @param obj $result_object the result object
* @param string $form_name
* @param string $method
@ -114,8 +114,7 @@ class EvalForm extends FormValidator
)
);
foreach ($this->evaluation_object->get_not_subscribed_students() as $user) {
if ((!isset($this->extra)) || empty($this->extra) || api_strtoupper(api_substr($user[1], 0,
1)) == $this->extra
if ((!isset($this->extra)) || empty($this->extra) || api_strtoupper(api_substr($user[1], 0,1)) == $this->extra
) {
$select->addoption($user[1].' '.$user[2].' ('.$user[3].')', $user[0]);
}

@ -172,10 +172,10 @@ EOT;
/**
* Adds a text field to the form.
* A trim-filter is attached to the field.
* @param string $label The label for the form-element
* @param string $name The element name
* @param bool $required (optional) Is the form-element required (default=true)
* @param array $attributes (optional) List of attributes for the form-element
* @param string $label The label for the form-element
* @param string $name The element name
* @param bool $required (optional) Is the form-element required (default=true)
* @param array $attributes (optional) List of attributes for the form-element
* @return HTML_QuickForm_text
*/
public function addText($name, $label, $required = true, $attributes = array())

Loading…
Cancel
Save