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

Public Member Functions

 MoodleQuickForm_rubriceditor ($elementName=null, $elementLabel=null, $attributes=null)
 setHelpButton ($helpbuttonargs, $function='helpbutton')
 getHelpButton ()
 getElementTemplateType ()
 add_regrade_confirmation ($changelevel)
 toHtml ()
 non_js_button_pressed ($value)
 validate ($value)
 exportValue (&$submitValues, $assoc=false)

Data Fields

 $_helpbutton = ''

Protected Member Functions

 prepare_data ($value=null, $withvalidation=false)
 get_next_id ($ids)

Protected Attributes

 $validationerrors = null
 $wasvalidated = false
 $nonjsbuttonpressed = false
 $regradeconfirmation = false

Detailed Description

Definition at line 29 of file rubriceditor.php.


Member Function Documentation

add_regrade_confirmation ( changelevel)

Specifies that confirmation about re-grading needs to be added to this rubric editor. $changelevel is saved in $this->regradeconfirmation and retrieved in toHtml()

See also:
gradingform_rubric_controller::update_or_check_rubric()
Parameters:
int$changelevel

Definition at line 82 of file rubriceditor.php.

exportValue ( &$  submitValues,
assoc = false 
)

Prepares the data for saving

See also:
prepare_data()
Parameters:
array$submitValues
boolean$assoc
Returns:
array

Reimplemented from HTML_QuickForm_input.

Definition at line 359 of file rubriceditor.php.

Here is the call graph for this function:

get_next_id ( ids) [protected]

Scans array $ids to find the biggest element ! NEWID*, increments it by 1 and returns

Parameters:
array$ids
Returns:
string

Definition at line 310 of file rubriceditor.php.

Here is the caller graph for this function:

The renderer will take care itself about different display in normal and frozen states

Returns:
string

Definition at line 71 of file rubriceditor.php.

get html for help button

public

Returns:
string html for help button

Definition at line 62 of file rubriceditor.php.

MoodleQuickForm_rubriceditor ( elementName = null,
elementLabel = null,
attributes = null 
)

Definition at line 41 of file rubriceditor.php.

Here is the call graph for this function:

non_js_button_pressed ( value)

Checks if a submit button was pressed which is supposed to be processed on client side by JS but user seem to have disabled JS in the browser. (buttons 'add criteria', 'add level', 'move up', 'move down', etc.) In this case the form containing this element is prevented from being submitted

Parameters:
array$value
Returns:
boolean true if non-submit button was pressed and not processed by JS

Definition at line 329 of file rubriceditor.php.

Here is the call graph for this function:

prepare_data ( value = null,
withvalidation = false 
) [protected]

Prepares the data passed in $_POST:

  • processes the pressed buttons 'addlevel', 'addcriterion', 'moveup', 'movedown', 'delete' (when JavaScript is disabled) sets $this->nonjsbuttonpressed to true/false if such button was pressed
  • if options not passed (i.e. we create a new rubric) fills the options array with the default values
  • if options are passed completes the options array with unchecked checkboxes
  • if $withvalidation is set, adds 'error_xxx' attributes to elements that contain errors and creates an error string and stores it in $this->validationerrors
Parameters:
array$value
boolean$withvalidationwhether to enable data validation
Returns:
array

Definition at line 142 of file rubriceditor.php.

Here is the call graph for this function:

Here is the caller graph for this function:

setHelpButton ( helpbuttonargs,
function = 'helpbutton' 
)

set html for help button

public

Parameters:
array$helparray of arguments to make a help button
string$functionfunction name to call to get html

Definition at line 52 of file rubriceditor.php.

Here is the call graph for this function:

toHtml ( )

Returns html string to display this element

Returns:
string

Reimplemented from HTML_QuickForm_input.

Definition at line 91 of file rubriceditor.php.

Here is the call graph for this function:

validate ( value)

Validates that rubric has at least one criterion, at least two levels within one criterion, each level has a valid score, all levels have filled definitions and all criteria have filled descriptions

Parameters:
array$value
Returns:
string|false error text or false if no errors found

Definition at line 344 of file rubriceditor.php.

Here is the call graph for this function:


Field Documentation

$_helpbutton = ''

help message

Definition at line 31 of file rubriceditor.php.

$nonjsbuttonpressed = false [protected]

If non-submit (JS) button was pressed: null - unknown, true/false - button was/wasn't pressed

Definition at line 37 of file rubriceditor.php.

$regradeconfirmation = false [protected]

Message to display in front of the editor (that there exist grades on this rubric being edited)

Definition at line 39 of file rubriceditor.php.

$validationerrors = null [protected]

stores the result of the last validation: null - undefined, false - no errors, string - error(s) text

Definition at line 33 of file rubriceditor.php.

$wasvalidated = false [protected]

if element has already been validated

Definition at line 35 of file rubriceditor.php.


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