Class: CourseManager
Source Location: /main/inc/lib/course.lib.php
Class Details
[line 177]
Class Methods
method add_user_to_course [line 344]
boolean add_user_to_course(
int
$user_id, string
$course_code, [string
$status = STUDENT])
|
|
Subscribe a user $user_id to a course $course_code.
Tags:
Parameters:
method attempt_create_virtual_course [line 1236]
void attempt_create_virtual_course(
$real_course_code,
$course_title,
$wanted_course_code,
$course_language,
$course_category)
|
|
Checks all parameters needed to create a virtual course. If they are all set, the virtual course creation procedure is called. Call this function instead of create_virtual_course
Parameters:
method check_parameter [line 465]
true check_parameter(
$parameter,
$error_message)
|
|
Checks wether a parameter exists. If it doesn't, the function displays an error message.
Tags:
Parameters:
method check_parameter_or_fail [line 479]
void check_parameter_or_fail(
$parameter,
$error_message)
|
|
Lets the script die when a parameter check fails.
Tags:
Parameters:
method create_combined_code [line 715]
void create_combined_code(
$user_is_registered_in_real_course,
$real_course_code,
$virtual_course_list)
|
|
Create a course code based on all real and virtual courses the user is registered in.
Parameters:
method create_combined_name [line 688]
void create_combined_name(
boolean
$user_is_registered_in_real_course,
$real_course_name,
$virtual_course_list, string
$real_course_name,, array
$virtual_course_list,)
|
|
Create a course title based on all real and virtual courses the user is registered in.
Parameters:
method create_database_dump [line 1504]
void create_database_dump(
$course_code
$course_code)
|
|
Creates a file called mysql_dump.sql in the course folder
Tags:
Parameters:
method create_virtual_course [line 1263]
true create_virtual_course(
$real_course_code,
$course_title,
$wanted_course_code,
$course_language,
$course_category)
|
|
This function creates a virtual course. It assumes all parameters have been checked and are not empty. It checks wether a course with the $wanted_course_code already exists. Users of this library should consider this function private, please call attempt_create_virtual_course instead of this one. NOTE: The virtual course 'owner' id (the first course admin) is set to the CURRENT user id.
Tags:
Parameters:
method delete_course [line 1323]
void delete_course(
string
$code)
|
|
Delete a course This function deletes a whole course-area from the platform. When the given course is a virtual course, the database and directory will not be deleted. When the given course is a real course, also all virtual courses refering to the given course will be deleted. Considering the fact that we remove all traces of the course in the main database, it makes sense to remove all tracking as well (if stats databases exist) so that a new course created with this code would not use the remains of an older course.
Tags:
Parameters:
method determine_course_title_from_course_info [line 614]
an determine_course_title_from_course_info(
$user_id,
$user_id, $course_info,
$course_info)
|
|
Find out for which courses the user is registered and determine a visual course code and course title from that. Takes virtual courses into account Default case: the name and code stay what they are. Scenarios: - User is registered in real course and virtual courses; name / code become a mix of all
- User is registered in real course only: name stays that of real course
- User is registered in virtual course only: name becomes that of virtual course
- user is not registered to any of the real/virtual courses: name stays that of real course
(I'm not sure about the last case, but this seems not too bad)
Tags:
Parameters:
method get_access_settings [line 205]
an get_access_settings(
$course_code, string
$course_code,)
|
|
Returns the access settings of the course: which visibility; wether subscribing is allowed; wether unsubscribing is allowed.
Tags:
Parameters:
method get_coach_list_from_course_code [line 1060]
void get_coach_list_from_course_code(
$course_code,
$session_id)
|
|
Parameters:
method get_course_information [line 185]
an get_course_information(
$course_code, string
$course_code,)
|
|
Returns all the information of a given coursecode
Tags:
Parameters:
method get_course_list_of_user_as_course_admin [line 572]
an get_course_list_of_user_as_course_admin(
$user_id)
|
|
Tags:
Parameters:
method get_group_list_of_course [line 1209]
void get_group_list_of_course(
$course_code)
|
|
Parameters:
method get_list_of_virtual_courses_for_specific_user_and_real_course [line 1181]
array get_list_of_virtual_courses_for_specific_user_and_real_course(
$user_id,
$user_id, $real_course_code,
$real_course_code)
|
|
Return an array of arrays, listing course info of all courses in the list linked to the real course $real_course_code, to which the user $user_id is subscribed.
Tags:
Parameters:
method get_real_and_linked_user_list [line 1146]
array get_real_and_linked_user_list(
$course_code, [
$with_sessions = true], [
$session_id = 0], array
$course_info)
|
|
Return user info array of all users registered in the specified course this includes the users of the course itsel and the users of all linked courses.
Tags:
Parameters:
method get_real_course_code_select_html [line 426]
a get_real_course_code_select_html(
string
$element_name, [
$has_size = true], [
$only_current_user_courses = true],
$user_id, boolean
$has_size,, boolean
$only_current_user_courses,)
|
|
This code creates a select form element to let the user choose a real course to link to. A good non-display library should not use echo statements, but just return text/html so users of the library can choose when to display. We display the course code, but internally store the course id.
Tags:
Parameters:
method get_real_course_list [line 510]
an get_real_course_list(
)
|
|
Tags:
method get_real_course_list_of_user_as_course_admin [line 544]
an get_real_course_list_of_user_as_course_admin(
$user_id)
|
|
Tags:
Parameters:
method get_student_list_from_course_code [line 1103]
array get_student_list_from_course_code(
string
$course_code, [
$with_session = false], [
$session_id = 0], boolean
$full)
|
|
Return user info array of all users registered in the specified real or virtual course This only returns the users that are registered in this actual course, not linked courses.
Tags:
Parameters:
method get_target_of_linked_course [line 845]
the get_target_of_linked_course(
the
$virtual_course_code)
|
|
This function returns the course code of the real course to which a virtual course is linked.
Tags:
Parameters:
method get_user_in_course_status [line 220]
int get_user_in_course_status(
$user_id,
$course_code)
|
|
Returns the status of a user in a course, which is COURSEMANAGER or STUDENT.
Tags:
Parameters:
method get_user_list_from_course_code [line 1015]
array get_user_list_from_course_code(
string
$course_code, [
$with_session = true], [
$session_id = 0])
|
|
Return user info array of all users registered in the specified real or virtual course This only returns the users that are registered in this actual course, not linked courses.
Tags:
Parameters:
method get_virtual_courses_linked_to_real_course [line 824]
void get_virtual_courses_linked_to_real_course(
$real_course_code,
$real_course_code)
|
|
Return an array of arrays, listing course info of all virtual course linked to the real course ID $real_course_code
Parameters:
method get_virtual_course_info [line 743]
void get_virtual_course_info(
$real_course_code,
$real_course_code)
|
|
Return course info array of virtual course Note this is different from getting information about a real course!
Parameters:
method get_virtual_course_list [line 527]
an get_virtual_course_list(
)
|
|
Tags:
method has_virtual_courses_from_code [line 803]
true has_virtual_courses_from_code(
$real_course_code,
$user_id)
|
|
Tags:
Parameters:
method is_course_teacher [line 922]
true is_course_teacher(
$user_id,
$user_id, $course_code,
$course_code)
|
|
Is the user a teacher in the given course?
Tags:
Parameters:
method is_existing_course_code [line 489]
true is_existing_course_code(
$wanted_course_code)
|
|
Tags:
Parameters:
method is_user_subscribed_in_course [line 872]
true is_user_subscribed_in_course(
$user_id,
$user_id, $course_info,
$course_code, [
$in_a_session = false])
|
|
Return course info array of virtual course
Tags:
Parameters:
method is_user_subscribed_in_real_or_linked_course [line 939]
true is_user_subscribed_in_real_or_linked_course(
$user_id,
$user_id, $course_info,
$course_code, [
$session_id = ''])
|
|
Is the user subscribed in the real course or linked courses?
Tags:
Parameters:
method is_virtual_course_from_system_code [line 760]
true is_virtual_course_from_system_code(
$system_code, string
$system_code,)
|
|
Tags:
Parameters:
method is_virtual_course_from_visual_code [line 782]
true is_virtual_course_from_visual_code(
$visual_code)
|
|
What's annoying is that you can't overload functions in PHP.
Tags:
Parameters:
method subscribe_user [line 275]
void subscribe_user(
$user_id,
$course_code, [
$status = STUDENT])
|
|
Subscribe a user to a course. No checks are performed here to see if course subscription is allowed.
Tags:
Parameters:
method unsubscribe_user [line 235]
void unsubscribe_user(
int|array
$user_id, string
$course_code)
|
|
Unsubscribe one or more users from a course
Parameters:
method userCourseSort [line 1542]
void userCourseSort(
$user_id,
$course_code)
|
|
Parameters:
|
|