Basic class for all survey question types.
More...
Basic class for all survey question types.
The SurveyQuestionGUI class defines and encapsulates basic methods and attributes for survey question types to be used for all parent classes.
- 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$
Definition at line 34 of file class.SurveyQuestionGUI.php.
◆ __construct()
SurveyQuestionGUI::__construct |
( |
|
$a_id = -1 | ) |
|
Definition at line 79 of file class.SurveyQuestionGUI.php.
References $_GET, $DIC, $ilCtrl, $lng, $tpl, ilLoggerFactory\getLogger(), initObject(), setQuestionTabs(), and user().
83 $this->rbacsystem = $DIC->rbac()->system();
84 $this->
user = $DIC->user();
85 $this->access = $DIC->access();
86 $this->tree = $DIC->repositoryTree();
87 $this->toolbar = $DIC->toolbar();
88 $lng = $DIC->language();
95 $this->ctrl->saveParameter($this,
"q_id");
96 $this->ctrl->setParameterByClass(
$_GET[
"cmdClass"],
"sel_question_types",
$_GET[
"sel_question_types"]);
97 $this->cumulated = array();
98 $this->tabs = $DIC->tabs();
103 $this->
object->loadFromDb($a_id);
static getLogger($a_component_id)
Get component logger.
◆ _getClassNameForQType()
static SurveyQuestionGUI::_getClassNameForQType |
( |
|
$q_type | ) |
|
|
static |
◆ _getGUIClassNameForId()
static SurveyQuestionGUI::_getGUIClassNameForId |
( |
|
$a_q_id | ) |
|
|
static |
◆ _getQuestionGUI()
static SurveyQuestionGUI::_getQuestionGUI |
( |
|
$questiontype, |
|
|
|
$question_id = -1 |
|
) |
| |
|
static |
◆ addCommandButtons()
SurveyQuestionGUI::addCommandButtons |
( |
|
$a_form | ) |
|
|
protected |
Definition at line 317 of file class.SurveyQuestionGUI.php.
References ilObject\_lookupType().
Referenced by initEditForm().
319 $a_form->addCommandButton(
"saveReturn", $this->lng->txt(
"save_return"));
320 $a_form->addCommandButton(
"save", $this->lng->txt(
"save"));
324 if ($this->object->hasCopies()) {
325 $a_form->addCommandButton(
"saveSync", $this->lng->txt(
"svy_save_sync"));
static _lookupType($a_id, $a_reference=false)
lookup object type
◆ addFieldsToEditForm()
◆ addGIT()
SurveyQuestionGUI::addGIT |
( |
| ) |
|
Definition at line 808 of file class.SurveyQuestionGUI.php.
References $_GET, and $_SESSION.
810 $this->
object->addInternalLink(
"il__git_" .
$_GET[
"git"]);
813 ilUtil::sendSuccess($this->lng->txt(
"material_added_successfully"),
true);
814 $this->ctrl->redirect($this,
"material");
◆ addMaterial()
SurveyQuestionGUI::addMaterial |
( |
| ) |
|
Add materials to a question.
Definition at line 729 of file class.SurveyQuestionGUI.php.
References $_GET, $_POST, $_SESSION, $tabs, $toolbar, $tree, ilPanelGUI\getInstance(), and material().
735 $ilTabs->activateTab(
"material");
737 $ilToolbar->addButton(
738 $this->lng->txt(
"cancel"),
739 $this->ctrl->getLinkTarget($this,
"material")
743 include_once(
"./Modules/SurveyQuestionPool/classes/class.ilMaterialExplorer.php");
744 switch (
$_POST[
"internalLinkType"]) {
764 $exp->setPathOpen((
int)
$_GET[
"ref_id"]);
765 if (!$exp->handleCommand()) {
766 include_once
"Services/UIComponent/Panel/classes/class.ilPanelGUI.php";
768 $panel->setHeading($this->lng->txt(
"select_object_to_link"));
769 $panel->setBody($exp->getHTML());
771 $this->tpl->setContent($panel->getHTML());
material($checkonly=false)
Material tab of the survey questions.
static getInstance()
Get instance.
◆ addPG()
SurveyQuestionGUI::addPG |
( |
| ) |
|
Definition at line 790 of file class.SurveyQuestionGUI.php.
References $_GET, and $_SESSION.
792 $this->
object->addInternalLink(
"il__pg_" .
$_GET[
"pg"]);
795 ilUtil::sendSuccess($this->lng->txt(
"material_added_successfully"),
true);
796 $this->ctrl->redirect($this,
"material");
◆ addPhrase()
◆ addSelectedPhrase()
SurveyQuestionGUI::addSelectedPhrase |
( |
| ) |
|
|
protected |
Definition at line 968 of file class.SurveyQuestionGUI.php.
References $form, $valid, addPhrase(), and initPhrasesForm().
971 if (
$form->checkInput()) {
972 $phrase_id =
$form->getInput(
"phrases");
975 if (strcmp($this->object->getPhrase($phrase_id),
"dp_standard_numbers") != 0) {
976 $this->
object->addPhrase($phrase_id);
978 $min =
$form->getInput(
"lower_limit");
979 $max =
$form->getInput(
"upper_limit");
982 $max_field =
$form->getItemByPostVar(
"upper_limit");
983 $max_field->setAlert($this->lng->txt(
"upper_limit_must_be_greater"));
986 $this->
object->addStandardNumbers($min, $max);
991 $this->
object->saveToDb();
993 ilUtil::sendSuccess($this->lng->txt(
'phrase_added'),
true);
994 $this->ctrl->redirect($this,
'editQuestion');
998 $form->setValuesByPost();
addPhrase(ilPropertyFormGUI $a_form=null)
Creates an output for the addition of phrases.
if(isset($_POST['submit'])) $form
◆ addST()
SurveyQuestionGUI::addST |
( |
| ) |
|
Definition at line 799 of file class.SurveyQuestionGUI.php.
References $_GET, and $_SESSION.
801 $this->
object->addInternalLink(
"il__st_" .
$_GET[
"st"]);
804 ilUtil::sendSuccess($this->lng->txt(
"material_added_successfully"),
true);
805 $this->ctrl->redirect($this,
"material");
◆ cancel()
SurveyQuestionGUI::cancel |
( |
| ) |
|
|
protected |
◆ cancelExplorer()
SurveyQuestionGUI::cancelExplorer |
( |
| ) |
|
◆ cancelSync()
SurveyQuestionGUI::cancelSync |
( |
| ) |
|
|
protected |
◆ confirmSavePhrase()
SurveyQuestionGUI::confirmSavePhrase |
( |
| ) |
|
Save a new phrase to the database.
public
Definition at line 1060 of file class.SurveyQuestionGUI.php.
References $_POST, $title, $valid, savePhrase(), and ilUtil\sendFailure().
1068 } elseif ($this->object->phraseExists(
$title)) {
1074 $this->
object->savePhrase(
$title);
1076 ilUtil::sendSuccess($this->lng->txt(
"phrase_saved"),
true);
1077 $this->ctrl->redirect($this,
"editQuestion");
savePhrase($a_reload=false)
Creates an output to save the current answers as a phrase.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
◆ copySyncForm()
SurveyQuestionGUI::copySyncForm |
( |
| ) |
|
|
protected |
Definition at line 417 of file class.SurveyQuestionGUI.php.
References $tabs, and $tbl.
Referenced by syncCopies().
421 $ilTabs->activateTab(
"edit_properties");
423 include_once
"Modules/SurveyQuestionPool/classes/class.ilSurveySyncTableGUI.php";
426 $this->tpl->setContent(
$tbl->getHTML());
Survey sync table GUI class.
◆ deleteMaterial()
SurveyQuestionGUI::deleteMaterial |
( |
| ) |
|
Definition at line 715 of file class.SurveyQuestionGUI.php.
References $_POST, and ilUtil\sendFailure().
717 if (is_array(
$_POST[
'idx'])) {
718 $this->
object->deleteMaterials(
$_POST[
'idx']);
719 ilUtil::sendSuccess($this->lng->txt(
'materials_deleted'),
true);
723 $this->ctrl->redirect($this,
'material');
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
◆ editQuestion()
◆ executeCommand()
& SurveyQuestionGUI::executeCommand |
( |
| ) |
|
Definition at line 111 of file class.SurveyQuestionGUI.php.
References $ret.
113 $cmd = $this->ctrl->getCmd();
114 $next_class = $this->ctrl->getNextClass($this);
115 switch ($next_class) {
117 $ret = &$this->$cmd();
◆ getMaterialOutput()
SurveyQuestionGUI::getMaterialOutput |
( |
| ) |
|
|
protected |
Creates the HTML output of the question material(s)
Definition at line 620 of file class.SurveyQuestionGUI.php.
References $_GET, $template, SurveyQuestion\_getInternalLinkHref(), and ilUtil\prepareFormOutput().
Referenced by SurveyTextQuestionGUI\getWorkingForm(), SurveyMetricQuestionGUI\getWorkingForm(), SurveySingleChoiceQuestionGUI\getWorkingForm(), SurveyMultipleChoiceQuestionGUI\getWorkingForm(), and SurveyMatrixQuestionGUI\getWorkingForm().
622 if (count($this->object->getMaterial())) {
623 $template =
new ilTemplate(
"tpl.il_svy_qpl_material.html",
true,
true,
"Modules/SurveyQuestionPool");
624 foreach ($this->object->getMaterial() as $material) {
626 switch ($material->type) {
629 $template->setVariable(
'MATERIAL_TYPE',
'internallink');
630 $template->setVariable(
'MATERIAL_HREF', $href);
634 $template->setVariable(
'TEXT_AVAILABLE_MATERIALS', $this->lng->txt(
'material'));
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
special template class to simplify handling of ITX/PEAR
static _getInternalLinkHref($target="", $a_parent_ref_id=null)
◆ getPrintView()
SurveyQuestionGUI::getPrintView |
( |
|
$question_title = 1 , |
|
|
|
$show_questiontext = 1 |
|
) |
| |
|
abstract |
◆ getPrintViewQuestionTitle()
SurveyQuestionGUI::getPrintViewQuestionTitle |
( |
|
$question_title = 1 | ) |
|
|
protected |
◆ getQuestionType()
SurveyQuestionGUI::getQuestionType |
( |
| ) |
|
◆ getWorkingForm()
SurveyQuestionGUI::getWorkingForm |
( |
|
$working_data = "" , |
|
|
|
$question_title = 1 , |
|
|
|
$show_questiontext = 1 , |
|
|
|
$error_message = "" , |
|
|
|
$survey_id = null |
|
) |
| |
|
abstract |
◆ importEditFormValues()
◆ initEditForm()
SurveyQuestionGUI::initEditForm |
( |
| ) |
|
|
protected |
Definition at line 251 of file class.SurveyQuestionGUI.php.
References $description, $form, $title, ilObjAdvancedEditing\_getUsedHTMLTags(), addCommandButtons(), addFieldsToEditForm(), ilFormPropertyGUI\setInfo(), ilFormPropertyGUI\setRequired(), and ilCheckboxInputGUI\setValue().
Referenced by editQuestion(), and saveForm().
253 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
255 $form->setFormAction($this->ctrl->getFormAction($this,
"save"));
256 $form->setTitle($this->lng->txt($this->getQuestionType()));
257 $form->setMultipart(
false);
258 $form->setTableWidth(
"100%");
263 $title->setRequired(
true);
268 $label->
setInfo($this->lng->txt(
"label_info"));
269 $label->setRequired(
false);
270 $form->addItem($label);
273 $author =
new ilTextInputGUI($this->lng->txt(
"author"),
"author");
275 $form->addItem($author);
285 $question->setRows(10);
286 $question->setCols(80);
287 $question->setUseRte(
true);
288 include_once
"./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
290 $question->addPlugin(
"latex");
291 $question->addButton(
"latex");
292 $question->addButton(
"pastelatex");
293 $question->setRTESupport($this->object->getId(),
"spl",
"survey");
294 $form->addItem($question);
299 $shuffle->setRequired(
false);
300 $form->addItem($shuffle);
307 $title->setValue($this->object->getTitle());
308 $label->setValue($this->object->label);
309 $author->setValue($this->object->getAuthor());
310 $description->setValue($this->object->getDescription());
311 $question->setValue($this->object->prepareTextareaOutput($this->object->getQuestiontext()));
312 $shuffle->setChecked($this->object->getObligatory());
static _getUsedHTMLTags($a_module="")
Returns an array of all allowed HTML tags for text editing.
if(isset($_POST['submit'])) $form
addFieldsToEditForm(ilPropertyFormGUI $a_form)
This class represents a text property in a property form.
addCommandButtons($a_form)
This class represents a text area property in a property form.
◆ initObject()
SurveyQuestionGUI::initObject |
( |
| ) |
|
|
abstractprotected |
◆ initPhrasesForm()
SurveyQuestionGUI::initPhrasesForm |
( |
| ) |
|
|
protected |
Definition at line 908 of file class.SurveyQuestionGUI.php.
References $form, ilSurveyPhrases\_getAvailablePhrases(), ilSurveyPhrases\_getCategoriesForPhrase(), and ilFormPropertyGUI\setRequired().
Referenced by addPhrase(), and addSelectedPhrase().
910 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
912 $form->setFormAction($this->ctrl->getFormAction($this,
"addSelectedPhrase"));
913 $form->setTitle($this->lng->txt(
"add_phrase"));
918 $form->addItem($group);
920 include_once
"./Modules/SurveyQuestionPool/classes/class.ilSurveyPhrases.php";
924 $opt =
new ilRadioOption($phrase_array[
"title"], $phrase_id);
925 $opt->setInfo(join(
",", $categories));
926 $group->addOption($opt);
928 if ($phrase_array[
"org_title"] ==
"dp_standard_numbers") {
932 $opt->addSubItem($min);
937 $opt->addSubItem($max);
941 $form->addCommandButton(
"addSelectedPhrase", $this->lng->txt(
"add_phrase"));
942 $form->addCommandButton(
"editQuestion", $this->lng->txt(
"cancel"));
This class represents an option in a radio group.
static _getCategoriesForPhrase($phrase_id)
Gets the available categories for a given phrase.
if(isset($_POST['submit'])) $form
static _getAvailablePhrases($useronly=0)
Gets the available phrases from the database.
◆ linkChilds()
SurveyQuestionGUI::linkChilds |
( |
| ) |
|
Definition at line 817 of file class.SurveyQuestionGUI.php.
References $_GET, $_SESSION, $nodes, $tabs, $tbl, ilLMPageObject\getPageList(), and ilUtil\sendFailure().
821 $selectable_items = array();
823 $source_id =
$_GET[
"source_id"];
827 include_once
"./Modules/LearningModule/classes/class.ilLMPageObject.php";
828 include_once(
"./Modules/LearningModule/classes/class.ilObjContentObjectGUI.php");
830 $cont_obj = $cont_obj_gui->object;
832 foreach ($pages as $page) {
833 if ($page[
"type"] ==
$_SESSION[
"search_link_type"]) {
834 $selectable_items[] = array(
835 "item_type" => $page[
"type"]
836 ,
"item_id" => $page[
"obj_id"]
837 ,
"title" => $page[
"title"]
844 include_once(
"./Modules/LearningModule/classes/class.ilObjContentObjectGUI.php");
846 $cont_obj = $cont_obj_gui->object;
848 $ctree = &$cont_obj->getLMTree();
849 $nodes = $ctree->getSubtree($ctree->getNodeData($ctree->getRootId()));
850 foreach (
$nodes as $node) {
851 if ($node[
"type"] ==
$_SESSION[
"search_link_type"]) {
852 $selectable_items[] = array(
853 "item_type" => $node[
"type"]
854 ,
"item_id" => $node[
"obj_id"]
855 ,
"title" => $node[
"title"]
862 include_once
"./Modules/Glossary/classes/class.ilObjGlossary.php";
865 $terms = $glossary->getTermList();
866 foreach ($terms as $term) {
867 $selectable_items[] = array(
869 ,
"item_id" => $term[
"id"]
870 ,
"title" => $term[
"term"]
876 $this->
object->addInternalLink(
"il__lm_" . $source_id);
880 if (
sizeof($selectable_items)) {
881 $ilTabs->activateTab(
"material");
882 $this->ctrl->setParameter($this,
"q_id", $this->object->getId());
883 $this->ctrl->setParameter($this,
"source_id", $source_id);
885 include_once
"Modules/SurveyQuestionPool/classes/tables/class.SurveyMaterialsSourceTableGUI.php";
887 $tbl->setData($selectable_items);
888 $this->tpl->setContent(
$tbl->getHTML());
890 if (
$_SESSION[
"search_link_type"] ==
"lm") {
891 ilUtil::sendSuccess($this->lng->txt(
"material_added_successfully"),
true);
895 $this->ctrl->redirect($this,
"material");
898 $this->ctrl->redirect($this,
"addMaterial");
TableGUI class for survey question source materials.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
Class ilObjContentObjectGUI.
static getPageList($lm_id)
static
◆ material()
SurveyQuestionGUI::material |
( |
|
$checkonly = false | ) |
|
Material tab of the survey questions.
Definition at line 649 of file class.SurveyQuestionGUI.php.
References $_GET, $data, $errors, $form, $rbacsystem, $tabs, $title, $type, SurveyQuestion\_getInternalLinkHref(), ilUtil\prepareFormOutput(), and ilFormPropertyGUI\setRequired().
Referenced by addMaterial().
654 $ilTabs->activateTab(
"material");
658 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
660 $form->setFormAction($this->ctrl->getFormAction($this));
661 $form->setTitle($this->lng->txt(
'add_material'));
662 $form->setMultipart(
false);
663 $form->setTableWidth(
"100%");
664 $form->setId(
"material");
669 $material->addOption(
new ilRadioOption($this->lng->txt(
'obj_lm'),
"lm"));
670 $material->addOption(
new ilRadioOption($this->lng->txt(
'obj_st'),
"st"));
671 $material->addOption(
new ilRadioOption($this->lng->txt(
'obj_pg'),
"pg"));
672 $material->addOption(
new ilRadioOption($this->lng->txt(
'glossary_term'),
"glo"));
673 $form->addItem($material);
675 $form->addCommandButton(
"addMaterial", $this->lng->txt(
"add"));
680 $form->setValuesByPost();
686 $add_html =
$form->getHTML();
691 if (count($this->object->getMaterial())) {
692 include_once
"./Modules/SurveyQuestionPool/classes/tables/class.ilSurveyMaterialsTableGUI.php";
695 foreach ($this->object->getMaterial() as $material) {
696 switch ($material->type) {
699 $type = $this->lng->txt(
'internal_link');
703 array_push($data, array(
'href' => $href,
'title' =>
$title,
'type' =>
$type));
705 $table_gui->setData($data);
706 $mat_html = $table_gui->getHTML();
710 $this->tpl->setVariable(
"ADM_CONTENT", $add_html . $mat_html);
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
This class represents an option in a radio group.
TableGUI class for survey question materials.
if(isset($_POST['submit'])) $form
static _getInternalLinkHref($target="", $a_parent_ref_id=null)
◆ originalSyncForm()
SurveyQuestionGUI::originalSyncForm |
( |
| ) |
|
|
protected |
Definition at line 473 of file class.SurveyQuestionGUI.php.
References $tabs.
477 $ilTabs->activateTab(
"edit_properties");
479 $this->ctrl->saveParameter($this,
"rtrn");
481 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
483 $cgui->setHeaderText($this->lng->txt(
"confirm_sync_questions"));
485 $cgui->setFormAction($this->ctrl->getFormAction($this,
"confirmRemoveQuestions"));
486 $cgui->setCancel($this->lng->txt(
"no"),
"cancelSync");
487 $cgui->setConfirm($this->lng->txt(
"yes"),
"sync");
489 $this->tpl->setContent($cgui->getHTML());
Confirmation screen class.
◆ outQuestionText()
SurveyQuestionGUI::outQuestionText |
( |
|
$template | ) |
|
|
protected |
Definition at line 171 of file class.SurveyQuestionGUI.php.
References $template.
Referenced by SurveyTextQuestionGUI\getPrintView(), SurveySingleChoiceQuestionGUI\getPrintView(), SurveyMetricQuestionGUI\getPrintView(), SurveyMultipleChoiceQuestionGUI\getPrintView(), SurveyMatrixQuestionGUI\getPrintView(), SurveyTextQuestionGUI\getWorkingForm(), SurveyMetricQuestionGUI\getWorkingForm(), SurveySingleChoiceQuestionGUI\getWorkingForm(), SurveyMultipleChoiceQuestionGUI\getWorkingForm(), and SurveyMatrixQuestionGUI\getWorkingForm().
173 $questiontext = $this->
object->getQuestiontext();
174 if (preg_match(
"/^<.[\\>]?>(.*?)<\\/.[\\>]*?>$/", $questiontext, $matches)) {
175 $questiontext = $matches[1];
177 $template->setVariable(
"QUESTIONTEXT", $this->object->prepareTextareaOutput($questiontext,
true));
178 if ($this->object->getObligatory($survey_id)) {
179 $template->setVariable(
"OBLIGATORY_TEXT",
' *');
◆ preview()
SurveyQuestionGUI::preview |
( |
| ) |
|
Creates a preview of the question.
private
Definition at line 587 of file class.SurveyQuestionGUI.php.
References $tabs, $tpl, ilPanelGUI\getInstance(), and getWorkingForm().
591 $ilTabs->activateTab(
"preview");
593 $tpl =
new ilTemplate(
"tpl.il_svy_qpl_preview.html",
true,
true,
"Modules/SurveyQuestionPool");
595 if ($this->object->getObligatory()) {
596 $tpl->setCurrentBlock(
"required");
597 $tpl->setVariable(
"TEXT_REQUIRED", $this->lng->txt(
"required_field"));
598 $tpl->parseCurrentBlock();
603 include_once
"Services/UIComponent/Panel/classes/class.ilPanelGUI.php";
605 $panel->setBody(
$tpl->get());
607 $this->tpl->setContent($panel->getHTML());
getWorkingForm($working_data="", $question_title=1, $show_questiontext=1, $error_message="", $survey_id=null)
special template class to simplify handling of ITX/PEAR
static getInstance()
Get instance.
◆ redirectAfterSaving()
SurveyQuestionGUI::redirectAfterSaving |
( |
|
$a_return = false | ) |
|
|
protected |
Redirect to calling survey or to edit form.
- Parameters
-
Definition at line 514 of file class.SurveyQuestionGUI.php.
References $_GET, $_SESSION, and ilUtil\redirect().
Referenced by cancelSync(), save(), sync(), and syncCopies().
519 if ($this->parent_url) {
521 if (strlen(
$_GET[
"new_for_survey"])) {
522 $addurl =
"&new_id=" .
$_GET[
"q_id"];
528 $this->ctrl->setParameterByClass(
"ilObjSurveyQuestionPoolGUI",
"q_id_table_nav",
$_SESSION[
'q_id_table_nav']);
529 $this->ctrl->redirectByClass(
"ilObjSurveyQuestionPoolGUI",
"questions");
534 $this->ctrl->setParameterByClass(
$_GET[
"cmdClass"],
"q_id", $this->object->getId());
535 $this->ctrl->setParameterByClass(
$_GET[
"cmdClass"],
"sel_question_types",
$_GET[
"sel_question_types"]);
536 $this->ctrl->setParameterByClass(
$_GET[
"cmdClass"],
"new_for_survey",
$_GET[
"new_for_survey"]);
537 $this->ctrl->redirectByClass(
$_GET[
"cmdClass"],
"editQuestion");
static redirect($a_script)
◆ removeMaterial()
SurveyQuestionGUI::removeMaterial |
( |
| ) |
|
◆ renderStatisticsDetailsTable()
SurveyQuestionGUI::renderStatisticsDetailsTable |
( |
array |
$a_head, |
|
|
array |
$a_rows, |
|
|
array |
$a_foot = null |
|
) |
| |
|
protected |
Definition at line 1083 of file class.SurveyQuestionGUI.php.
References $html, and $row.
1086 $html[] =
'<div class="ilTableOuter table-responsive">';
1087 $html[] =
'<table class="table table-striped">';
1089 $html[] =
"<thead>";
1091 foreach ($a_head as $col) {
1094 $html[] = ($col !=
"") ? $col :
" ";
1098 $html[] =
"</thead>";
1100 $html[] =
"<tbody>";
1101 foreach ($a_rows as
$row) {
1103 foreach ($row as $col) {
1106 $html[] = ($col !=
"") ? $col :
" ";
1111 $html[] =
"</tbody>";
1114 $html[] =
"<tfoot>";
1116 foreach ($a_foot as $col) {
1119 $html[] = ($col !=
"") ? $col :
" ";
1123 $html[] =
"</tfoot>";
1126 $html[] =
"</table>";
1128 return implode(
"\n",
$html);
◆ save()
SurveyQuestionGUI::save |
( |
|
$a_return = false , |
|
|
|
$a_sync = false |
|
) |
| |
|
protected |
Definition at line 378 of file class.SurveyQuestionGUI.php.
References $ilUser, $user, SurveyQuestion\_isComplete(), SurveyQuestion\_isWriteable(), SurveyQuestion\_questionExists(), editQuestion(), redirectAfterSaving(), saveForm(), and ilUtil\sendFailure().
Referenced by saveReturn(), and saveSync().
390 $ilUser->setPref(
"svy_lastquestiontype", $this->object->getQuestionType());
391 $ilUser->writePref(
"svy_lastquestiontype", $this->object->getQuestionType());
394 $this->ctrl->setParameter($this,
"q_id", $this->object->getId());
395 include_once
"./Modules/SurveyQuestionPool/classes/class.SurveyQuestion.php";
399 ilUtil::sendSuccess($this->lng->txt(
"msg_obj_modified"),
true);
400 $this->ctrl->redirect($this,
'copySyncForm');
403 if ($originalexists &&
406 $this->ctrl->setParameter($this,
'rtrn', 1);
408 $this->ctrl->redirect($this,
'originalSyncForm');
412 ilUtil::sendSuccess($this->lng->txt(
"msg_obj_modified"),
true);
redirectAfterSaving($a_return=false)
Redirect to calling survey or to edit form.
static _isComplete($question_id)
Checks whether the question is complete or not.
static _isWriteable($question_id, $user_id)
Returns true if the question is writeable by a certain user.
static _questionExists($question_id)
Returns true if the question already exists in the database.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
editQuestion(ilPropertyFormGUI $a_form=null)
◆ saveForm()
SurveyQuestionGUI::saveForm |
( |
| ) |
|
|
protected |
◆ savePhrase()
SurveyQuestionGUI::savePhrase |
( |
|
$a_reload = false | ) |
|
Creates an output to save the current answers as a phrase.
public
Definition at line 1007 of file class.SurveyQuestionGUI.php.
References $_SESSION, $data, $i, $result, $tabs, $toolbar, $txt, and saveForm().
Referenced by confirmSavePhrase().
1012 $ilTabs->activateTab(
"edit_properties");
1017 $this->
object->saveToDb();
1021 include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
1023 $ilToolbar->addInputItem(
$txt,
true);
1024 $ilToolbar->addFormButton($this->lng->txt(
"confirm"),
"confirmSavePhrase");
1025 $ilToolbar->setFormAction($this->ctrl->getFormAction($this));
1027 include_once
"./Modules/SurveyQuestionPool/classes/tables/class.ilSurveySavePhraseTableGUI.php";
1029 $table_gui->setDescription($this->lng->txt(
"save_phrase_introduction"));
1032 if (method_exists($this->
object,
"getCategories")) {
1033 $categories = $this->
object->getCategories();
1035 $categories = $this->
object->getColumns();
1039 for (
$i = 0;
$i < $categories->getCategoryCount();
$i++) {
1040 $cat = $categories->getCategory(
$i);
1043 "answer" => $cat->title,
1044 "other" => $cat->other,
1045 "scale" => $cat->scale,
1046 "neutral" => $cat->neutral
1049 $table_gui->setData(
$data);
1052 $this->tpl->setContent($table_gui->getHTML());
This class represents a text property in a property form.
◆ saveReturn()
SurveyQuestionGUI::saveReturn |
( |
| ) |
|
|
protected |
◆ saveSync()
SurveyQuestionGUI::saveSync |
( |
| ) |
|
|
protected |
◆ setBackUrl()
SurveyQuestionGUI::setBackUrl |
( |
|
$a_url | ) |
|
◆ setQuestionTabs()
SurveyQuestionGUI::setQuestionTabs |
( |
| ) |
|
|
abstract |
◆ setQuestionTabsForClass()
SurveyQuestionGUI::setQuestionTabsForClass |
( |
|
$guiclass | ) |
|
Definition at line 188 of file class.SurveyQuestionGUI.php.
References $_GET, $_SESSION, $rbacsystem, $tabs, $title, and getQuestionType().
Referenced by SurveyMultipleChoiceQuestionGUI\setQuestionTabs(), SurveyTextQuestionGUI\setQuestionTabs(), SurveySingleChoiceQuestionGUI\setQuestionTabs(), SurveyMetricQuestionGUI\setQuestionTabs(), and SurveyMatrixQuestionGUI\setQuestionTabs().
193 $this->ctrl->setParameterByClass($guiclass,
"sel_question_types", $this->
getQuestionType());
194 $this->ctrl->setParameterByClass($guiclass,
"q_id",
$_GET[
"q_id"]);
196 if ($this->parent_url) {
198 if (strlen(
$_GET[
"new_for_survey"])) {
199 $addurl =
"&new_id=" .
$_GET[
"q_id"];
201 $ilTabs->setBackTarget($this->lng->txt(
"menubacktosurvey"), $this->parent_url . $addurl);
203 $this->ctrl->setParameterByClass(
"ilObjSurveyQuestionPoolGUI",
"q_id_table_nav",
$_SESSION[
'q_id_table_nav']);
204 $ilTabs->setBackTarget($this->lng->txt(
"spl"), $this->ctrl->getLinkTargetByClass(
"ilObjSurveyQuestionPoolGUI",
"questions"));
207 $ilTabs->addNonTabbedLink(
209 $this->lng->txt(
"preview"),
210 $this->ctrl->getLinkTargetByClass($guiclass,
"preview")
217 $this->lng->txt(
"properties"),
218 $this->ctrl->getLinkTargetByClass($guiclass,
"editQuestion")
221 if (stristr($guiclass,
"matrix")) {
224 $this->lng->txt(
"layout"),
225 $this->ctrl->getLinkTargetByClass($guiclass,
"layout")
232 $this->lng->txt(
"material"),
233 $this->ctrl->getLinkTargetByClass($guiclass,
"material")
237 if ($this->object->getId() > 0) {
238 $title = $this->lng->txt(
"edit") .
" "" . $this->
object->getTitle() .
""";
243 $this->tpl->setVariable(
"HEADER",
$title);
getQuestionType()
Returns the question type string.
◆ sync()
SurveyQuestionGUI::sync |
( |
| ) |
|
|
protected |
Definition at line 492 of file class.SurveyQuestionGUI.php.
References redirectAfterSaving().
494 $original_id = $this->
object->original_id;
496 $this->
object->syncWithOriginal();
499 ilUtil::sendSuccess($this->lng->txt(
"msg_obj_modified"),
true);
redirectAfterSaving($a_return=false)
Redirect to calling survey or to edit form.
◆ syncCopies()
SurveyQuestionGUI::syncCopies |
( |
| ) |
|
|
protected |
Definition at line 429 of file class.SurveyQuestionGUI.php.
References $_POST, $access, $id, $lng, ilObject\_getAllReferences(), copySyncForm(), redirectAfterSaving(), and ilUtil\sendFailure().
434 if (!
sizeof(
$_POST[
"qid"])) {
439 foreach ($this->object->getCopyIds(
true) as $survey_id => $questions) {
443 foreach ($ref_ids as $ref_id) {
444 if ($ilAccess->checkAccess(
"edit",
"", $ref_id)) {
451 foreach ($questions as $qid) {
452 if (in_array($qid,
$_POST[
"qid"])) {
453 $id = $this->
object->getId();
455 $this->
object->setId($qid);
456 $this->
object->setOriginalId(
$id);
457 $this->
object->saveToDb();
459 $this->
object->setId(
$id);
460 $this->
object->setOriginalId(null);
469 ilUtil::sendSuccess(
$lng->txt(
"survey_sync_success"),
true);
redirectAfterSaving($a_return=false)
Redirect to calling survey or to edit form.
if(!array_key_exists('StateId', $_REQUEST)) $id
static _getAllReferences($a_id)
get all reference ids of object
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
◆ validateEditForm()
◆ $access
SurveyQuestionGUI::$access |
|
protected |
◆ $ctrl
◆ $cumulated
SurveyQuestionGUI::$cumulated |
|
protected |
◆ $lng
◆ $log
◆ $object
SurveyQuestionGUI::$object |
◆ $parent_url
SurveyQuestionGUI::$parent_url |
|
protected |
◆ $rbacsystem
SurveyQuestionGUI::$rbacsystem |
|
protected |
◆ $tabs
Definition at line 64 of file class.SurveyQuestionGUI.php.
Referenced by addMaterial(), addPhrase(), copySyncForm(), editQuestion(), SurveyMatrixQuestionGUI\layout(), linkChilds(), material(), originalSyncForm(), preview(), savePhrase(), and setQuestionTabsForClass().
◆ $toolbar
SurveyQuestionGUI::$toolbar |
|
protected |
◆ $tpl
◆ $tree
◆ $user
The documentation for this class was generated from the following file: