diff --git a/application/helpers/questionHelper.php b/application/helpers/questionHelper.php index ca56a9852ae..8292ebf31a3 100644 --- a/application/helpers/questionHelper.php +++ b/application/helpers/questionHelper.php @@ -836,7 +836,7 @@ public static function getAttributesDefinitions() ); self::$attributes["random_order"] = array( - "types" => Question::QT_EXCLAMATION_LIST_DROPDOWN . Question::QT_A_ARRAY_5_POINT . Question::QT_B_ARRAY_10_CHOICE_QUESTIONS . Question::QT_C_ARRAY_YES_UNCERTAIN_NO . Question::QT_E_ARRAY_INC_SAME_DEC . Question::QT_F_ARRAY . Question::QT_H_ARRAY_COLUMN . Question::QT_K_MULTIPLE_NUMERICAL . Question::QT_L_LIST . Question::QT_M_MULTIPLE_CHOICE . Question::QT_O_LIST_WITH_COMMENT . Question::QT_P_MULTIPLE_CHOICE_WITH_COMMENTS . Question::QT_Q_MULTIPLE_SHORT_TEXT . Question::QT_R_RANKING . Question::QT_1_ARRAY_DUAL . Question::QT_COLON_ARRAY_NUMBERS . Question::QT_SEMICOLON_ARRAY_TEXT, + "types" => Question::QT_A_ARRAY_5_POINT . Question::QT_B_ARRAY_10_CHOICE_QUESTIONS . Question::QT_C_ARRAY_YES_UNCERTAIN_NO . Question::QT_E_ARRAY_INC_SAME_DEC . Question::QT_F_ARRAY . Question::QT_H_ARRAY_COLUMN . Question::QT_K_MULTIPLE_NUMERICAL . Question::QT_M_MULTIPLE_CHOICE . Question::QT_O_LIST_WITH_COMMENT . Question::QT_P_MULTIPLE_CHOICE_WITH_COMMENTS . Question::QT_Q_MULTIPLE_SHORT_TEXT . Question::QT_1_ARRAY_DUAL . Question::QT_COLON_ARRAY_NUMBERS . Question::QT_SEMICOLON_ARRAY_TEXT, 'category' => gT('Display'), 'sortorder' => 100, 'inputtype' => 'singleselect', @@ -848,6 +848,19 @@ public static function getAttributesDefinitions() "caption" => gT('Random order') ); + self::$attributes["answer_order"] = array( + "types" => Question::QT_L_LIST . Question::QT_R_RANKING . Question::QT_EXCLAMATION_LIST_DROPDOWN, + 'category' => gT('Display'), + 'sortorder' => 100, + 'inputtype' => 'singleselect', + 'options' => array('normal' => gT('Normal'), 'random' => gT("Random"), 'alphabetical' => gT("Alphabetical")), + //1=>gT('Randomize on each page load') // Shnoulle : replace by yes till we have only one solution + //2=>gT('Randomize once on survey start') //Mdekker: commented out as code to handle this was removed in refactoring + 'default' => 0, + "help" => gT('Present answer options in normal, random or alphabetical order'), + "caption" => gT('Answer options order') + ); + self::$attributes["showpopups"] = array( "types" => Question::QT_R_RANKING, 'category' => gT('Display'), diff --git a/application/models/QuestionTemplate.php b/application/models/QuestionTemplate.php index dff79ab96ae..c756db1d44a 100644 --- a/application/models/QuestionTemplate.php +++ b/application/models/QuestionTemplate.php @@ -381,9 +381,12 @@ public function getCustomAttributes() * @param string $type * @return array * @todo Move to QuestionTheme? + * @todo This is not the same as QuestionTheme::findQuestionMetaDataForAllTypes() which is the database layer + * @todo this should check the filestructure instead of the database as this is the filestructure layer */ public static function getQuestionTemplateList($type) { + // todo: incorrect, this should check the filestructure instead of the database as this is the filestructure layer /** @var QuestionTheme[] */ $questionThemes = QuestionTheme::model()->findAllByAttributes( [],