Page MenuHomePhabricator

Investigate: QuickSurveys capabilities
Closed, ResolvedPublic

Assigned To
Authored By
Prtksxna
Feb 17 2022, 4:35 AM
Referenced Files
F35047690: image.png
Apr 12 2022, 5:30 AM
F35047688: image.png
Apr 12 2022, 5:30 AM
F35047737: image.png
Apr 12 2022, 5:30 AM
F34953932: image.png
Feb 17 2022, 4:35 AM

Description

We are planning to use the QuickSurveys extension to collect feedback on the data shown by the SimilarEditors tool. Before we can design the form and the questions for collecting feedback we need to understand some of the features of QS:

  1. Is it possible to have just a question and an open text box?
  2. Can the survey be shown to users every time? Even if they've already seen and filled it in the past?
  3. Can we know what query they made on the page when they filled out the survey?
  4. Is it possible to have a checkbox + textbox form where the textbox is always available, no matter which checkbox is checked?

image.png (748×672 px, 71 KB)

Event Timeline

I wrote this in phab and posting it while waiting on some clarification on 3. so I don't lose what I've written.

QuickSurveys uses EventLogging to send survey results and follows the QuickSurveysResponses schema

1. Is it possible to have just a question and an open text box?

Yes with the relevant settings:

$wgQuickSurveysConfig = [
  'layout' => 'single-answer',
  'answers' => [],
],

image.png (205×328 px, 16 KB)
and the event it sends:
image.png (58×354 px, 9 KB)

(filling out the text input would override any pre-made button options)

2. Can the survey be shown to users every time? Even if they've already seen and filled it in the past?

Yes. tl;dr: use quicksurvey=<survey id>. There is a forcedSurvey check in showSurvey() and it pulls from the query parameters as documented here.

Normally, when the survey is loaded, the user's survey status is set with getBucketForSurvey and checking for tokens. If the user has already responded to a survey, these checks in showSurvey() will fail:

getSurveyToken( enabledSurvey ) !== '~' &&
getBucketForSurvey( enabledSurvey ) === 'A' &&

but forcedSurvey overrides all this.

3. Can we know what query they made on the page when they filled out the survey?

Maybe. A pageTitle is sent along with the event so if Similar Editors uses pages like Special:Contributions (Special:Contributions/<user>) where the user is part of the main URL, then yes. Parameters (eg. ?user=<user>) are not sent along and would need to be implemented.

4. Is it possible to have a checkbox + textbox form where the textbox is always available, no matter which checkbox is checked?

No. Out of box, multiple-answer would be the layout for checkboxes and the documentation specifically calls out " A freeform text input will not be provided."

However, the event sent is a comma delineated string so it might be possible to implement freeform text.

image.png (75×326 px, 9 KB)

@Prtksxna could you clarify what you mean by this?

By query I meant which user did they search for using the SimilarEditors tool. By collecting this we'd be able to run the query ourselves and see what kind of results they must've seen.

Thank you! I've finished a preliminary investigation into QuickSurveys. Something I noticed was this gotcha noted in the documentation (emphasis mine):

Note that a survey won't show up when:

on the Main Page;
on non-article page;
on non-existent article page. Be careful when using the MobileFrontend content provider!;
on skin Minerva when the beta opt in panel is shown;
(Broken: if a survey is an external one and points to non-https location. TODO: Pending task T255291.)

Presumably, Special:SimilarEditors is going to be a non-article page.

Tchanders subscribed.

@Prtksxna I've moved this to Done, but feel free to put it in one of the Design columns if that's more appropriate