ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilAnswerWizardInputGUI Class Reference

This class represents a single choice wizard property in a property form. More...

+ Inheritance diagram for ilAnswerWizardInputGUI:
+ Collaboration diagram for ilAnswerWizardInputGUI:

Public Member Functions

 __construct ($a_title="", $a_postvar="")
 Constructor.
 setValue ($a_value)
 Set Value.
 setValues ($a_values)
 Set Values.
 getValues ()
 Get Values.
 setSingleline ($a_value)
 Set singleline.
 getSingleline ()
 Get singleline.
 setQuestionObject ($a_value)
 Set question object.
 getQuestionObject ()
 Get question object.
 setAllowMove ($a_allow_move)
 Set allow move.
 getAllowMove ()
 Get allow move.
 setMinvalueShouldBeGreater ($a_bool)
 Set minvalueShouldBeGreater.
 minvalueShouldBeGreater ()
 Get minvalueShouldBeGreater.
 setMinValue ($a_minvalue)
 Set Minimum Value.
 getMinValue ()
 Get Minimum Value.
 checkInput ()
 Check input, strip slashes etc.
 insert (&$a_tpl)
 Insert property html.
- Public Member Functions inherited from ilTextInputGUI
 getValue ()
 Get Value.
 setValidationFailureMessage ($a_msg)
 Set message string for validation failure.
 getValidationFailureMessage ()
 setValidationRegexp ($a_value)
 Set validation regexp.
 getValidationRegexp ()
 Get validation regexp.
 setMaxLength ($a_maxlength)
 Set Max Length.
 getMaxLength ()
 Get Max Length.
 setSize ($a_size)
 Set Size.
 setInlineStyle ($a_style)
 Set inline style.
 getInlineStyle ()
 Get inline style.
 setCssClass ($a_class)
 getCssClass ()
 setValueByArray ($a_values)
 Set value by array.
 getSize ()
 Get Size.
 setSuffix ($a_value)
 Set suffix.
 getSuffix ()
 Get suffix.
 setInputType ($a_type)
 set input type
 getInputType ()
 get input type
 setSubmitFormOnEnter ($a_val)
 Set submit form on enter.
 getSubmitFormOnEnter ()
 Get submit form on enter.
 getDataSource ()
 get datasource link for js autocomplete
 setDataSource ($href, $a_delimiter=null)
 set datasource link for js autocomplete
 setDataSourceSubmitOnSelection ($a_stat)
 getDataSourceSubmitOnSelection ()
 setDataSourceSubmitUrl ($a_url)
 getDataSourceSubmitUrl ()
 setMultiValues (array $a_values)
 Set multi values.
 getTableFilterHTML ()
 Get HTML for table filter.
 getToolbarHTML ()
 Get HTML for toolbar.
 setDisableHtmlAutoComplete ($autocomplete)
 isHtmlAutoCompleteDisabled ()
- Public Member Functions inherited from ilSubEnabledFormPropertyGUI
 addSubItem ($a_item)
 Add Subitem.
 getSubItems ()
 Get Subitems.
 getSubInputItemsRecursive ()
 returns a flat array of possibly existing subitems recursively
 checkSubItemsInput ()
 Check SubItems.
 getSubForm ()
 Get sub form html.
 getItemByPostVar ($a_post_var)
 Get item by post var.
- Public Member Functions inherited from ilFormPropertyGUI
executeCommand ()
 Execute command.
 getType ()
 Get Type.
 setTitle ($a_title)
 Set Title.
 getTitle ()
 Get Title.
 setPostVar ($a_postvar)
 Set Post Variable.
 getPostVar ()
 Get Post Variable.
 getFieldId ()
 Get Post Variable.
 setInfo ($a_info)
 Set Information Text.
 getInfo ()
 Get Information Text.
 setAlert ($a_alert)
 Set Alert Text.
 getAlert ()
 Get Alert Text.
 setRequired ($a_required)
 Set Required.
 getRequired ()
 Get Required.
 setDisabled ($a_disabled)
 Set Disabled.
 getDisabled ()
 Get Disabled.
 setParentForm ($a_parentform)
 Set Parent Form.
 getParentForm ()
 Get Parent Form.
 setParent ($a_val)
 Set Parent GUI object.
 getParent ()
 Get Parent GUI object.
 hideSubForm ()
 Sub form hidden on init?
 setHiddenTitle ($a_val)
 Set hidden title (for screenreaders)
 getHiddenTitle ()
 Get hidden title.
 serializeData ()
 serialize data
 unserializeData ($a_data)
 unserialize data
 writeToSession ()
 Write to session.
 clearFromSession ()
 Clear session value.
 readFromSession ()
 Read from session.
 getHiddenTag ($a_post_var, $a_value)
 Get hidden tag (used for disabled properties)
 setMulti ($a_multi, $a_sortable=false, $a_addremove=true)
 Set Multi.
 getMulti ()
 Get Multi.
 getMultiValues ()
 Get multi values.
 getContentOutsideFormTag ()
 Get content that has to reside outside of the parent form tag, e.g.

Protected Attributes

 $values = array()
 $allowMove = false
 $singleline = true
 $qstObject = null
 $minvalue = false
 $minvalueShouldBeGreater = false
- Protected Attributes inherited from ilTextInputGUI
 $value
 $maxlength = 200
 $size = 40
 $validationRegexp
 $validationFailureMessage = ''
 $suffix
 $style_css
 $css_class
 $ajax_datasource
 $ajax_datasource_delimiter
 $ajax_datasource_commit = FALSE
 $ajax_datasource_commit_url
 $submit_form_on_enter = false
 $autocomplete_disabled = false
- Protected Attributes inherited from ilSubEnabledFormPropertyGUI
 $sub_items = array()
- Protected Attributes inherited from ilFormPropertyGUI
 $type
 $title
 $postvar
 $info
 $alert
 $required = false
 $parentgui
 $parentform
 $hidden_title = ""
 $multi = false
 $multi_sortable = false
 $multi_addremove = true
 $multi_values

Additional Inherited Members

- Protected Member Functions inherited from ilFormPropertyGUI
 setType ($a_type)
 Set Type.
 getMultiIconsHTML ()
 Get HTML for multiple value icons.

Detailed Description

This class represents a single choice wizard property in a property form.

Author
Helmut Schottmüller ilias.nosp@m.@aur.nosp@m.ealis.nosp@m..de
Version
Id:
class.ilAnswerWizardInputGUI.php 55160 2014-11-14 14:09:45Z mjansen

Definition at line 13 of file class.ilAnswerWizardInputGUI.php.

Constructor & Destructor Documentation

ilAnswerWizardInputGUI::__construct (   $a_title = "",
  $a_postvar = "" 
)

Constructor.

Parameters
string$a_titleTitle
string$a_postvarPost Variable

Reimplemented from ilTextInputGUI.

Definition at line 28 of file class.ilAnswerWizardInputGUI.php.

References ilTextInputGUI\setSize().

{
parent::__construct($a_title, $a_postvar);
$this->setSize('25');
$this->validationRegexp = "";
}

+ Here is the call graph for this function:

Member Function Documentation

ilAnswerWizardInputGUI::checkInput ( )

Check input, strip slashes etc.

set alert, if input is not ok.

Returns
boolean Input ok, true/false

Reimplemented from ilTextInputGUI.

Definition at line 180 of file class.ilAnswerWizardInputGUI.php.

References $_POST, $lng, ilSubEnabledFormPropertyGUI\checkSubItemsInput(), getMinValue(), ilFormPropertyGUI\getPostVar(), minvalueShouldBeGreater(), ilFormPropertyGUI\setAlert(), and ilUtil\stripSlashesRecursive().

{
global $lng;
if (is_array($_POST[$this->getPostVar()])) $_POST[$this->getPostVar()] = ilUtil::stripSlashesRecursive($_POST[$this->getPostVar()]);
$foundvalues = $_POST[$this->getPostVar()];
if (is_array($foundvalues))
{
// check answers
if (is_array($foundvalues['answer']))
{
foreach ($foundvalues['answer'] as $aidx => $answervalue)
{
if ((strlen($answervalue)) == 0)
{
$this->setAlert($lng->txt("msg_input_is_required"));
return FALSE;
}
}
}
// check points
$max = 0;
if (is_array($foundvalues['points']))
{
foreach ($foundvalues['points'] as $points)
{
if ($points > $max) $max = $points;
if (((strlen($points)) == 0) || (!is_numeric($points)))
{
$this->setAlert($lng->txt("form_msg_numeric_value_required"));
return FALSE;
}
{
if (trim($points) != "" &&
$this->getMinValue() !== false &&
$points <= $this->getMinValue())
{
$this->setAlert($lng->txt("form_msg_value_too_low"));
return false;
}
}
else
{
if (trim($points) != "" &&
$this->getMinValue() !== false &&
$points < $this->getMinValue())
{
$this->setAlert($lng->txt("form_msg_value_too_low"));
return false;
}
}
}
}
if ($max == 0)
{
$this->setAlert($lng->txt("enter_enough_positive_points"));
return false;
}
}
else
{
$this->setAlert($lng->txt("msg_input_is_required"));
return FALSE;
}
return $this->checkSubItemsInput();
}

+ Here is the call graph for this function:

ilAnswerWizardInputGUI::getAllowMove ( )

Get allow move.

Returns
boolean Allow move

Definition at line 132 of file class.ilAnswerWizardInputGUI.php.

References $allowMove.

Referenced by insert().

{
}

+ Here is the caller graph for this function:

ilAnswerWizardInputGUI::getMinValue ( )

Get Minimum Value.

Returns
float Minimum Value

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

References $minvalue.

Referenced by checkInput().

{
}

+ Here is the caller graph for this function:

ilAnswerWizardInputGUI::getQuestionObject ( )

Get question object.

Returns
object Value

Definition at line 112 of file class.ilAnswerWizardInputGUI.php.

References $qstObject.

{
}
ilAnswerWizardInputGUI::getSingleline ( )

Get singleline.

Returns
boolean Value

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

References $singleline.

Referenced by insert().

{
}

+ Here is the caller graph for this function:

ilAnswerWizardInputGUI::getValues ( )

Get Values.

Returns
array Values

Definition at line 72 of file class.ilAnswerWizardInputGUI.php.

References $values.

{
return $this->values;
}
ilAnswerWizardInputGUI::insert ( $a_tpl)

Insert property html.

Returns
int Size

Reimplemented from ilTextInputGUI.

Definition at line 256 of file class.ilAnswerWizardInputGUI.php.

References $lng, $tpl, ilTextInputGUI\$value, ilGlyphGUI\ADD, ilGlyphGUI\DOWN, ilGlyphGUI\get(), getAllowMove(), ilFormPropertyGUI\getDisabled(), ilFormPropertyGUI\getFieldId(), ilTextInputGUI\getMaxLength(), ilFormPropertyGUI\getPostVar(), getSingleline(), ilTextInputGUI\getSize(), ilUtil\prepareFormOutput(), ilGlyphGUI\REMOVE, and ilGlyphGUI\UP.

{
global $lng;
$tpl = new ilTemplate("tpl.prop_answerwizardinput.html", true, true, "Modules/TestQuestionPool");
$i = 0;
foreach ($this->values as $value)
{
if ($this->getSingleline())
{
if (is_object($value))
{
$tpl->setCurrentBlock("prop_text_propval");
$tpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput($value->getAnswertext()));
$tpl->parseCurrentBlock();
$tpl->setCurrentBlock("prop_points_propval");
$tpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput($value->getPoints()));
$tpl->parseCurrentBlock();
}
$tpl->setCurrentBlock('singleline');
$tpl->setVariable("SIZE", $this->getSize());
$tpl->setVariable("SINGLELINE_ID", $this->getPostVar() . "[answer][$i]");
$tpl->setVariable("SINGLELINE_ROW_NUMBER", $i);
$tpl->setVariable("SINGLELINE_POST_VAR", $this->getPostVar());
$tpl->setVariable("MAXLENGTH", $this->getMaxLength());
if ($this->getDisabled())
{
$tpl->setVariable("DISABLED_SINGLELINE", " disabled=\"disabled\"");
}
$tpl->parseCurrentBlock();
}
else if (!$this->getSingleline())
{
if (is_object($value))
{
$tpl->setCurrentBlock("prop_points_propval");
$tpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput($value->getPoints()));
$tpl->parseCurrentBlock();
}
$tpl->setCurrentBlock('multiline');
$tpl->setVariable("PROPERTY_VALUE", $this->qstObject->prepareTextareaOutput($value->getAnswertext()));
$tpl->setVariable("MULTILINE_ID", $this->getPostVar() . "[answer][$i]");
$tpl->setVariable("MULTILINE_ROW_NUMBER", $i);
$tpl->setVariable("MULTILINE_POST_VAR", $this->getPostVar());
if ($this->getDisabled())
{
$tpl->setVariable("DISABLED_MULTILINE", " disabled=\"disabled\"");
}
$tpl->parseCurrentBlock();
}
if ($this->getAllowMove())
{
$tpl->setCurrentBlock("move");
$tpl->setVariable("CMD_UP", "cmd[up" . $this->getFieldId() . "][$i]");
$tpl->setVariable("CMD_DOWN", "cmd[down" . $this->getFieldId() . "][$i]");
$tpl->setVariable("ID", $this->getPostVar() . "[$i]");
$tpl->setVariable("UP_BUTTON", ilGlyphGUI::get(ilGlyphGUI::UP));
$tpl->setVariable("DOWN_BUTTON", ilGlyphGUI::get(ilGlyphGUI::DOWN));
$tpl->parseCurrentBlock();
}
$tpl->setCurrentBlock("row");
$tpl->setVariable("POST_VAR", $this->getPostVar());
$tpl->setVariable("ROW_NUMBER", $i);
$tpl->setVariable("ID", $this->getPostVar() . "[answer][$i]");
$tpl->setVariable("POINTS_ID", $this->getPostVar() . "[points][$i]");
$tpl->setVariable("CMD_ADD", "cmd[add" . $this->getFieldId() . "][$i]");
$tpl->setVariable("CMD_REMOVE", "cmd[remove" . $this->getFieldId() . "][$i]");
if ($this->getDisabled())
{
$tpl->setVariable("DISABLED_POINTS", " disabled=\"disabled\"");
}
$tpl->setVariable("ADD_BUTTON", ilGlyphGUI::get(ilGlyphGUI::ADD));
$tpl->setVariable("REMOVE_BUTTON", ilGlyphGUI::get(ilGlyphGUI::REMOVE));
$tpl->parseCurrentBlock();
$i++;
}
$tpl->setVariable("ELEMENT_ID", $this->getPostVar());
$tpl->setVariable("ANSWER_TEXT", $lng->txt('answer_text'));
$tpl->setVariable("POINTS_TEXT", $lng->txt('points'));
$tpl->setVariable("COMMANDS_TEXT", $lng->txt('actions'));
$a_tpl->setCurrentBlock("prop_generic");
$a_tpl->setVariable("PROP_GENERIC", $tpl->get());
$a_tpl->parseCurrentBlock();
global $tpl;
$tpl->addJavascript("./Services/Form/js/ServiceFormWizardInput.js");
$tpl->addJavascript("./Modules/TestQuestionPool/templates/default/answerwizard.js");
}

+ Here is the call graph for this function:

ilAnswerWizardInputGUI::minvalueShouldBeGreater ( )

Get minvalueShouldBeGreater.

Returns
boolean true if the minimum value should be greater than minvalue

Definition at line 152 of file class.ilAnswerWizardInputGUI.php.

References $minvalueShouldBeGreater.

Referenced by checkInput(), and setMinvalueShouldBeGreater().

+ Here is the caller graph for this function:

ilAnswerWizardInputGUI::setAllowMove (   $a_allow_move)

Set allow move.

Parameters
boolean$a_allow_moveAllow move

Definition at line 122 of file class.ilAnswerWizardInputGUI.php.

{
$this->allowMove = $a_allow_move;
}
ilAnswerWizardInputGUI::setMinValue (   $a_minvalue)

Set Minimum Value.

Parameters
float$a_minvalueMinimum Value

Definition at line 161 of file class.ilAnswerWizardInputGUI.php.

{
$this->minvalue = $a_minvalue;
}
ilAnswerWizardInputGUI::setMinvalueShouldBeGreater (   $a_bool)

Set minvalueShouldBeGreater.

Parameters
boolean$a_booltrue if the minimum value should be greater than minvalue

Definition at line 142 of file class.ilAnswerWizardInputGUI.php.

References minvalueShouldBeGreater().

{
$this->minvalueShouldBeGreater = $a_bool;
}

+ Here is the call graph for this function:

ilAnswerWizardInputGUI::setQuestionObject (   $a_value)

Set question object.

Parameters
object$a_valuetest object

Definition at line 102 of file class.ilAnswerWizardInputGUI.php.

{
$this->qstObject =& $a_value;
}
ilAnswerWizardInputGUI::setSingleline (   $a_value)

Set singleline.

Parameters
boolean$a_valueValue

Definition at line 82 of file class.ilAnswerWizardInputGUI.php.

{
$this->singleline = $a_value;
}
ilAnswerWizardInputGUI::setValue (   $a_value)

Set Value.

Parameters
string$a_valueValue

Reimplemented from ilTextInputGUI.

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

References ilTextInputGUI\$value.

{
$this->values = array();
if (is_array($a_value))
{
if (is_array($a_value['answer']))
{
foreach ($a_value['answer'] as $index => $value)
{
include_once "./Modules/TestQuestionPool/classes/class.assAnswerBinaryStateImage.php";
$answer = new ASS_AnswerBinaryStateImage($value, $a_value['points'][$index], $index, 1, $a_value['imagename'][$index]);
array_push($this->values, $answer);
}
}
}
}
ilAnswerWizardInputGUI::setValues (   $a_values)

Set Values.

Parameters
array$a_valueValue

Definition at line 62 of file class.ilAnswerWizardInputGUI.php.

{
$this->values = $a_values;
}

Field Documentation

ilAnswerWizardInputGUI::$allowMove = false
protected

Definition at line 16 of file class.ilAnswerWizardInputGUI.php.

Referenced by getAllowMove().

ilAnswerWizardInputGUI::$minvalue = false
protected

Definition at line 19 of file class.ilAnswerWizardInputGUI.php.

Referenced by getMinValue().

ilAnswerWizardInputGUI::$minvalueShouldBeGreater = false
protected

Definition at line 20 of file class.ilAnswerWizardInputGUI.php.

Referenced by minvalueShouldBeGreater().

ilAnswerWizardInputGUI::$qstObject = null
protected

Definition at line 18 of file class.ilAnswerWizardInputGUI.php.

Referenced by getQuestionObject().

ilAnswerWizardInputGUI::$singleline = true
protected

Definition at line 17 of file class.ilAnswerWizardInputGUI.php.

Referenced by getSingleline().

ilAnswerWizardInputGUI::$values = array()
protected

Definition at line 15 of file class.ilAnswerWizardInputGUI.php.

Referenced by getValues().


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