Go to the source code of this file.
Namespaces |
| namespace | mod |
| | Local Library of functions for module scorm.
|
Enumerations |
| enum | CHOICE_PUBLISH_ANONYMOUS |
| enum | CHOICE_PUBLISH_NAMES |
| enum | CHOICE_SHOWRESULTS_NOT |
| enum | CHOICE_SHOWRESULTS_AFTER_ANSWER |
| enum | CHOICE_SHOWRESULTS_AFTER_CLOSE |
| enum | CHOICE_SHOWRESULTS_ALWAYS |
| enum | CHOICE_DISPLAY_HORIZONTAL |
| enum | CHOICE_DISPLAY_VERTICAL |
Functions |
| | choice_user_outline ($course, $user, $mod, $choice) |
| | Standard functions /////////////////////////////////////////////////////////.
|
| | choice_user_complete ($course, $user, $mod, $choice) |
| | choice_add_instance ($choice) |
| | choice_update_instance ($choice) |
| | choice_prepare_options ($choice, $user, $coursemodule, $allresponses) |
| | choice_user_submit_response ($formanswer, $choice, $userid, $course, $cm) |
| | choice_show_reportlink ($user, $cm) |
| | prepare_choice_show_results ($choice, $course, $cm, $allresponses, $forcepublish=false) |
| | choice_delete_responses ($attemptids, $choice, $cm, $course) |
| | choice_delete_instance ($id) |
| | choice_get_participants ($choiceid) |
| | choice_get_option_text ($choice, $id) |
| | choice_get_choice ($choiceid) |
| | choice_get_view_actions () |
| | choice_get_post_actions () |
| | choice_reset_course_form_definition (&$mform) |
| | choice_reset_course_form_defaults ($course) |
| | choice_reset_userdata ($data) |
| | choice_get_response_data ($choice, $cm, $groupmode) |
| | choice_get_extra_capabilities () |
| | choice_supports ($feature) |
| | choice_extend_settings_navigation (settings_navigation $settings, navigation_node $choicenode) |
| | choice_get_completion_state ($course, $cm, $userid, $type) |
| | choice_page_type_list ($pagetype, $parentcontext, $currentcontext) |
Variables |
| global | $CHOICE_COLUMN_HEIGHT = 300 |
| global | $CHOICE_COLUMN_WIDTH = 300 |
| global | $CHOICE_PUBLISH |
| global | $CHOICE_SHOWRESULTS |
| global | $CHOICE_DISPLAY |
Enumeration Type Documentation
Function Documentation
Given an object containing all the necessary data, (defined by the form in mod_form.php) this function will create a new instance and return the id number of the new instance.
object
- Parameters:
-
- Returns:
- int
Definition at line 111 of file lib.php.
Given an ID of an instance of this module, this function will permanently delete the instance and any data that depends on it.
object
- Parameters:
-
- Returns:
- bool
Definition at line 566 of file lib.php.
object
- Parameters:
-
| array | $attemptids | |
| object | $choice | Choice main table row |
| object | $cm | Course-module object |
| object | $course | Course object |
- Returns:
- bool
Definition at line 529 of file lib.php.
Adds module specific settings to the settings block
- Parameters:
-
Definition at line 810 of file lib.php.
Gets a full choice record
object
- Parameters:
-
- Returns:
- object|bool The choice or false
Definition at line 638 of file lib.php.
Obtains the automatic completion state for this choice based on any conditions in forum settings.
- Parameters:
-
| object | $course | Course |
| object | $cm | Course-module |
| int | $userid | User ID |
| bool | $type | Type of comparison (or/and; can be used as return value if no conditions) |
- Returns:
- bool True if completed, false if not, $type if conditions not set.
Definition at line 844 of file lib.php.
Returns all other caps used in module
- Returns:
- array
Definition at line 772 of file lib.php.
Returns text string which is the answer that matches the id
object
- Parameters:
-
- Returns:
- string
Definition at line 621 of file lib.php.
Returns the users with data in one choice (users with records in choice_responses, students)
- Todo:
- : deprecated - to be deleted in 2.2
- Parameters:
-
- Returns:
- array
Definition at line 599 of file lib.php.
- Returns:
- array
Definition at line 663 of file lib.php.
object object object CONTEXT_MODULE
- Parameters:
-
| object | $choice | |
| object | $cm | |
| int | $groupmode | |
- Returns:
- array
Get the current group
Initialise the returned array, which is a matrix: $allresponses[responseid][userid] = responseobject
First get all the users who have access here To start with we assume they are all "unanswered" then move them later
Get all the recorded responses for this choice
Use the responses to move users into the correct column
Definition at line 731 of file lib.php.
- Returns:
- array
Definition at line 656 of file lib.php.
Return a list of page types
- Parameters:
-
| string | $pagetype | current page type |
| stdClass | $parentcontext | Block's parent context |
| stdClass | $currentcontext | Current context of block |
Definition at line 867 of file lib.php.
object
- Parameters:
-
| object | $choice | |
| object | $user | |
| object | $coursemodule | |
| array | $allresponses | |
- Returns:
- array
Definition at line 197 of file lib.php.
Course reset form defaults.
- Returns:
- array
Definition at line 684 of file lib.php.
Implementation of the function for printing the form elements that control whether the course reset functionality affects the choice.
- Parameters:
-
| object | $mform | form passed by reference |
Definition at line 674 of file lib.php.
Actual implementation of the reset course functionality, delete all the choice responses for course $data->courseid.
object object
- Parameters:
-
| object | $data | the data submitted from the reset course. |
- Returns:
- array status array
updating dates - shift may be negative too
Definition at line 697 of file lib.php.
- Parameters:
-
- Returns:
- void Output is echo'd
Definition at line 324 of file lib.php.
FEATURE_GROUPS FEATURE_GROUPINGS FEATURE_GROUPMEMBERSONLY FEATURE_MOD_INTRO FEATURE_COMPLETION_TRACKS_VIEWS FEATURE_GRADE_HAS_GRADE FEATURE_GRADE_OUTCOMES
- Parameters:
-
| string | $feature | FEATURE_xx constant for requested feature |
- Returns:
- mixed True if module supports feature, null if doesn't know
Definition at line 787 of file lib.php.
Given an object containing all the necessary data, (defined by the form in mod_form.php) this function will update an existing instance with new data.
object
- Parameters:
-
- Returns:
- bool
Definition at line 149 of file lib.php.
object
- Parameters:
-
| object | $course | |
| object | $user | |
| object | $mod | |
| object | $choice | |
- Returns:
- string|void
Definition at line 89 of file lib.php.
Standard functions /////////////////////////////////////////////////////////.
object
- Parameters:
-
| object | $course | |
| object | $user | |
| object | $mod | |
| object | $choice | |
- Returns:
- object|null
Definition at line 70 of file lib.php.
object
- Parameters:
-
| int | $formanswer | |
| object | $choice | |
| int | $userid | |
| object | $course | Course object |
| object | $cm | |
Definition at line 246 of file lib.php.
object
- Parameters:
-
| object | $choice | |
| object | $course | |
| object | $coursemodule | |
| array | $allresponses | * |
| bool | $allresponses | |
- Returns:
- object
Print "Select all" etc.
Definition at line 347 of file lib.php.
Variable Documentation
| $CHOICE_COLUMN_HEIGHT = 300 |
int $CHOICE_COLUMN_HEIGHT
Definition at line 25 of file lib.php.
| $CHOICE_COLUMN_WIDTH = 300 |
int $CHOICE_COLUMN_WIDTH
Definition at line 29 of file lib.php.
Initial value:array $CHOICE_DISPLAY
Definition at line 56 of file lib.php.
Initial value:array $CHOICE_PUBLISH
Definition at line 44 of file lib.php.
Initial value:array $CHOICE_SHOWRESULTS
Definition at line 49 of file lib.php.