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 314 of file class.SurveyQuestionGUI.php.
References ilObject\_lookupType().
Referenced by initEditForm().
316 $a_form->addCommandButton(
"saveReturn", $this->lng->txt(
"save_return"));
317 $a_form->addCommandButton(
"save", $this->lng->txt(
"save"));
321 if ($this->object->hasCopies()) {
322 $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 797 of file class.SurveyQuestionGUI.php.
References $_GET, and $_SESSION.
799 $this->
object->addInternalLink(
"il__git_" .
$_GET[
"git"]);
802 ilUtil::sendSuccess($this->lng->txt(
"material_added_successfully"),
true);
803 $this->ctrl->redirect($this,
"material");
◆ addMaterial()
SurveyQuestionGUI::addMaterial |
( |
| ) |
|
Add materials to a question.
Definition at line 720 of file class.SurveyQuestionGUI.php.
References $_GET, $_POST, $_SESSION, $tabs, $toolbar, $tree, ilPanelGUI\getInstance(), and material().
726 $ilTabs->activateTab(
"material");
728 $ilToolbar->addButton(
729 $this->lng->txt(
"cancel"),
730 $this->ctrl->getLinkTarget($this,
"material")
734 switch (
$_POST[
"internalLinkType"]) {
754 $exp->setPathOpen((
int)
$_GET[
"ref_id"]);
755 if (!$exp->handleCommand()) {
757 $panel->setHeading($this->lng->txt(
"select_object_to_link"));
758 $panel->setBody($exp->getHTML());
760 $this->tpl->setContent($panel->getHTML());
material($checkonly=false)
Material tab of the survey questions.
static getInstance()
Get instance.
◆ addPG()
SurveyQuestionGUI::addPG |
( |
| ) |
|
Definition at line 779 of file class.SurveyQuestionGUI.php.
References $_GET, and $_SESSION.
781 $this->
object->addInternalLink(
"il__pg_" .
$_GET[
"pg"]);
784 ilUtil::sendSuccess($this->lng->txt(
"material_added_successfully"),
true);
785 $this->ctrl->redirect($this,
"material");
◆ addPhrase()
◆ addSelectedPhrase()
SurveyQuestionGUI::addSelectedPhrase |
( |
| ) |
|
|
protected |
Definition at line 950 of file class.SurveyQuestionGUI.php.
References $valid, addPhrase(), and initPhrasesForm().
953 if ($form->checkInput()) {
954 $phrase_id = $form->getInput(
"phrases");
957 if (strcmp($this->object->getPhrase($phrase_id),
"dp_standard_numbers") != 0) {
958 $this->
object->addPhrase($phrase_id);
960 $min = $form->getInput(
"lower_limit");
961 $max = $form->getInput(
"upper_limit");
964 $max_field = $form->getItemByPostVar(
"upper_limit");
965 $max_field->setAlert($this->lng->txt(
"upper_limit_must_be_greater"));
968 $this->
object->addStandardNumbers($min, $max);
973 $this->
object->saveToDb();
975 ilUtil::sendSuccess($this->lng->txt(
'phrase_added'),
true);
976 $this->ctrl->redirect($this,
'editQuestion');
980 $form->setValuesByPost();
addPhrase(ilPropertyFormGUI $a_form=null)
Creates an output for the addition of phrases.
◆ addST()
SurveyQuestionGUI::addST |
( |
| ) |
|
Definition at line 788 of file class.SurveyQuestionGUI.php.
References $_GET, and $_SESSION.
790 $this->
object->addInternalLink(
"il__st_" .
$_GET[
"st"]);
793 ilUtil::sendSuccess($this->lng->txt(
"material_added_successfully"),
true);
794 $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 1040 of file class.SurveyQuestionGUI.php.
References $_POST, $valid, savePhrase(), and ilUtil\sendFailure().
1042 $title =
$_POST[
"phrase_title"];
1045 if (!trim($title)) {
1048 } elseif ($this->object->phraseExists($title)) {
1054 $this->
object->savePhrase($title);
1056 ilUtil::sendSuccess($this->lng->txt(
"phrase_saved"),
true);
1057 $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 |
◆ deleteMaterial()
SurveyQuestionGUI::deleteMaterial |
( |
| ) |
|
Definition at line 706 of file class.SurveyQuestionGUI.php.
References $_POST, and ilUtil\sendFailure().
708 if (is_array(
$_POST[
'idx'])) {
709 $this->
object->deleteMaterials(
$_POST[
'idx']);
710 ilUtil::sendSuccess($this->lng->txt(
'materials_deleted'),
true);
714 $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 613 of file class.SurveyQuestionGUI.php.
References $_GET, SurveyQuestion\_getInternalLinkHref(), and ilUtil\prepareFormOutput().
Referenced by SurveyTextQuestionGUI\getWorkingForm(), SurveyMetricQuestionGUI\getWorkingForm(), SurveySingleChoiceQuestionGUI\getWorkingForm(), SurveyMultipleChoiceQuestionGUI\getWorkingForm(), and SurveyMatrixQuestionGUI\getWorkingForm().
615 if (count($this->object->getMaterial())) {
616 $template =
new ilTemplate(
"tpl.il_svy_qpl_material.html",
true,
true,
"Modules/SurveyQuestionPool");
617 foreach ($this->object->getMaterial() as $material) {
618 $template->setCurrentBlock(
'material');
619 switch ($material->type) {
622 $template->setVariable(
'MATERIAL_TYPE',
'internallink');
623 $template->setVariable(
'MATERIAL_HREF', $href);
626 $template->setVariable(
'MATERIAL_TITLE', (strlen($material->title)) ?
ilUtil::prepareFormOutput($material->title) : $this->lng->txt(
'material'));
627 $template->setVariable(
'TEXT_AVAILABLE_MATERIALS', $this->lng->txt(
'material'));
628 $template->parseCurrentBlock();
630 return $template->get();
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
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 248 of file class.SurveyQuestionGUI.php.
References ilObjAdvancedEditing\_getRichTextEditor(), ilObjAdvancedEditing\_getUsedHTMLTags(), addCommandButtons(), addFieldsToEditForm(), ilFormPropertyGUI\setRequired(), and ilCheckboxInputGUI\setValue().
Referenced by editQuestion(), and saveForm().
251 $form->setFormAction($this->ctrl->getFormAction($this,
"save"));
252 $form->setTitle($this->lng->txt($this->getQuestionType()));
253 $form->setMultipart(
false);
254 $form->setTableWidth(
"100%");
259 $title->setRequired(
true);
260 $form->addItem($title);
264 $label->setInfo($this->lng->txt(
"label_info"));
265 $label->setRequired(
false);
266 $form->addItem($label);
269 $author =
new ilTextInputGUI($this->lng->txt(
"author"),
"author");
270 $author->setRequired(
true);
271 $form->addItem($author);
274 $description =
new ilTextInputGUI($this->lng->txt(
"description"),
"description");
275 $description->setRequired(
false);
276 $form->addItem($description);
281 $question->setRows(10);
282 $question->setCols(80);
284 $question->setUseRte(
true);
286 $question->addPlugin(
"latex");
287 $question->addButton(
"latex");
288 $question->addButton(
"pastelatex");
289 $question->setRTESupport($this->object->getId(),
"spl",
"survey");
291 $form->addItem($question);
296 $shuffle->setRequired(
false);
297 $form->addItem($shuffle);
304 $title->setValue($this->object->getTitle());
305 $label->setValue($this->object->label);
306 $author->setValue($this->object->getAuthor());
307 $description->setValue($this->object->getDescription());
308 $question->setValue($this->object->prepareTextareaOutput($this->object->getQuestiontext()));
309 $shuffle->setChecked($this->object->getObligatory());
static _getRichTextEditor()
Returns the identifier for the Rich Text Editor.
static _getUsedHTMLTags($a_module="")
Returns an array of all allowed HTML tags for text editing.
addFieldsToEditForm(ilPropertyFormGUI $a_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 892 of file class.SurveyQuestionGUI.php.
References ilSurveyPhrases\_getAvailablePhrases(), ilSurveyPhrases\_getCategoriesForPhrase(), and ilFormPropertyGUI\setRequired().
Referenced by addPhrase(), and addSelectedPhrase().
895 $form->setFormAction($this->ctrl->getFormAction($this,
"addSelectedPhrase"));
896 $form->setTitle($this->lng->txt(
"add_phrase"));
901 $form->addItem($group);
906 $opt =
new ilRadioOption($phrase_array[
"title"], $phrase_id);
907 $opt->setInfo(join(
",", $categories));
908 $group->addOption($opt);
910 if ($phrase_array[
"org_title"] ==
"dp_standard_numbers") {
914 $opt->addSubItem($min);
919 $opt->addSubItem($max);
923 $form->addCommandButton(
"addSelectedPhrase", $this->lng->txt(
"add_phrase"));
924 $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.
static _getAvailablePhrases($useronly=0)
Gets the available phrases from the database.
◆ linkChilds()
SurveyQuestionGUI::linkChilds |
( |
| ) |
|
Definition at line 806 of file class.SurveyQuestionGUI.php.
References $_GET, $_SESSION, $tabs, ilLMPageObject\getPageList(), and ilUtil\sendFailure().
810 $selectable_items = array();
812 $source_id =
$_GET[
"source_id"];
817 $cont_obj = $cont_obj_gui->object;
819 foreach ($pages as $page) {
820 if ($page[
"type"] ==
$_SESSION[
"search_link_type"]) {
821 $selectable_items[] = array(
822 "item_type" => $page[
"type"]
823 ,
"item_id" => $page[
"obj_id"]
824 ,
"title" => $page[
"title"]
832 $cont_obj = $cont_obj_gui->object;
834 $ctree = &$cont_obj->getLMTree();
835 $nodes = $ctree->getSubtree($ctree->getNodeData($ctree->getRootId()));
836 foreach ($nodes as $node) {
837 if ($node[
"type"] ==
$_SESSION[
"search_link_type"]) {
838 $selectable_items[] = array(
839 "item_type" => $node[
"type"]
840 ,
"item_id" => $node[
"obj_id"]
841 ,
"title" => $node[
"title"]
850 $terms = $glossary->getTermList();
851 foreach ($terms as $term) {
852 $selectable_items[] = array(
854 ,
"item_id" => $term[
"id"]
855 ,
"title" => $term[
"term"]
861 $this->
object->addInternalLink(
"il__lm_" . $source_id);
865 if (
sizeof($selectable_items)) {
866 $ilTabs->activateTab(
"material");
867 $this->ctrl->setParameter($this,
"q_id", $this->object->getId());
868 $this->ctrl->setParameter($this,
"source_id", $source_id);
871 $tbl->setData($selectable_items);
872 $this->tpl->setContent($tbl->getHTML());
874 if (
$_SESSION[
"search_link_type"] ==
"lm") {
875 ilUtil::sendSuccess($this->lng->txt(
"material_added_successfully"),
true);
879 $this->ctrl->redirect($this,
"material");
882 $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 642 of file class.SurveyQuestionGUI.php.
References $_GET, $data, $errors, $rbacsystem, $tabs, $type, SurveyQuestion\_getInternalLinkHref(), ilUtil\prepareFormOutput(), and ilFormPropertyGUI\setRequired().
Referenced by addMaterial().
647 $ilTabs->activateTab(
"material");
652 $form->setFormAction($this->ctrl->getFormAction($this));
653 $form->setTitle($this->lng->txt(
'add_material'));
654 $form->setMultipart(
false);
655 $form->setTableWidth(
"100%");
656 $form->setId(
"material");
661 $material->addOption(
new ilRadioOption($this->lng->txt(
'obj_lm'),
"lm"));
662 $material->addOption(
new ilRadioOption($this->lng->txt(
'obj_st'),
"st"));
663 $material->addOption(
new ilRadioOption($this->lng->txt(
'obj_pg'),
"pg"));
664 $material->addOption(
new ilRadioOption($this->lng->txt(
'glossary_term'),
"glo"));
665 $form->addItem($material);
667 $form->addCommandButton(
"addMaterial", $this->lng->txt(
"add"));
672 $form->setValuesByPost();
673 $errors = !$form->checkInput();
678 $add_html = $form->getHTML();
683 if (count($this->object->getMaterial())) {
686 foreach ($this->object->getMaterial() as $material) {
687 switch ($material->type) {
690 $type = $this->lng->txt(
'internal_link');
694 array_push($data, array(
'href' => $href,
'title' => $title,
'type' =>
$type));
696 $table_gui->setData($data);
697 $mat_html = $table_gui->getHTML();
701 $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.
static _getInternalLinkHref($target="", $a_parent_ref_id=null)
◆ originalSyncForm()
SurveyQuestionGUI::originalSyncForm |
( |
| ) |
|
|
protected |
Definition at line 468 of file class.SurveyQuestionGUI.php.
References $tabs.
472 $ilTabs->activateTab(
"edit_properties");
474 $this->ctrl->saveParameter($this,
"rtrn");
477 $cgui->setHeaderText($this->lng->txt(
"confirm_sync_questions"));
479 $cgui->setFormAction($this->ctrl->getFormAction($this,
"confirmRemoveQuestions"));
480 $cgui->setCancel($this->lng->txt(
"no"),
"cancelSync");
481 $cgui->setConfirm($this->lng->txt(
"yes"),
"sync");
483 $this->tpl->setContent($cgui->getHTML());
Confirmation screen class.
◆ outQuestionText()
SurveyQuestionGUI::outQuestionText |
( |
|
$template | ) |
|
|
protected |
Definition at line 168 of file class.SurveyQuestionGUI.php.
Referenced by SurveyTextQuestionGUI\getPrintView(), SurveySingleChoiceQuestionGUI\getPrintView(), SurveyMetricQuestionGUI\getPrintView(), SurveyMultipleChoiceQuestionGUI\getPrintView(), SurveyMatrixQuestionGUI\getPrintView(), SurveyTextQuestionGUI\getWorkingForm(), SurveyMetricQuestionGUI\getWorkingForm(), SurveySingleChoiceQuestionGUI\getWorkingForm(), SurveyMultipleChoiceQuestionGUI\getWorkingForm(), and SurveyMatrixQuestionGUI\getWorkingForm().
170 $questiontext = $this->
object->getQuestiontext();
171 if (preg_match(
"/^<.[\\>]?>(.*?)<\\/.[\\>]*?>$/", $questiontext, $matches)) {
172 $questiontext = $matches[1];
174 $template->setVariable(
"QUESTIONTEXT", $this->object->prepareTextareaOutput($questiontext,
true));
175 if ($this->object->getObligatory($survey_id)) {
176 $template->setVariable(
"OBLIGATORY_TEXT",
' *');
◆ preview()
SurveyQuestionGUI::preview |
( |
| ) |
|
Creates a preview of the question.
private
Definition at line 581 of file class.SurveyQuestionGUI.php.
References $tabs, $tpl, ilPanelGUI\getInstance(), and getWorkingForm().
585 $ilTabs->activateTab(
"preview");
587 $tpl =
new ilTemplate(
"tpl.il_svy_qpl_preview.html",
true,
true,
"Modules/SurveyQuestionPool");
589 if ($this->object->getObligatory()) {
590 $tpl->setCurrentBlock(
"required");
591 $tpl->setVariable(
"TEXT_REQUIRED", $this->lng->txt(
"required_field"));
592 $tpl->parseCurrentBlock();
598 $panel->setBody(
$tpl->get());
600 $this->tpl->setContent($panel->getHTML());
getWorkingForm($working_data="", $question_title=1, $show_questiontext=1, $error_message="", $survey_id=null)
static getInstance()
Get instance.
◆ redirectAfterSaving()
SurveyQuestionGUI::redirectAfterSaving |
( |
|
$a_return = false | ) |
|
|
protected |
Redirect to calling survey or to edit form.
- Parameters
-
Definition at line 508 of file class.SurveyQuestionGUI.php.
References $_GET, $_SESSION, and ilUtil\redirect().
Referenced by cancelSync(), save(), sync(), and syncCopies().
513 if ($this->parent_url) {
515 if (strlen(
$_GET[
"new_for_survey"])) {
516 $addurl =
"&new_id=" .
$_GET[
"q_id"];
522 $this->ctrl->setParameterByClass(
"ilObjSurveyQuestionPoolGUI",
"q_id_table_nav",
$_SESSION[
'q_id_table_nav']);
523 $this->ctrl->redirectByClass(
"ilObjSurveyQuestionPoolGUI",
"questions");
528 $this->ctrl->setParameterByClass(
$_GET[
"cmdClass"],
"q_id", $this->object->getId());
529 $this->ctrl->setParameterByClass(
$_GET[
"cmdClass"],
"sel_question_types",
$_GET[
"sel_question_types"]);
530 $this->ctrl->setParameterByClass(
$_GET[
"cmdClass"],
"new_for_survey",
$_GET[
"new_for_survey"]);
531 $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 1063 of file class.SurveyQuestionGUI.php.
1066 $html[] =
'<div class="ilTableOuter table-responsive">';
1067 $html[] =
'<table class="table table-striped">';
1069 $html[] =
"<thead>";
1071 foreach ($a_head as $col) {
1074 $html[] = ($col !=
"") ? $col :
" ";
1078 $html[] =
"</thead>";
1080 $html[] =
"<tbody>";
1081 foreach ($a_rows as $row) {
1083 foreach ($row as $col) {
1086 $html[] = ($col !=
"") ? $col :
" ";
1091 $html[] =
"</tbody>";
1094 $html[] =
"<tfoot>";
1096 foreach ($a_foot as $col) {
1099 $html[] = ($col !=
"") ? $col :
" ";
1103 $html[] =
"</tfoot>";
1106 $html[] =
"</table>";
1108 return implode(
"\n", $html);
◆ save()
SurveyQuestionGUI::save |
( |
|
$a_return = false , |
|
|
|
$a_sync = false |
|
) |
| |
|
protected |
Definition at line 375 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().
387 $ilUser->setPref(
"svy_lastquestiontype", $this->object->getQuestionType());
388 $ilUser->writePref(
"svy_lastquestiontype", $this->object->getQuestionType());
391 $this->ctrl->setParameter($this,
"q_id", $this->object->getId());
395 ilUtil::sendSuccess($this->lng->txt(
"msg_obj_modified"),
true);
396 $this->ctrl->redirect($this,
'copySyncForm');
399 if ($originalexists &&
402 $this->ctrl->setParameter($this,
'rtrn', 1);
404 $this->ctrl->redirect($this,
'originalSyncForm');
408 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 |
Definition at line 349 of file class.SurveyQuestionGUI.php.
References editQuestion(), importEditFormValues(), initEditForm(), and validateEditForm().
Referenced by addPhrase(), save(), and savePhrase().
352 if ($form->checkInput()) {
354 $this->
object->setTitle($form->getInput(
"title"));
355 $this->
object->label = ($form->getInput(
"label"));
356 $this->
object->setAuthor($form->getInput(
"author"));
357 $this->
object->setDescription($form->getInput(
"description"));
358 $this->
object->setQuestiontext($form->getInput(
"question"));
359 $this->
object->setObligatory($form->getInput(
"obligatory"));
364 $this->
object->saveToDb();
370 $form->setValuesByPost();
validateEditForm(ilPropertyFormGUI $a_form)
importEditFormValues(ilPropertyFormGUI $a_form)
editQuestion(ilPropertyFormGUI $a_form=null)
◆ savePhrase()
SurveyQuestionGUI::savePhrase |
( |
|
$a_reload = false | ) |
|
Creates an output to save the current answers as a phrase.
public
Definition at line 989 of file class.SurveyQuestionGUI.php.
References $_SESSION, $data, $i, $result, $tabs, $toolbar, $txt, and saveForm().
Referenced by confirmSavePhrase().
994 $ilTabs->activateTab(
"edit_properties");
999 $this->
object->saveToDb();
1004 $ilToolbar->addInputItem(
$txt,
true);
1005 $ilToolbar->addFormButton($this->lng->txt(
"confirm"),
"confirmSavePhrase");
1006 $ilToolbar->setFormAction($this->ctrl->getFormAction($this));
1009 $table_gui->setDescription($this->lng->txt(
"save_phrase_introduction"));
1012 if (method_exists($this->
object,
"getCategories")) {
1013 $categories = $this->
object->getCategories();
1015 $categories = $this->
object->getColumns();
1019 for (
$i = 0;
$i < $categories->getCategoryCount();
$i++) {
1020 $cat = $categories->getCategory(
$i);
1023 "answer" => $cat->title,
1024 "other" => $cat->other,
1025 "scale" => $cat->scale,
1026 "neutral" => $cat->neutral
1029 $table_gui->setData(
$data);
1032 $this->tpl->setContent($table_gui->getHTML());
◆ saveReturn()
SurveyQuestionGUI::saveReturn |
( |
| ) |
|
|
protected |
◆ saveSync()
SurveyQuestionGUI::saveSync |
( |
| ) |
|
|
protected |
◆ setBackUrl()
SurveyQuestionGUI::setBackUrl |
( |
|
$a_url | ) |
|
◆ setQuestionTabs()
SurveyQuestionGUI::setQuestionTabs |
( |
| ) |
|
|
abstract |
◆ setQuestionTabsForClass()
SurveyQuestionGUI::setQuestionTabsForClass |
( |
|
$guiclass | ) |
|
Definition at line 185 of file class.SurveyQuestionGUI.php.
References $_GET, $_SESSION, $rbacsystem, $tabs, and getQuestionType().
Referenced by SurveyMultipleChoiceQuestionGUI\setQuestionTabs(), SurveyTextQuestionGUI\setQuestionTabs(), SurveySingleChoiceQuestionGUI\setQuestionTabs(), SurveyMetricQuestionGUI\setQuestionTabs(), and SurveyMatrixQuestionGUI\setQuestionTabs().
190 $this->ctrl->setParameterByClass($guiclass,
"sel_question_types", $this->
getQuestionType());
191 $this->ctrl->setParameterByClass($guiclass,
"q_id",
$_GET[
"q_id"]);
193 if ($this->parent_url) {
195 if (strlen(
$_GET[
"new_for_survey"])) {
196 $addurl =
"&new_id=" .
$_GET[
"q_id"];
198 $ilTabs->setBackTarget($this->lng->txt(
"menubacktosurvey"), $this->parent_url . $addurl);
200 $this->ctrl->setParameterByClass(
"ilObjSurveyQuestionPoolGUI",
"q_id_table_nav",
$_SESSION[
'q_id_table_nav']);
201 $ilTabs->setBackTarget($this->lng->txt(
"spl"), $this->ctrl->getLinkTargetByClass(
"ilObjSurveyQuestionPoolGUI",
"questions"));
204 $ilTabs->addNonTabbedLink(
206 $this->lng->txt(
"preview"),
207 $this->ctrl->getLinkTargetByClass($guiclass,
"preview")
214 $this->lng->txt(
"properties"),
215 $this->ctrl->getLinkTargetByClass($guiclass,
"editQuestion")
218 if (stristr($guiclass,
"matrix")) {
221 $this->lng->txt(
"layout"),
222 $this->ctrl->getLinkTargetByClass($guiclass,
"layout")
229 $this->lng->txt(
"material"),
230 $this->ctrl->getLinkTargetByClass($guiclass,
"material")
234 if ($this->object->getId() > 0) {
235 $title = $this->lng->txt(
"edit") .
" "" . $this->
object->getTitle() .
""";
237 $title = $this->lng->txt(
"create_new") .
" " . $this->lng->txt($this->
getQuestionType());
240 $this->tpl->setVariable(
"HEADER", $title);
getQuestionType()
Returns the question type string.
◆ sync()
SurveyQuestionGUI::sync |
( |
| ) |
|
|
protected |
Definition at line 486 of file class.SurveyQuestionGUI.php.
References redirectAfterSaving().
488 $original_id = $this->
object->original_id;
490 $this->
object->syncWithOriginal();
493 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 424 of file class.SurveyQuestionGUI.php.
References $_POST, $access, $lng, ilObject\_getAllReferences(), copySyncForm(), redirectAfterSaving(), and ilUtil\sendFailure().
429 if (!
sizeof(
$_POST[
"qid"])) {
434 foreach ($this->object->getCopyIds(
true) as $survey_id => $questions) {
438 foreach ($ref_ids as $ref_id) {
439 if ($ilAccess->checkAccess(
"edit",
"", $ref_id)) {
446 foreach ($questions as $qid) {
447 if (in_array($qid,
$_POST[
"qid"])) {
448 $id = $this->
object->getId();
450 $this->
object->setId($qid);
451 $this->
object->setOriginalId($id);
452 $this->
object->saveToDb();
454 $this->
object->setId($id);
455 $this->
object->setOriginalId(null);
464 ilUtil::sendSuccess(
$lng->txt(
"survey_sync_success"),
true);
redirectAfterSaving($a_return=false)
Redirect to calling survey or to edit form.
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: