Skip to content

Commit

Permalink
Fixed issue #15470: Selecting a different Questiontype during Questio…
Browse files Browse the repository at this point in the history
…n creation will load the wrong attributes
  • Loading branch information
ptelu committed Oct 28, 2019
1 parent c619cd8 commit 118568a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion application/models/QuestionCreate.php
Expand Up @@ -9,12 +9,17 @@ public static function getInstance($iSurveyId, $type)
if($gid == 0) {
$gid = array_values($oSurvey->groups)[0]->gid;
}
if (isset($type) && !empty($type)){
$questionType = $type;
} else {
$questionType = SettingsUser::getUserSettingValue('preselectquestiontype', null, null, null, Yii::app()->getConfig('preselectquestiontype'));
}
$oCurrentGroup = Questiongroup::model()->findByPk($gid);
$temporaryTitle = 'G'.str_pad($oCurrentGroup->group_order, 2, '0', STR_PAD_LEFT).'Q'.str_pad((safecount($oSurvey->baseQuestions)+1), 2, '0', STR_PAD_LEFT);
$aQuestionData = [
'sid' => $iSurveyId,
'gid' => $gid,
'type' => SettingsUser::getUserSettingValue('preselectquestiontype', null, null, null, Yii::app()->getConfig('preselectquestiontype')),
'type' => $questionType,
'other' => 'N',
'mandatory' => 'N',
'relevance' => 1,
Expand Down

0 comments on commit 118568a

Please sign in to comment.