Page MenuHomePhabricator

UI - Create question with free text input
Closed, ResolvedPublic

Description

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' ]
	],
];

Event Timeline

Mimurawil changed the task status from Open to In Progress.Apr 23 2024, 1:25 AM

Change #1026694 had a related patch set uploaded (by Mimurawil; author: Mimurawil):

[mediawiki/extensions/QuickSurveys@master] T362973: Add free text input to multi answer layout

https://gerrit.wikimedia.org/r/1026694

Test wiki created on Patch demo by SimoneThisDot using patch(es) linked to this task:
https://patchdemo.wmflabs.org/wikis/42ce80c18c/w

Test wiki created on Patch demo by SimoneThisDot using patch(es) linked to this task:
https://patchdemo.wmflabs.org/wikis/a44d09140e/w

Test wiki on Patch demo by SimoneThisDot using patch(es) linked to this task was deleted:

https://patchdemo.wmflabs.org/wikis/42ce80c18c/w/

Change #1037233 had a related patch set uploaded (by Simone Cuomo; author: Simone Cuomo):

[mediawiki/extensions/QuickSurveys@community-safety] Improve capability of QuickSurvey

https://gerrit.wikimedia.org/r/1037233

Change #1037233 merged by jenkins-bot:

[mediawiki/extensions/QuickSurveys@community-safety] Improve capability of QuickSurvey

https://gerrit.wikimedia.org/r/1037233

Change #1026694 abandoned by Simone Cuomo:

[mediawiki/extensions/QuickSurveys@master] T362973: Add free text input to multi answer layout

Reason:

The work for this branch and ticket has been completed in a feature branch "https://gerrit.wikimedia.org/r/c/mediawiki/extensions/QuickSurveys/+/1037233"

https://gerrit.wikimedia.org/r/1026694

Test wiki on Patch demo by SimoneThisDot using patch(es) linked to this task was deleted:

https://patchdemo.wmflabs.org/wikis/a44d09140e/w/

Test wiki created on Patch demo by SimoneThisDot using patch(es) linked to this task:
https://patchdemo.wmflabs.org/wikis/1f5a200338/w

Test wiki on Patch demo by SimoneThisDot using patch(es) linked to this task was deleted:

https://patchdemo.wmflabs.org/wikis/1f5a200338/w/

Test wiki created on Patch demo by Jdlrobson using patch(es) linked to this task:
https://patchdemo.wmflabs.org/wikis/e606e11883/w

Test wiki created on Patch demo by SimoneThisDot using patch(es) linked to this task:
https://patchdemo.wmflabs.org/wikis/0d85df7998/w

Test wiki on Patch demo by Amdrel using patch(es) linked to this task was deleted:

https://patchdemo.wmflabs.org/wikis/80286dd93e/w/

Test wiki on Patch demo by Amdrel using patch(es) linked to this task was deleted:

https://patchdemo.wmflabs.org/wikis/7ed125994c/w/

Test wiki on Patch demo by SimoneThisDot using patch(es) linked to this task was deleted:

https://patchdemo.wmflabs.org/wikis/0d85df7998/w/