Skip to content

Commit

Permalink
Dev: Add dummy attribute to test question
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt committed Sep 5, 2016
1 parent 22a088d commit f94b481
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
Expand Up @@ -2,6 +2,8 @@

/**
* Test question object
* Dummy system to be replaced, only here to investigate the communication
* between old and new question system.
*/
class TestQuestionObject // extends QuestionObjectBase
{
Expand All @@ -21,13 +23,29 @@ public function getAnswer()
*/
public function getQuestionCodes()
{
return array('123X234X345');
}

/**
* Example of attribute:
"max_num_value" = array(
"types"=>"K",
'category'=>gT('Input'),
'sortorder'=>100,
'inputtype'=>'text',
"help"=>gT('Maximum sum value of multiple numeric input'),
"caption"=>gT('Maximum sum value'));
* @return array
*/
public function getQuestionAttributes()
public function getAttributeNames()
{
$attributeNames = array();
$attributeNames[] = ls\helpers\questionHelper::$attributes['hidden'];
$attributeNames[0]['i18n'] = false; // TODO: Why needed?
$attributeNames[0]['name'] = 'hidden'; // TODO: Why needed?
$attributeNames[0]['default'] = 0; // TODO: Why needed?
return $attributeNames;
}

}
1 change: 0 additions & 1 deletion application/helpers/SurveyRuntimeHelper.php
Expand Up @@ -1035,7 +1035,6 @@ function run($surveyid,$args)
}
$qidattributes = getQuestionAttributeValues($ia[0]);
var_dump($qidattributes);
die;

$questionIsNotEquation = $ia[4] != '*';
$questionIsHidden = !isset($qidattributes['hidden']) || $qidattributes['hidden'] == 1;
Expand Down

0 comments on commit f94b481

Please sign in to comment.