class CourseObjectManual in Course 7
Same name and namespace in other branches
- 6 modules/course_object_manual/course_object_manual.classes.inc \CourseObjectManual
- 7.2 modules/course_object_manual/course_object_manual.classes.inc \CourseObjectManual
Hierarchy
- class \Entity implements EntityInterface
- class \CourseHandler
- class \CourseObject
- class \CourseObjectManual
- class \CourseObject
- class \CourseHandler
Expanded class hierarchy of CourseObjectManual
1 string reference to 'CourseObjectManual'
- course_object_manual_course_handlers in modules/
course_object_manual/ course_object_manual.module - Implements hook_course_handlers().
File
- modules/
course_object_manual/ course_object_manual.classes.inc, line 3
View source
class CourseObjectManual extends CourseObject {
/**
* Display status message as course content.
*/
public function take() {
return $this
->getStatus();
}
/**
* Return a message about the user's status in this object, for when this
* object is hidden.
*/
public function getStatus() {
$grade = $this
->getFulfillment()
->getGrade();
$config = $this
->getOptions();
if ($this
->getFulfillment()
->isComplete()) {
// User has a completed fulfillment (passed).
return check_plain(t($config['complete_msg']));
}
elseif ($this
->getFulfillment()
->getGrade() == '') {
// User has a fulfillment but no grade (incomplete).
return check_plain(t($config['incomplete_msg']));
}
else {
// User has a grade but not complete (failed).
return check_plain(t($config['failed_msg']));
}
}
public function optionsDefinition() {
$defaults = parent::optionsDefinition();
$defaults['complete_msg'] = 'Your instructor has marked you as passed.';
$defaults['incomplete_msg'] = 'Your instructor has not given you a pass/fail grade yet.';
$defaults['failed_msg'] = 'Your instructor has marked you as failed.';
return $defaults;
}
public function optionsForm(&$form, &$form_state) {
parent::optionsForm($form, $form_state);
$config = $this
->getOptions();
$form['complete_msg'] = array(
'#type' => 'textfield',
'#title' => t('Complete message'),
'#default_value' => $config['complete_msg'],
);
$form['failed_msg'] = array(
'#type' => 'textfield',
'#title' => t('Failed message'),
'#default_value' => $config['failed_msg'],
);
$form['incomplete_msg'] = array(
'#type' => 'textfield',
'#title' => t('Incomplete message'),
'#default_value' => $config['incomplete_msg'],
);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CourseHandler:: |
final public | function | Merge an array of options onto the existing options. | |
CourseHandler:: |
public | function | Get an array of access messages. | |
CourseHandler:: |
protected | function | Return an array of database fields. This determines what fields should be serialized instead of stored. | |
CourseHandler:: |
function | |||
CourseHandler:: |
public | function | Get an handler option's value. | |
CourseHandler:: |
public | function | Return a list of warning strings about this handler. | 1 |
CourseHandler:: |
private | function | Merge arrays with replace, not append. | |
CourseHandler:: |
public | function | Set an access message to be displayed along with the course object when it is in the outline. For example, "This activity will open on XYZ" or "Please complete Step 1 to take this activity." | |
CourseHandler:: |
public | function | Set an option for this handler. | |
CourseHandler:: |
final public | function | Set this entire handler's options. | |
CourseHandler:: |
function |
Overrides Entity:: |
1 | |
CourseObject:: |
protected | property | ||
CourseObject:: |
public | function | Access functionality for course objects. | 1 |
CourseObject:: |
function |
Builds a structured array representing the entity's content. Overrides Entity:: |
||
CourseObject:: |
public static | function | Set the context of which course this course object belongs to. | 1 |
CourseObject:: |
public | function | Creates a course object. | 1 |
CourseObject:: |
public | function |
Deletes a course object's external resources. Overrides Entity:: |
1 |
CourseObject:: |
function | 1 | ||
CourseObject:: |
function | Returns an translated error message if this object has issues with cloning. | 2 | |
CourseObject:: |
function | Get the object component for this course object. | ||
CourseObject:: |
function | Get the object component title for this course object. | ||
CourseObject:: |
function | Get the Course that contains this CourseObject. | ||
CourseObject:: |
function | Get the course node ID this CourseObject belongs to. | ||
CourseObject:: |
public | function | Get the URL to edit this course object, if any. | 1 |
CourseObject:: |
public | function | Get the user's fulfillment for this course object. | |
CourseObject:: |
function | Get the instance ID. This could be the external component ID, a Node ID... | ||
CourseObject:: |
public static | function | Return the number of occurances that can be in a course at the same time. For example, the design of the Certificate module can only have 1 set of mappings per node. The same goes for Course Credit. We may also want a course object that can only be… | 2 |
CourseObject:: |
function | Get the module that provides this course object. | ||
CourseObject:: |
public | function |
Get options, with session options, except weight, having precedence. Overrides CourseHandler:: |
|
CourseObject:: |
public | function |
Get core options summary. Overrides CourseHandler:: |
1 |
CourseObject:: |
function | Let the course object provide its own reports. | 4 | |
CourseObject:: |
function | Let the course object provide its own reports. | 4 | |
CourseObject:: |
public | function | How should this course object be executed? | 2 |
CourseObject:: |
protected | function | Get the URL to take this course object, if any. | 1 |
CourseObject:: |
function | 1 | ||
CourseObject:: |
public | function | Return the URL to the course object router. | |
CourseObject:: |
public | function | ||
CourseObject:: |
public | function | Get the URL to view this course object, if any. | 1 |
CourseObject:: |
function | Grant access to the external course object. | 1 | |
CourseObject:: |
public | function | Specify whether fulfillment uses asynchronous polling. | 2 |
CourseObject:: |
public | function | ||
CourseObject:: |
function | Is this object graded? | 2 | |
CourseObject:: |
public | function | Is this course object required for course completion? | |
CourseObject:: |
public | function | If this course object is required, can be it skipped? | |
CourseObject:: |
function | Checks the temporary status of a course object. | ||
CourseObject:: |
private | function | ||
CourseObject:: |
public | function |
Save object configs to cache. Overrides CourseHandler:: |
1 |
CourseObject:: |
public | function |
Validate? Overrides CourseHandler:: |
1 |
CourseObject:: |
public | function | Override navigation links. | 1 |
CourseObject:: |
public | function | Overrides a course outline list item. | 1 |
CourseObject:: |
function | Give the course object a chance do asynchronous polling and set completion on demand. | ||
CourseObject:: |
public | function | Get all course object implementations of getOptionsSummary(). | |
CourseObject:: |
function | Revoke access to the external course object. | 1 | |
CourseObject:: |
public | function |
Let objects create their instances before saving the course object. Overrides CourseHandler:: |
1 |
CourseObject:: |
function | Set the object component for this course object. | ||
CourseObject:: |
public | function | Set the Course for this CourseObject. | |
CourseObject:: |
public | function | Mark this object for deletion. | |
CourseObject:: |
function | Set the internal course object ID. | ||
CourseObject:: |
function | Set this object's instance ID. | 1 | |
CourseObject:: |
function | Set the module that provides this course object. | ||
CourseObject:: |
public | function | ||
CourseObject:: |
final public | function | Take a course object. | |
CourseObject:: |
function | 1 | ||
CourseObject:: |
function | Remove any records associated with this course object for the user. | 2 | |
CourseObject:: |
public | function |
Generate URI from course object. Overrides Entity:: |
|
CourseObjectManual:: |
public | function |
Return a message about the user's status in this object, for when this
object is hidden. Overrides CourseObject:: |
|
CourseObjectManual:: |
public | function |
Define configuration elements and their defaults. Overrides CourseObject:: |
|
CourseObjectManual:: |
public | function |
Default options form for all course objects. Overrides CourseObject:: |
|
CourseObjectManual:: |
public | function |
Display status message as course content. Overrides CourseObject:: |
|
Entity:: |
protected | property | 1 | |
Entity:: |
protected | property | ||
Entity:: |
protected | property | ||
Entity:: |
protected | property | ||
Entity:: |
protected | property | ||
Entity:: |
public | function |
Returns the bundle of the entity. Overrides EntityInterface:: |
|
Entity:: |
protected | function | Defines the entity label if the 'entity_class_label' callback is used. | 1 |
Entity:: |
protected | function | Override this in order to implement a custom default URI and specify 'entity_class_uri' as 'uri callback' hook_entity_info(). | |
Entity:: |
public | function |
Returns the info of the type of the entity. Overrides EntityInterface:: |
|
Entity:: |
public | function |
Returns the type of the entity. Overrides EntityInterface:: |
|
Entity:: |
public | function |
Exports the entity. Overrides EntityInterface:: |
|
Entity:: |
public | function |
Gets the raw, translated value of a property or field. Overrides EntityInterface:: |
|
Entity:: |
public | function |
Checks if the entity has a certain exportable status. Overrides EntityInterface:: |
|
Entity:: |
public | function |
Returns the entity identifier, i.e. the entities name or numeric id. Overrides EntityInterface:: |
|
Entity:: |
public | function |
Returns the internal, numeric identifier. Overrides EntityInterface:: |
|
Entity:: |
public | function |
Checks whether the entity is the default revision. Overrides EntityInterface:: |
|
Entity:: |
public | function |
Returns the label of the entity. Overrides EntityInterface:: |
|
Entity:: |
protected | function | Set up the object instance on construction or unserializiation. | |
Entity:: |
public | function |
Generate an array for rendering the entity. Overrides EntityInterface:: |
|
Entity:: |
public | function |
Returns the EntityMetadataWrapper of the entity. Overrides EntityInterface:: |
|
Entity:: |
public | function | Magic method to only serialize what's necessary. | |
Entity:: |
public | function | Magic method to invoke setUp() on unserialization. |