dokeos-gradebook
[ class tree: dokeos-gradebook ] [ index: dokeos-gradebook ] [ all elements ]

Class: Category

Source Location: /main/gradebook/lib/be/category.class.php

Class Overview


Defines a gradebook Category object


Author(s):

  • Bert Stepp�, Stijn Konings

Implements interfaces:

Variables

Methods



Class Details

[line 9]
Defines a gradebook Category object



Tags:

author:  Bert Stepp�, Stijn Konings
filesource:  Source Code for this file


[ Top ]


Class Variables

$certificate_min_score =

[line 22]



Tags:

access:  private

Type:   mixed


[ Top ]

$course_code =

[line 18]



Tags:

access:  private

Type:   mixed


[ Top ]

$description =

[line 16]



Tags:

access:  private

Type:   mixed


[ Top ]

$id =

[line 14]



Tags:

access:  private

Type:   mixed


[ Top ]

$name =

[line 15]



Tags:

access:  private

Type:   mixed


[ Top ]

$parent =

[line 19]



Tags:

access:  private

Type:   mixed


[ Top ]

$user_id =

[line 17]



Tags:

access:  private

Type:   mixed


[ Top ]

$visible =

[line 21]



Tags:

access:  private

Type:   mixed


[ Top ]

$weight =

[line 20]



Tags:

access:  private

Type:   mixed


[ Top ]



Class Methods


constructor Category [line 27]

Category Category( )



[ Top ]

method add [line 235]

void add( )

Insert this category into the database



Tags:

access:  public


[ Top ]

method add_subtree [line 732]

void add_subtree( $targets, $level, $catid, $visible)

Internal function used by get_tree()



Tags:

access:  private


Parameters:

   $targets  
   $level  
   $catid  
   $visible  

[ Top ]

method add_target_subcategories [line 621]

void add_target_subcategories( $targets, $level, $catid)

Internal function used by get_target_categories()



Tags:

access:  private


Parameters:

   $targets  
   $level  
   $catid  

[ Top ]

method apply_course_code_to_children [line 667]

void apply_course_code_to_children( )

Internal function used by move_to_cat()



Tags:

access:  private


[ Top ]

method apply_visibility_to_children [line 803]

void apply_visibility_to_children( )

Apply the same visibility to every subcategory, evaluation and link



Tags:

access:  public


[ Top ]

method calc_score [line 391]

array calc_score( [$stud_id $stud_id = null])

Calculate the score of this category



Tags:

return:  (score sum, weight sum) or null if no scores available
access:  public


Parameters:

$stud_id   $stud_id   student id (default: all students - then the average is returned)

[ Top ]

method can_be_moved_to_cat [line 641]

void can_be_moved_to_cat( $cat)

Internal function used by get_target_categories() and add_target_subcategories()

Can this category be moved to the given category ? Impossible when origin and target are the same... children won't be processed either. (a category can't be moved to one of its own children)




Tags:

access:  private


Parameters:

   $cat  

[ Top ]

method create_category_objects_from_mysql_result [line 212]

void create_category_objects_from_mysql_result( $result)



Tags:

access:  private


Parameters:

   $result  

[ Top ]

method create_root_category [line 198]

void create_root_category( )



Tags:

access:  private


[ Top ]

method delete [line 304]

void delete( )

Delete this evaluation from the database



Tags:

access:  public


[ Top ]

method delete_all [line 453]

void delete_all( )

Delete this category and every subcategory, evaluation and result inside



Tags:

access:  public


[ Top ]

method does_name_exist [line 319]

void does_name_exist( $name $name, $parent $parent)

Check if a category name (with the same parent category) already exists



Tags:

access:  public


Parameters:

$name   $name   name to check (if not given, the name property of this object will be checked)
$parent   $parent   parent category

[ Top ]

method get_all_courses [line 778]

array get_all_courses( $user_id)

Generate an array of all courses that a teacher is admin of.



Tags:

return:  2-dimensional array - every element contains 2 subelements (code, title)
access:  public


Parameters:

   $user_id  

[ Top ]

method get_certificate_min_score [line 54]

void get_certificate_min_score( )



Tags:

access:  public


[ Top ]

method get_course_code [line 65]

void get_course_code( )



Tags:

access:  public


[ Top ]

method get_date [line 1025]

void get_date( )



Tags:

access:  public


[ Top ]

method get_description [line 44]

void get_description( )



Tags:

access:  public


[ Top ]

method get_evaluations [line 929]

void get_evaluations( [int $stud_id = null], [boolean $recursive = false])

Get appropriate evaluations visible for the user



Tags:

access:  public


Parameters:

int   $stud_id   student id (default: all students)
boolean   $recursive   process subcategories (default: no recursion)

[ Top ]

method get_icon_name [line 1030]

void get_icon_name( )



Tags:

access:  public


[ Top ]

method get_id [line 34]

void get_id( )



Tags:

access:  public


[ Top ]

method get_independent_categories_with_result_for_student [line 860]

void get_independent_categories_with_result_for_student( $cat_id $cat_id, $stud_id $stud_id, [$cats $cats = array()])

Retrieve all categories inside a course independent category that should be visible to a student.



Tags:

access:  public


Parameters:

$cat_id   $cat_id   parent category
$stud_id   $stud_id   student id
$cats   $cats   optional: if defined, the categories will be added to this array

[ Top ]

method get_item_type [line 1020]

void get_item_type( )



Tags:

access:  public


[ Top ]

method get_links [line 986]

void get_links( [int $stud_id = null], [boolean $recursive = false])

Get appropriate links visible for the user



Tags:

access:  public


Parameters:

int   $stud_id   student id (default: all students)
boolean   $recursive   process subcategories (default: no recursion)

[ Top ]

method get_name [line 39]

void get_name( )



Tags:

access:  public


[ Top ]

method get_not_created_course_categories [line 747]

array get_not_created_course_categories( $user_id)

Generate an array of courses that a teacher hasn't created a category for.



Tags:

return:  2-dimensional array - every element contains 2 subelements (code, title)
access:  public


Parameters:

   $user_id  

[ Top ]

method get_parent_id [line 70]

void get_parent_id( )



Tags:

access:  public


[ Top ]

method get_root_categories_for_student [line 479]

void get_root_categories_for_student( $stud_id $stud_id)

Return array of Category objects where a student is subscribed to.



Tags:

access:  public


Parameters:

$stud_id   $stud_id   student id

[ Top ]

method get_root_categories_for_teacher [line 522]

void get_root_categories_for_teacher( $user_id $user_id)

Return array of Category objects where a teacher is admin for.



Tags:

access:  public


Parameters:

$user_id   $user_id   user id (to return everything, use 'null' here)

[ Top ]

method get_subcategories [line 880]

void get_subcategories( [int $stud_id = null])

Get appropriate subcategories visible for the user



Tags:

access:  public


Parameters:

int   $stud_id   student id (default: all students)

[ Top ]

method get_target_categories [line 570]

array get_target_categories( )

Generate an array of possible categories where this category can be moved to.

Notice: its own parent will be included in the list: it's up to the frontend to disable this element.




Tags:

return:  2-dimensional array - every element contains 3 subelements (id, name, level)
access:  public


[ Top ]

method get_tree [line 695]

void get_tree( )

Generate an array of all categories the user can navigate to



Tags:

access:  public


[ Top ]

method get_user_id [line 49]

void get_user_id( )



Tags:

access:  public


[ Top ]

method get_weight [line 75]

void get_weight( )



Tags:

access:  public


[ Top ]

method has_evaluations_with_results_for_student [line 833]

void has_evaluations_with_results_for_student( $stud_id)

Check if a category contains evaluations with a result for a given student



Tags:

access:  public


Parameters:

   $stud_id  

[ Top ]

method is_certificate_available [line 365]

boolean is_certificate_available( integer $user_id)

Checks if the certificate is available for the given user in this category



Tags:

return:  True if conditions match, false if fails
access:  public


Parameters:

integer   $user_id   User ID

[ Top ]

method is_course [line 379]

void is_course( )

Is this category a course ? A category is a course if it has a course code and no parent category.



Tags:

access:  public


[ Top ]

method is_movable [line 559]

void is_movable( )

Can this category be moved to somewhere else ? The root and courses cannot be moved.



Tags:

access:  public


[ Top ]

method is_visible [line 80]

void is_visible( )



Tags:

access:  public


[ Top ]

method load [line 141]

void load( [$id $id = null], [$user_id $user_id = null], [$course_code $course_code = null], [$parent_id $parent_id = null], [$visible $visible = null])

Retrieve categories and return them as an array of Category objects



Tags:

access:  public


Parameters:

$id   $id   category id
$user_id   $user_id   user id (category owner)
$course_code   $course_code   course code
$parent_id   $parent_id   parent category
$visible   $visible   visible

[ Top ]

method move_to_cat [line 653]

void move_to_cat( $cat)

Move this category to the given category.

If this category moves from inside a course to outside, its course code must be changed, as well as the course code of all underlying categories and evaluations. All links will be deleted as well !




Tags:

access:  public


Parameters:

   $cat  

[ Top ]

method save [line 264]

void save( )

Update the properties of this category in the database



Tags:

access:  public


[ Top ]

method set_certificate_min_score [line 110]

void set_certificate_min_score( [ $min_score = null])



Tags:

access:  public


Parameters:

   $min_score  

[ Top ]

method set_course_code [line 105]

void set_course_code( $course_code)



Tags:

access:  public


Parameters:

   $course_code  

[ Top ]

method set_description [line 95]

void set_description( $description)



Tags:

access:  public


Parameters:

   $description  

[ Top ]

method set_id [line 85]

void set_id( $id)



Tags:

access:  public


Parameters:

   $id  

[ Top ]

method set_name [line 90]

void set_name( $name)



Tags:

access:  public


Parameters:

   $name  

[ Top ]

method set_parent_id [line 115]

void set_parent_id( $parent)



Tags:

access:  public


Parameters:

   $parent  

[ Top ]

method set_user_id [line 100]

void set_user_id( $user_id)



Tags:

access:  public


Parameters:

   $user_id  

[ Top ]

method set_visible [line 125]

void set_visible( $visible)



Tags:

access:  public


Parameters:

   $visible  

[ Top ]

method set_weight [line 120]

void set_weight( $weight)



Tags:

access:  public


Parameters:

   $weight  

[ Top ]


Documentation generated on Thu, 12 Jun 2008 13:02:17 -0500 by phpDocumentor 1.4.1