ILIAS  Release_3_10_x_branch Revision 61812
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilSurveyEvaluationGUI.php
Go to the documentation of this file.
1 <?php
2  /*
3  +----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2001 ILIAS open source, University of Cologne |
7  | |
8  | This program is free software; you can redistribute it and/or |
9  | modify it under the terms of the GNU General Public License |
10  | as published by the Free Software Foundation; either version 2 |
11  | of the License, or (at your option) any later version. |
12  | |
13  | This program is distributed in the hope that it will be useful, |
14  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16  | GNU General Public License for more details. |
17  | |
18  | You should have received a copy of the GNU General Public License |
19  | along with this program; if not, write to the Free Software |
20  | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21  +----------------------------------------------------------------------------+
22 */
23 
24 include_once "./Modules/Survey/classes/inc.SurveyConstants.php";
25 
38 {
39  var $object;
40  var $lng;
41  var $tpl;
42  var $ctrl;
43 
52  function ilSurveyEvaluationGUI($a_object)
53  {
54  global $lng, $tpl, $ilCtrl;
55 
56  $this->lng =& $lng;
57  $this->tpl =& $tpl;
58  $this->ctrl =& $ilCtrl;
59  $this->object =& $a_object;
60  }
61 
65  function &executeCommand()
66  {
67  $cmd = $this->ctrl->getCmd();
68  $next_class = $this->ctrl->getNextClass($this);
69 
70  $cmd = $this->getCommand($cmd);
71  switch($next_class)
72  {
73  default:
74  $ret =& $this->$cmd();
75  break;
76  }
77  return $ret;
78  }
79 
80  function getCommand($cmd)
81  {
82  return $cmd;
83  }
84 
93  {
94  global $rbacsystem;
95  global $ilUser;
96 
97  if ($rbacsystem->checkAccess("write", $_GET["ref_id"]))
98  {
99  // people with write access always have access to the evaluation
100  $_SESSION["anon_evaluation_access"] = $_GET["ref_id"];
101  return $this->evaluation();
102  }
103  if ($this->object->getEvaluationAccess() == EVALUATION_ACCESS_ALL)
104  {
105  // if the evaluation access is open for all users, grant it
106  $_SESSION["anon_evaluation_access"] = $_GET["ref_id"];
107  return $this->evaluation();
108  }
109  $surveycode = $this->object->getUserAccessCode($ilUser->getId());
110  if ($this->object->isAnonymizedParticipant($surveycode))
111  {
112  $_SESSION["anon_evaluation_access"] = $_GET["ref_id"];
113  return $this->evaluation();
114  }
115  $this->tpl->setVariable("TABS", "");
116  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_svy_svy_evaluation_checkaccess.html", "Modules/Survey");
117  $this->tpl->setCurrentBlock("adm_content");
118  $this->tpl->setVariable("AUTHENTICATION_NEEDED", $this->lng->txt("svy_check_evaluation_authentication_needed"));
119  $this->tpl->setVariable("FORM_ACTION", $this->ctrl->getFormAction($this, "checkAnonymizedEvaluationAccess"));
120  $this->tpl->setVariable("EVALUATION_CHECKACCESS_INTRODUCTION", $this->lng->txt("svy_check_evaluation_access_introduction"));
121  $this->tpl->setVariable("VALUE_CHECK", $this->lng->txt("ok"));
122  $this->tpl->setVariable("VALUE_CANCEL", $this->lng->txt("cancel"));
123  $this->tpl->setVariable("TEXT_SURVEY_CODE", $this->lng->txt("survey_code"));
124  $this->tpl->parseCurrentBlock();
125  }
126 
135  {
136  $surveycode = $_POST["surveycode"];
137  if ($this->object->isAnonymizedParticipant($surveycode))
138  {
139  $_SESSION["anon_evaluation_access"] = $_GET["ref_id"];
140  $this->evaluation();
141  }
142  else
143  {
144  ilUtil::sendInfo($this->lng->txt("svy_check_evaluation_wrong_key", true));
145  $this->cancelEvaluationAccess();
146  }
147  }
148 
157  {
158  include_once "./Services/Utilities/classes/class.ilUtil.php";
159  global $tree;
160  $path = $tree->getPathFull($this->object->getRefID());
161  ilUtil::redirect("repository.php?cmd=frameset&ref_id=" . $path[count($path) - 2]["child"]);
162  }
163 
171  function evaluationdetails()
172  {
173  $this->evaluation(1);
174  }
175 
176  function exportCumulatedResults($details = 0)
177  {
178  $format_bold = "";
179  $format_percent = "";
180  $format_datetime = "";
181  $format_title = "";
182  $surveyname = ilUtil::getASCIIFilename(preg_replace("/\s/", "_", $this->object->getTitle()));
183 
184  switch ($_POST["export_format"])
185  {
186  case TYPE_XLS:
187  include_once "./classes/class.ilExcelWriterAdapter.php";
188  $excelfile = ilUtil::ilTempnam();
189  $adapter = new ilExcelWriterAdapter($excelfile, FALSE);
190  $workbook = $adapter->getWorkbook();
191  $workbook->setVersion(8); // Use Excel97/2000 Format
192  // Creating a worksheet
193  $format_bold =& $workbook->addFormat();
194  $format_bold->setBold();
195  $format_percent =& $workbook->addFormat();
196  $format_percent->setNumFormat("0.00%");
197  $format_datetime =& $workbook->addFormat();
198  $format_datetime->setNumFormat("DD/MM/YYYY hh:mm:ss");
199  $format_title =& $workbook->addFormat();
200  $format_title->setBold();
201  $format_title->setColor('black');
202  $format_title->setPattern(1);
203  $format_title->setFgColor('silver');
204  $format_title->setAlign('center');
205  // Creating a worksheet
206  include_once ("./classes/class.ilExcelUtils.php");
207  $mainworksheet =& $workbook->addWorksheet();
208  $mainworksheet->writeString(0, 0, ilExcelUtils::_convert_text($this->lng->txt("title"), $_POST["export_format"]), $format_bold);
209  $mainworksheet->writeString(0, 1, ilExcelUtils::_convert_text($this->lng->txt("question"), $_POST["export_format"]), $format_bold);
210  $mainworksheet->writeString(0, 2, ilExcelUtils::_convert_text($this->lng->txt("question_type"), $_POST["export_format"]), $format_bold);
211  $mainworksheet->writeString(0, 3, ilExcelUtils::_convert_text($this->lng->txt("users_answered"), $_POST["export_format"]), $format_bold);
212  $mainworksheet->writeString(0, 4, ilExcelUtils::_convert_text($this->lng->txt("users_skipped"), $_POST["export_format"]), $format_bold);
213  $mainworksheet->writeString(0, 5, ilExcelUtils::_convert_text($this->lng->txt("mode"), $_POST["export_format"]), $format_bold);
214  $mainworksheet->writeString(0, 6, ilExcelUtils::_convert_text($this->lng->txt("mode_text"), $_POST["export_format"]), $format_bold);
215  $mainworksheet->writeString(0, 7, ilExcelUtils::_convert_text($this->lng->txt("mode_nr_of_selections"), $_POST["export_format"]), $format_bold);
216  $mainworksheet->writeString(0, 8, ilExcelUtils::_convert_text($this->lng->txt("median"), $_POST["export_format"]), $format_bold);
217  $mainworksheet->writeString(0, 9, ilExcelUtils::_convert_text($this->lng->txt("arithmetic_mean"), $_POST["export_format"]), $format_bold);
218  break;
219  case (TYPE_SPSS):
220  $csvfile = array();
221  $csvrow = array();
222  array_push($csvrow, $this->lng->txt("title"));
223  array_push($csvrow, $this->lng->txt("question"));
224  array_push($csvrow, $this->lng->txt("question_type"));
225  array_push($csvrow, $this->lng->txt("users_answered"));
226  array_push($csvrow, $this->lng->txt("users_skipped"));
227  array_push($csvrow, $this->lng->txt("mode"));
228 
229  //array_push($csvrow, $this->lng->txt("mode_text"));
230 
231 
232  array_push($csvrow, $this->lng->txt("mode_nr_of_selections"));
233  array_push($csvrow, $this->lng->txt("median"));
234  array_push($csvrow, $this->lng->txt("arithmetic_mean"));
235  array_push($csvfile, $csvrow);
236  break;
237  }
238  $questions =& $this->object->getSurveyQuestions();
239  $counter++;
240  foreach ($questions as $data)
241  {
242  include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php";
243  $question = SurveyQuestion::_instanciateQuestion($data["question_id"]);
244 
245  $eval = $this->object->getCumulatedResults($question);
246  switch ($_POST["export_format"])
247  {
248  case TYPE_XLS:
249  $counter = $question->setExportCumulatedXLS($mainworksheet, $format_title, $format_bold, $eval, $counter);
250  break;
251  case (TYPE_SPSS):
252  $csvrows =& $question->setExportCumulatedCVS($eval);
253  foreach ($csvrows as $csvrow)
254  {
255  array_push($csvfile, $csvrow);
256  }
257  break;
258  }
259  if ($details)
260  {
261  switch ($_POST["export_format"])
262  {
263  case TYPE_XLS:
264  $question->setExportDetailsXLS($workbook, $format_title, $format_bold, $eval);
265  break;
266  }
267  }
268  }
269 
270  switch ($_POST["export_format"])
271  {
272  case TYPE_XLS:
273  // Let's send the file
274  $workbook->close();
275  ilUtil::deliverFile($excelfile, "$surveyname.xls", "application/vnd.ms-excel");
276  exit();
277  break;
278  case TYPE_SPSS:
279  $csv = "";
280  $separator = ";";
281  foreach ($csvfile as $csvrow)
282  {
283  $csvrow =& $this->object->processCSVRow($csvrow, TRUE, $separator);
284  $csv .= join($csvrow, $separator) . "\n";
285  }
286  include_once "./Services/Utilities/classes/class.ilUtil.php";
287  ilUtil::deliverData($csv, "$surveyname.csv");
288  exit();
289  break;
290  }
291  }
292 
293  function evaluation($details = 0)
294  {
295  global $ilUser;
296  global $rbacsystem;
297  global $ilias;
298 
299  if (!$rbacsystem->checkAccess("read",$_GET["ref_id"]))
300  {
301  ilUtil::sendInfo($this->lng->txt("permission_denied"));
302  return;
303  }
304  switch ($this->object->getEvaluationAccess())
305  {
307  if (!$rbacsystem->checkAccess("write", $_GET["ref_id"]))
308  {
309  ilUtil::sendInfo($this->lng->txt("permission_denied"));
310  return;
311  }
312  break;
314  include_once "./Modules/Survey/classes/class.ilObjSurveyAccess.php";
315  if (!($rbacsystem->checkAccess("write",$_GET["ref_id"]) || ilObjSurveyAccess::_hasEvaluationAccess($this->object->getId(), $ilUser->getId())))
316  {
317  ilUtil::sendInfo($this->lng->txt("permission_denied"));
318  return;
319  }
320  break;
322  if (($this->object->getAnonymize() == 1) && ($_SESSION["anon_evaluation_access"] != $_GET["ref_id"]))
323  {
325  return;
326  }
327  break;
328  }
329 
330  if (strlen($_POST["export_format"]))
331  {
332  $this->exportCumulatedResults($details);
333  return;
334  }
335 
337  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_svy_svy_evaluation.html", "Modules/Survey");
338  $this->tpl->addCss("./Modules/Survey/templates/default/survey_print.css", "print");
339  $counter = 0;
340  $classes = array("tblrow1", "tblrow2");
341  $questions =& $this->object->getSurveyQuestions();
342  foreach ($questions as $data)
343  {
344  include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php";
345  $question_gui = SurveyQuestion::_instanciateQuestionGUI($data["question_id"]);
346  $question = $question_gui->object;
347  $row = $question_gui->getCumulatedResultRow($counter, $classes[$counter % 2], $this->object->getSurveyId());
348  $this->tpl->setCurrentBlock("row");
349  $this->tpl->setVariable("ROW", $row);
350  $this->tpl->parseCurrentBlock();
351  if ($details)
352  {
353  $detail = $question_gui->getCumulatedResultsDetails($this->object->getSurveyId(), $counter+1);
354  $this->tpl->setCurrentBlock("detail");
355  $this->tpl->setVariable("DETAIL", $detail);
356  $this->tpl->parseCurrentBlock();
357  }
358  $counter++;
359  }
360 
361  $this->tpl->setCurrentBlock("generic_css");
362  $this->tpl->setVariable("LOCATION_GENERIC_STYLESHEET", "./Modules/Survey/templates/default/evaluation_print.css");
363  $this->tpl->setVariable("MEDIA_GENERIC_STYLESHEET", "print");
364  $this->tpl->parseCurrentBlock();
365  $this->tpl->setCurrentBlock("adm_content");
366  $this->tpl->setVariable("QUESTION_TITLE", $this->lng->txt("title"));
367  $this->tpl->setVariable("QUESTION_TEXT", $this->lng->txt("question"));
368  $this->tpl->setVariable("QUESTION_TYPE", $this->lng->txt("question_type"));
369  $this->tpl->setVariable("USERS_ANSWERED", $this->lng->txt("users_answered"));
370  $this->tpl->setVariable("USERS_SKIPPED", $this->lng->txt("users_skipped"));
371  $this->tpl->setVariable("MODE", $this->lng->txt("mode"));
372  $this->tpl->setVariable("MODE_NR_OF_SELECTIONS", $this->lng->txt("mode_nr_of_selections"));
373  $this->tpl->setVariable("MEDIAN", $this->lng->txt("median"));
374  $this->tpl->setVariable("ARITHMETIC_MEAN", $this->lng->txt("arithmetic_mean"));
375  global $ilAccess;
376  if ($ilAccess->checkAccess("write", "", $this->object->getRefId()))
377  {
378  $this->tpl->setVariable("FORM_ACTION", $this->ctrl->getFormAction($this, "evaluation"));
379  $this->tpl->setVariable("EXPORT_DATA", $this->lng->txt("export_data_as"));
380  $this->tpl->setVariable("TEXT_EXCEL", $this->lng->txt("exp_type_excel"));
381  $this->tpl->setVariable("TEXT_CSV", $this->lng->txt("exp_type_csv"));
382  $this->tpl->setVariable("BTN_EXPORT", $this->lng->txt("export"));
383  if ($details)
384  {
385  $this->tpl->setVariable("CMD_EXPORT", "evaluationdetails");
386  }
387  else
388  {
389  $this->tpl->setVariable("CMD_EXPORT", "evaluation");
390  }
391  }
392  $this->tpl->setVariable("BTN_PRINT", $this->lng->txt("print"));
393  $this->tpl->setVariable("VALUE_DETAIL", $details);
394  $this->tpl->setVariable("PRINT_ACTION", $this->ctrl->getFormAction($this, "evaluation"));
395  $this->tpl->parseCurrentBlock();
396  }
397 
405  function exportUserSpecificResults($export_format)
406  {
407  global $ilLog;
408  $surveyname = ilUtil::getASCIIFilename(preg_replace("/\s/", "_", $this->object->getTitle()));
409  $csvfile = array();
410  $csvrow = array();
411  $questions = array();
412  $questions =& $this->object->getSurveyQuestions(true);
413  array_push($csvrow, $this->lng->txt("username"));
414  if ($this->object->canExportSurveyCode())
415  {
416  array_push($csvrow, $this->lng->txt("codes"));
417  }
418  if ($this->object->getAnonymize() == ANONYMIZE_OFF)
419  {
420  array_push($csvrow, $this->lng->txt("gender"));
421  }
422  $cellcounter = 1;
423  foreach ($questions as $question_id => $question_data)
424  {
425  include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php";
426  $question = SurveyQuestion::_instanciateQuestion($question_data["question_id"]);
427  $question->addUserSpecificResultsExportTitles($csvrow);
428  $questions[$question_data["question_id"]] = $question;
429  }
430  array_push($csvfile, $csvrow);
431  $participants =& $this->object->getSurveyFinishedIds();
432 
433  foreach ($participants as $user_id)
434  {
435  $resultset =& $this->object->getEvaluationByUser($questions, $user_id);
436  $csvrow = array();
437  array_push($csvrow, $resultset["name"]);
438  if ($this->object->canExportSurveyCode())
439  {
440  array_push($csvrow, $user_id);
441  }
442  if ($this->object->getAnonymize() == ANONYMIZE_OFF)
443  {
444  array_push($csvrow, $resultset["gender"]);
445  }
446  foreach ($questions as $question_id => $question)
447  {
448  $question->addUserSpecificResultsData($csvrow, $resultset);
449  }
450  array_push($csvfile, $csvrow);
451  }
452  switch ($export_format)
453  {
454  case TYPE_XLS:
455  include_once "./classes/class.ilExcelWriterAdapter.php";
456  $excelfile = ilUtil::ilTempnam();
457  $adapter = new ilExcelWriterAdapter($excelfile, FALSE);
458  $workbook = $adapter->getWorkbook();
459  $workbook->setVersion(8); // Use Excel97/2000 Format
460  // Creating a worksheet
461  $format_bold =& $workbook->addFormat();
462  $format_bold->setBold();
463  $format_percent =& $workbook->addFormat();
464  $format_percent->setNumFormat("0.00%");
465  $format_datetime =& $workbook->addFormat();
466  $format_datetime->setNumFormat("DD/MM/YYYY hh:mm:ss");
467  $format_title =& $workbook->addFormat();
468  $format_title->setBold();
469  $format_title->setColor('black');
470  $format_title->setPattern(1);
471  $format_title->setFgColor('silver');
472  $format_title_plain =& $workbook->addFormat();
473  $format_title_plain->setColor('black');
474  $format_title_plain->setPattern(1);
475  $format_title_plain->setFgColor('silver');
476  // Creating a worksheet
477  $pages = floor((count($csvfile[0])) / 250) + 1;
478  $worksheets = array();
479  for ($i = 0; $i < $pages; $i++)
480  {
481  $worksheets[$i] =& $workbook->addWorksheet();
482  }
483  $row = 0;
484  include_once "./classes/class.ilExcelUtils.php";
485  foreach ($csvfile as $csvrow)
486  {
487  $col = 0;
488  if ($row == 0)
489  {
490  $worksheet = 0;
491  $mainworksheet =& $worksheets[$worksheet];
492  foreach ($csvrow as $text)
493  {
494  $mainworksheet->writeString($row, $col++, ilExcelUtils::_convert_text($text, $_POST["export_format"]), $format_title);
495  if ($col % 251 == 0)
496  {
497  $worksheet++;
498  $col = 1;
499  $mainworksheet =& $worksheets[$worksheet];
500  $mainworksheet->writeString($row, 0, ilExcelUtils::_convert_text($csvrow[0], $_POST["export_format"]), $format_title);
501  }
502  }
503  }
504  else
505  {
506  $worksheet = 0;
507  $mainworksheet =& $worksheets[$worksheet];
508  foreach ($csvrow as $text)
509  {
510  if (is_numeric($text))
511  {
512  $mainworksheet->writeNumber($row, $col++, $text);
513  }
514  else
515  {
516  $mainworksheet->writeString($row, $col++, ilExcelUtils::_convert_text($text, $_POST["export_format"]));
517  }
518  if ($col % 251 == 0)
519  {
520  $worksheet++;
521  $col = 1;
522  $mainworksheet =& $worksheets[$worksheet];
523  $mainworksheet->writeString($row, 0, ilExcelUtils::_convert_text($csvrow[0], $_POST["export_format"]));
524  }
525  }
526  }
527  $row++;
528  }
529  $workbook->close();
530  ilUtil::deliverFile($excelfile, "$surveyname.xls", "application/vnd.ms-excel");
531  exit();
532  break;
533  case TYPE_SPSS:
534  $csv = "";
535  $separator = ";";
536  foreach ($csvfile as $csvrow)
537  {
538  $csvrow =& str_replace("\n", " ", $this->object->processCSVRow($csvrow, TRUE, $separator));
539  $csv .= join($csvrow, $separator) . "\n";
540  }
541  include_once "./Services/Utilities/classes/class.ilUtil.php";
542  ilUtil::deliverData($csv, "$surveyname.csv");
543  exit();
544  break;
545  }
546  }
547 
555  function evaluationuser()
556  {
557  global $ilAccess, $ilLog;
558 
559  if (!$ilAccess->checkAccess("write", "", $this->object->getRefId()))
560  {
561  ilUtil::sendInfo($this->lng->txt("no_permission"), TRUE);
562  $this->ctrl->redirectByClass("ilObjSurveyGUI", "infoScreen");
563  }
564  if (!is_array($_POST))
565  {
566  $_POST = array();
567  }
568  if (array_key_exists("export_format", $_POST))
569  {
570  return $this->exportUserSpecificResults($_POST["export_format"]);
571  }
572 
573  $this->tpl->addCss("./Modules/Survey/templates/default/survey_print.css", "print");
574  $userResults =& $this->object->getUserSpecificResults();
576  $this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_svy_svy_evaluation_user.html", "Modules/Survey");
577  $counter = 0;
578  $classes = array("tblrow1top", "tblrow2top");
579  $questions =& $this->object->getSurveyQuestions(true);
580  $this->tpl->setCurrentBlock("headercell");
581  $this->tpl->setVariable("TEXT_HEADER_CELL", $this->lng->txt("username"));
582  $this->tpl->parseCurrentBlock();
583  if ($this->object->getAnonymize() == ANONYMIZE_OFF)
584  {
585  $this->tpl->setCurrentBlock("headercell");
586  $this->tpl->setVariable("TEXT_HEADER_CELL", $this->lng->txt("gender"));
587  $this->tpl->parseCurrentBlock();
588  }
589  $this->tpl->setCurrentBlock("headercell");
590  $this->tpl->setVariable("TEXT_HEADER_CELL", $this->lng->txt("question"));
591  $this->tpl->parseCurrentBlock();
592 
593  $this->tpl->setCurrentBlock("headercell");
594  $this->tpl->setVariable("TEXT_HEADER_CELL", $this->lng->txt("results"));
595  $this->tpl->parseCurrentBlock();
596 
597  $cellcounter = 1;
598  $participants =& $this->object->getSurveyParticipants();
599  foreach ($participants as $data)
600  {
601  $this->tpl->setCurrentBlock("bodycell");
602  $this->tpl->setVariable("COLOR_CLASS", $classes[$counter % 2]);
603  $this->tpl->setVariable("TEXT_BODY_CELL", $data["sortname"]);
604  $this->tpl->parseCurrentBlock();
605  if ($this->object->getAnonymize() == ANONYMIZE_OFF)
606  {
607  $this->tpl->setCurrentBlock("bodycell");
608  $this->tpl->setVariable("COLOR_CLASS", $classes[$counter % 2]);
609  $this->tpl->setVariable("TEXT_BODY_CELL", $data["gender"]);
610  $this->tpl->parseCurrentBlock();
611  }
612  $intro = TRUE;
613  $questioncounter = 1;
614  foreach ($questions as $question_id => $question_data)
615  {
616  if ($intro)
617  {
618  $intro = FALSE;
619  }
620  else
621  {
622  if ($this->object->getAnonymize() == ANONYMIZE_OFF)
623  {
624  $this->tpl->setCurrentBlock("bodycell");
625  $this->tpl->setVariable("COLOR_CLASS", $classes[$counter % 2]);
626  $this->tpl->parseCurrentBlock();
627  }
628  $this->tpl->setCurrentBlock("bodycell");
629  $this->tpl->setVariable("COLOR_CLASS", $classes[$counter % 2]);
630  $this->tpl->parseCurrentBlock();
631  }
632  $this->tpl->setCurrentBlock("bodycell");
633  $this->tpl->setVariable("COLOR_CLASS", $classes[$counter % 2]);
634  $this->tpl->setVariable("TEXT_BODY_CELL", $questioncounter++ . ". " . $question_data["title"]);
635  $this->tpl->parseCurrentBlock();
636 
637  $found = $userResults[$question_id][$data["active_id"]];
638  $text = "";
639  if (is_array($found))
640  {
641  $text = implode("<br />", $found);
642  }
643  else
644  {
645  $text = $found;
646  }
647  if (strlen($text) == 0) $text = $this->lng->txt("skipped");
648  $this->tpl->setCurrentBlock("bodycell");
649  $this->tpl->setVariable("COLOR_CLASS", $classes[$counter % 2]);
650  $this->tpl->setVariable("TEXT_BODY_CELL", $text);
651  $this->tpl->parseCurrentBlock();
652  $this->tpl->setCurrentBlock("row");
653  $this->tpl->parse("row");
654  }
655  $counter++;
656  }
657  $this->tpl->setCurrentBlock("generic_css");
658  $this->tpl->setVariable("LOCATION_GENERIC_STYLESHEET", "./Modules/Survey/templates/default/evaluation_print.css");
659  $this->tpl->setVariable("MEDIA_GENERIC_STYLESHEET", "print");
660  $this->tpl->parseCurrentBlock();
661  $this->tpl->setCurrentBlock("adm_content");
662  $this->tpl->setVariable("EXPORT_DATA", $this->lng->txt("export_data_as"));
663  $this->tpl->setVariable("TEXT_EXCEL", $this->lng->txt("exp_type_excel"));
664  $this->tpl->setVariable("TEXT_CSV", $this->lng->txt("exp_type_csv"));
665  $this->tpl->setVariable("BTN_EXPORT", $this->lng->txt("export"));
666  $this->tpl->setVariable("BTN_PRINT", $this->lng->txt("print"));
667  $this->tpl->setVariable("FORM_ACTION", $this->ctrl->getFormAction($this, "evaluationuser"));
668  $this->tpl->setVariable("PRINT_ACTION", $this->ctrl->getFormAction($this, "evaluationuser"));
669  $this->tpl->setVariable("CMD_EXPORT", "evaluationuser");
670  $this->tpl->parseCurrentBlock();
671  }
672 
680  function outChart()
681  {
682  $survey_id = $_GET["survey"];
683  $question_id = $_GET["question"];
684  $type = (strlen($_GET["type"])) ? $_GET["type"] : "";
685  $question =& $this->object->_instanciateQuestion($question_id);
686  $question->outChart($survey_id, $type);
687  }
688 }
689 ?>