本文整理汇总了PHP中ilTextAreaInputGUI::setRteTags方法的典型用法代码示例。如果您正苦于以下问题:PHP ilTextAreaInputGUI::setRteTags方法的具体用法?PHP ilTextAreaInputGUI::setRteTags怎么用?PHP ilTextAreaInputGUI::setRteTags使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ilTextAreaInputGUI
的用法示例。
在下文中一共展示了ilTextAreaInputGUI::setRteTags方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: feedback
/**
* Creates the output of the feedback page for a single choice question
*
* @access public
*/
function feedback($checkonly = false)
{
$save = strcmp($this->ctrl->getCmd(), "saveFeedback") == 0 ? TRUE : FALSE;
include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this));
$form->setTitle($this->lng->txt('feedback_answers'));
$form->setTableWidth("98%");
$form->setId("feedback");
$complete = new ilTextAreaInputGUI($this->lng->txt("feedback_complete_solution"), "feedback_complete");
$complete->setValue($this->object->prepareTextareaOutput($this->object->getFeedbackGeneric(1)));
$complete->setRequired(false);
$complete->setRows(10);
$complete->setCols(80);
if (!$this->getPreventRteUsage()) {
$complete->setUseRte(true);
}
include_once "./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
$complete->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("assessment"));
$complete->addPlugin("latex");
$complete->addButton("latex");
$complete->addButton("pastelatex");
$complete->setRTESupport($this->object->getId(), "qpl", "assessment", null, false, '3.4.7');
$form->addItem($complete);
$incomplete = new ilTextAreaInputGUI($this->lng->txt("feedback_incomplete_solution"), "feedback_incomplete");
$incomplete->setValue($this->object->prepareTextareaOutput($this->object->getFeedbackGeneric(0)));
$incomplete->setRequired(false);
$incomplete->setRows(10);
$incomplete->setCols(80);
if (!$this->getPreventRteUsage()) {
$incomplete->setUseRte(true);
}
include_once "./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
$incomplete->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("assessment"));
$incomplete->addPlugin("latex");
$incomplete->addButton("latex");
$incomplete->addButton("pastelatex");
$incomplete->setRTESupport($this->object->getId(), "qpl", "assessment", null, false, '3.4.7');
$form->addItem($incomplete);
if (!$this->getSelfAssessmentEditingMode()) {
foreach ($this->object->getErrorData() as $index => $answer) {
$caption = $ordinal = $index + 1;
$caption .= '. <br />"' . $answer->text_wrong . '" => ';
$caption .= '"' . $answer->text_correct . '"';
$caption .= '</i>';
$answerobj = new ilTextAreaInputGUI($this->object->prepareTextareaOutput($caption, true), "feedback_answer_{$index}");
$answerobj->setValue($this->object->prepareTextareaOutput($this->object->getFeedbackSingleAnswer($index)));
$answerobj->setRequired(false);
$answerobj->setRows(10);
$answerobj->setCols(80);
$answerobj->setUseRte(true);
include_once "./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
$answerobj->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("assessment"));
$answerobj->addPlugin("latex");
$answerobj->addButton("latex");
$answerobj->addButton("pastelatex");
$answerobj->setRTESupport($this->object->getId(), "qpl", "assessment", null, false, '3.4.7');
$form->addItem($answerobj);
}
}
global $ilAccess;
if ($ilAccess->checkAccess("write", "", $_GET['ref_id']) || $this->getSelfAssessmentEditingMode()) {
$form->addCommandButton("saveFeedback", $this->lng->txt("save"));
}
if ($save) {
$form->setValuesByPost();
$errors = !$form->checkInput();
$form->setValuesByPost();
// again, because checkInput now performs the whole stripSlashes handling and we need this if we don't want to have duplication of backslashes
}
if (!$checkonly) {
$this->tpl->setVariable("ADM_CONTENT", $form->getHTML());
}
return $errors;
}
示例2: initPropertiesForm
//.........这里部分代码省略.........
$online->setChecked($this->object->isOnline());
$form->addItem($online);
$act_type = new ilCheckboxInputGUI($this->lng->txt('rep_visibility_until'), 'access_type');
// $act_type->setInfo($this->lng->txt('svy_availability_until_info'));
$act_type->setChecked($this->object->isActivationLimited());
$this->tpl->addJavaScript('./Services/Form/js/date_duration.js');
include_once "Services/Form/classes/class.ilDateDurationInputGUI.php";
$dur = new ilDateDurationInputGUI($this->lng->txt('rep_time_period'), "access_period");
$dur->setShowTime(true);
$date = $this->object->getActivationStartDate();
$dur->setStart(new ilDateTime($date ? $date : time(), IL_CAL_UNIX));
$dur->setStartText($this->lng->txt('rep_activation_limited_start'));
$date = $this->object->getActivationEndDate();
$dur->setEnd(new ilDateTime($date ? $date : time(), IL_CAL_UNIX));
$dur->setEndText($this->lng->txt('rep_activation_limited_end'));
$act_type->addSubItem($dur);
$visible = new ilCheckboxInputGUI($this->lng->txt('rep_activation_limited_visibility'), 'access_visiblity');
$visible->setInfo($this->lng->txt('svy_activation_limited_visibility_info'));
$visible->setChecked($this->object->getActivationVisibility());
$act_type->addSubItem($visible);
$form->addItem($act_type);
// before start
$section = new ilFormSectionHeaderGUI();
$section->setTitle($this->lng->txt('svy_settings_section_before_start'));
$form->addItem($section);
// introduction
$intro = new ilTextAreaInputGUI($this->lng->txt("introduction"), "introduction");
$intro->setValue($this->object->prepareTextareaOutput($this->object->getIntroduction()));
$intro->setRows(10);
$intro->setCols(80);
$intro->setUseRte(TRUE);
$intro->setInfo($this->lng->txt("survey_introduction_info"));
include_once "./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
$intro->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("survey"));
$intro->addPlugin("latex");
$intro->addButton("latex");
$intro->addButton("pastelatex");
$intro->setRTESupport($this->object->getId(), "svy", "survey", null, $hide_rte_switch);
$form->addItem($intro);
// access
$section = new ilFormSectionHeaderGUI();
$section->setTitle($this->lng->txt('svy_settings_section_access'));
$form->addItem($section);
// enable start date
$start = $this->object->getStartDate();
$enablestartingtime = new ilCheckboxInputGUI($this->lng->txt("start_date"), "enabled_start_date");
$enablestartingtime->setValue(1);
// $enablestartingtime->setOptionTitle($this->lng->txt("enabled"));
$enablestartingtime->setChecked($start);
// start date
$startingtime = new ilDateTimeInputGUI('', 'start_date');
$startingtime->setShowTime(true);
if ($start) {
$startingtime->setDate(new ilDate($start, IL_CAL_TIMESTAMP));
}
$enablestartingtime->addSubItem($startingtime);
$form->addItem($enablestartingtime);
// enable end date
$end = $this->object->getEndDate();
$enableendingtime = new ilCheckboxInputGUI($this->lng->txt("end_date"), "enabled_end_date");
$enableendingtime->setValue(1);
// $enableendingtime->setOptionTitle($this->lng->txt("enabled"));
$enableendingtime->setChecked($end);
// end date
$endingtime = new ilDateTimeInputGUI('', 'end_date');
$endingtime->setShowTime(true);
示例3: buildFeedbackContentFormProperty
/**
* builds and returns a form property gui object with the given label and postvar
* that is addable to property forms
* depending on the given flag "asNonEditable" it returns a ...
* - non editable gui
* - textarea input gui
*
* @final
* @access protected
* @param string $label
* @param string $postVar
* @param boolean $asNonEditable
* @return ilTextAreaInputGUI|ilNonEditableValueGUI $formProperty
*/
protected final function buildFeedbackContentFormProperty($label, $postVar, $asNonEditable)
{
if ($asNonEditable) {
require_once 'Services/Form/classes/class.ilNonEditableValueGUI.php';
$property = new ilNonEditableValueGUI($label, $postVar, true);
} else {
require_once 'Services/Form/classes/class.ilTextAreaInputGUI.php';
require_once 'Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php';
$property = new ilTextAreaInputGUI($label, $postVar);
$property->setRequired(false);
$property->setRows(10);
$property->setCols(80);
if (!$this->questionOBJ->getPreventRteUsage()) {
$property->setUseRte(true);
$property->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("assessment"));
$property->addPlugin("latex");
$property->addButton("latex");
$property->addButton("pastelatex");
}
$property->setRTESupport($this->questionOBJ->getId(), "qpl", "assessment");
}
return $property;
}
示例4: certificateEditor
//.........这里部分代码省略.........
$pageformat->checkInput();
}
$form->addItem($pageformat);
$bgimage = new ilImageFileInputGUI($this->lng->txt("certificate_background_image"), "background");
$bgimage->setRequired(FALSE);
$bgimage->setUseCache(false);
if (count($_POST)) {
// handle the background upload
if (strlen($_FILES["background"]["tmp_name"])) {
if ($bgimage->checkInput()) {
$result = $this->object->uploadBackgroundImage($_FILES["background"]["tmp_name"]);
if ($result == FALSE) {
$bgimage->setAlert($this->lng->txt("certificate_error_upload_bgimage"));
}
}
}
}
if (!$this->object->hasBackgroundImage()) {
include_once "./Services/Certificate/classes/class.ilObjCertificateSettingsAccess.php";
if (ilObjCertificateSettingsAccess::hasBackgroundImage()) {
$bgimage->setImage(ilObjCertificateSettingsAccess::getBackgroundImageThumbPathWeb());
}
} else {
$bgimage->setImage($this->object->getBackgroundImageThumbPathWeb());
}
$form->addItem($bgimage);
$padding_top = new ilTextInputGUI($this->lng->txt("certificate_padding_top"), "padding_top");
$padding_top->setRequired(TRUE);
$padding_top->setValue($form_fields["padding_top"]);
$padding_top->setSize(6);
$padding_top->setValidationRegexp("/[0123456789\\.](cm|mm|in|pt|pc|px|em)/is");
$padding_top->setInfo($this->lng->txt("certificate_unit_description"));
if (strcmp($this->ctrl->getCmd(), "certificateSave") == 0) {
$padding_top->checkInput();
}
$form->addItem($padding_top);
$rect = new ilCSSRectInputGUI($this->lng->txt("certificate_margin_body"), "margin_body");
$rect->setRequired(TRUE);
$rect->setUseUnits(TRUE);
$rect->setTop($form_fields["margin_body_top"]);
$rect->setBottom($form_fields["margin_body_bottom"]);
$rect->setLeft($form_fields["margin_body_left"]);
$rect->setRight($form_fields["margin_body_right"]);
$rect->setInfo($this->lng->txt("certificate_unit_description"));
if (strcmp($this->ctrl->getCmd(), "certificateSave") == 0) {
$rect->checkInput();
}
$form->addItem($rect);
$certificate = new ilTextAreaInputGUI($this->lng->txt("certificate_text"), "certificate_text");
$certificate->removePlugin('ilimgupload');
$certificate->setValue($form_fields["certificate_text"]);
$certificate->setRequired(TRUE);
$certificate->setRows(20);
$certificate->setCols(80);
// fraunhpatch start
$common_desc_tpl = new ilTemplate("tpl.common_desc.html", true, true, "Services/Certificate");
foreach (ilCertificate::getCustomCertificateFields() as $f) {
$common_desc_tpl->setCurrentBlock("cert_field");
$common_desc_tpl->setVariable("PH", $f["ph"]);
$common_desc_tpl->setVariable("PH_TXT", $f["name"]);
$common_desc_tpl->parseCurrentBlock();
}
$common_desc = $common_desc_tpl->get();
// fraunhpatch start
$certificate->setInfo($this->object->getAdapter()->getCertificateVariablesDescription() . $common_desc);
$certificate->setUseRte(TRUE, '3.4.7');
$tags = array("br", "em", "font", "li", "ol", "p", "span", "strong", "u", "ul");
$certificate->setRteTags($tags);
if (strcmp($this->ctrl->getCmd(), "certificateSave") == 0) {
$certificate->checkInput();
}
$form->addItem($certificate);
$this->object->getAdapter()->addAdditionalFormElements($form, $form_fields);
if ($ilAccess->checkAccess("write", "", $_GET["ref_id"])) {
if ($this->object->isComplete() || $this->object->hasBackgroundImage()) {
$form->addCommandButton("certificatePreview", $this->lng->txt("certificate_preview"));
$form->addCommandButton("certificateExportFO", $this->lng->txt("certificate_export"));
$form->addCommandButton("certificateDelete", $this->lng->txt("delete"));
}
$form->addCommandButton("certificateSave", $this->lng->txt("save"));
}
$this->tpl->setVariable("ADM_CONTENT", $form->getHTML());
if (strcmp($this->ctrl->getCmd(), "certificateSave") == 0) {
if ($_POST["background_delete"]) {
$this->object->deleteBackgroundImage();
}
if ($form->checkInput()) {
try {
$xslfo = $this->object->processXHTML2FO($form_fields);
$this->object->getAdapter()->saveFormFields($form_fields);
$this->object->saveCertificate($xslfo);
$this->object->writeActive($form_fields["active"]);
ilUtil::sendSuccess($this->lng->txt("saved_successfully"), TRUE);
$this->ctrl->redirect($this, "certificateEditor");
} catch (Exception $e) {
ilUtil::sendFailure($e->getMessage());
}
}
}
}
示例5: editQuestion
/**
* Creates an output of the edit form for the question
*
* @access public
*/
public function editQuestion($checkonly = FALSE)
{
include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this));
$form->setTitle($this->lng->txt($this->getQuestionType()));
$form->setMultipart(FALSE);
$form->setTableWidth("100%");
$form->setId("multiplechoice");
// title
$title = new ilTextInputGUI($this->lng->txt("title"), "title");
$title->setValue($this->object->getTitle());
$title->setRequired(TRUE);
$form->addItem($title);
// label
$label = new ilTextInputGUI($this->lng->txt("label"), "label");
$label->setValue($this->object->label);
$label->setInfo($this->lng->txt("label_info"));
$label->setRequired(false);
$form->addItem($label);
// author
$author = new ilTextInputGUI($this->lng->txt("author"), "author");
$author->setValue($this->object->getAuthor());
$author->setRequired(TRUE);
$form->addItem($author);
// description
$description = new ilTextInputGUI($this->lng->txt("description"), "description");
$description->setValue($this->object->getDescription());
$description->setRequired(FALSE);
$form->addItem($description);
// questiontext
$question = new ilTextAreaInputGUI($this->lng->txt("question"), "question");
$question->setValue($this->object->prepareTextareaOutput($this->object->getQuestiontext()));
$question->setRequired(TRUE);
$question->setRows(10);
$question->setCols(80);
$question->setUseRte(TRUE);
include_once "./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
$question->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("survey"));
$question->addPlugin("latex");
$question->addButton("latex");
$question->addButton("pastelatex");
$question->setRTESupport($this->object->getId(), "spl", "survey", null, false, "3.4.7");
$form->addItem($question);
// obligatory
$shuffle = new ilCheckboxInputGUI($this->lng->txt("obligatory"), "obligatory");
$shuffle->setValue(1);
$shuffle->setChecked($this->object->getObligatory());
$shuffle->setRequired(FALSE);
$form->addItem($shuffle);
// orientation
$orientation = new ilRadioGroupInputGUI($this->lng->txt("orientation"), "orientation");
$orientation->setRequired(false);
$orientation->setValue($this->object->getOrientation());
$orientation->addOption(new ilRadioOption($this->lng->txt('vertical'), 0));
$orientation->addOption(new ilRadioOption($this->lng->txt('horizontal'), 1));
$form->addItem($orientation);
// minimum answers
$minanswers = new ilCheckboxInputGUI($this->lng->txt("use_min_answers"), "use_min_answers");
$minanswers->setValue(1);
$minanswers->setOptionTitle($this->lng->txt("use_min_answers_option"));
$minanswers->setChecked($this->object->use_min_answers);
$minanswers->setRequired(FALSE);
$nranswers = new ilNumberInputGUI($this->lng->txt("nr_min_answers"), "nr_min_answers");
$nranswers->setSize(5);
$nranswers->setDecimals(0);
$nranswers->setRequired(false);
$nranswers->setMinValue(1);
$nranswers->setValue($this->object->nr_min_answers);
$minanswers->addSubItem($nranswers);
$nrmaxanswers = new ilNumberInputGUI($this->lng->txt("nr_max_answers"), "nr_max_answers");
$nrmaxanswers->setSize(5);
$nrmaxanswers->setDecimals(0);
$nrmaxanswers->setRequired(false);
$nrmaxanswers->setMinValue(1);
$nrmaxanswers->setValue($this->object->nr_max_answers);
$minanswers->addSubItem($nrmaxanswers);
$form->addItem($minanswers);
// Answers
include_once "./Modules/SurveyQuestionPool/classes/class.ilCategoryWizardInputGUI.php";
$answers = new ilCategoryWizardInputGUI($this->lng->txt("answers"), "answers");
$answers->setRequired(false);
$answers->setAllowMove(true);
$answers->setShowWizard(false);
$answers->setShowSavePhrase(false);
$answers->setUseOtherAnswer(true);
$answers->setShowNeutralCategory(true);
$answers->setNeutralCategoryTitle($this->lng->txt('svy_neutral_answer'));
if (!$this->object->getCategories()->getCategoryCount()) {
$this->object->getCategories()->addCategory("");
}
$answers->setValues($this->object->getCategories());
$answers->setDisabledScale(false);
$form->addItem($answers);
$this->addCommandButtons($form);
//.........这里部分代码省略.........
示例6: initEditForm
protected function initEditForm()
{
include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this, "save"));
$form->setTitle($this->lng->txt($this->getQuestionType()));
$form->setMultipart(FALSE);
$form->setTableWidth("100%");
// $form->setId("essay");
// title
$title = new ilTextInputGUI($this->lng->txt("title"), "title");
$title->setRequired(TRUE);
$form->addItem($title);
// label
$label = new ilTextInputGUI($this->lng->txt("label"), "label");
$label->setInfo($this->lng->txt("label_info"));
$label->setRequired(false);
$form->addItem($label);
// author
$author = new ilTextInputGUI($this->lng->txt("author"), "author");
$author->setRequired(TRUE);
$form->addItem($author);
// description
$description = new ilTextInputGUI($this->lng->txt("description"), "description");
$description->setRequired(FALSE);
$form->addItem($description);
// questiontext
$question = new ilTextAreaInputGUI($this->lng->txt("question"), "question");
$question->setRequired(TRUE);
$question->setRows(10);
$question->setCols(80);
$question->setUseRte(TRUE);
include_once "./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
$question->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("survey"));
$question->addPlugin("latex");
$question->addButton("latex");
$question->addButton("pastelatex");
$question->setRTESupport($this->object->getId(), "spl", "survey");
$form->addItem($question);
// obligatory
$shuffle = new ilCheckboxInputGUI($this->lng->txt("obligatory"), "obligatory");
$shuffle->setValue(1);
$shuffle->setRequired(FALSE);
$form->addItem($shuffle);
$this->addFieldsToEditForm($form);
$this->addCommandButtons($form);
// values
$title->setValue($this->object->getTitle());
$label->setValue($this->object->label);
$author->setValue($this->object->getAuthor());
$description->setValue($this->object->getDescription());
$question->setValue($this->object->prepareTextareaOutput($this->object->getQuestiontext()));
$shuffle->setChecked($this->object->getObligatory());
return $form;
}
示例7: editQuestion
/**
* Creates an output of the edit form for the question
*
* @access public
*/
public function editQuestion($checkonly = FALSE)
{
include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this));
$form->setTitle($this->lng->txt($this->getQuestionType()));
$form->setMultipart(FALSE);
$form->setTableWidth("100%");
$form->setId("multiplechoice");
// title
$title = new ilTextInputGUI($this->lng->txt("title"), "title");
$title->setValue($this->object->getTitle());
$title->setRequired(TRUE);
$form->addItem($title);
// label
$label = new ilTextInputGUI($this->lng->txt("label"), "label");
$label->setValue($this->object->label);
$label->setInfo($this->lng->txt("label_info"));
$label->setRequired(false);
$form->addItem($label);
// author
$author = new ilTextInputGUI($this->lng->txt("author"), "author");
$author->setValue($this->object->getAuthor());
$author->setRequired(TRUE);
$form->addItem($author);
// description
$description = new ilTextInputGUI($this->lng->txt("description"), "description");
$description->setValue($this->object->getDescription());
$description->setRequired(FALSE);
$form->addItem($description);
// questiontext
$question = new ilTextAreaInputGUI($this->lng->txt("question"), "question");
$question->setValue($this->object->prepareTextareaOutput($this->object->getQuestiontext()));
$question->setRequired(TRUE);
$question->setRows(10);
$question->setCols(80);
$question->setUseRte(TRUE);
include_once "./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
$question->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("survey"));
$question->addPlugin("latex");
$question->addButton("latex");
$question->addButton("pastelatex");
$question->setRTESupport($this->object->getId(), "spl", "survey", null, false, "3.4.7");
$form->addItem($question);
// subtype
$subtype = new ilRadioGroupInputGUI($this->lng->txt("subtype"), "type");
$subtype->setRequired(false);
$subtype->setValue($this->object->getSubtype());
$subtypes = array("0" => "matrix_subtype_sr", "1" => "matrix_subtype_mr");
foreach ($subtypes as $idx => $st) {
$subtype->addOption(new ilRadioOption($this->lng->txt($st), $idx));
}
$form->addItem($subtype);
// obligatory
$shuffle = new ilCheckboxInputGUI($this->lng->txt("obligatory"), "obligatory");
$shuffle->setValue(1);
$shuffle->setChecked($this->object->getObligatory());
$shuffle->setRequired(FALSE);
$form->addItem($shuffle);
$header = new ilFormSectionHeaderGUI();
$header->setTitle($this->lng->txt("matrix_appearance"));
$form->addItem($header);
// column separators
$column_separators = new ilCheckboxInputGUI($this->lng->txt("matrix_column_separators"), "column_separators");
$column_separators->setValue(1);
$column_separators->setInfo($this->lng->txt("matrix_column_separators_description"));
$column_separators->setChecked($this->object->getColumnSeparators());
$column_separators->setRequired(false);
$form->addItem($column_separators);
// row separators
$row_separators = new ilCheckboxInputGUI($this->lng->txt("matrix_row_separators"), "row_separators");
$row_separators->setValue(1);
$row_separators->setInfo($this->lng->txt("matrix_row_separators_description"));
$row_separators->setChecked($this->object->getRowSeparators());
$row_separators->setRequired(false);
$form->addItem($row_separators);
// neutral column separators
$neutral_column_separator = new ilCheckboxInputGUI($this->lng->txt("matrix_neutral_column_separator"), "neutral_column_separator");
$neutral_column_separator->setValue(1);
$neutral_column_separator->setInfo($this->lng->txt("matrix_neutral_column_separator_description"));
$neutral_column_separator->setChecked($this->object->getNeutralColumnSeparator());
$neutral_column_separator->setRequired(false);
$form->addItem($neutral_column_separator);
$header = new ilFormSectionHeaderGUI();
$header->setTitle($this->lng->txt("matrix_columns"));
$form->addItem($header);
// Answers
include_once "./Modules/SurveyQuestionPool/classes/class.ilCategoryWizardInputGUI.php";
$columns = new ilCategoryWizardInputGUI("", "columns");
$columns->setRequired(false);
$columns->setAllowMove(true);
$columns->setShowWizard(true);
$columns->setShowNeutralCategory(true);
$columns->setDisabledScale(false);
$columns->setNeutralCategoryTitle($this->lng->txt('matrix_neutral_answer'));
//.........这里部分代码省略.........
示例8: editQuestion
/**
* Creates an output of the edit form for the question
*/
public function editQuestion()
{
include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this));
$form->setTitle($this->lng->txt($this->getQuestionType()));
$form->setMultipart(FALSE);
$form->setTableWidth("100%");
$form->setId("essay");
// title
$title = new ilTextInputGUI($this->lng->txt("title"), "title");
$title->setValue($this->object->getTitle());
$title->setRequired(TRUE);
$form->addItem($title);
// label
$label = new ilTextInputGUI($this->lng->txt("label"), "label");
$label->setValue($this->object->label);
$label->setInfo($this->lng->txt("label_info"));
$label->setRequired(false);
$form->addItem($label);
// author
$author = new ilTextInputGUI($this->lng->txt("author"), "author");
$author->setValue($this->object->getAuthor());
$author->setRequired(TRUE);
$form->addItem($author);
// description
$description = new ilTextInputGUI($this->lng->txt("description"), "description");
$description->setValue($this->object->getDescription());
$description->setRequired(FALSE);
$form->addItem($description);
// questiontext
$question = new ilTextAreaInputGUI($this->lng->txt("question"), "question");
$question->setValue($this->object->prepareTextareaOutput($this->object->getQuestiontext()));
$question->setRequired(TRUE);
$question->setRows(10);
$question->setCols(80);
$question->setUseRte(TRUE);
include_once "./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
$question->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("survey"));
$question->addPlugin("latex");
$question->addButton("latex");
$question->addButton("pastelatex");
$question->setRTESupport($this->object->getId(), "spl", "survey", null, false, "3.4.7");
$form->addItem($question);
// maximum number of characters
$maxchars = new ilNumberInputGUI($this->lng->txt("maxchars"), "maxchars");
$maxchars->setRequired(false);
$maxchars->setSize(5);
if ($this->object->getMaxChars() > 0) {
$maxchars->setValue($this->object->getMaxChars());
}
$maxchars->setDecimals(0);
$form->addItem($maxchars);
// textwidth
$textwidth = new ilNumberInputGUI($this->lng->txt("width"), "textwidth");
$textwidth->setRequired(true);
$textwidth->setSize(3);
$textwidth->setValue($this->object->getTextWidth());
$textwidth->setDecimals(0);
$textwidth->setMinValue(10);
$form->addItem($textwidth);
// textheight
$textheight = new ilNumberInputGUI($this->lng->txt("height"), "textheight");
$textheight->setRequired(true);
$textheight->setSize(3);
$textheight->setValue($this->object->getTextHeight());
$textheight->setDecimals(0);
$textheight->setMinValue(1);
$form->addItem($textheight);
// obligatory
$shuffle = new ilCheckboxInputGUI($this->lng->txt("obligatory"), "obligatory");
$shuffle->setValue(1);
$shuffle->setChecked($this->object->getObligatory());
$shuffle->setRequired(FALSE);
$form->addItem($shuffle);
$this->addCommandButtons($form);
$errors = false;
if ($this->isSaveCommand()) {
$form->setValuesByPost();
$errors = !$form->checkInput();
$form->setValuesByPost();
// again, because checkInput now performs the whole stripSlashes handling and we need this if we don't want to have duplication of backslashes
if ($errors) {
$checkonly = false;
}
}
if (!$checkonly) {
$this->tpl->setVariable("ADM_CONTENT", $form->getHTML());
}
return $errors;
}
示例9: initPartProperties
/**
* add the properties of a question part to the form
*
* @param object form object to extend
* @param object question part object
* @param integer counter of the question part
*/
private function initPartProperties($form, $part_obj = null, $counter = "1")
{
// Use a dummy part object for a new booking definition
if (!isset($part_obj)) {
$part_obj = new assAccountingQuestionPart($this->object);
}
// Part identifier (is 0 for a new part)
$item = new ilHiddenInputGUI("parts[]");
$item->setValue($part_obj->getPartId());
$form->addItem($item);
// Title
$item = new ilFormSectionHeaderGUI();
$item->setTitle($this->plugin->txt('accounting_table') . ' ' . $counter);
$form->addItem($item);
// Position
$item = new ilNumberInputGUI($this->plugin->txt('position'), 'position_' . $part_obj->getPartId());
$item->setSize(2);
$item->setDecimals(1);
$item->SetInfo($this->plugin->txt('position_info'));
if ($part_obj->getPartId()) {
$item->setValue(sprintf("%01.1f", $part_obj->getPosition()));
}
$form->addItem($item);
// Text
$item = new ilTextAreaInputGUI($this->plugin->txt("question_part"), 'text_' . $part_obj->getPartId());
$item->setValue($this->object->prepareTextareaOutput($part_obj->getText()));
$item->setRows(10);
$item->setCols(80);
if (!$this->object->getSelfAssessmentEditingMode()) {
$item->setUseRte(TRUE);
include_once "./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
$item->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("assessment"));
$item->addPlugin("latex");
$item->addButton("latex");
$item->addButton("pastelatex");
$item->setRTESupport($this->object->getId(), "qpl", "assessment");
} else {
$item->setRteTags(self::getSelfAssessmentTags());
$item->setUseTagsForRteOnly(false);
}
$form->addItem($item);
// Booking XML definition
$item = new ilCustomInputGUI($this->plugin->txt('booking_xml'));
$item->setInfo($this->plugin->txt('booking_xml_info'));
$tpl = $this->plugin->getTemplate('tpl.il_as_qpl_accqst_edit_xml.html');
$tpl->setVariable("CONTENT", ilUtil::prepareFormOutput($part_obj->getBookingXML()));
$tpl->setVariable("NAME", 'booking_xml_' . $part_obj->getPartId());
$item->setHTML($tpl->get());
// Booking file
$subitem = new ilFileInputGUI($this->plugin->txt('booking_file'), "booking_file_" . $part_obj->getPartId());
$subitem->setSuffixes(array('xml'));
$item->addSubItem($subitem);
// Download button
if (strlen($part_obj->getBookingXML())) {
$tpl = $this->plugin->getTemplate('tpl.il_as_qpl_accqst_form_custom.html');
$this->ctrl->setParameter($this, 'xmltype', 'booking');
$this->ctrl->setParameter($this, 'part_id', $part_obj->getPartId());
$tpl->setCurrentBlock('button');
$tpl->setVariable('BUTTON_HREF', $this->ctrl->getLinkTarget($this, 'downloadXml'));
$tpl->setVariable('BUTTON_TEXT', $this->plugin->txt('download_booking_xml'));
$tpl->ParseCurrentBlock();
$subitem = new ilcustomInputGUI('');
$subitem->setHTML($tpl->get());
$item->addSubItem($subitem);
}
$form->addItem($item);
// Delete Button
if ($part_obj->getPartId()) {
$tpl = $this->plugin->getTemplate('tpl.il_as_qpl_accqst_form_custom.html');
$tpl->setCurrentBlock('button');
$this->ctrl->setParameter($this, 'part_id', $part_obj->getPartId());
$tpl->setVariable('BUTTON_HREF', $this->ctrl->getLinkTarget($this, 'deletePart'));
$tpl->setVariable('BUTTON_TEXT', $this->plugin->txt('delete_accounting_table'));
$tpl->ParseCurrentBlock();
$item = new ilcustomInputGUI();
$item->setHTML($tpl->get());
$form->addItem($item);
}
}
示例10: addBasicQuestionFormProperties
function addBasicQuestionFormProperties($form)
{
// title
$title = new ilTextInputGUI($this->lng->txt("title"), "title");
$title->setValue($this->object->getTitle());
$title->setRequired(TRUE);
$form->addItem($title);
if (!$this->object->getSelfAssessmentEditingMode()) {
// author
$author = new ilTextInputGUI($this->lng->txt("author"), "author");
$author->setValue($this->object->getAuthor());
$author->setRequired(TRUE);
$form->addItem($author);
// description
$description = new ilTextInputGUI($this->lng->txt("description"), "comment");
$description->setValue($this->object->getComment());
$description->setRequired(FALSE);
$form->addItem($description);
} else {
// author as hidden field
$hi = new ilHiddenInputGUI("author");
$author = ilUtil::prepareFormOutput($this->object->getAuthor());
if (trim($author) == "") {
$author = "-";
}
$hi->setValue($author);
$form->addItem($hi);
}
// questiontext
$question = new ilTextAreaInputGUI($this->lng->txt("question"), "question");
$question->setValue($this->object->prepareTextareaOutput($this->object->getQuestion()));
$question->setRequired(TRUE);
$question->setRows(10);
$question->setCols(80);
if (!$this->object->getSelfAssessmentEditingMode()) {
if ($this->object->getAdditionalContentEditingMode() == assQuestion::ADDITIONAL_CONTENT_EDITING_MODE_DEFAULT) {
$question->setUseRte(TRUE);
include_once "./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
$question->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("assessment"));
$question->addPlugin("latex");
$question->addButton("latex");
$question->addButton("pastelatex");
$question->setRTESupport($this->object->getId(), "qpl", "assessment");
}
} else {
$question->setRteTags(self::getSelfAssessmentTags());
$question->setUseTagsForRteOnly(false);
}
$form->addItem($question);
$tpl = new ilTemplate("tpl.il_as_qpl_cloze_gap_button_code.html", TRUE, TRUE, "Modules/TestQuestionPool");
$tpl->setVariable('INSERT_GAP', $this->lng->txt('insert_gap'));
$tpl->setVariable('CREATE_GAPS', $this->lng->txt('create_gaps'));
$tpl->parseCurrentBlock();
$button = new ilCustomInputGUI(' ', '');
$button->setHtml($tpl->get());
$form->addItem($button);
if (!$this->object->getSelfAssessmentEditingMode()) {
// duration
$duration = new ilDurationInputGUI($this->lng->txt("working_time"), "Estimated");
$duration->setShowHours(TRUE);
$duration->setShowMinutes(TRUE);
$duration->setShowSeconds(TRUE);
$ewt = $this->object->getEstimatedWorkingTime();
$duration->setHours($ewt["h"]);
$duration->setMinutes($ewt["m"]);
$duration->setSeconds($ewt["s"]);
$duration->setRequired(FALSE);
$form->addItem($duration);
} else {
// number of tries
if (strlen($this->object->getNrOfTries())) {
$nr_tries = $this->object->getNrOfTries();
} else {
$nr_tries = $this->object->getDefaultNrOfTries();
}
/*if ($nr_tries <= 0)
{
$nr_tries = 1;
}*/
if ($nr_tries < 0) {
$nr_tries = 0;
}
$ni = new ilNumberInputGUI($this->lng->txt("qst_nr_of_tries"), "nr_of_tries");
$ni->setValue($nr_tries);
//$ni->setMinValue(1);
$ni->setMinValue(0);
$ni->setSize(5);
$ni->setMaxLength(5);
$ni->setRequired(true);
$form->addItem($ni);
}
}
示例11: populateQuestionSpecificFormPart
public function populateQuestionSpecificFormPart(ilPropertyFormGUI $form)
{
// cloze text
$cloze_text = new ilTextAreaInputGUI($this->lng->txt("cloze_text"), 'cloze_text');
$cloze_text->setRequired(true);
$cloze_text->setValue($this->applyIndizesToGapText($this->object->getClozeText()));
$cloze_text->setInfo($this->lng->txt("close_text_hint"));
$cloze_text->setRows(10);
$cloze_text->setCols(80);
if (!$this->object->getSelfAssessmentEditingMode()) {
if ($this->object->getAdditionalContentEditingMode() == assQuestion::ADDITIONAL_CONTENT_EDITING_MODE_DEFAULT) {
$cloze_text->setUseRte(TRUE);
include_once "./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
$cloze_text->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("assessment"));
$cloze_text->addPlugin("latex");
$cloze_text->addButton("latex");
$cloze_text->addButton("pastelatex");
}
} else {
$cloze_text->setUseRte(TRUE);
$cloze_text->setRteTags(self::getSelfAssessmentTags());
$cloze_text->setUseTagsForRteOnly(false);
}
$cloze_text->setRTESupport($this->object->getId(), "qpl", "assessment");
$form->addItem($cloze_text);
$tpl = new ilTemplate("tpl.il_as_qpl_cloze_gap_button_code.html", TRUE, TRUE, "Modules/TestQuestionPool");
$tpl->setVariable('INSERT_GAP', $this->lng->txt('insert_gap'));
$tpl->setVariable('CREATE_GAPS', $this->lng->txt('create_gaps'));
$tpl->parseCurrentBlock();
$button = new ilCustomInputGUI(' ', '');
$button->setHtml($tpl->get());
$form->addItem($button);
// text rating
if (!$this->object->getSelfAssessmentEditingMode()) {
$textrating = new ilSelectInputGUI($this->lng->txt("text_rating"), "textgap_rating");
$text_options = array("ci" => $this->lng->txt("cloze_textgap_case_insensitive"), "cs" => $this->lng->txt("cloze_textgap_case_sensitive"), "l1" => sprintf($this->lng->txt("cloze_textgap_levenshtein_of"), "1"), "l2" => sprintf($this->lng->txt("cloze_textgap_levenshtein_of"), "2"), "l3" => sprintf($this->lng->txt("cloze_textgap_levenshtein_of"), "3"), "l4" => sprintf($this->lng->txt("cloze_textgap_levenshtein_of"), "4"), "l5" => sprintf($this->lng->txt("cloze_textgap_levenshtein_of"), "5"));
$textrating->setOptions($text_options);
$textrating->setValue($this->object->getTextgapRating());
$form->addItem($textrating);
// text field length
$fixedTextLength = new ilNumberInputGUI($this->lng->txt("cloze_fixed_textlength"), "fixedTextLength");
$ftl = $this->object->getFixedTextLength();
$fixedTextLength->setValue($ftl > 0 ? $ftl : '');
$fixedTextLength->setMinValue(0);
$fixedTextLength->setSize(3);
$fixedTextLength->setMaxLength(6);
$fixedTextLength->setInfo($this->lng->txt('cloze_fixed_textlength_description'));
$fixedTextLength->setRequired(false);
$form->addItem($fixedTextLength);
// identical scoring
$identical_scoring = new ilCheckboxInputGUI($this->lng->txt("identical_scoring"), "identical_scoring");
$identical_scoring->setValue(1);
$identical_scoring->setChecked($this->object->getIdenticalScoring());
$identical_scoring->setInfo($this->lng->txt('identical_scoring_desc'));
$identical_scoring->setRequired(FALSE);
$form->addItem($identical_scoring);
}
return $form;
}
示例12: feedback
/**
* Creates the output of the feedback page for a single choice question
*
* @access public
*/
function feedback($checkonly = false)
{
$save = strcmp($this->ctrl->getCmd(), "saveFeedback") == 0 ? TRUE : FALSE;
include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this));
$form->setTitle($this->lng->txt('feedback_answers'));
$form->setTableWidth("100%");
$form->setId("feedback");
$complete = new ilTextAreaInputGUI($this->lng->txt("feedback_complete_solution"), "feedback_complete");
$complete->setValue($this->object->prepareTextareaOutput($this->object->getFeedbackGeneric(1)));
$complete->setRequired(falsse);
$complete->setRows(10);
$complete->setCols(80);
$complete->setUseRte(true);
include_once "./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
$complete->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("assessment"));
$complete->addPlugin("latex");
$complete->addButton("latex");
$complete->addButton("pastelatex");
$complete->setRTESupport($this->object->getId(), "qpl", "assessment");
$form->addItem($complete);
$incomplete = new ilTextAreaInputGUI($this->lng->txt("feedback_incomplete_solution"), "feedback_incomplete");
$incomplete->setValue($this->object->prepareTextareaOutput($this->object->getFeedbackGeneric(0)));
$incomplete->setRequired(false);
$incomplete->setRows(10);
$incomplete->setCols(80);
$incomplete->setUseRte(true);
include_once "./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
$incomplete->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("assessment"));
$incomplete->addPlugin("latex");
$incomplete->addButton("latex");
$incomplete->addButton("pastelatex");
$incomplete->setRTESupport($this->object->getId(), "qpl", "assessment");
$form->addItem($incomplete);
if (!$this->getSelfAssessmentEditingMode()) {
foreach ($this->object->answers as $index => $answer) {
$answerobj = new ilTextAreaInputGUI($this->object->prepareTextareaOutput($answer->getAnswertext(), true), "feedback_answer_{$index}");
$answerobj->setValue($this->object->prepareTextareaOutput($this->object->getFeedbackSyntaxTree($index)));
$answerobj->setRequired(false);
$answerobj->setRows(10);
$answerobj->setCols(80);
$answerobj->setUseRte(true);
include_once "./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
$answerobj->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("assessment"));
$answerobj->addPlugin("latex");
$answerobj->addButton("latex");
$answerobj->addButton("pastelatex");
$answerobj->setRTESupport($this->object->getId(), "qpl", "assessment");
$form->addItem($answerobj);
}
}
$form->addCommandButton("saveFeedback", $this->lng->txt("save"));
if ($save) {
$form->setValuesByPost();
$errors = !$form->checkInput();
$form->setValuesByPost();
// again, because checkInput now performs the whole stripSlashes handling and we need this if we don't want to have duplication of backslashes
}
if (!$checkonly) {
$this->tpl->setVariable("ADM_CONTENT", $form->getHTML());
}
return $errors;
}
示例13: editQuestion
/**
* Creates an output of the edit form for the question
*
* @access public
*/
public function editQuestion($checkonly = FALSE)
{
include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this));
$form->setTitle($this->lng->txt($this->getQuestionType()));
$form->setMultipart(FALSE);
$form->setTableWidth("100%");
$form->setId("multiplechoice");
// title
$title = new ilTextInputGUI($this->lng->txt("title"), "title");
$title->setValue($this->object->getTitle());
$title->setRequired(TRUE);
$form->addItem($title);
// label
$label = new ilTextInputGUI($this->lng->txt("label"), "label");
$label->setValue($this->object->label);
$label->setInfo($this->lng->txt("label_info"));
$label->setRequired(false);
$form->addItem($label);
// author
$author = new ilTextInputGUI($this->lng->txt("author"), "author");
$author->setValue($this->object->getAuthor());
$author->setRequired(TRUE);
$form->addItem($author);
// description
$description = new ilTextInputGUI($this->lng->txt("description"), "description");
$description->setValue($this->object->getDescription());
$description->setRequired(FALSE);
$form->addItem($description);
// questiontext
$question = new ilTextAreaInputGUI($this->lng->txt("question"), "question");
$question->setValue($this->object->prepareTextareaOutput($this->object->getQuestiontext()));
$question->setRequired(TRUE);
$question->setRows(10);
$question->setCols(80);
$question->setUseRte(TRUE);
include_once "./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
$question->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("survey"));
$question->addPlugin("latex");
$question->addButton("latex");
$question->addButton("pastelatex");
$question->setRTESupport($this->object->getId(), "spl", "survey", null, false, "3.4.7");
$form->addItem($question);
// subtype
$subtype = new ilRadioGroupInputGUI($this->lng->txt("subtype"), "type");
$subtype->setRequired(true);
$subtype->setValue($this->object->getSubtype());
$form->addItem($subtype);
// #10652
$opt = new ilRadioOption($this->lng->txt('non_ratio'), 3, $this->lng->txt("metric_subtype_description_interval"));
$subtype->addOption($opt);
// minimum value
$minimum = new ilNumberInputGUI($this->lng->txt("minimum"), "minimum3");
if ($this->object->getSubtype() == 3) {
$minimum->setValue($this->object->getMinimum());
}
$minimum->setRequired(false);
$minimum->setSize(6);
$opt->addSubItem($minimum);
// maximum value
$maximum = new ilNumberInputGUI($this->lng->txt("maximum"), "maximum3");
if ($this->object->getSubtype() == 3) {
$maximum->setValue($this->object->getMaximum());
}
$maximum->setRequired(false);
$maximum->setSize(6);
$opt->addSubItem($maximum);
$opt = new ilRadioOption($this->lng->txt('ratio_non_absolute'), 4, $this->lng->txt("metric_subtype_description_rationonabsolute"));
$subtype->addOption($opt);
// minimum value
$minimum = new ilNumberInputGUI($this->lng->txt("minimum"), "minimum4");
if ($this->object->getSubtype() == 4) {
$minimum->setValue($this->object->getMinimum());
}
$minimum->setRequired(false);
$minimum->setSize(6);
$minimum->setMinValue(0);
$opt->addSubItem($minimum);
// maximum value
$maximum = new ilNumberInputGUI($this->lng->txt("maximum"), "maximum4");
if ($this->object->getSubtype() == 4) {
$maximum->setValue($this->object->getMaximum());
}
$maximum->setRequired(false);
$maximum->setSize(6);
$opt->addSubItem($maximum);
$opt = new ilRadioOption($this->lng->txt('ratio_absolute'), 5, $this->lng->txt("metric_subtype_description_ratioabsolute"));
$subtype->addOption($opt);
// minimum value
$minimum = new ilNumberInputGUI($this->lng->txt("minimum"), "minimum5");
if ($this->object->getSubtype() == 5) {
$minimum->setValue($this->object->getMinimum());
}
$minimum->setRequired(false);
//.........这里部分代码省略.........
示例14: addBasicQuestionFormProperties
/**
* Add basic question form properties:
* assessment: title, author, description, question, working time
*
* @return int Default Nr of Tries
*/
function addBasicQuestionFormProperties($form)
{
// title
$title = new ilTextInputGUI($this->lng->txt("title"), "title");
$title->setValue($this->object->getTitle());
$title->setRequired(TRUE);
$form->addItem($title);
if (!$this->object->getSelfAssessmentEditingMode()) {
// author
$author = new ilTextInputGUI($this->lng->txt("author"), "author");
$author->setValue($this->object->getAuthor());
$author->setRequired(TRUE);
$form->addItem($author);
// description
$description = new ilTextInputGUI($this->lng->txt("description"), "comment");
$description->setValue($this->object->getComment());
$description->setRequired(FALSE);
$form->addItem($description);
} else {
// author as hidden field
$hi = new ilHiddenInputGUI("author");
$author = ilUtil::prepareFormOutput($this->object->getAuthor());
if (trim($author) == "") {
$author = "-";
}
$hi->setValue($author);
$form->addItem($hi);
}
// questiontext
$question = new ilTextAreaInputGUI($this->lng->txt("question"), "question");
$question->setValue($this->object->prepareTextareaOutput($this->object->getQuestion()));
$question->setRequired(TRUE);
$question->setRows(10);
$question->setCols(80);
if (!$this->object->getSelfAssessmentEditingMode()) {
if ($this->object->getAdditionalContentEditingMode() != assQuestion::ADDITIONAL_CONTENT_EDITING_MODE_PAGE_OBJECT) {
$question->setUseRte(TRUE);
include_once "./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
$question->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("assessment"));
$question->addPlugin("latex");
$question->addButton("latex");
$question->addButton("pastelatex");
$question->setRTESupport($this->object->getId(), "qpl", "assessment");
}
} else {
$question->setRteTags(self::getSelfAssessmentTags());
$question->setUseTagsForRteOnly(false);
}
$form->addItem($question);
if (!$this->object->getSelfAssessmentEditingMode()) {
// duration
$duration = new ilDurationInputGUI($this->lng->txt("working_time"), "Estimated");
$duration->setShowHours(TRUE);
$duration->setShowMinutes(TRUE);
$duration->setShowSeconds(TRUE);
$ewt = $this->object->getEstimatedWorkingTime();
$duration->setHours($ewt["h"]);
$duration->setMinutes($ewt["m"]);
$duration->setSeconds($ewt["s"]);
$duration->setRequired(FALSE);
$form->addItem($duration);
} else {
// number of tries
if (strlen($this->object->getNrOfTries())) {
$nr_tries = $this->object->getNrOfTries();
} else {
$nr_tries = $this->object->getDefaultNrOfTries();
}
if ($nr_tries < 1) {
$nr_tries = "";
}
$ni = new ilNumberInputGUI($this->lng->txt("qst_nr_of_tries"), "nr_of_tries");
$ni->setValue($nr_tries);
$ni->setMinValue(0);
$ni->setSize(5);
$ni->setMaxLength(5);
$form->addItem($ni);
}
}
示例15: initHeadingForm
protected function initHeadingForm($a_question_id = null)
{
$survey_questions = $this->object->getSurveyQuestions();
include_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
$form = new ilPropertyFormGUI();
$form->setFormAction($this->ctrl->getFormAction($this, ""));
// heading
$heading = new ilTextAreaInputGUI($this->lng->txt("heading"), "heading");
$heading->setRows(10);
$heading->setCols(80);
$heading->setUseRte(TRUE);
include_once "./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
$heading->setRteTags(ilObjAdvancedEditing::_getUsedHTMLTags("survey"));
$heading->removePlugin(ilRTE::ILIAS_IMG_MANAGER_PLUGIN);
$heading->setRTESupport($this->object->getId(), "svy", "survey");
$heading->setRequired(true);
$form->addItem($heading);
$insertbefore = new ilSelectInputGUI($this->lng->txt("insert"), "insertbefore");
$options = array();
foreach ($survey_questions as $key => $value) {
$options[$key] = $this->lng->txt("before") . ": \"" . $value["title"] . "\"";
}
$insertbefore->setOptions($options);
$insertbefore->setRequired(true);
$form->addItem($insertbefore);
$form->addCommandButton("saveHeading", $this->lng->txt("save"));
$form->addCommandButton("questions", $this->lng->txt("cancel"));
if ($a_question_id) {
$form->setTitle($this->lng->txt("edit_heading"));
$heading->setValue($this->object->prepareTextareaOutput($survey_questions[$a_question_id]["heading"]));
$insertbefore->setValue($a_question_id);
$insertbefore->setDisabled(true);
} else {
$form->setTitle($this->lng->txt("add_heading"));
}
return $form;
}