ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
SurveyMetricQuestionGUI Class Reference

Metric survey question GUI representation. More...

+ Inheritance diagram for SurveyMetricQuestionGUI:
+ Collaboration diagram for SurveyMetricQuestionGUI:

Public Member Functions

 setQuestionTabs ()
 
 getParsedAnswers (array $a_working_data=null, $a_only_user_anwers=false)
 
 getPrintView ($question_title=1, $show_questiontext=1, $survey_id=null, array $a_working_data=null)
 Creates a HTML representation of the question. More...
 
 getWorkingForm ($working_data="", $question_title=1, $show_questiontext=1, $error_message="", $survey_id=null)
 Creates the question output form for the learner. More...
 
- Public Member Functions inherited from SurveyQuestionGUI
 __construct ($a_id=-1)
 
 setQuestionTabs ()
 
executeCommand ()
 
 getQuestionType ()
 Returns the question type string. More...
 
 setBackUrl ($a_url)
 
 setQuestionTabsForClass ($guiclass)
 
 getPrintView ($question_title=1, $show_questiontext=1)
 
 preview ()
 Creates a preview of the question. More...
 
 getWorkingForm ($working_data="", $question_title=1, $show_questiontext=1, $error_message="", $survey_id=null)
 
 material ($checkonly=false)
 Material tab of the survey questions. More...
 
 deleteMaterial ()
 
 addMaterial ()
 Add materials to a question. More...
 
 removeMaterial ()
 
 cancelExplorer ()
 
 addPG ()
 
 addST ()
 
 addGIT ()
 
 linkChilds ()
 
 savePhrase ($a_reload=false)
 Creates an output to save the current answers as a phrase. More...
 
 confirmSavePhrase ()
 Save a new phrase to the database. More...
 

Protected Member Functions

 initObject ()
 
 addFieldsToEditForm (ilPropertyFormGUI $a_form)
 
 importEditFormValues (ilPropertyFormGUI $a_form)
 
- Protected Member Functions inherited from SurveyQuestionGUI
 initObject ()
 
 outQuestionText ($template)
 
 initEditForm ()
 
 addCommandButtons ($a_form)
 
 editQuestion (ilPropertyFormGUI $a_form=null)
 
 saveSync ()
 
 saveReturn ()
 
 saveForm ()
 
 save ($a_return=false, $a_sync=false)
 
 copySyncForm ()
 
 syncCopies ()
 
 originalSyncForm ()
 
 sync ()
 
 cancelSync ()
 
 redirectAfterSaving ($a_return=false)
 Redirect to calling survey or to edit form. More...
 
 cancel ()
 
 validateEditForm (ilPropertyFormGUI $a_form)
 
 addFieldsToEditForm (ilPropertyFormGUI $a_form)
 
 importEditFormValues (ilPropertyFormGUI $a_form)
 
 getPrintViewQuestionTitle ($question_title=1)
 
 getMaterialOutput ()
 Creates the HTML output of the question material(s) More...
 
 initPhrasesForm ()
 
 addPhrase (ilPropertyFormGUI $a_form=null)
 Creates an output for the addition of phrases. More...
 
 addSelectedPhrase ()
 
 renderStatisticsDetailsTable (array $a_head, array $a_rows, array $a_foot=null)
 

Additional Inherited Members

- Static Public Member Functions inherited from SurveyQuestionGUI
static _getQuestionGUI ($questiontype, $question_id=-1)
 Creates a question gui representation. More...
 
static _getGUIClassNameForId ($a_q_id)
 
static _getClassNameForQType ($q_type)
 
- Data Fields inherited from SurveyQuestionGUI
 $object
 
- Protected Attributes inherited from SurveyQuestionGUI
 $rbacsystem
 
 $user
 
 $access
 
 $tree
 
 $toolbar
 
 $tabs
 
 $tpl
 
 $lng
 
 $ctrl
 
 $cumulated
 
 $parent_url
 
 $log
 

Detailed Description

Metric survey question GUI representation.

The SurveyMetricQuestionGUI class encapsulates the GUI representation for metric survey question types.

Author
Helmut Schottmüller helmu.nosp@m.t.sc.nosp@m.hottm.nosp@m.uell.nosp@m.er@ma.nosp@m.c.co.nosp@m.m

Definition at line 13 of file class.SurveyMetricQuestionGUI.php.

Member Function Documentation

◆ addFieldsToEditForm()

SurveyMetricQuestionGUI::addFieldsToEditForm ( ilPropertyFormGUI  $a_form)
protected

Reimplemented from SurveyQuestionGUI.

Definition at line 30 of file class.SurveyMetricQuestionGUI.php.

31 {
32 // subtype
33 $subtype = new ilRadioGroupInputGUI($this->lng->txt("subtype"), "type");
34 $subtype->setRequired(true);
35 $a_form->addItem($subtype);
36
37 // #10652
38 $opt = new ilRadioOption($this->lng->txt('non_ratio'), SurveyMetricQuestion::SUBTYPE_NON_RATIO, $this->lng->txt("metric_subtype_description_interval"));
39 $subtype->addOption($opt);
40
41 // minimum value
42 $minimum1 = new ilNumberInputGUI($this->lng->txt("minimum"), "minimum3");
43 $minimum1->setRequired(false);
44 $minimum1->setSize(6);
45 $opt->addSubItem($minimum1);
46
47 // maximum value
48 $maximum1 = new ilNumberInputGUI($this->lng->txt("maximum"), "maximum3");
49 $maximum1->setRequired(false);
50 $maximum1->setSize(6);
51 $opt->addSubItem($maximum1);
52
53 $opt = new ilRadioOption($this->lng->txt('ratio_non_absolute'), SurveyMetricQuestion::SUBTYPE_RATIO_NON_ABSOLUTE, $this->lng->txt("metric_subtype_description_rationonabsolute"));
54 $subtype->addOption($opt);
55
56 // minimum value
57 $minimum2 = new ilNumberInputGUI($this->lng->txt("minimum"), "minimum4");
58 $minimum2->setRequired(false);
59 $minimum2->setSize(6);
60 $minimum2->setMinValue(0);
61 $opt->addSubItem($minimum2);
62
63 // maximum value
64 $maximum2 = new ilNumberInputGUI($this->lng->txt("maximum"), "maximum4");
65 $maximum2->setRequired(false);
66 $maximum2->setSize(6);
67 $opt->addSubItem($maximum2);
68
69 $opt = new ilRadioOption($this->lng->txt('ratio_absolute'), SurveyMetricQuestion::SUBTYPE_RATIO_ABSOLUTE, $this->lng->txt("metric_subtype_description_ratioabsolute"));
70 $subtype->addOption($opt);
71
72 // minimum value
73 $minimum3 = new ilNumberInputGUI($this->lng->txt("minimum"), "minimum5");
74 $minimum3->setRequired(false);
75 $minimum3->setSize(6);
76 $minimum3->setMinValue(0);
77 $minimum3->setDecimals(0);
78 $opt->addSubItem($minimum3);
79
80 // maximum value
81 $maximum3 = new ilNumberInputGUI($this->lng->txt("maximum"), "maximum5");
82 $maximum3->setDecimals(0);
83 $maximum3->setRequired(false);
84 $maximum3->setSize(6);
85 $opt->addSubItem($maximum3);
86
87
88 // values
89 $subtype->setValue($this->object->getSubtype());
90
91 switch ($this->object->getSubtype()) {
93 $minimum1->setValue($this->object->getMinimum());
94 $maximum1->setValue($this->object->getMaximum());
95 break;
96
98 $minimum2->setValue($this->object->getMinimum());
99 $maximum2->setValue($this->object->getMaximum());
100 break;
101
103 $minimum3->setValue($this->object->getMinimum());
104 $maximum3->setValue($this->object->getMaximum());
105 break;
106 }
107 }
This class represents a number property in a property form.
addItem($a_item)
Add Item (Property, SectionHeader).
This class represents a property in a property form.
This class represents an option in a radio group.

References ilPropertyFormGUI\addItem(), SurveyMetricQuestion\SUBTYPE_NON_RATIO, SurveyMetricQuestion\SUBTYPE_RATIO_ABSOLUTE, and SurveyMetricQuestion\SUBTYPE_RATIO_NON_ABSOLUTE.

+ Here is the call graph for this function:

◆ getParsedAnswers()

SurveyMetricQuestionGUI::getParsedAnswers ( array  $a_working_data = null,
  $a_only_user_anwers = false 
)

Definition at line 118 of file class.SurveyMetricQuestionGUI.php.

119 {
120 $res = array();
121
122 if (is_array($a_working_data)) {
123 $res[] = array("value" => $a_working_data[0]["value"]);
124 }
125
126 return $res;
127 }
foreach($_POST as $key=> $value) $res

References $res.

Referenced by getPrintView().

+ Here is the caller graph for this function:

◆ getPrintView()

SurveyMetricQuestionGUI::getPrintView (   $question_title = 1,
  $show_questiontext = 1,
  $survey_id = null,
array  $a_working_data = null 
)

Creates a HTML representation of the question.

Creates a HTML representation of the question

@access private

Definition at line 136 of file class.SurveyMetricQuestionGUI.php.

137 {
138 $user_answer = null;
139 if ($a_working_data) {
140 $user_answer = $this->getParsedAnswers($a_working_data);
141 $user_answer = $user_answer[0]["value"];
142 }
143
144 $template = new ilTemplate("tpl.il_svy_qpl_metric_printview.html", true, true, "Modules/SurveyQuestionPool");
145 $template->setVariable("MIN_MAX", $this->object->getMinMaxText());
146
147 if ($show_questiontext) {
148 $this->outQuestionText($template);
149 }
150 if ($question_title) {
151 $template->setVariable("QUESTION_TITLE", $this->getPrintViewQuestionTitle($question_title));
152 }
153 $template->setVariable("TEXT_ANSWER", $this->lng->txt("answer"));
154 $template->setVariable("QUESTION_ID", $this->object->getId());
155
156 if (!is_array($a_working_data) || !trim($user_answer)) {
157 $solution_text = "";
158 $len = 10;
159 for ($i = 0; $i < 10; $i++) {
160 $solution_text .= "&#160;";
161 }
162 } else {
163 $solution_text = $user_answer;
164 }
165 $template->setVariable("TEXT_SOLUTION", $solution_text);
166
167 $template->parseCurrentBlock();
168 return $template->get();
169 }
getParsedAnswers(array $a_working_data=null, $a_only_user_anwers=false)
getPrintViewQuestionTitle($question_title=1)
special template class to simplify handling of ITX/PEAR
$i
Definition: metadata.php:24

References $i, getParsedAnswers(), SurveyQuestionGUI\getPrintViewQuestionTitle(), and SurveyQuestionGUI\outQuestionText().

+ Here is the call graph for this function:

◆ getWorkingForm()

SurveyMetricQuestionGUI::getWorkingForm (   $working_data = "",
  $question_title = 1,
  $show_questiontext = 1,
  $error_message = "",
  $survey_id = null 
)

Creates the question output form for the learner.

Creates the question output form for the learner

@access public

Reimplemented from SurveyQuestionGUI.

Definition at line 183 of file class.SurveyMetricQuestionGUI.php.

184 {
185 $template = new ilTemplate("tpl.il_svy_out_metric.html", true, true, "Modules/SurveyQuestionPool");
186 $template->setCurrentBlock("material_metric");
187 $template->setVariable("TEXT_MATERIAL", $this->getMaterialOutput());
188 $template->parseCurrentBlock();
189 $template->setVariable("MIN_MAX", $this->object->getMinMaxText());
190 /*if (strlen($this->object->getMinimum()))
191 {
192 $template->setCurrentBlock("minimum");
193 $template->setVariable("TEXT_MINIMUM", $this->lng->txt("minimum"));
194 $template->setVariable("VALUE_MINIMUM", $this->object->getMinimum());
195 $template->parseCurrentBlock();
196 }
197 if (strlen($this->object->getMaximum()))
198 {
199 $template->setCurrentBlock("maximum");
200 $template->setVariable("TEXT_MAXIMUM", $this->lng->txt("maximum"));
201 $template->setVariable("VALUE_MAXIMUM", $this->object->getMaximum());
202 $template->parseCurrentBlock();
203 }*/
204
205 $template->setVariable("QUESTIONTEXT", $this->object->prepareTextareaOutput($questiontext, true));
206 if ($show_questiontext) {
207 $this->outQuestionText($template);
208 }
209 if ($question_title) {
210 $template->setVariable("QUESTION_TITLE", $this->object->getTitle());
211 }
212 $template->setVariable("TEXT_ANSWER", $this->lng->txt("answer"));
213 $template->setVariable("QUESTION_ID", $this->object->getId());
214 if (is_array($working_data)) {
215 $template->setVariable("VALUE_METRIC", $working_data[0]["value"]);
216 }
217
218 $template->setVariable("INPUT_SIZE", 10);
219
220 if (strcmp($error_message, "") != 0) {
221 $template->setVariable("ERROR_MESSAGE", "<p class=\"warning\">$error_message</p>");
222 }
223 $template->parseCurrentBlock();
224 return $template->get();
225 }
getMaterialOutput()
Creates the HTML output of the question material(s)

References SurveyQuestionGUI\getMaterialOutput(), and SurveyQuestionGUI\outQuestionText().

+ Here is the call graph for this function:

◆ importEditFormValues()

SurveyMetricQuestionGUI::importEditFormValues ( ilPropertyFormGUI  $a_form)
protected

Reimplemented from SurveyQuestionGUI.

Definition at line 109 of file class.SurveyMetricQuestionGUI.php.

110 {
111 $type = (int) $a_form->getInput("type");
112 $this->object->setOrientation($a_form->getInput("orientation"));
113 $this->object->setSubtype($type);
114 $this->object->setMinimum($a_form->getInput("minimum" . $type));
115 $this->object->setMaximum($a_form->getInput("maximum" . $type));
116 }
getInput($a_post_var, $ensureValidation=true)
Returns the value of a HTTP-POST variable, identified by the passed id.
$type

References $type, and ilPropertyFormGUI\getInput().

+ Here is the call graph for this function:

◆ initObject()

SurveyMetricQuestionGUI::initObject ( )
protected

Reimplemented from SurveyQuestionGUI.

Definition at line 15 of file class.SurveyMetricQuestionGUI.php.

16 {
17 $this->object = new SurveyMetricQuestion();
18 }

◆ setQuestionTabs()

SurveyMetricQuestionGUI::setQuestionTabs ( )

Reimplemented from SurveyQuestionGUI.

Definition at line 25 of file class.SurveyMetricQuestionGUI.php.

26 {
27 $this->setQuestionTabsForClass("surveymetricquestiongui");
28 }

References SurveyQuestionGUI\setQuestionTabsForClass().

+ Here is the call graph for this function:

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