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


Public Member Functions | |
| get_typeid () | |
| get_typestring () | |
| get_idstring () | |
| display ($renderer, $attempt) | |
| create_answers ($properties) | |
| check_answer () | |
| update ($properties) | |
| stats (array &$pagestats, $tries) | |
| report_answers ($answerpage, $answerdata, $useranswer, $pagestats, &$i, &$n) | |
| is_unanswered ($nretakes) | |
| requires_manual_grading () | |
| get_earnedscore ($answers, $attempt) | |
Protected Attributes | |
| $type = lesson_page::TYPE_QUESTION | |
| $typeidstring = 'essay' | |
| $typeid = LESSON_PAGE_ESSAY | |
| $string = null | |
| 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 from lesson_page.
Definition at line 85 of file essay.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 from lesson_page.
Definition at line 66 of file essay.php.

| display | ( | $ | renderer, |
| $ | attempt | ||
| ) |
This method gets called to display the page to the user taking the lesson
| object | $renderer | |
| object | $attempt |
Reimplemented from lesson_page.
Definition at line 51 of file essay.php.

| get_earnedscore | ( | $ | answers, |
| $ | attempt | ||
| ) |
| get_idstring | ( | ) |
| get_typeid | ( | ) |
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 from lesson_page.
| get_typestring | ( | ) |
This method should return the string that describes the pagetype
Reimplemented from lesson_page.
| is_unanswered | ( | $ | nretakes | ) |
Checks to see if a page has been answered previously
| int | $nretakes |
Reimplemented from lesson_page.
Definition at line 228 of file essay.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 from lesson_page.
Definition at line 177 of file essay.php.

Informs whether this page type require manual grading or not
Reimplemented from lesson_page.
Adds stats for this page to the &pagestats object. This should be defined for all page types that grade
| array | $pagestats | |
| int | $tries |
Reimplemented from lesson_page.
| update | ( | $ | properties | ) |
$type = lesson_page::TYPE_QUESTION [protected] |
Reimplemented from lesson_page.
$typeid = LESSON_PAGE_ESSAY [protected] |