29        parent::__construct($a_title, $a_postvar);
 
   39        $this->values = array();
 
   40        if (is_array($a_value)) {
 
   41            include_once 
"./Modules/TestQuestionPool/classes/class.assAnswerErrorText.php";
 
   42            if (is_array($a_value[
'key'])) {
 
   43                foreach ($a_value[
'key'] as $idx => 
$key) {
 
   44                    array_push($this->values, 
new assAnswerErrorText(
$key, $a_value[
'value'][$idx], str_replace(
",", 
".", $a_value[
'points'][$idx])));
 
   57        $this->key_size = $a_size;
 
   77        $this->value_size = $a_size;
 
   97        $this->key_maxlength = $a_maxlength;
 
  117        $this->value_maxlength = $a_maxlength;
 
  137        $this->value_name = $a_name;
 
  157        $this->key_name = $a_name;
 
  177        $this->values = $a_values;
 
  205        if (is_array($foundvalues)) {
 
  207            if (is_array($foundvalues[
'key']) && is_array($foundvalues[
'value'])) {
 
  208                foreach ($foundvalues[
'key'] as $val) {
 
  210                        $this->
setAlert($lng->txt(
"msg_input_is_required"));
 
  214                foreach ($foundvalues[
'value'] as $val) {
 
  216                        $this->
setAlert($lng->txt(
"msg_input_is_required"));
 
  220                foreach ($foundvalues[
'points'] as $val) {
 
  222                        $this->
setAlert($lng->txt(
"msg_input_is_required"));
 
  225                    if (!is_numeric(str_replace(
",", 
".", $val))) {
 
  226                        $this->
setAlert($lng->txt(
"form_msg_numeric_value_required"));
 
  229                    if ((
float) $val <= 0) {
 
  230                        $this->
setAlert($lng->txt(
"positive_numbers_required"));
 
  236                    $this->
setAlert($lng->txt(
"msg_input_is_required"));
 
  242                $this->
setAlert($lng->txt(
"msg_input_is_required"));
 
  259        $tpl = 
new ilTemplate(
"tpl.prop_errortextwizardinput.html", 
true, 
true, 
"Modules/TestQuestionPool");
 
  261        foreach ($this->values as 
$value) {
 
  263                if (strlen(
$value->text_wrong)) {
 
  264                    $tpl->setCurrentBlock(
"prop_key_propval");
 
  266                    $tpl->parseCurrentBlock();
 
  268                if (strlen(
$value->text_correct)) {
 
  269                    $tpl->setCurrentBlock(
"prop_value_propval");
 
  271                    $tpl->parseCurrentBlock();
 
  273                if (strlen(
$value->points)) {
 
  274                    $tpl->setCurrentBlock(
"prop_points_propval");
 
  276                    $tpl->parseCurrentBlock();
 
  280            $tpl->setCurrentBlock(
"row");
 
  281            $class = (
$i % 2 == 0) ? 
"even" : 
"odd";
 
  285            if (
$i == count($this->values)-1) {
 
  288            $tpl->setVariable(
"ROW_CLASS", $class);
 
  289            $tpl->setVariable(
"ROW_NUMBER", 
$i);
 
  296            $tpl->setVariable(
"VALUE_ID", $this->
getPostVar() . 
"[value][$i]");
 
  301            $tpl->parseCurrentBlock();
 
  308        $tpl->setVariable(
"POINTS_TEXT", $lng->txt(
'points'));
 
  310        $a_tpl->setCurrentBlock(
"prop_generic");
 
  311        $a_tpl->setVariable(
"PROP_GENERIC", 
$tpl->get());
 
  312        $a_tpl->parseCurrentBlock();
 
An exception for terminatinating execution or to throw for unit testing.
Class for error text answers.
This class represents a key value pair wizard property in a property form.
checkInput()
Check input, strip slashes etc.
setValueSize($a_size)
Set value size.
getValueSize()
Get value size.
setValueMaxlength($a_maxlength)
Set value maxlength.
setValue($a_value)
Set Value.
setKeyName($a_name)
Set key name.
getKeyMaxlength()
Get key maxlength.
insert($a_tpl)
Insert property html.
setKeyMaxlength($a_maxlength)
Set key maxlength.
setKeySize($a_size)
Set key size.
__construct($a_title="", $a_postvar="")
Constructor.
getValueMaxlength()
Get value maxlength.
getValueName()
Get value name.
getKeyName()
Get key name.
setValues($a_values)
Set Values.
setValueName($a_name)
Set value name.
getKeySize()
Get key size.
special template class to simplify handling of ITX/PEAR
This class represents a text property in a property form.
static stripSlashesRecursive($a_data, $a_strip_html=true, $a_allow="")
Strip slashes from array and sub-arrays.
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms @access public