CMS  Version 3.9
AbstractQuestion Class Reference

Defines the relations and functions required of a Question class that uses Questionnaire form and results classes. More...

+ Inheritance diagram for AbstractQuestion:

Public Member Functions

 isEditable ()
 Returns true if the question can be edited and false if it cannot. More...
 
 QuestionType ()
 
 setDefaultValues ()
 Sets the default values for a question object: More...
 
 isFreeText ()
 
 isShortText ()
 
 isCheckList ()
 
 isRatings ()
 
 isMultiChoice ()
 
 isDropDown ()
 
 isHeading ()
 
 formatEditableMessage ()
 
 AbstractQuestion ()
 

Public Attributes

 $editable = true
 
 $fieldAliases
 

Detailed Description

Defines the relations and functions required of a Question class that uses Questionnaire form and results classes.

Question classes should contain a sort order field called either sort_order or question_number

Author
janice

Definition at line 50 of file question.inc.

Member Function Documentation

◆ AbstractQuestion()

AbstractQuestion::AbstractQuestion ( )

Definition at line 130 of file question.inc.

131  {
132  }

◆ formatEditableMessage()

AbstractQuestion::formatEditableMessage ( )

Definition at line 122 of file question.inc.

123  {
124  if(!$this->editable)
125  {
126  return "<p><b><i>Note:&nbsp;</i>This question has been answered. You may edit the question but be careful not to change its meaning.</b></p>\n";
127  }
128  }

◆ isCheckList()

AbstractQuestion::isCheckList ( )

Definition at line 97 of file question.inc.

98  {
99  return ($this->question_type_id == 5) ? true : false;
100  }
$table column("Redirect From", "<a href='redirect_form?redirect_id={redirect_id}'>{redirect_from}</a>", true, "width: 30%") -> column("Redirect To", "<a href='{redirect_to}' target='_blank'>{redirect_to}</a>", true, "width: 30%") ->column("Last Modified", "{last_modified}", true, "width: 20%; text-align: center") ->column("Override", "{ override true
Definition: redirects.inc:9

◆ isDropDown()

AbstractQuestion::isDropDown ( )

Definition at line 112 of file question.inc.

113  {
114  return ($this->question_type_id == 6) ? true : false;
115  }

◆ isEditable()

AbstractQuestion::isEditable ( )
abstract

Returns true if the question can be edited and false if it cannot.

Reimplemented in SurveyQuestion, and Question.

◆ isFreeText()

AbstractQuestion::isFreeText ( )

Definition at line 87 of file question.inc.

88  {
89  return ($this->question_type_id == 4) ? true : false;
90  }

◆ isHeading()

AbstractQuestion::isHeading ( )

Definition at line 117 of file question.inc.

118  {
119  return ($this->question_type_id == 7) ? true : false;
120  }

◆ isMultiChoice()

AbstractQuestion::isMultiChoice ( )

Definition at line 107 of file question.inc.

108  {
109  return ($this->question_type_id == 1) ? true : false;
110  }

◆ isRatings()

AbstractQuestion::isRatings ( )

Definition at line 102 of file question.inc.

103  {
104  return ($this->question_type_id == 2) ? true : false;
105  }

◆ isShortText()

AbstractQuestion::isShortText ( )

Definition at line 92 of file question.inc.

93  {
94  return ($this->question_type_id == 3) ? true : false;
95  }

◆ QuestionType()

AbstractQuestion::QuestionType ( )
abstract

Reimplemented in SurveyQuestion, and Question.

◆ setDefaultValues()

AbstractQuestion::setDefaultValues ( )

Sets the default values for a question object:

Definition at line 73 of file question.inc.

74  {
75  $this->num_rows = 3;
76  $this->required = 0;
77 
78  $qTypes = Query::create(QuestionType, "ORDER BY sort_order")
79  ->execute();
80 
81  if(count($qTypes) > 0)
82  {
83  $this->question_type_id = $qTypes[0]->question_type_id;
84  }
85  }

Member Data Documentation

◆ $editable

AbstractQuestion::$editable = true

Definition at line 52 of file question.inc.

◆ $fieldAliases

AbstractQuestion::$fieldAliases
Initial value:
= array(
"char_limit" => "Character Limit for Answer",
"num_rows" => "Number of Rows for Answer",
"options" => "Options for Answer",
"required" => "Answer Required",
)

Definition at line 54 of file question.inc.


The documentation for this class was generated from the following file: