Page MenuHomePhabricator

Update PHP to support multi-question survey
Closed, ResolvedPublic

Description

As an user of the QuickSurvey extension, I would like it to have the ability to support multi-question survey.

AC:

  • Single question survey written in the previous format still work as expected
  • The extension can handle multi-question survey
  • The extension can handle multi-question with Text area question
  • The extension has tests to cover this scenarios

Event Timeline

Amdrel changed the task status from Open to In Progress.Apr 22 2024, 3:31 PM
Amdrel claimed this task.

Change #1024807 had a related patch set uploaded (by Amdrel; author: Amdrel):

[mediawiki/extensions/QuickSurveys@master] Implement support for new survey schema

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

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/

Is the "shuffleAnswersDisplay" option supposed to work with surveys with multiple answers?

Previously I could define "shuffleAnswersDisplay" to shuffle all answers for a single question.

With the new format, shuffleAnswersDisplay can display on answers or on the root eg..

$wgQuickSurveysConfig[] = [
...
	'questions' => [
		[
			'name' => 'test',
			'layout' => 'single-answer',
			'question' => 'Do you like writing unit tests?',
                 	'shuffleAnswersDisplay' => true,
			'answers' => [
				[ 'label' => 'ext-quicksurveys-test-internal-survey-positive' ],
				[ 'label' => 'ext-quicksurveys-test-internal-survey-negative' ],
			],
		],
		[
			'name' => 'test2',
			'layout' => 'single-answer',
			'question' => 'Do you like writing integration tests?',
			'answers' => [
				[ 'label' => 'ext-quicksurveys-test-internal-survey-positive' ],
				[ 'label' => 'ext-quicksurveys-test-internal-survey-negative' ],
			],
		],
	],
	'shuffleAnswersDisplay' => true,

I expected this to shuffle the different questions e.g. sometimes "Do you like writing integration tests?" would appear as the first question but that doesn't seem to work as I expected. How should this work?

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

[mediawiki/extensions/QuickSurveys@community-safety] Implement support for new survey schema

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

Change #1037217 abandoned by Simone Cuomo:

[mediawiki/extensions/QuickSurveys@community-safety] Implement support for new survey schema

Reason:

Wrong Patch created

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

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 #1024807 abandoned by Amdrel:

[mediawiki/extensions/QuickSurveys@master] Implement support for new survey schema

Reason:

This patch has been cherry-picked and squashed into the following branch: https://gerrit.wikimedia.org/r/q/project:mediawiki/extensions/QuickSurveys+branch:community-safety+status:merged

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

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/