24include_once 
"./Modules/SurveyQuestionPool/classes/class.SurveyQuestionGUI.php";
 
   41        include_once 
"./Modules/SurveyQuestionPool/classes/class.SurveyMetricQuestion.php";
 
   59        $subtype->setRequired(
true);
 
   64        $subtype->addOption($opt);
 
   68        $minimum1->setRequired(
false);
 
   69        $minimum1->setSize(6);
 
   70        $opt->addSubItem($minimum1);
 
   74        $maximum1->setRequired(
false);
 
   75        $maximum1->setSize(6);
 
   76        $opt->addSubItem($maximum1);
 
   79        $subtype->addOption($opt);
 
   83        $minimum2->setRequired(
false);
 
   84        $minimum2->setSize(6);
 
   85        $minimum2->setMinValue(0);
 
   86        $opt->addSubItem($minimum2);
 
   90        $maximum2->setRequired(
false);
 
   91        $maximum2->setSize(6);
 
   92        $opt->addSubItem($maximum2);
 
   95        $subtype->addOption($opt);
 
   99        $minimum3->setRequired(
false);
 
  100        $minimum3->setSize(6);
 
  101        $minimum3->setMinValue(0);
 
  102        $minimum3->setDecimals(0);
 
  103        $opt->addSubItem($minimum3);
 
  107        $maximum3->setDecimals(0);
 
  108        $maximum3->setRequired(
false);
 
  109        $maximum3->setSize(6);
 
  110        $opt->addSubItem($maximum3);
 
  114        $subtype->setValue($this->object->getSubtype());
 
  116        switch ($this->object->getSubtype()) {
 
  118                $minimum1->setValue($this->object->getMinimum());
 
  119                $maximum1->setValue($this->object->getMaximum());
 
  123                $minimum2->setValue($this->object->getMinimum());
 
  124                $maximum2->setValue($this->object->getMaximum());
 
  128                $minimum3->setValue($this->object->getMinimum());
 
  129                $maximum3->setValue($this->object->getMaximum());
 
  137        $this->
object->setOrientation($a_form->
getInput(
"orientation"));
 
  138        $this->
object->setSubtype(
$type);
 
  139        $this->
object->setMinimum($a_form->
getInput(
"minimum" . 
$type));
 
  140        $this->
object->setMaximum($a_form->
getInput(
"maximum" . 
$type));
 
  143    public function getParsedAnswers(array $a_working_data = 
null, $a_only_user_anwers = 
false)
 
  147        if (is_array($a_working_data)) {
 
  148            $res[] = array(
"value" => $a_working_data[0][
"value"]);
 
  161    public function getPrintView($question_title = 1, $show_questiontext = 1, $survey_id = 
null, array $a_working_data = 
null)
 
  164        if ($a_working_data) {
 
  166            $user_answer = $user_answer[0][
"value"];
 
  169        $template = 
new ilTemplate(
"tpl.il_svy_qpl_metric_printview.html", 
true, 
true, 
"Modules/SurveyQuestionPool");
 
  170        $template->setVariable(
"MIN_MAX", $this->object->getMinMaxText());
 
  172        if ($show_questiontext) {
 
  175        if ($question_title) {
 
  178        $template->setVariable(
"TEXT_ANSWER", $this->lng->txt(
"answer"));
 
  179        $template->setVariable(
"QUESTION_ID", $this->object->getId());
 
  181        if (!is_array($a_working_data) || !trim($user_answer)) {
 
  184            for (
$i = 0; 
$i < 10; 
$i++) {
 
  185                $solution_text .= 
" ";
 
  188            $solution_text = $user_answer;
 
  190        $template->setVariable(
"TEXT_SOLUTION", $solution_text);
 
  208    public function getWorkingForm($working_data = 
"", $question_title = 1, $show_questiontext = 1, $error_message = 
"", $survey_id = 
null)
 
  210        $template = 
new ilTemplate(
"tpl.il_svy_out_metric.html", 
true, 
true, 
"Modules/SurveyQuestionPool");
 
  211        $template->setCurrentBlock(
"material_metric");
 
  214        $template->setVariable(
"MIN_MAX", $this->object->getMinMaxText());
 
  230        $template->setVariable(
"QUESTIONTEXT", $this->object->prepareTextareaOutput($questiontext, 
true));
 
  231        if ($show_questiontext) {
 
  234        if ($question_title) {
 
  235            $template->setVariable(
"QUESTION_TITLE", $this->object->getTitle());
 
  237        $template->setVariable(
"TEXT_ANSWER", $this->lng->txt(
"answer"));
 
  238        $template->setVariable(
"QUESTION_ID", $this->object->getId());
 
  239        if (is_array($working_data)) {
 
  240            $template->setVariable(
"VALUE_METRIC", $working_data[0][
"value"]);
 
  243        $template->setVariable(
"INPUT_SIZE", 10);
 
  245        if (strcmp($error_message, 
"") != 0) {
 
  246            $template->setVariable(
"ERROR_MESSAGE", 
"<p class=\"warning\">$error_message</p>");
 
An exception for terminatinating execution or to throw for unit testing.
Metric survey question GUI representation.
addFieldsToEditForm(ilPropertyFormGUI $a_form)
getWorkingForm($working_data="", $question_title=1, $show_questiontext=1, $error_message="", $survey_id=null)
Creates the question output form for the learner.
importEditFormValues(ilPropertyFormGUI $a_form)
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.
const SUBTYPE_RATIO_NON_ABSOLUTE
const SUBTYPE_RATIO_ABSOLUTE
Basic class for all survey question types.
getPrintViewQuestionTitle($question_title=1)
outQuestionText($template)
setQuestionTabsForClass($guiclass)
getMaterialOutput()
Creates the HTML output of the question material(s)
This class represents an option in a radio group.
special template class to simplify handling of ITX/PEAR
foreach($_POST as $key=> $value) $res