00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 include_once "./survey/classes/class.SurveyQuestionGUI.php";
00025 include_once "./survey/classes/inc.SurveyConstants.php";
00026
00038 class SurveyNominalQuestionGUI extends SurveyQuestionGUI
00039 {
00040
00049 function SurveyNominalQuestionGUI(
00050 $id = -1
00051 )
00052
00053 {
00054 $this->SurveyQuestionGUI();
00055 include_once "./survey/classes/class.SurveyNominalQuestion.php";
00056 $this->object = new SurveyNominalQuestion();
00057 if ($id >= 0)
00058 {
00059 $this->object->loadFromDb($id);
00060 }
00061 }
00062
00071 function getQuestionType()
00072 {
00073 return "SurveyNominalQuestion";
00074 }
00075
00083 function editQuestion()
00084 {
00085 $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_svy_qpl_nominal.html", true);
00086 $this->tpl->addBlockFile("OTHER_QUESTION_DATA", "other_question_data", "tpl.il_svy_qpl_other_question_data.html", true);
00087 $this->tpl->setVariable("TEXT_ORIENTATION", $this->lng->txt("orientation"));
00088 switch ($this->object->getOrientation())
00089 {
00090 case 0:
00091 $this->tpl->setVariable("SELECTED_VERTICAL", " selected=\"selected\"");
00092 break;
00093 case 1:
00094 $this->tpl->setVariable("SELECTED_HORIZONTAL", " selected=\"selected\"");
00095 break;
00096 case 2:
00097 $this->tpl->setVariable("SELECTED_COMBOBOX", " selected=\"selected\"");
00098 break;
00099 }
00100 $this->tpl->setVariable("TXT_VERTICAL", $this->lng->txt("vertical"));
00101 $this->tpl->setVariable("TXT_HORIZONTAL", $this->lng->txt("horizontal"));
00102 if ($this->object->getSubtype() == SUBTYPE_MCSR)
00103 {
00104 $this->tpl->setVariable("TXT_COMBOBOX", $this->lng->txt("combobox"));
00105 }
00106
00107 $internallinks = array(
00108 "lm" => $this->lng->txt("obj_lm"),
00109 "st" => $this->lng->txt("obj_st"),
00110 "pg" => $this->lng->txt("obj_pg"),
00111 "glo" => $this->lng->txt("glossary_term")
00112 );
00113 foreach ($internallinks as $key => $value)
00114 {
00115 $this->tpl->setCurrentBlock("internallink");
00116 $this->tpl->setVariable("TYPE_INTERNAL_LINK", $key);
00117 $this->tpl->setVariable("TEXT_INTERNAL_LINK", $value);
00118 $this->tpl->parseCurrentBlock();
00119 }
00120
00121 $this->tpl->setCurrentBlock("adm_content");
00122 $this->tpl->setVariable("TEXT_MATERIAL", $this->lng->txt("material"));
00123 if (count($this->object->material))
00124 {
00125 include_once "./survey/classes/class.SurveyQuestion.php";
00126 $href = SurveyQuestion::_getInternalLinkHref($this->object->material["internal_link"]);
00127 $this->tpl->setVariable("TEXT_VALUE_MATERIAL", " <a href=\"$href\" target=\"content\">" . $this->lng->txt("material"). "</a> ");
00128 $this->tpl->setVariable("BUTTON_REMOVE_MATERIAL", $this->lng->txt("remove"));
00129 $this->tpl->setVariable("BUTTON_ADD_MATERIAL", $this->lng->txt("change"));
00130 $this->tpl->setVariable("VALUE_MATERIAL", $this->object->material["internal_link"]);
00131 $this->tpl->setVariable("VALUE_MATERIAL_TITLE", $this->object->material["title"]);
00132 $this->tpl->setVariable("TEXT_TITLE", $this->lng->txt("title"));
00133 }
00134 else
00135 {
00136 $this->tpl->setVariable("BUTTON_ADD_MATERIAL", $this->lng->txt("add"));
00137 }
00138 $this->tpl->setVariable("QUESTION_ID", $this->object->getId());
00139 $this->tpl->setVariable("VALUE_TITLE", $this->object->getTitle());
00140 $this->tpl->setVariable("VALUE_DESCRIPTION", $this->object->getDescription());
00141 $this->tpl->setVariable("VALUE_AUTHOR", $this->object->getAuthor());
00142 $questiontext = $this->object->getQuestiontext();
00143 $this->tpl->setVariable("VALUE_QUESTION", ilUtil::prepareFormOutput($this->object->prepareTextareaOutput($questiontext)));
00144 $this->tpl->setVariable("TXT_SR", $this->lng->txt("multiple_choice_single_response"));
00145 $this->tpl->setVariable("TXT_MR", $this->lng->txt("multiple_choice_multiple_response"));
00146 if ($this->object->getSubtype() == SUBTYPE_MCSR)
00147 {
00148 $this->tpl->setVariable("SELECTED_SR", " selected=\"selected\"");
00149 }
00150 else
00151 {
00152 $this->tpl->setVariable("SELECTED_MR", " selected=\"selected\"");
00153 }
00154 $this->tpl->setVariable("TEXT_TITLE", $this->lng->txt("title"));
00155 $this->tpl->setVariable("TEXT_AUTHOR", $this->lng->txt("author"));
00156 $this->tpl->setVariable("TEXT_DESCRIPTION", $this->lng->txt("description"));
00157 $this->tpl->setVariable("TEXT_QUESTION", $this->lng->txt("question"));
00158 $this->tpl->setVariable("TEXT_QUESTION_TYPE", $this->lng->txt("questiontype"));
00159 $this->tpl->setVariable("TEXT_OBLIGATORY", $this->lng->txt("obligatory"));
00160 if ($this->object->getObligatory())
00161 {
00162 $this->tpl->setVariable("CHECKED_OBLIGATORY", " checked=\"checked\"");
00163 }
00164 $this->tpl->setVariable("SAVE",$this->lng->txt("save"));
00165 $this->tpl->setVariable("TXT_REQUIRED_FLD", $this->lng->txt("required_field"));
00166 $this->tpl->setVariable("FORM_ACTION", $this->ctrl->getFormAction($this));
00167 $this->tpl->setVariable("TEXT_QUESTION_TYPE", $this->lng->txt($this->getQuestionType()));
00168 $this->tpl->parseCurrentBlock();
00169 include_once "./Services/RTE/classes/class.ilRTE.php";
00170 $rtestring = ilRTE::_getRTEClassname();
00171 include_once "./Services/RTE/classes/class.$rtestring.php";
00172 $rte = new $rtestring();
00173 $rte->addPlugin("latex");
00174 $rte->addButton("latex");
00175 $rte->removePlugin("ibrowser");
00176 include_once "./classes/class.ilObject.php";
00177 $obj_id = $_GET["q_id"];
00178 $obj_type = ilObject::_lookupType($_GET["ref_id"], TRUE);
00179 $rte->addRTESupport($obj_id, $obj_type, "survey");
00180 }
00181
00189 function outWorkingForm($working_data = "", $question_title = 1, $error_message = "")
00190 {
00191 if (count($this->object->material))
00192 {
00193 $this->tpl->setCurrentBlock("material_nominal");
00194 include_once "./survey/classes/class.SurveyQuestion.php";
00195 $href = SurveyQuestion::_getInternalLinkHref($this->object->material["internal_link"]);
00196 $this->tpl->setVariable("TEXT_MATERIAL", $this->lng->txt("material") . ": <a href=\"$href\" target=\"content\">" . $this->object->material["title"]. "</a> ");
00197 $this->tpl->parseCurrentBlock();
00198 }
00199 switch ($this->object->getOrientation())
00200 {
00201 case 0:
00202
00203 for ($i = 0; $i < $this->object->categories->getCategoryCount(); $i++) {
00204 $category = $this->object->categories->getCategory($i);
00205 if ($this->object->getSubtype() == SUBTYPE_MCSR)
00206 {
00207 $this->tpl->setCurrentBlock("nominal_row_sr");
00208 $this->tpl->setVariable("TEXT_NOMINAL", $category);
00209 $this->tpl->setVariable("VALUE_NOMINAL", $i);
00210 $this->tpl->setVariable("QUESTION_ID", $this->object->getId());
00211 if (is_array($working_data))
00212 {
00213 foreach ($working_data as $value)
00214 {
00215 if (strlen($value["value"]))
00216 {
00217 if ($value["value"] == $i)
00218 {
00219 $this->tpl->setVariable("CHECKED_NOMINAL", " checked=\"checked\"");
00220 }
00221 }
00222 }
00223 }
00224 $this->tpl->parseCurrentBlock();
00225 }
00226 else
00227 {
00228 $this->tpl->setCurrentBlock("nominal_row_mr");
00229 $this->tpl->setVariable("TEXT_NOMINAL", $category);
00230 $this->tpl->setVariable("VALUE_NOMINAL", $i);
00231 $this->tpl->setVariable("QUESTION_ID", $this->object->getId());
00232 if (is_array($working_data))
00233 {
00234 foreach ($working_data as $value)
00235 {
00236 if (strlen($value["value"]))
00237 {
00238 if ($value["value"] == $i)
00239 {
00240 $this->tpl->setVariable("CHECKED_NOMINAL", " checked=\"checked\"");
00241 }
00242 }
00243 }
00244 }
00245 $this->tpl->parseCurrentBlock();
00246 }
00247 }
00248 break;
00249 case 1:
00250
00251 if ($this->object->getSubtype() == SUBTYPE_MCSR)
00252 {
00253 for ($i = 0; $i < $this->object->categories->getCategoryCount(); $i++)
00254 {
00255 $category = $this->object->categories->getCategory($i);
00256 $this->tpl->setCurrentBlock("radio_col_nominal");
00257 $this->tpl->setVariable("VALUE_NOMINAL", $i);
00258 $this->tpl->setVariable("QUESTION_ID", $this->object->getId());
00259 if (is_array($working_data))
00260 {
00261 foreach ($working_data as $value)
00262 {
00263 if (strlen($value["value"]))
00264 {
00265 if ($value["value"] == $i)
00266 {
00267 $this->tpl->setVariable("CHECKED_NOMINAL", " checked=\"checked\"");
00268 }
00269 }
00270 }
00271 }
00272 $this->tpl->parseCurrentBlock();
00273 }
00274 for ($i = 0; $i < $this->object->categories->getCategoryCount(); $i++)
00275 {
00276 $category = $this->object->categories->getCategory($i);
00277 $this->tpl->setCurrentBlock("text_col_nominal");
00278 $this->tpl->setVariable("VALUE_NOMINAL", $i);
00279 $this->tpl->setVariable("TEXT_NOMINAL", $category);
00280 $this->tpl->setVariable("QUESTION_ID", $this->object->getId());
00281 $this->tpl->parseCurrentBlock();
00282 }
00283 }
00284 else
00285 {
00286 for ($i = 0; $i < $this->object->categories->getCategoryCount(); $i++)
00287 {
00288 $category = $this->object->categories->getCategory($i);
00289 $this->tpl->setCurrentBlock("checkbox_col_nominal");
00290 $this->tpl->setVariable("VALUE_NOMINAL", $i);
00291 $this->tpl->setVariable("QUESTION_ID", $this->object->getId());
00292 if (is_array($working_data))
00293 {
00294 foreach ($working_data as $value)
00295 {
00296 if (strlen($value["value"]))
00297 {
00298 if ($value["value"] == $i)
00299 {
00300 $this->tpl->setVariable("CHECKED_NOMINAL", " checked=\"checked\"");
00301 }
00302 }
00303 }
00304 }
00305 $this->tpl->parseCurrentBlock();
00306 }
00307 for ($i = 0; $i < $this->object->categories->getCategoryCount(); $i++)
00308 {
00309 $category = $this->object->categories->getCategory($i);
00310 $this->tpl->setCurrentBlock("text_col_nominal_mr");
00311 $this->tpl->setVariable("VALUE_NOMINAL", $i);
00312 $this->tpl->setVariable("TEXT_NOMINAL", $category);
00313 $this->tpl->setVariable("QUESTION_ID", $this->object->getId());
00314 $this->tpl->parseCurrentBlock();
00315 }
00316 }
00317 break;
00318 case 2:
00319
00320 for ($i = 0; $i < $this->object->categories->getCategoryCount(); $i++)
00321 {
00322 $category = $this->object->categories->getCategory($i);
00323 $this->tpl->setCurrentBlock("comborow_nominal");
00324 $this->tpl->setVariable("TEXT_NOMINAL", $category);
00325 $this->tpl->setVariable("VALUE_NOMINAL", $i);
00326 if (is_array($working_data))
00327 {
00328 foreach ($working_data as $value)
00329 {
00330 if (strlen($value["value"]))
00331 {
00332 if ($value["value"] == $i)
00333 {
00334 $this->tpl->setVariable("SELECTED_NOMINAL", " selected=\"selected\"");
00335 }
00336 }
00337 }
00338 }
00339 $this->tpl->parseCurrentBlock();
00340 }
00341 $this->tpl->setCurrentBlock("combooutput_nominal");
00342 $this->tpl->setVariable("QUESTION_ID", $this->object->getId());
00343 $this->tpl->setVariable("SELECT_OPTION", $this->lng->txt("select_option"));
00344 $this->tpl->setVariable("TEXT_SELECTION", $this->lng->txt("selection"));
00345 $this->tpl->parseCurrentBlock();
00346 break;
00347 }
00348
00349 $this->tpl->setCurrentBlock("question_data_nominal");
00350 if (strcmp($error_message, "") != 0)
00351 {
00352 $this->tpl->setVariable("ERROR_MESSAGE", "<p class=\"warning\">$error_message</p>");
00353 }
00354 $questiontext = $this->object->getQuestiontext();
00355 $this->tpl->setVariable("QUESTIONTEXT", $this->object->prepareTextareaOutput($questiontext, TRUE));
00356 if (! $this->object->getObligatory())
00357 {
00358 $this->tpl->setVariable("OBLIGATORY_TEXT", $this->lng->txt("survey_question_optional"));
00359 }
00360 if ($question_title)
00361 {
00362 $this->tpl->setVariable("QUESTION_TITLE", $this->object->getTitle());
00363 }
00364 $this->tpl->parseCurrentBlock();
00365 }
00366
00374 function preview()
00375 {
00376 $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_svy_qpl_preview.html", true);
00377 $this->tpl->addBlockFile("NOMINAL", "nominal", "tpl.il_svy_out_nominal.html", true);
00378 $this->outWorkingForm();
00379 $this->tpl->parseCurrentBlock();
00380 }
00381
00390 function writePostData()
00391 {
00392 $result = 0;
00393 if ((!$_POST["title"]) or (!$_POST["author"]) or (!$_POST["question"]))
00394 $result = 1;
00395
00396
00397 if ($_POST["id"] > 0)
00398 $this->object->setId($_POST["id"]);
00399 include_once "./classes/class.ilUtil.php";
00400 $this->object->setTitle(ilUtil::stripSlashes($_POST["title"]));
00401 $this->object->setAuthor(ilUtil::stripSlashes($_POST["author"]));
00402 $this->object->setDescription(ilUtil::stripSlashes($_POST["description"]));
00403 if (strlen($_POST["material"]))
00404 {
00405 $this->object->setMaterial($_POST["material"], 0, ilUtil::stripSlashes($_POST["material_title"]));
00406 }
00407 $this->object->setSubtype($_POST["type"]);
00408 $this->object->setOrientation($_POST["orientation"]);
00409 include_once "./classes/class.ilObjAdvancedEditing.php";
00410 $questiontext = ilUtil::stripSlashes($_POST["question"], true, ilObjAdvancedEditing::_getUsedHTMLTagsAsString("survey"));
00411 $this->object->setQuestiontext($questiontext);
00412 if ($_POST["obligatory"])
00413 {
00414 $this->object->setObligatory(1);
00415 }
00416 else
00417 {
00418 $this->object->setObligatory(0);
00419 }
00420
00421 if ($saved)
00422 {
00423
00424
00425
00426
00427 $this->object->saveToDb("", false);
00428 }
00429 return $result;
00430 }
00431
00439 function categories($add = false)
00440 {
00441 if ($this->object->getId() < 1)
00442 {
00443 sendInfo($this->lng->txt("fill_out_all_required_fields_add_category"), true);
00444 $this->ctrl->redirect($this, "editQuestion");
00445 }
00446 if (strcmp($this->ctrl->getCmd(), "categories") == 0) $_SESSION["spl_modified"] = false;
00447 $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_svy_qpl_nominal_answers.html", true);
00448
00449 for ($i = 0; $i < $this->object->categories->getCategoryCount(); $i++)
00450 {
00451 $this->tpl->setCurrentBlock("cat_selector");
00452 $this->tpl->setVariable("CATEGORY_ORDER", $i);
00453 $this->tpl->parseCurrentBlock();
00454 $this->tpl->setCurrentBlock("categories");
00455 $category = $this->object->categories->getCategory($i);
00456 $this->tpl->setVariable("CATEGORY_ORDER", $i);
00457 $this->tpl->setVariable("CATEGORY_NUMBER", $i+1);
00458 $this->tpl->setVariable("VALUE_CATEGORY", $category);
00459 $this->tpl->setVariable("TEXT_CATEGORY", $this->lng->txt("category"));
00460 $this->tpl->parseCurrentBlock();
00461 }
00462
00463 if ($add)
00464 {
00465 $nrOfCategories = $_POST["nrOfCategories"];
00466 if ($nrOfCategories < 1) $nrOfCategories = 1;
00467
00468 for ($i = 1; $i <= $nrOfCategories; $i++)
00469 {
00470 $this->tpl->setCurrentBlock("categories");
00471 $this->tpl->setVariable("CATEGORY_ORDER", $this->object->categories->getCategoryCount() + $i - 1);
00472 $this->tpl->setVariable("TEXT_CATEGORY", $this->lng->txt("category"));
00473 $this->tpl->parseCurrentBlock();
00474 }
00475 }
00476
00477 if (is_array($_SESSION["spl_move"]))
00478 {
00479 if (count($_SESSION["spl_move"]))
00480 {
00481 $this->tpl->setCurrentBlock("move_buttons");
00482 $this->tpl->setVariable("INSERT_BEFORE", $this->lng->txt("insert_before"));
00483 $this->tpl->setVariable("INSERT_AFTER", $this->lng->txt("insert_after"));
00484 $this->tpl->parseCurrentBlock();
00485 }
00486 }
00487
00488 include_once "./classes/class.ilUtil.php";
00489 if ($this->object->categories->getCategoryCount() == 0)
00490 {
00491 if (!$add)
00492 {
00493 $this->tpl->setCurrentBlock("nocategories");
00494 $this->tpl->setVariable("NO_CATEGORIES", $this->lng->txt("question_contains_no_categories"));
00495 $this->tpl->parseCurrentBlock();
00496 }
00497 }
00498 else
00499 {
00500 $this->tpl->setCurrentBlock("selectall");
00501 $this->tpl->setVariable("SELECT_ALL", $this->lng->txt("select_all"));
00502 $this->tpl->parseCurrentBlock();
00503 $this->tpl->setCurrentBlock("existingcategories");
00504 $this->tpl->setVariable("DELETE", $this->lng->txt("delete"));
00505 $this->tpl->setVariable("MOVE", $this->lng->txt("move"));
00506 $this->tpl->setVariable("ARROW", "<img src=\"" . ilUtil::getImagePath("arrow_downright.gif") . "\" alt=\"".$this->lng->txt("arrow_downright")."\">");
00507 $this->tpl->parseCurrentBlock();
00508 }
00509
00510 for ($i = 1; $i < 10; $i++)
00511 {
00512 $this->tpl->setCurrentBlock("numbers");
00513 $this->tpl->setVariable("VALUE_NUMBER", $i);
00514 if ($i == 1)
00515 {
00516 $this->tpl->setVariable("TEXT_NUMBER", $i . " " . $this->lng->txt("category"));
00517 }
00518 else
00519 {
00520 $this->tpl->setVariable("TEXT_NUMBER", $i . " " . $this->lng->txt("categories"));
00521 }
00522 $this->tpl->parseCurrentBlock();
00523 }
00524
00525 $this->tpl->setCurrentBlock("adm_content");
00526 $this->tpl->setVariable("FORM_ACTION", $this->ctrl->getFormAction($this));
00527 $this->tpl->setVariable("VALUE_ADD_CATEGORY", $this->lng->txt("add"));
00528 $this->tpl->setVariable("SAVE", $this->lng->txt("save"));
00529 if ($_SESSION["spl_modified"])
00530 {
00531 $this->tpl->setVariable("FORM_DATA_MODIFIED_PRESS_SAVE", $this->lng->txt("form_data_modified_press_save"));
00532 }
00533 $questiontext = $this->object->getQuestiontext();
00534 $this->tpl->setVariable("QUESTION_TEXT", $this->object->prepareTextareaOutput($questiontext, TRUE));
00535 $this->tpl->parseCurrentBlock();
00536 }
00537
00538 function setQuestionTabs()
00539 {
00540 $this->setQuestionTabsForClass("surveynominalquestiongui");
00541 }
00542
00543 function outCumulatedResultsDetails(&$cumulated_results, $counter)
00544 {
00545 $this->tpl->setCurrentBlock("detail_row");
00546 $this->tpl->setVariable("TEXT_OPTION", $this->lng->txt("question"));
00547 $questiontext = $this->object->getQuestiontext();
00548 $this->tpl->setVariable("TEXT_OPTION_VALUE", $this->object->prepareTextareaOutput($questiontext, TRUE));
00549 $this->tpl->parseCurrentBlock();
00550 $this->tpl->setCurrentBlock("detail_row");
00551 $this->tpl->setVariable("TEXT_OPTION", $this->lng->txt("question_type"));
00552 $this->tpl->setVariable("TEXT_OPTION_VALUE", $this->lng->txt($this->getQuestionType()));
00553 $this->tpl->parseCurrentBlock();
00554 $this->tpl->setCurrentBlock("detail_row");
00555 $this->tpl->setVariable("TEXT_OPTION", $this->lng->txt("users_answered"));
00556 $this->tpl->setVariable("TEXT_OPTION_VALUE", $cumulated_results["USERS_ANSWERED"]);
00557 $this->tpl->parseCurrentBlock();
00558 $this->tpl->setCurrentBlock("detail_row");
00559 $this->tpl->setVariable("TEXT_OPTION", $this->lng->txt("users_skipped"));
00560 $this->tpl->setVariable("TEXT_OPTION_VALUE", $cumulated_results["USERS_SKIPPED"]);
00561 $this->tpl->parseCurrentBlock();
00562
00563 $this->tpl->setCurrentBlock("detail_row");
00564 $this->tpl->setVariable("TEXT_OPTION", $this->lng->txt("subtype"));
00565 switch ($this->object->getSubType())
00566 {
00567 case SUBTYPE_MCSR:
00568 $this->tpl->setVariable("TEXT_OPTION_VALUE", $this->lng->txt("multiple_choice_single_response"));
00569 break;
00570 case SUBTYPE_MCMR:
00571 $this->tpl->setVariable("TEXT_OPTION_VALUE", $this->lng->txt("multiple_choice_multiple_response"));
00572 break;
00573 }
00574 $this->tpl->parseCurrentBlock();
00575
00576 $this->tpl->setCurrentBlock("detail_row");
00577 $this->tpl->setVariable("TEXT_OPTION", $this->lng->txt("mode"));
00578 $this->tpl->setVariable("TEXT_OPTION_VALUE", $cumulated_results["MODE"]);
00579 $this->tpl->parseCurrentBlock();
00580 $this->tpl->setCurrentBlock("detail_row");
00581 $this->tpl->setVariable("TEXT_OPTION", $this->lng->txt("mode_nr_of_selections"));
00582 $this->tpl->setVariable("TEXT_OPTION_VALUE", $cumulated_results["MODE_NR_OF_SELECTIONS"]);
00583 $this->tpl->parseCurrentBlock();
00584
00585 $this->tpl->setCurrentBlock("detail_row");
00586 $this->tpl->setVariable("TEXT_OPTION", $this->lng->txt("categories"));
00587 $categories = "";
00588 if (is_array($cumulated_results["variables"]))
00589 {
00590 foreach ($cumulated_results["variables"] as $key => $value)
00591 {
00592 $categories .= "<li>" . $this->lng->txt("title") . ":" . "<span class=\"bold\">" . $value["title"] . "</span><br />" .
00593 $this->lng->txt("category_nr_selected") . ": " . "<span class=\"bold\">" . $value["selected"] . "</span><br />" .
00594 $this->lng->txt("percentage_of_selections") . ": " . "<span class=\"bold\">" . sprintf("%.2f", 100*$value["percentage"]) . "</span></li>";
00595 }
00596 }
00597 $categories = "<ol>$categories</ol>";
00598 $this->tpl->setVariable("TEXT_OPTION_VALUE", $categories);
00599 $this->tpl->parseCurrentBlock();
00600
00601
00602 $this->tpl->setVariable("TEXT_CHART", $this->lng->txt("chart"));
00603 $this->tpl->setVariable("ALT_CHART", $data["title"] . "( " . $this->lng->txt("chart") . ")");
00604 $this->tpl->setVariable("CHART","./survey/displaychart.php?grName=" . urlencode($this->object->getTitle()) .
00605 "&type=bars" .
00606 "&x=" . urlencode($this->lng->txt("answers")) .
00607 "&y=" . urlencode($this->lng->txt("users_answered")) .
00608 "&arr=".base64_encode(serialize($cumulated_results["variables"])));
00609
00610 $this->tpl->setCurrentBlock("detail");
00611 $this->tpl->setVariable("QUESTION_TITLE", "$counter. ".$this->object->getTitle());
00612 $this->tpl->parseCurrentBlock();
00613 }
00614 }
00615 ?>