Definition at line 669 of file question_renderer.inc.
◆ CheckListView()
CheckListView::CheckListView |
( |
|
$parent, |
|
|
|
$question |
|
) |
| |
Definition at line 671 of file question_renderer.inc.
QuestionField($parent, $question)
$question
The question renderer obj.
$parent
The parent QuestionForm obj.
◆ drawGraph()
CheckListView::drawGraph |
( |
|
$mgr, |
|
|
|
$answers |
|
) |
| |
Draws an interactive graphical view of answers to one question.
- Parameters
-
obj | $mgr | - object of the Survey/Questionnaire Results manager class |
Array | $answers | - all survey or questionnaire answers to this question |
Definition at line 810 of file question_renderer.inc.
static drawChecklistGraph($question, $resultsManager, $answers)
Draws an interactive graphical view of answers to one question.
◆ drawView()
CheckListView::drawView |
( |
| ) |
|
◆ getAnswer()
CheckListView::getAnswer |
( |
| ) |
|
Reimplemented from QuestionField.
Definition at line 776 of file question_renderer.inc.
778 $optionArr = explode(
"\n", $this->question->options);
779 $options = $this->parent->incrementArray($optionArr);
790 if(is_array($values))
792 if(array_search($value, $values) !== FALSE)
800 return implode($this->answerSeparator,
$answers);
◆ getRequired()
CheckListView::getRequired |
( |
| ) |
|
Reimplemented from QuestionField.
Definition at line 744 of file question_renderer.inc.
746 if($this->question->required > 0)
748 $optionArr = explode(
"\n", $this->question->options);
749 if(count($optionArr) > 1)
751 $label = ($this->question->required > 1) ?
"checkboxes" :
"checkbox";
752 $required =
"* at least " . $this->question->required .
" $label must be checked";
◆ getRequiredValidator()
CheckListView::getRequiredValidator |
( |
| ) |
|
Reimplemented from QuestionField.
Definition at line 760 of file question_renderer.inc.
764 $pk = $this->question->getPrimaryKey();
765 $answer = ($this->parent->readOnlyForm) ? $this->answer :
"";
766 $question_number = $this->question->question_number ? $this->question->question_number : $this->parent->mgr->getQuestionNumber($this->question);
$answer
The answer to the question obj.
RequiredCheckListQuestion Validator.
◆ getValues()
CheckListView::getValues |
( |
| ) |
|
Definition at line 676 of file question_renderer.inc.
678 $values = $this->parent->getAnswer($this->question);
681 if(strlen($values)==1 AND is_numeric($values))
682 $values = array($values);
683 elseif(strlen($values)==0)
686 $values = explode(",", $values);
◆ writeHTML()
CheckListView::writeHTML |
( |
| ) |
|
Reimplemented from QuestionField.
Definition at line 691 of file question_renderer.inc.
693 $optionArr = explode(
"\n", $this->question->options);
694 $options = $this->parent->incrementArray($optionArr);
695 $tips = explode(
"\n", $this->question->context_help);
699 $readonly = $this->parent->readOnlyForm ?
" DISABLED" :
"";
702 echo
"<table class=\"layout\">";
706 $pk = $this->question->getPrimaryKey();
712 if(is_array($values))
714 $checked = (array_search($value, $values) !== FALSE) ?
" checked" :
"";
717 $tip = $tips[$idx - 1];
720 $tip =
" onmouseover=\"showTextToolTip('question_{$this->question->$pk}', event, 'question_help', '".jsSafe($tip).
"'); return false;\" onmouseout=\"hideToolTip('question_help');return false\" ";
723 echo
"<tr><td style=\"padding:1px\"$tip><input type='checkbox'
724 class='checkbox' name='question_{$this->question->$pk}[$idx]'
725 value='$value'$readonly$checked/> $text</td></tr>";
730 echo
"<input type=\"hidden\" name=\"count_question_{$this->question->$pk}\" value=\"$count\">";
$readonly
Whether the questions should be drawn readonly.
The documentation for this class was generated from the following file: