class CourseObjectCertificate in Course 6
Same name and namespace in other branches
- 7.2 modules/course_certificate/course_certificate.classes.inc \CourseObjectCertificate
- 7 modules/course_certificate/course_certificate.classes.inc \CourseObjectCertificate
Hierarchy
- class \CourseHandler
- class \CourseObject
- class \CourseObjectCertificate
- class \CourseObject
Expanded class hierarchy of CourseObjectCertificate
1 string reference to 'CourseObjectCertificate'
- course_certificate_course_handlers in modules/
course_certificate/ course_certificate.module - Implements hook_course_handlers().
File
- modules/
course_certificate/ course_certificate.classes.inc, line 3
View source
class CourseObjectCertificate extends CourseObject {
public function take() {
// Fulfill immediately.
$this
->getFulfillment()
->setComplete(1)
->save();
return l('Download certificate', "node/" . $this
->getCourseNid() . "/certificate");
}
public function optionsDefinition() {
$options = parent::optionsDefinition();
$options['required'] = 0;
$options['certificate_node'] = 1;
return $options;
}
public function optionsForm(&$form, &$form_state) {
parent::optionsForm($form, $form_state);
$options = $this
->getOptions();
$form['certificate_node'] = array(
'#title' => 'Use node settings from Certificate',
'#type' => 'checkbox',
'#default_value' => $options['certificate_node'],
'#description' => 'This will direct the user to node/' . $this
->getCourseNid() . '/certificate',
'#disabled' => TRUE,
);
}
public function getTakeType() {
return 'content';
}
public function getCloneAbility() {
return TRUE;
}
public static function getMaxOccurences() {
return 1;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CourseHandler:: |
private | property | ||
CourseHandler:: |
protected | property | ||
CourseHandler:: |
public | property | ||
CourseHandler:: |
public | property | ||
CourseHandler:: |
public | property | ||
CourseHandler:: |
public | property | ||
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:: |
final public | function | Get an option stored in this CourseObject. | |
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:: |
final public | function | Set an option for this handler. | |
CourseHandler:: |
final public | function | Set this entire handler's options. | |
CourseObject:: |
private | property | ||
CourseObject:: |
private | property | ||
CourseObject:: |
protected | property | ||
CourseObject:: |
public | function | Access functionality for course objects. | |
CourseObject:: |
public | function | Creates a course object. | 1 |
CourseObject:: |
public | function | Deletes a course object's external resources. | 1 |
CourseObject:: |
function | 1 | ||
CourseObject:: |
function | Get the object component 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 this course object's fulfillment object. | |
CourseObject:: |
function | Get the instance ID. This could be the external component ID, a Node ID... | ||
CourseObject:: |
function | Get the module that provides this course object. | ||
CourseObject:: |
public | function |
Get options, with session options having precedence. Overrides CourseHandler:: |
|
CourseObject:: |
public | function |
Get core options summary. Overrides CourseHandler:: |
2 |
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 | Get the user's status in this course object. | 1 |
CourseObject:: |
protected | function | Get the URL to take this course object, if any. | 1 |
CourseObject:: |
function | |||
CourseObject:: |
public | function | Return the URL to the course object router. | |
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:: |
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:: |
function | Set the internal course object ID. | ||
CourseObject:: |
function | Set this object's instance ID. | ||
CourseObject:: |
function | Set the module that provides this course object. | ||
CourseObject:: |
function | Set the user fulfilling/creating this course object. | ||
CourseObject:: |
final public | function | Take a course object. | |
CourseObject:: |
function | 1 | ||
CourseObject:: |
function | Remove any records associated with this course object for the user. | 1 | |
CourseObject:: |
function |
Construct a course object from a database record. Overrides CourseHandler:: |
1 | |
CourseObjectCertificate:: |
public | function |
Returns an translated error message if this object has issues with cloning. Overrides CourseObject:: |
|
CourseObjectCertificate:: |
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… Overrides CourseObject:: |
|
CourseObjectCertificate:: |
public | function |
How should this course object be executed? Overrides CourseObject:: |
|
CourseObjectCertificate:: |
public | function |
Define configuration elements and their defaults. Overrides CourseObject:: |
|
CourseObjectCertificate:: |
public | function |
Default options form for all course objects. Overrides CourseObject:: |
|
CourseObjectCertificate:: |
public | function |
Overrides CourseObject:: |