Page MenuHomePhabricator

Survey answers should be customisable and allow an arbitary number of buttons
Closed, ResolvedPublic2 Story Points

Description

Given I define an internal survey as follows:

$wgQuickSurveysConfig = array(
		"name" => "annesurvey",
		"type" => "internal",
		"question" => "anne-survey-question",
		"answers" => array(
			"anne-survey-answer-one",
			"anne-survey-answer-two",
			"anne-survey-answer-three",
			"anne-survey-answer-four"
		),
		"schema" => "QuickSurveysResponses",
		"enabled" => true,
		"coverage" => 1,
		"description" => "anne-survey-description",
		"platform" => array(
			"desktop" => array( "stable" ),
			"mobile" => array( "stable", "beta", "alpha" ),
		),
	),

I should see four neutral buttons with labels <anne-survey-question-one>,<anne-survey-question-two>,<anne-survey-question-three>,<anne-survey-question-four>
When I click on them they should log the message key anne-survey-question-one, anne-survey-question-two,anne-survey-question-three, anne-survey-question-four respectively even if the messages are defined.

Note: I should be able to define a survey with any number of buttons. 1... 20... 500. :) and do not get into arguments about whether a one button survey would ever be useful. You never know! :)

Event Timeline

Jdlrobson raised the priority of this task from to Needs Triage.
Jdlrobson updated the task description. (Show Details)
Jdlrobson added subscribers: Aklapper, Jdlrobson.
Jdlrobson updated the task description. (Show Details)Sep 10 2015, 11:17 PM
Jdlrobson set Security to None.
atgo added a subscriber: atgo.Sep 11 2015, 12:20 AM

I think this covers our initial use case pretty well. I'm starting a thread with design research and jkatz as well to refine the survey further, but if we can make these changes and figure out placement/design as per T110362 we should be in a good spot.

Jdlrobson updated the task description. (Show Details)Sep 14 2015, 4:18 PM
KLans_WMF edited a custom field.Sep 14 2015, 4:25 PM
phuedx claimed this task.Sep 15 2015, 11:28 AM
phuedx moved this task from To Do to Doing on the Reading-Web-Sprint-56-Four Lions board.

Change 238437 had a related patch set uploaded (by Phuedx):
Make internal surveys accept arbitrary answers

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

As I pointed out during yesterday's kick off meeting, the example configuration isn't quite right: the answers property is a map of some arbitrary internal name, which we log, to an i18n message key, i.e.

"answers" => array(
  "yes" => "ext-internal-internal-yes",
  "maybe" => "ext-internal-survey-maybe,
  "no" => "ext-internal-survey-no",
),

Change 238599 had a related patch set uploaded (by Jdlrobson):
QA: Add browser tests for multiple answer surveys

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

Merged your patch after my browser test showed it worked. Keen to get the browser test merged before signing off so leaving in this column.

Change 238437 merged by jenkins-bot:
Make internal surveys accept arbitrary answers

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

This needs more work. I left a comment at https://gerrit.wikimedia.org/r/#/c/238437/

Change 238693 had a related patch set uploaded (by Phuedx):
Don't configure answers with a map

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

Change 238693 merged by jenkins-bot:
Don't configure answers with a map

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

Change 238599 merged by jenkins-bot:
QA: Add browser tests for multiple answer surveys

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

Jdlrobson closed this task as Resolved.Sep 17 2015, 9:48 PM

Looks good to me but I noticed this T112982 sigggh :/
I will sign off as soon as I can verify on beta cluster.

Sign off blocked on T112204