As a Wikimedia logged in user, I would like quickSurvey to be able to handle single or multiple questions with a free text input.
AC:
- The free text input will just display on specific layout (defined in the quicksurvey json)
- The free text will be disabled (or hidden depending from the design) if the value to which it is attached is not selected
- The free text will be enabled and updatable if the value to which it is attached is selected
- NOTE: If the user click on the value, fills the free text and then change its option, we should make sure that the free text is either reset, or it is NOT sent to the event.
- The free text value should be sent as part of the event
QA
The following survey can be used to test this functionality:
$wgQuickSurveysConfig[] = [ 'name' => 'foo', 'type' => 'internal', 'enabled' => true, 'questions' => [ [ "name" => "my question 1", "layout" => "single-answer", "question" => "ext-quicksurveys-my-question-1", "answers" => [ [ "label"=> "ext-quicksurveys-my-question-2-answer-7", "freeformTextLabel"=> "ext-quicksurveys-my-question-2-answer-7-free-text-placeholder" ], [ "label"=> "ext-quicksurveys-my-question-2-answer-1" ], [ "label"=> "ext-quicksurveys-my-question-2-answer-2" ], [ "label"=> "ext-quicksurveys-my-question-2-answer-3" ], [ "label"=> "ext-quicksurveys-my-question-2-answer-4" ], [ "label"=> "ext-quicksurveys-my-question-2-answer-5" ], [ "label"=> "ext-quicksurveys-my-question-2-answer-6" ], [ "label"=> "ext-quicksurveys-answer-i-prefer-not-to-say" ] ], ], ], 'shuffleAnswersDisplay' => true, 'enabled' => true, // Percentage of users that will see the survey 'coverage' => 1, // For each platform (desktop, mobile), which version of it is targeted 'platforms' => [ 'desktop' => [ 'stable' ], 'mobile' => [ 'stable' ] ], ];