|
Moodle
2.2.1
http://www.collinsharper.com
|


Definition at line 1678 of file locallib.php.
| __construct | ( | $ | properties, |
| lesson $ | lesson | ||
| ) |
Constructor method
| object | $properties | |
| lesson | $lesson |
Definition at line 2085 of file locallib.php.
| add_page_link | ( | $ | previd | ) |
Can be set to true if the page requires a static link to create a new instance instead of simply being included in the dropdown
| int | $previd |
Reimplemented in lesson_page_type_branchtable, lesson_page_type_endofbranch, lesson_page_type_endofcluster, and lesson_page_type_cluster.
Definition at line 2180 of file locallib.php.
| callback_on_view | ( | $ | canmanage | ) |
This is a callback method that can be override and gets called when ever a page is viewed
| bool | $canmanage | True if the user has the manage cap |
Reimplemented in lesson_page_type_cluster, lesson_page_type_endofbranch, and lesson_page_type_endofcluster.
Definition at line 2108 of file locallib.php.
| check_answer | ( | ) |
This method MUST be overridden by all question page types, or page types that wish to score a page.
The structure of result should always be the same so it is a good idea when overriding this method on a page type to call $result = parent::check_answer(); before modifying it as required.
Reimplemented in lesson_page_type_branchtable, lesson_page_type_matching, lesson_page_type_multichoice, lesson_page_type_essay, lesson_page_type_truefalse, lesson_page_type_numerical, and lesson_page_type_shortanswer.
Definition at line 2277 of file locallib.php.

Creates a new lesson_page within the database and returns the correct pagetype object to use to interact with the new lesson
| object | $properties | |
| lesson | $lesson |
Definition at line 1735 of file locallib.php.

| create_answers | ( | $ | properties | ) |
Creates answers within the database for this lesson_page. Usually only ever called when creating a new page instance
| object | $properties |
Reimplemented in lesson_page_type_matching, and lesson_page_type_essay.
Definition at line 2224 of file locallib.php.


| delete | ( | ) | [final] |
Deletes a lesson_page from the database as well as any associated records.
Definition at line 1824 of file locallib.php.

| display | ( | $ | renderer, |
| $ | attempt | ||
| ) | [abstract] |
This method gets called to display the page to the user taking the lesson
| object | $renderer | |
| object | $attempt |
Reimplemented in lesson_page_type_branchtable, lesson_page_type_multichoice, lesson_page_type_essay, lesson_page_type_matching, lesson_page_type_numerical, lesson_page_type_shortanswer, lesson_page_type_truefalse, lesson_page_type_cluster, lesson_page_type_endofbranch, and lesson_page_type_endofcluster.

| display_answers | ( | html_table $ | table | ) |
Updates a table with the answers for this page
| html_table | $table |
Reimplemented in lesson_page_type_multichoice, lesson_page_type_matching, lesson_page_type_shortanswer, lesson_page_type_numerical, and lesson_page_type_truefalse.
Definition at line 2418 of file locallib.php.
| earned_score | ( | $ | answers, |
| $ | attempt | ||
| ) |
Returns the score for the attempt This may be overridden by page types that require manual grading
| array | $answers | |
| object | $attempt |
Definition at line 2097 of file locallib.php.
| get_answers | ( | ) | [final] |
Returns the answers that are associated with this page in the database
Definition at line 1884 of file locallib.php.


| get_contents | ( | ) |
Returns the contents field for the page properly formatted and with plugin file url's converted
Definition at line 2383 of file locallib.php.


| get_displayinmenublock | ( | ) | [protected] |
Set to true if this page should display in the menu block
Reimplemented in lesson_page_type_branchtable.
Definition at line 2401 of file locallib.php.
| get_grayout | ( | ) | [protected] |
Determines if this page should be grayed out on the management/report screens
Reimplemented in lesson_page_type_branchtable, lesson_page_type_endofbranch, lesson_page_type_endofcluster, and lesson_page_type_cluster.
Definition at line 2438 of file locallib.php.
| get_jump_name | ( | $ | jumpto | ) | [final, protected] |
Returns the string for a jump name
| int | $jumpto | Jump code or page ID |
Definition at line 2048 of file locallib.php.


| get_jumps | ( | ) |
Gets an array of the jumps used by the answers of this page
Reimplemented in lesson_page_type_matching, lesson_page_type_multichoice, and lesson_page_type_branchtable.
Definition at line 2481 of file locallib.php.

| static get_jumptooptions | ( | $ | pageid, |
| lesson $ | lesson | ||
| ) | [static] |
Returns an array of options to display when choosing the jumpto for a page/answer
| int | $pageid | |
| lesson | $lesson |
Definition at line 2343 of file locallib.php.

| get_lesson | ( | ) | [final, protected] |
Returns the lesson this page is associated with
Definition at line 1907 of file locallib.php.
| get_type | ( | ) | [final, protected] |
Returns the type of page this is. Not to be confused with page type
Definition at line 1916 of file locallib.php.
| get_typeid | ( | ) | [abstract, protected] |
This method should return the integer used to identify the page type within the database and throughout code. This maps back to the defines used in 1.x
Reimplemented in lesson_page_type_cluster, lesson_page_type_endofbranch, lesson_page_type_endofcluster, lesson_page_type_branchtable, lesson_page_type_essay, lesson_page_type_matching, lesson_page_type_multichoice, lesson_page_type_numerical, lesson_page_type_shortanswer, and lesson_page_type_truefalse.
| get_typestring | ( | ) | [abstract, protected] |
This method should return the string that describes the pagetype
Reimplemented in lesson_page_type_cluster, lesson_page_type_endofbranch, lesson_page_type_endofcluster, lesson_page_type_branchtable, lesson_page_type_essay, lesson_page_type_matching, lesson_page_type_multichoice, lesson_page_type_numerical, lesson_page_type_shortanswer, and lesson_page_type_truefalse.
| has_option | ( | ) |
True if the page uses a custom option
Should be override and set to true if the page uses a custom option.
Definition at line 2299 of file locallib.php.
| is_unanswered | ( | $ | nretakes | ) |
Checks to see if a page has been answered previously
| int | $nretakes |
Reimplemented in lesson_page_type_essay.
Definition at line 2210 of file locallib.php.

| is_unseen | ( | $ | param | ) |
Returns true if a page has been viewed before
| array | int | $param | Either an array of pages that have been seen or the number of retakes a user has had |
Reimplemented in lesson_page_type_branchtable.
Definition at line 2191 of file locallib.php.

This method loads a page object from the database and returns it as a specialised object that extends lesson_page
| int | $id | |
| lesson | $lesson |
Definition at line 1798 of file locallib.php.

| max_answers | ( | $ | default | ) |
Returns the maximum number of answers for this page given the maximum number of answers permitted by the lesson.
| int | $default |
Definition at line 2310 of file locallib.php.
| move | ( | $ | nextpageid = null, |
| $ | prevpageid = null |
||
| ) | [final] |
Moves a page by updating its nextpageid and prevpageid values within the database
| int | $nextpageid | |
| int | $prevpageid |
Definition at line 1863 of file locallib.php.

Get the string that describes the options of this page type
Reimplemented in lesson_page_type_multichoice, lesson_page_type_matching, and lesson_page_type_shortanswer.
Definition at line 2409 of file locallib.php.
A callback method that allows a page to override the next page a user will see during when this page is being completed.
Reimplemented in lesson_page_type_endofcluster, and lesson_page_type_cluster.
Definition at line 2507 of file locallib.php.
| properties | ( | ) |
Returns the properties of this lesson page as an object
Reimplemented from lesson_base.
Definition at line 2318 of file locallib.php.


| record_attempt | ( | $ | context | ) | [final] |
Records an attempt at this page
moodle_database $DB
| stdClass | $context |
This should be overridden by each page type to actually check the response against what ever custom criteria they have defined
Definition at line 1928 of file locallib.php.

| report_answers | ( | $ | answerpage, |
| $ | answerdata, | ||
| $ | useranswer, | ||
| $ | pagestats, | ||
| &$ | i, | ||
| &$ | n | ||
| ) |
Formats the answers of this page for a report
| object | $answerpage | |
| object | $answerdata | |
| object | $useranswer | |
| array | $pagestats | |
| int | $i | Count of first level answers |
| int | $n | Count of second level answers |
Reimplemented in lesson_page_type_matching, lesson_page_type_multichoice, lesson_page_type_shortanswer, lesson_page_type_truefalse, lesson_page_type_branchtable, lesson_page_type_numerical, and lesson_page_type_essay.
Definition at line 2464 of file locallib.php.
Informs whether this page type require manual grading or not
Reimplemented in lesson_page_type_essay.
Definition at line 2498 of file locallib.php.
Adds stats for this page to the &pagestats object. This should be defined for all page types that grade
| array | $pagestats | |
| int | $tries |
Reimplemented in lesson_page_type_matching, lesson_page_type_multichoice, lesson_page_type_shortanswer, lesson_page_type_truefalse, lesson_page_type_numerical, and lesson_page_type_essay.
Definition at line 2449 of file locallib.php.
| update | ( | $ | properties, |
| $ | context = null, |
||
| $ | maxbytes = null |
||
| ) |
Updates a lesson page and its answers within the database
| object | $properties |
Definition at line 2118 of file locallib.php.

| valid_page_and_view | ( | &$ | validpages, |
| &$ | pageviews | ||
| ) |
This method is used to determine if this page is a valid page
| array | $validpages | |
| array | $pageviews |
Reimplemented in lesson_page_type_endofbranch, lesson_page_type_endofcluster, and lesson_page_type_cluster.
Definition at line 2518 of file locallib.php.
$answers = null [protected] |
Definition at line 1689 of file locallib.php.
$lesson = null [protected] |
Definition at line 1684 of file locallib.php.
$type = 0 [protected] |
Reimplemented in lesson_page_type_branchtable, lesson_page_type_cluster, lesson_page_type_endofbranch, lesson_page_type_endofcluster, lesson_page_type_essay, lesson_page_type_matching, lesson_page_type_multichoice, lesson_page_type_numerical, lesson_page_type_shortanswer, and lesson_page_type_truefalse.
Definition at line 1694 of file locallib.php.
| const TYPE_QUESTION = 0 |
Constants used to identify the type of the page
Definition at line 1699 of file locallib.php.
| const TYPE_STRUCTURE = 1 |
Definition at line 1700 of file locallib.php.