showing created categories in assingments when we are in session -refs #5962

1.9.x
Yoselyn Castillo 12 years ago
parent ad5b66254e
commit da6e8b6d92
  1. 10
      main/gradebook/lib/be/category.class.php

@ -1176,6 +1176,16 @@ class Category implements GradebookItem
* @return array Array of subcategories
*/
public function get_subcategories ($stud_id = null, $course_code = null, $session_id = null, $order = null) {
if (!empty ($session_id)) {
$tbl_grade_categories = Database :: get_main_table(TABLE_MAIN_GRADEBOOK_CATEGORY);
$sql_session = 'SELECT * FROM '.$tbl_grade_categories. 'WHERE session_id = '.$session_id;
$result_session = Database::query($sql_session);
if (Database::num_rows($result_session) > 0) {
$data_session = Database::fetch_array($result_session);
$parent_id = $data_session['id'];
return Category::load(null, null, null, $parent_id, null, null, $order);
}
}
// 1 student
if (isset($stud_id)) {
// special case: this is the root

Loading…
Cancel
Save