|
Moodle
2.2.1
http://www.collinsharper.com
|
Public Member Functions | |
| __construct ($cm, $expectingmissing=CONDITION_MISSING_NOTHING, $loaddata=true) | |
| get_full_course_module () | |
| add_completion_condition ($cmid, $requiredcompletion) | |
| add_grade_condition ($gradeitemid, $min, $max, $updateinmemory=false) | |
| wipe_conditions () | |
| get_full_information ($modinfo=null) | |
| is_available (&$information, $grabthelot=false, $userid=0, $modinfo=null) | |
| show_availability () | |
Static Public Member Functions | |
| static | fill_availability_conditions (&$cm) |
| static | wipe_session_cache () |
| static | update_cm_from_form ($cm, $fromform, $wipefirst=true) |
| static | completion_value_used_as_condition ($course, $cm) |
Data Fields | |
| $gotdata | |
Definition at line 59 of file conditionlib.php.
| __construct | ( | $ | cm, |
| $ | expectingmissing = CONDITION_MISSING_NOTHING, |
||
| $ | loaddata = true |
||
| ) |
Constructs with course-module details.
object CONDITION_MISSING_NOTHING CONDITION_MISSING_EVERYTHING DEBUG_DEVELOPER CONDITION_MISSING_EXTRATABLE
| object | $cm | Moodle course-module object. May have extra fields ->conditionsgrade, ->conditionscompletion which should come from get_fast_modinfo. Should have ->availablefrom, ->availableuntil, and ->showavailability, ->course; but the only required thing is ->id. |
| int | $expectingmissing | Used to control whether or not a developer debugging message (performance warning) will be displayed if some of the above data is missing and needs to be retrieved; a CONDITION_MISSING_xx constant |
| bool | $loaddata | If you need a 'write-only' object, set this value to false to prevent database access from constructor |
Definition at line 86 of file conditionlib.php.

| add_completion_condition | ( | $ | cmid, |
| $ | requiredcompletion | ||
| ) |
Adds to the database a condition based on completion of another module.
object
| int | $cmid | ID of other module |
| int | $requiredcompletion | COMPLETION_xx constant |
Definition at line 213 of file conditionlib.php.
| add_grade_condition | ( | $ | gradeitemid, |
| $ | min, | ||
| $ | max, | ||
| $ | updateinmemory = false |
||
| ) |
Adds to the database a condition based on the value of a grade item.
object
| int | $gradeitemid | ID of grade item |
| float | $min | Minimum grade (>=), up to 5 decimal points, or null if none |
| float | $max | Maximum grade (<), up to 5 decimal points, or null if none |
| bool | $updateinmemory | If true, updates data in memory; otherwise, memory version may be out of date (this has performance consequences, so don't do it unless it really needs updating) |
Definition at line 236 of file conditionlib.php.
| static completion_value_used_as_condition | ( | $ | course, |
| $ | cm | ||
| ) | [static] |
Used in course/lib.php because we need to disable the completion JS if a completion value affects a conditional activity.
object
| object | $course | Moodle course object |
| object | $cm | Moodle course-module |
Definition at line 720 of file conditionlib.php.

| static fill_availability_conditions | ( | &$ | cm | ) | [static] |
Adds the extra availability conditions (if any) into the given course-module object.
object object
| object | $cm | Moodle course-module data object |
Definition at line 140 of file conditionlib.php.

Definition at line 201 of file conditionlib.php.
| get_full_information | ( | $ | modinfo = null | ) |
Obtains a string describing all availability restrictions (even if they do not apply any more).
object object
| object | $modinfo | Usually leave as null for default. Specify when calling recursively from inside get_fast_modinfo. The value supplied here must include list of all CMs with 'id' and 'name' |
Definition at line 289 of file conditionlib.php.

| is_available | ( | &$ | information, |
| $ | grabthelot = false, |
||
| $ | userid = 0, |
||
| $ | modinfo = null |
||
| ) |
Determines whether this particular course-module is currently available according to these criteria.
object object COMPLETION_COMPLETE COMPLETION_COMPLETE_FAIL COMPLETION_COMPLETE_PASS
| string | $information | If the item has availability restrictions, a string that describes the conditions will be stored in this variable; if this variable is set blank, that means don't display anything |
| bool | $grabthelot | Performance hint: if true, caches information required for all course-modules, to make the front page and similar pages work more quickly (works only for current user) |
| int | $userid | If set, specifies a different user ID to check availability for |
| object | $modinfo | Usually leave as null for default. Specify when calling recursively from inside get_fast_modinfo. The value supplied here must include list of all CMs with 'id' and 'name' |
Definition at line 437 of file conditionlib.php.

| coding_exception | If data wasn't loaded |
Definition at line 570 of file conditionlib.php.
| static update_cm_from_form | ( | $ | cm, |
| $ | fromform, | ||
| $ | wipefirst = true |
||
| ) | [static] |
Utility function called by modedit.php; updates the course_modules_availability table based on the module form data.
| object | $cm | Course-module with as much data as necessary, min id |
| object | $fromform | |
| bool | $wipefirst | Defaults to true |
Definition at line 690 of file conditionlib.php.
| wipe_conditions | ( | ) |
Erases from the database all conditions for this activity.
object
Definition at line 266 of file conditionlib.php.
| static wipe_session_cache | ( | ) | [static] |
For testing only. Wipes information cached in user session.
object
Definition at line 676 of file conditionlib.php.

| $gotdata |
Definition at line 63 of file conditionlib.php.