Moodle  2.2.1
http://www.collinsharper.com
lesson_page_type_essay Class Reference
Inheritance diagram for lesson_page_type_essay:
Collaboration diagram for lesson_page_type_essay:

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

Detailed Description

Definition at line 32 of file essay.php.


Member Function Documentation

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.

Returns:
stdClass

Reimplemented from lesson_page.

Definition at line 85 of file essay.php.

Here is the call graph for this function:

create_answers ( properties)

Creates answers within the database for this lesson_page. Usually only ever called when creating a new page instance

Parameters:
object$properties
Returns:
array

Reimplemented from lesson_page.

Definition at line 66 of file essay.php.

Here is the call graph for this function:

display ( renderer,
attempt 
)

This method gets called to display the page to the user taking the lesson

Parameters:
object$renderer
object$attempt
Returns:
string

Reimplemented from lesson_page.

Definition at line 51 of file essay.php.

Here is the call graph for this function:

get_earnedscore ( answers,
attempt 
)

Definition at line 238 of file essay.php.

Definition at line 48 of file essay.php.

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

Returns:
int

Reimplemented from lesson_page.

Definition at line 39 of file essay.php.

This method should return the string that describes the pagetype

Returns:
string

Reimplemented from lesson_page.

Definition at line 42 of file essay.php.

is_unanswered ( nretakes)

Checks to see if a page has been answered previously

Parameters:
int$nretakes
Returns:
bool

Reimplemented from lesson_page.

Definition at line 228 of file essay.php.

Here is the call graph for this function:

report_answers ( answerpage,
answerdata,
useranswer,
pagestats,
&$  i,
&$  n 
)

Formats the answers of this page for a report

Parameters:
object$answerpage
object$answerdata
object$useranswer
array$pagestats
int$iCount of first level answers
int$nCount of second level answers
Returns:
object The answer page for this

Reimplemented from lesson_page.

Definition at line 177 of file essay.php.

Here is the call graph for this function:

Informs whether this page type require manual grading or not

Returns:
bool

Reimplemented from lesson_page.

Definition at line 235 of file essay.php.

stats ( array &$  pagestats,
tries 
)

Adds stats for this page to the &pagestats object. This should be defined for all page types that grade

Parameters:
array$pagestats
int$tries
Returns:
bool

Reimplemented from lesson_page.

Definition at line 154 of file essay.php.

update ( properties)

Definition at line 126 of file essay.php.

Here is the call graph for this function:


Field Documentation

$string = null [protected]

Definition at line 37 of file essay.php.

$type = lesson_page::TYPE_QUESTION [protected]

Reimplemented from lesson_page.

Definition at line 34 of file essay.php.

$typeid = LESSON_PAGE_ESSAY [protected]

Definition at line 36 of file essay.php.

$typeidstring = 'essay' [protected]

Definition at line 35 of file essay.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations