ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilSurveyEvaluationGUI Class Reference

Survey evaluation graphical output. More...

+ Collaboration diagram for ilSurveyEvaluationGUI:

Public Member Functions

 ilSurveyEvaluationGUI ($a_object)
 ilSurveyEvaluationGUI constructor
executeCommand ()
 execute command
 getCommand ($cmd)
 checkAnonymizedEvaluationAccess ()
 Show the detailed evaluation.
 checkEvaluationAccess ()
 Checks the evaluation access after entering the survey access code.
 cancelEvaluationAccess ()
 Cancels the input of the survey access code for evaluation access.
 evaluationdetails ()
 Show the detailed evaluation.
 exportCumulatedResults ($details=0)
 exportData ()
 exportDetailData ()
 printEvaluation ()
 evaluation ($details=0)
 exportUserSpecificResults ($export_format, $export_label="")
 Export the user specific results for the survey.
 exportEvaluationParticipantsState ($export_format)
 Export a list of the survey participants state.
 evaluationuser ()
 Print the survey evaluation for a selected user.
 evaluationparticipantsstate ()
 Print a list of survey participants state.
 outChart ()
 Creates an image visualising the results of a question.

Data Fields

 $object
 $lng
 $tpl
 $ctrl

Detailed Description

Survey evaluation graphical output.

The ilSurveyEvaluationGUI class creates the evaluation output for the ilObjSurveyGUI class. This saves some heap space because the ilObjSurveyGUI class will be smaller.

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
Version
Id:
class.ilSurveyEvaluationGUI.php 32741 2012-01-24 09:19:36Z hschottm

Definition at line 37 of file class.ilSurveyEvaluationGUI.php.

Member Function Documentation

ilSurveyEvaluationGUI::cancelEvaluationAccess ( )

Cancels the input of the survey access code for evaluation access.

Cancels the input of the survey access code for evaluation access

private

Definition at line 156 of file class.ilSurveyEvaluationGUI.php.

References $path, and ilUtil\redirect().

Referenced by checkEvaluationAccess().

{
include_once "./Services/Utilities/classes/class.ilUtil.php";
global $tree;
$path = $tree->getPathFull($this->object->getRefID());
ilUtil::redirect("repository.php?cmd=frameset&ref_id=" . $path[count($path) - 2]["child"]);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilSurveyEvaluationGUI::checkAnonymizedEvaluationAccess ( )

Show the detailed evaluation.

Show the detailed evaluation

private

Definition at line 92 of file class.ilSurveyEvaluationGUI.php.

References $_GET, $_SESSION, evaluation(), and EVALUATION_ACCESS_ALL.

Referenced by evaluation().

{
global $rbacsystem;
global $ilUser;
if ($rbacsystem->checkAccess("write", $_GET["ref_id"]))
{
// people with write access always have access to the evaluation
$_SESSION["anon_evaluation_access"] = $_GET["ref_id"];
return $this->evaluation();
}
if ($this->object->getEvaluationAccess() == EVALUATION_ACCESS_ALL)
{
// if the evaluation access is open for all users, grant it
$_SESSION["anon_evaluation_access"] = $_GET["ref_id"];
return $this->evaluation();
}
$surveycode = $this->object->getUserAccessCode($ilUser->getId());
if ($this->object->isAnonymizedParticipant($surveycode))
{
$_SESSION["anon_evaluation_access"] = $_GET["ref_id"];
return $this->evaluation();
}
$this->tpl->setVariable("TABS", "");
$this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_svy_svy_evaluation_checkaccess.html", "Modules/Survey");
$this->tpl->setCurrentBlock("adm_content");
$this->tpl->setVariable("AUTHENTICATION_NEEDED", $this->lng->txt("svy_check_evaluation_authentication_needed"));
$this->tpl->setVariable("FORM_ACTION", $this->ctrl->getFormAction($this, "checkAnonymizedEvaluationAccess"));
$this->tpl->setVariable("EVALUATION_CHECKACCESS_INTRODUCTION", $this->lng->txt("svy_check_evaluation_access_introduction"));
$this->tpl->setVariable("VALUE_CHECK", $this->lng->txt("ok"));
$this->tpl->setVariable("VALUE_CANCEL", $this->lng->txt("cancel"));
$this->tpl->setVariable("TEXT_SURVEY_CODE", $this->lng->txt("survey_code"));
$this->tpl->parseCurrentBlock();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilSurveyEvaluationGUI::checkEvaluationAccess ( )

Checks the evaluation access after entering the survey access code.

Checks the evaluation access after entering the survey access code

private

Definition at line 134 of file class.ilSurveyEvaluationGUI.php.

References $_GET, $_POST, $_SESSION, cancelEvaluationAccess(), evaluation(), and ilUtil\sendFailure().

{
$surveycode = $_POST["surveycode"];
if ($this->object->isAnonymizedParticipant($surveycode))
{
$_SESSION["anon_evaluation_access"] = $_GET["ref_id"];
$this->evaluation();
}
else
{
ilUtil::sendFailure($this->lng->txt("svy_check_evaluation_wrong_key", true));
}
}

+ Here is the call graph for this function:

ilSurveyEvaluationGUI::evaluation (   $details = 0)

Definition at line 341 of file class.ilSurveyEvaluationGUI.php.

References $_GET, $_SESSION, $data, ilObjSurveyAccess\_hasEvaluationAccess(), SurveyQuestion\_instanciateQuestionGUI(), checkAnonymizedEvaluationAccess(), EVALUATION_ACCESS_ALL, EVALUATION_ACCESS_OFF, EVALUATION_ACCESS_PARTICIPANTS, ilUtil\prepareFormOutput(), and ilUtil\sendFailure().

Referenced by checkAnonymizedEvaluationAccess(), checkEvaluationAccess(), and evaluationdetails().

{
global $ilUser;
global $rbacsystem;
global $ilias;
if (!$rbacsystem->checkAccess("read",$_GET["ref_id"]))
{
ilUtil::sendFailure($this->lng->txt("permission_denied"));
return;
}
switch ($this->object->getEvaluationAccess())
{
if (!$rbacsystem->checkAccess("write", $_GET["ref_id"]))
{
ilUtil::sendFailure($this->lng->txt("permission_denied"));
return;
}
break;
include_once "./Modules/Survey/classes/class.ilObjSurveyAccess.php";
if (!($rbacsystem->checkAccess("write",$_GET["ref_id"]) || ilObjSurveyAccess::_hasEvaluationAccess($this->object->getId(), $ilUser->getId())))
{
ilUtil::sendFailure($this->lng->txt("permission_denied"));
return;
}
break;
if (($this->object->getAnonymize() == 1) && ($_SESSION["anon_evaluation_access"] != $_GET["ref_id"]))
{
return;
}
break;
}
$this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_svy_svy_evaluation.html", "Modules/Survey");
$questions =& $this->object->getSurveyQuestions();
$data = array();
$counter = 1;
foreach ($questions as $qdata)
{
include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php";
$question_gui = SurveyQuestion::_instanciateQuestionGUI($qdata["question_id"]);
$question = $question_gui->object;
$c = $question->getCumulatedResultData($this->object->getSurveyId(), $counter);
if (is_array($c[0]))
{
foreach ($c as $a)
{
array_push($data, $a);
}
}
else
{
array_push($data, $c);
}
$counter++;
if ($details)
{
$detail = $question_gui->getCumulatedResultsDetails($this->object->getSurveyId(), $counter-1);
$this->tpl->setCurrentBlock("detail");
$this->tpl->setVariable("DETAIL", $detail);
$this->tpl->parseCurrentBlock();
}
}
$exporttypes = array(
"excel" => $this->lng->txt('exp_type_excel'),
"csv" => $this->lng->txt('exp_type_csv')
);
foreach ($exporttypes as $key => $value)
{
$this->tpl->setCurrentBlock('exportoption');
$this->tpl->setVariable('OPTION_VALUE', $key);
$this->tpl->setVariable('OPTION_TITLE', ilUtil::prepareFormOutput($value));
$this->tpl->parseCurrentBlock();
}
$labeldata = array(
array("title" => $this->lng->txt('export_label_only'), 'value' => 'label_only'),
array("title" => $this->lng->txt('export_title_only'), 'value' => 'title_only'),
array("title" => $this->lng->txt('export_title_label'), 'value' => 'title_label')
);
foreach ($labeldata as $label)
{
$this->tpl->setCurrentBlock("label_option");
$this->tpl->setVariable("LABEL_VALUE", $label['value']);
$this->tpl->setVariable("LABEL_TEXT", ilUtil::prepareFormOutput($label['title']));
$this->tpl->parseCurrentBlock();
}
if ($details)
{
$this->tpl->setVariable('SUBMIT_CMD', 'exportDetailData');
}
else
{
$this->tpl->setVariable('SUBMIT_CMD', 'exportData');
}
$this->tpl->setVariable('SUBMIT_VALUE', $this->lng->txt("export"));
include_once "./Modules/Survey/classes/tables/class.ilSurveyResultsCumulatedTableGUI.php";
$table_gui = new ilSurveyResultsCumulatedTableGUI($this, 'evaluation', $detail);
$table_gui->setData($data);
$this->tpl->setVariable('CUMULATED', $table_gui->getHTML());
$this->tpl->addCss("./Modules/Survey/templates/default/survey_print.css", "print");
$this->tpl->setVariable('FORMACTION', $this->ctrl->getFormAction($this, 'evaluation'));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilSurveyEvaluationGUI::evaluationdetails ( )

Show the detailed evaluation.

Show the detailed evaluation

private

Definition at line 171 of file class.ilSurveyEvaluationGUI.php.

References evaluation().

{
$this->evaluation(1);
}

+ Here is the call graph for this function:

ilSurveyEvaluationGUI::evaluationparticipantsstate ( )

Print a list of survey participants state.

Print a list of survey participants state

private

Definition at line 774 of file class.ilSurveyEvaluationGUI.php.

References $_POST, $data, exportEvaluationParticipantsState(), and ilUtil\sendInfo().

{
global $ilAccess;
if (!$ilAccess->checkAccess("write", "", $this->object->getRefId()))
{
ilUtil::sendInfo($this->lng->txt("no_permission"), TRUE);
$this->ctrl->redirectByClass("ilObjSurveyGUI", "infoScreen");
}
if (!is_array($_POST))
{
$_POST = array();
}
if (array_key_exists("export_format", $_POST))
{
return $this->exportEvaluationParticipantsState($_POST["export_format"]);
}
$this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_svy_svy_evaluation_participants_state.html", "Modules/Survey");
$counter = 0;
$classes = array("tblrow1top", "tblrow2top");
$this->tpl->setCurrentBlock("headercell");
$this->tpl->setVariable("TEXT_HEADER_CELL", $this->lng->txt("fullname"));
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock("headercell");
$this->tpl->setVariable("TEXT_HEADER_CELL", $this->lng->txt("login"));
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock("headercell");
$this->tpl->setVariable("TEXT_HEADER_CELL", $this->lng->txt("gender"));
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock("headercell");
$this->tpl->setVariable("TEXT_HEADER_CELL", $this->lng->txt("email"));
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock("headercell");
$this->tpl->setVariable("TEXT_HEADER_CELL", $this->lng->txt("status"));
$this->tpl->parseCurrentBlock();
$cellcounter = 1;
$participants =& $this->object->getSurveyParticipantsState();
foreach ($participants as $data)
{
$this->tpl->setCurrentBlock("bodycell");
$this->tpl->setVariable("COLOR_CLASS", $classes[$counter % 2]);
$this->tpl->setVariable("TEXT_BODY_CELL", $data["sortname"]);
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock("bodycell");
$this->tpl->setVariable("COLOR_CLASS", $classes[$counter % 2]);
$this->tpl->setVariable("TEXT_BODY_CELL", $data["login"]);
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock("bodycell");
$this->tpl->setVariable("COLOR_CLASS", $classes[$counter % 2]);
$this->tpl->setVariable("TEXT_BODY_CELL", $data["gender"]);
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock("bodycell");
$this->tpl->setVariable("COLOR_CLASS", $classes[$counter % 2]);
$this->tpl->setVariable("TEXT_BODY_CELL", $data["email"]);
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock("bodycell");
$this->tpl->setVariable("COLOR_CLASS", $classes[$counter % 2]);
$status = ($data["status"]) ? $this->lng->txt("svy_finished") : $this->lng->txt("svy_not_finished");
$this->tpl->setVariable("TEXT_BODY_CELL", $status);
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock("row");
$this->tpl->parse("row");
$counter++;
}
$this->tpl->setCurrentBlock("adm_content");
$this->tpl->setVariable("EXPORT_DATA", $this->lng->txt("export_data_as"));
$this->tpl->setVariable("TEXT_EXCEL", $this->lng->txt("exp_type_excel"));
$this->tpl->setVariable("TEXT_CSV", $this->lng->txt("exp_type_csv"));
$this->tpl->setVariable("BTN_EXPORT", $this->lng->txt("export"));
$this->tpl->setVariable("BTN_PRINT", $this->lng->txt("print"));
$this->tpl->setVariable("FORM_ACTION", $this->ctrl->getFormAction($this));
$this->tpl->setVariable("PRINT_ACTION", $this->ctrl->getFormAction($this));
$this->tpl->setVariable("CMD_EXPORT", "evaluationparticipantsstate");
$this->tpl->parseCurrentBlock();
}

+ Here is the call graph for this function:

ilSurveyEvaluationGUI::evaluationuser ( )

Print the survey evaluation for a selected user.

Print the survey evaluation for a selected user

private

Definition at line 666 of file class.ilSurveyEvaluationGUI.php.

References $_POST, $data, $ilLog, $results, exportUserSpecificResults(), ilUtil\prepareFormOutput(), ilUtil\sendFailure(), ilUtil\sendInfo(), and ilTable2GUI\setData().

{
global $ilAccess, $ilLog;
if (!$ilAccess->checkAccess("write", "", $this->object->getRefId()))
{
ilUtil::sendFailure($this->lng->txt("no_permission"), TRUE);
$this->ctrl->redirectByClass("ilObjSurveyGUI", "infoScreen");
}
if (!is_array($_POST))
{
$_POST = array();
}
if (array_key_exists("export_format", $_POST))
{
return $this->exportUserSpecificResults($_POST["export_format"], $_POST['export_label']);
}
$this->tpl->addCss("./Modules/Survey/templates/default/survey_print.css", "print");
$userResults =& $this->object->getUserSpecificResults();
$this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_svy_svy_evaluation_user.html", "Modules/Survey");
$questions =& $this->object->getSurveyQuestions(true);
$participants =& $this->object->getSurveyParticipants();
$tabledata = array();
foreach ($participants as $data)
{
$questioncounter = 1;
$question = "";
$results = "";
$first = true;
foreach ($questions as $question_id => $question_data)
{
$found = $userResults[$question_id][$data["active_id"]];
$text = "";
if (is_array($found))
{
$text = implode("<br />", $found);
}
else
{
$text = $found;
}
if (strlen($text) == 0) $text = $this->lng->txt("skipped");
$wt = $this->object->getWorkingtimeForParticipant($data['active_id']);
if ($first)
{
array_push($tabledata, array(
'username' => $data["sortname"],
'gender' => $data["gender"],
'question' => $questioncounter++ . ". " . $question_data["title"],
'results' => $text,
'workingtime' => $wt
));
$first = false;
}
else
{
array_push($tabledata, array(
'username' => " ",
'gender' => " ",
'question' => $questioncounter++ . ". " . $question_data["title"],
'results' => $text,
'workingtime' => null
));
}
}
}
$this->tpl->setCurrentBlock("generic_css");
$this->tpl->setVariable("LOCATION_GENERIC_STYLESHEET", "./Modules/Survey/templates/default/evaluation_print.css");
$this->tpl->setVariable("MEDIA_GENERIC_STYLESHEET", "print");
$this->tpl->parseCurrentBlock();
$labeldata = array(
array("title" => $this->lng->txt('export_label_only'), 'value' => 'label_only'),
array("title" => $this->lng->txt('export_title_only'), 'value' => 'title_only'),
array("title" => $this->lng->txt('export_title_label'), 'value' => 'title_label')
);
foreach ($labeldata as $label)
{
$this->tpl->setCurrentBlock("label_option");
$this->tpl->setVariable("LABEL_VALUE", $label['value']);
$this->tpl->setVariable("LABEL_TEXT", ilUtil::prepareFormOutput($label['title']));
$this->tpl->parseCurrentBlock();
}
$this->tpl->setCurrentBlock("adm_content");
$this->tpl->setVariable("EXPORT_DATA", $this->lng->txt("export_data_as"));
$this->tpl->setVariable("TEXT_EXCEL", $this->lng->txt("exp_type_excel"));
$this->tpl->setVariable("TEXT_CSV", $this->lng->txt("exp_type_csv"));
$this->tpl->setVariable("BTN_EXPORT", $this->lng->txt("export"));
$this->tpl->setVariable("BTN_PRINT", $this->lng->txt("print"));
$this->tpl->setVariable("FORM_ACTION", $this->ctrl->getFormAction($this, "evaluationuser"));
$this->tpl->setVariable("PRINT_ACTION", $this->ctrl->getFormAction($this, "evaluationuser"));
$this->tpl->setVariable("CMD_EXPORT", "evaluationuser");
include_once "./Modules/Survey/classes/tables/class.ilSurveyResultsUserTableGUI.php";
$table_gui = new ilSurveyResultsUserTableGUI($this, 'evaluationuser', $this->object->getAnonymize());
$table_gui->setData($tabledata);
$this->tpl->setVariable('TABLE', $table_gui->getHTML());
$this->tpl->parseCurrentBlock();
}

+ Here is the call graph for this function:

& ilSurveyEvaluationGUI::executeCommand ( )

execute command

Definition at line 65 of file class.ilSurveyEvaluationGUI.php.

References $cmd, $ret, and getCommand().

{
$cmd = $this->ctrl->getCmd();
$next_class = $this->ctrl->getNextClass($this);
$cmd = $this->getCommand($cmd);
switch($next_class)
{
default:
$ret =& $this->$cmd();
break;
}
return $ret;
}

+ Here is the call graph for this function:

ilSurveyEvaluationGUI::exportCumulatedResults (   $details = 0)

Definition at line 176 of file class.ilSurveyEvaluationGUI.php.

References $_POST, $data, $separator, SurveyQuestion\_instanciateQuestion(), CELL_FORMAT_BOLD, ilUtil\deliverData(), ilExcelUtils\ExcelAdapter(), exit, ilUtil\getASCIIFilename(), TYPE_SPSS, and TYPE_XLS.

Referenced by exportData(), and exportDetailData().

{
$format_bold = "";
$format_percent = "";
$format_datetime = "";
$format_title = "";
$surveyname = ilUtil::getASCIIFilename(preg_replace("/\s/", "_", $this->object->getTitle()));
switch ($_POST["export_format"])
{
case TYPE_XLS:
include_once "./Services/Excel/classes/class.ilExcelUtils.php";
$column = 0;
switch ($_POST['export_label'])
{
case 'label_only':
$adapter->setCellValue(0, $column, $this->lng->txt("label"), CELL_FORMAT_BOLD);
break;
case 'title_only':
$adapter->setCellValue(0, $column, $this->lng->txt("title"), CELL_FORMAT_BOLD);
break;
default:
$adapter->setCellValue(0, $column, $this->lng->txt("title"), CELL_FORMAT_BOLD);
$column++;
$adapter->setCellValue(0, $column, $this->lng->txt("label"), CELL_FORMAT_BOLD);
break;
}
$column++;
$adapter->setCellValue(0, $column, $this->lng->txt("question"), CELL_FORMAT_BOLD);
$column++;
$adapter->setCellValue(0, $column, $this->lng->txt("question_type"), CELL_FORMAT_BOLD);
$column++;
$adapter->setCellValue(0, $column, $this->lng->txt("users_answered"), CELL_FORMAT_BOLD);
$column++;
$adapter->setCellValue(0, $column, $this->lng->txt("users_skipped"), CELL_FORMAT_BOLD);
$column++;
$adapter->setCellValue(0, $column, $this->lng->txt("mode"), CELL_FORMAT_BOLD);
$column++;
$adapter->setCellValue(0, $column, $this->lng->txt("mode_text"), CELL_FORMAT_BOLD);
$column++;
$adapter->setCellValue(0, $column, $this->lng->txt("mode_nr_of_selections"), CELL_FORMAT_BOLD);
$column++;
$adapter->setCellValue(0, $column, $this->lng->txt("median"), CELL_FORMAT_BOLD);
$column++;
$adapter->setCellValue(0, $column, $this->lng->txt("arithmetic_mean"), CELL_FORMAT_BOLD);
break;
case (TYPE_SPSS):
$csvfile = array();
$csvrow = array();
switch ($_POST['export_label'])
{
case 'label_only':
array_push($csvrow, $this->lng->txt("label"));
break;
case 'title_only':
array_push($csvrow, $this->lng->txt("title"));
break;
default:
array_push($csvrow, $this->lng->txt("title"));
array_push($csvrow, $this->lng->txt("label"));
break;
}
array_push($csvrow, $this->lng->txt("question"));
array_push($csvrow, $this->lng->txt("question_type"));
array_push($csvrow, $this->lng->txt("users_answered"));
array_push($csvrow, $this->lng->txt("users_skipped"));
array_push($csvrow, $this->lng->txt("mode"));
//array_push($csvrow, $this->lng->txt("mode_text"));
array_push($csvrow, $this->lng->txt("mode_nr_of_selections"));
array_push($csvrow, $this->lng->txt("median"));
array_push($csvrow, $this->lng->txt("arithmetic_mean"));
array_push($csvfile, $csvrow);
break;
}
$questions =& $this->object->getSurveyQuestions();
$counter++;
foreach ($questions as $data)
{
include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php";
$question = SurveyQuestion::_instanciateQuestion($data["question_id"]);
$eval = $this->object->getCumulatedResults($question);
switch ($_POST["export_format"])
{
case TYPE_XLS:
$counter = $question->setExportCumulatedXLS($adapter, $eval, $counter, $_POST['export_label']);
break;
case (TYPE_SPSS):
$csvrows =& $question->setExportCumulatedCVS($eval, $_POST['export_label']);
foreach ($csvrows as $csvrow)
{
array_push($csvfile, $csvrow);
}
break;
}
if ($details)
{
switch ($_POST["export_format"])
{
case TYPE_XLS:
$question->setExportDetailsXLS($adapter, $eval, $_POST['export_label']);
$adapter->setActiveWorksheet(0);
break;
}
}
}
switch ($_POST["export_format"])
{
case TYPE_XLS:
// Let's send the file
$adapter->deliver($surveyname . "." . $adapter->getFileExtension());
exit();
break;
case TYPE_SPSS:
$csv = "";
$separator = ";";
foreach ($csvfile as $csvrow)
{
$csvrow =& $this->object->processCSVRow($csvrow, TRUE, $separator);
$csv .= join($csvrow, $separator) . "\n";
}
include_once "./Services/Utilities/classes/class.ilUtil.php";
ilUtil::deliverData($csv, "$surveyname.csv");
exit();
break;
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilSurveyEvaluationGUI::exportData ( )

Definition at line 309 of file class.ilSurveyEvaluationGUI.php.

References $_POST, and exportCumulatedResults().

{
if (strlen($_POST["export_format"]))
{
return;
}
else
{
$this->ctrl->redirect($this, 'evaluation');
}
}

+ Here is the call graph for this function:

ilSurveyEvaluationGUI::exportDetailData ( )

Definition at line 322 of file class.ilSurveyEvaluationGUI.php.

References $_POST, and exportCumulatedResults().

{
if (strlen($_POST["export_format"]))
{
return;
}
else
{
$this->ctrl->redirect($this, 'evaluation');
}
}

+ Here is the call graph for this function:

ilSurveyEvaluationGUI::exportEvaluationParticipantsState (   $export_format)

Export a list of the survey participants state.

Export a list of the survey participants state

private

Definition at line 604 of file class.ilSurveyEvaluationGUI.php.

References $separator, ilUtil\deliverData(), exit, ilUtil\getASCIIFilename(), ilUtil\sendInfo(), TYPE_SPSS, and TYPE_XLS.

Referenced by evaluationparticipantsstate().

{
$surveyname = ilUtil::getASCIIFilename(preg_replace("/\s/", "_", $this->object->getTitle()));
$csvfile = array();
$csvrow = array();
$participants =& $this->object->getSurveyParticipantsState();
$cellcounter = 1;
#get the keys for header row and then break after first row
while ($el = each($participants))
{
$csvrow = array();
while ($field = each($el['value']))
{
array_push($csvrow, $field['key']);
#reset($el['value']);
}
array_push($csvfile, $csvrow);
break;
}
#then get all data rows
reset($participants);
while ($el = each($participants)) {
$csvrow = array();
while ($field = each($el['value']))
{
array_push($csvrow, $field['value']);
}
array_push($csvfile, $csvrow);
}
switch ($export_format)
{
case TYPE_XLS:
ilUtil::sendInfo("Not implemented",TRUE);
break;
case TYPE_SPSS:
$csv = "";
$separator = ";";
foreach ($csvfile as $csvrow)
{
$csvrow =& str_replace("\n", " ", $this->object->processCSVRow($csvrow, TRUE, $separator));
$csv .= join($csvrow, $separator) . "\n";
}
include_once "./Services/Utilities/classes/class.ilUtil.php";
ilUtil::deliverData($csv, "$surveyname.csv");
exit();
break;
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilSurveyEvaluationGUI::exportUserSpecificResults (   $export_format,
  $export_label = "" 
)

Export the user specific results for the survey.

Export the user specific results for the survey

private

Definition at line 457 of file class.ilSurveyEvaluationGUI.php.

References $ilLog, $row, $separator, SurveyQuestion\_instanciateQuestion(), ANONYMIZE_OFF, CELL_FORMAT_TITLE, ilUtil\deliverData(), ilExcelUtils\ExcelAdapter(), exit, ilUtil\getASCIIFilename(), TYPE_SPSS, and TYPE_XLS.

Referenced by evaluationuser().

{
global $ilLog;
$surveyname = ilUtil::getASCIIFilename(preg_replace("/\s/", "_", $this->object->getTitle()));
$csvfile = array();
$csvrow = array();
$questions = array();
$questions =& $this->object->getSurveyQuestions(true);
array_push($csvrow, $this->lng->txt("username"));
if ($this->object->canExportSurveyCode())
{
array_push($csvrow, $this->lng->txt("codes"));
}
if ($this->object->getAnonymize() == ANONYMIZE_OFF)
{
array_push($csvrow, $this->lng->txt("gender"));
}
$cellcounter = 1;
foreach ($questions as $question_id => $question_data)
{
include_once "./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php";
$question = SurveyQuestion::_instanciateQuestion($question_data["question_id"]);
$question->addUserSpecificResultsExportTitles($csvrow, $export_label);
$questions[$question_data["question_id"]] = $question;
}
array_push($csvfile, $csvrow);
$participants =& $this->object->getSurveyFinishedIds();
foreach ($participants as $user_id)
{
$resultset =& $this->object->getEvaluationByUser($questions, $user_id);
$csvrow = array();
array_push($csvrow, $resultset["name"]);
if ($this->object->canExportSurveyCode())
{
array_push($csvrow, $user_id);
}
if ($this->object->getAnonymize() == ANONYMIZE_OFF)
{
array_push($csvrow, $resultset["gender"]);
}
foreach ($questions as $question_id => $question)
{
$question->addUserSpecificResultsData($csvrow, $resultset);
}
$wt = $this->object->getWorkingtimeForParticipant($user_id);
array_push($csvrow, $wt);
array_push($csvfile, $csvrow);
}
switch ($export_format)
{
case TYPE_XLS:
include_once "./Services/Excel/classes/class.ilExcelUtils.php";
$pages = floor((count($csvfile[0])) / 250) + 1;
for ($i = 0; $i < $pages; $i++)
{
$adapter->addWorksheet($this->lng->txt('page') . ' ' . ($i+2));
}
$row = 0;
include_once "./Services/Excel/classes/class.ilExcelUtils.php";
$contentstartrow = 0;
foreach ($csvfile as $csvrow)
{
$col = 0;
if ($row == 0)
{
$worksheet = 0;
$adapter->setActiveWorksheet($worksheet);
foreach ($csvrow as $text)
{
if (is_array($text))
{
$textcount = 0;
foreach ($text as $string)
{
$adapter->setCellValue($row + $textcount, $col, $string, CELL_FORMAT_TITLE);
$textcount++;
$contentstartrow = max($contentstartrow, $textcount);
}
$col++;
}
else
{
$adapter->setCellValue($row, $col++, $text, CELL_FORMAT_TITLE);
}
if ($col % 251 == 0)
{
$worksheet++;
$col = 1;
$adapter->setActiveWorksheet($worksheet);
$adapter->setCellValue($row, 0, $csvrow[0], CELL_FORMAT_TITLE);
}
}
$adapter->setCellValue($row, $col++, $this->lng->txt('workingtime'), CELL_FORMAT_TITLE);
$row = $contentstartrow;
}
else
{
$worksheet = 0;
$adapter->setActiveWorksheet($worksheet);
foreach ($csvrow as $text)
{
if (is_numeric($text))
{
$adapter->setCellValue($row, $col++, $text);
}
else
{
$adapter->setCellValue($row, $col++, $text);
}
if ($col % 251 == 0)
{
$worksheet++;
$col = 1;
$adapter->setActiveWorksheet($worksheet);
$adapter->setCellValue($row, 0, $csvrow[0]);
}
}
}
$row++;
}
$adapter->deliver($surveyname . "." . $adapter->getFileExtension());
exit();
break;
case TYPE_SPSS:
$csv = "";
$separator = ";";
foreach ($csvfile as $csvrow)
{
$csvrow =& str_replace("\n", " ", $this->object->processCSVRow($csvrow, TRUE, $separator));
$csv .= join($csvrow, $separator) . "\n";
}
include_once "./Services/Utilities/classes/class.ilUtil.php";
ilUtil::deliverData($csv, "$surveyname.csv");
exit();
break;
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilSurveyEvaluationGUI::getCommand (   $cmd)

Definition at line 80 of file class.ilSurveyEvaluationGUI.php.

References $cmd.

Referenced by executeCommand().

{
return $cmd;
}

+ Here is the caller graph for this function:

ilSurveyEvaluationGUI::ilSurveyEvaluationGUI (   $a_object)

ilSurveyEvaluationGUI constructor

The constructor takes possible arguments an creates an instance of the ilSurveyEvaluationGUI object.

Parameters
object$a_objectAssociated ilObjSurvey class public

Definition at line 52 of file class.ilSurveyEvaluationGUI.php.

References $ilCtrl, $lng, and $tpl.

{
global $lng, $tpl, $ilCtrl;
$this->lng =& $lng;
$this->tpl =& $tpl;
$this->ctrl =& $ilCtrl;
$this->object =& $a_object;
}
ilSurveyEvaluationGUI::outChart ( )

Creates an image visualising the results of a question.

public

Definition at line 871 of file class.ilSurveyEvaluationGUI.php.

References $_GET, and $type.

{
$survey_id = $_GET["survey"];
$question_id = $_GET["question"];
$type = (strlen($_GET["type"])) ? $_GET["type"] : "";
$question =& $this->object->_instanciateQuestion($question_id);
$question->outChart($survey_id, $type);
}
ilSurveyEvaluationGUI::printEvaluation ( )

Definition at line 335 of file class.ilSurveyEvaluationGUI.php.

References ilUtil\sendInfo().

{
ilUtil::sendInfo($this->lng->txt('use_browser_print_function'), true);
$this->ctrl->redirect($this, 'evaluation');
}

+ Here is the call graph for this function:

Field Documentation

ilSurveyEvaluationGUI::$ctrl

Definition at line 42 of file class.ilSurveyEvaluationGUI.php.

ilSurveyEvaluationGUI::$lng

Definition at line 40 of file class.ilSurveyEvaluationGUI.php.

Referenced by ilSurveyEvaluationGUI().

ilSurveyEvaluationGUI::$object

Definition at line 39 of file class.ilSurveyEvaluationGUI.php.

ilSurveyEvaluationGUI::$tpl

Definition at line 41 of file class.ilSurveyEvaluationGUI.php.

Referenced by ilSurveyEvaluationGUI().


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