3 class CourseObjectManual
extends CourseObject
{
6 * Display status message as course content.
8 public
function take() {
9 return $this->getStatus();
13 * Return a message about the user's status in this object, for when this
16 public
function getStatus($type = 'short') {
17 $grade = $this->getFulfillment()->getGrade();
18 $config = $this->getOptions();
19 if (!$this->getFulfillment()->getId()) {
20 // User has not been given a status yet.
21 return $config['incomplete_msg'];
24 if ($this->getFulfillment()->isComplete()) {
25 // Complete. User given passed status.
26 return $config['complete_msg'];
29 // User given a status but it wasn't complete. This means they failed.
30 return $config['failed_msg'];
34 public
function optionsDefinition() {
35 $defaults = parent
::optionsDefinition();
37 $defaults['complete_msg'] = 'Your instructor has marked you as passed.';
38 $defaults['incomplete_msg'] = 'Your instructor has not given you a pass/fail grade yet.';
39 $defaults['failed_msg'] = 'Your instructor has marked you as failed.';
44 public
function optionsForm(&$form, &$form_state) {
45 parent
::optionsForm($form, $form_state);
47 $config = $this->getOptions();
49 $form['complete_msg'] = array(
50 '#type' => 'textfield',
51 '#title' => 'Complete message',
52 '#default_value' => $config['complete_msg'],
55 $form['failed_msg'] = array(
56 '#type' => 'textfield',
57 '#title' => 'Failed message',
58 '#default_value' => $config['failed_msg'],
61 $form['incomplete_msg'] = array(
62 '#type' => 'textfield',
63 '#title' => 'Incomplete message',
64 '#default_value' => $config['incomplete_msg'],