-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/enhance survey questions #326
base: main
Are you sure you want to change the base?
Feature/enhance survey questions #326
Conversation
… and the response options
I realize I based this pull request on a much older version. Feel free to ignore any changes that are in conflict with your more recent release. |
Thank you for this PR @essentialols! 🙌 FYI we know the metadata situation in this R package isn't ideal right now; we have some discussion on this in #267 as well as all the issues and PRs linked in there, and plan to really revamp the functions like @jmobrien what do you think about making a change like this now, vs. working toward our larger move from v2 to v3 for metadata in general? Speaking of which, have you tried using library(qualtRics)
metadata("SV_3gbwq8aJgqPwQDP")
#> $metadata
#> surveyID name ownerId organizationId isActive
#> 1 SV_3gbwq8aJgqPwQDP Beskar Armor UR_8wfG5qsMxuh0Jrn conjoint TRUE
#> creationDate lastModifiedDate expiration_startdate
#> 1 2020-02-20T00:35:40Z 2023-07-20T20:39:20Z NA
#> expiration_endDate
#> 1 NA
#>
#> $questions
#> $questions$QID63
#> $questions$QID63$questionType
#> $questions$QID63$questionType$type
#> [1] "MC"
#>
#> $questions$QID63$questionType$selector
#> [1] "SAVR"
#>
#> $questions$QID63$questionType$subSelector
#> [1] "TX"
#>
#>
#> $questions$QID63$questionText
#> [1] "How often do you typically use your beskar armor?"
#>
#> $questions$QID63$questionLabel
#> NULL
#>
#> $questions$QID63$validation
#> $questions$QID63$validation$doesForceResponse
#> [1] TRUE
#>
#>
#> $questions$QID63$questionName
#> [1] "Q63"
#>
#> $questions$QID63$choices
#> $questions$QID63$choices$`1`
#> $questions$QID63$choices$`1`$recode
#> [1] "1"
#>
#> $questions$QID63$choices$`1`$description
#> [1] "<span style=\"color:#8e44ad;\">Daily</span>"
#>
#> $questions$QID63$choices$`1`$choiceText
#> [1] "<span style=\"color:#8e44ad;\">Daily</span>"
#>
#> $questions$QID63$choices$`1`$imageDescription
#> NULL
#>
#> $questions$QID63$choices$`1`$variableName
#> NULL
#>
#> $questions$QID63$choices$`1`$analyze
#> [1] TRUE
#>
#>
#> $questions$QID63$choices$`2`
#> $questions$QID63$choices$`2`$recode
#> [1] "2"
#>
#> $questions$QID63$choices$`2`$description
#> [1] "Weekly"
#>
#> $questions$QID63$choices$`2`$choiceText
#> [1] "Weekly"
#>
#> $questions$QID63$choices$`2`$imageDescription
#> NULL
#>
#> $questions$QID63$choices$`2`$variableName
#> NULL
#>
#> $questions$QID63$choices$`2`$analyze
#> [1] TRUE
#>
#>
#> $questions$QID63$choices$`3`
#> $questions$QID63$choices$`3`$recode
#> [1] "3"
#>
#> $questions$QID63$choices$`3`$description
#> [1] "Once a <span style=\"background-color:#9b59b6;\">month</span>"
#>
#> $questions$QID63$choices$`3`$choiceText
#> [1] "Once a <span style=\"background-color:#9b59b6;\">month</span>"
#>
#> $questions$QID63$choices$`3`$imageDescription
#> NULL
#>
#> $questions$QID63$choices$`3`$variableName
#> NULL
#>
#> $questions$QID63$choices$`3`$analyze
#> [1] TRUE
#>
#>
#> $questions$QID63$choices$`4`
#> $questions$QID63$choices$`4`$recode
#> [1] "4"
#>
#> $questions$QID63$choices$`4`$description
#> [1] "<a href=\"https://www.instagram.com/p/B5qn5ath0ij/?hl=en\">Less often</a>"
#>
#> $questions$QID63$choices$`4`$choiceText
#> [1] "<a href=\"https://www.instagram.com/p/B5qn5ath0ij/?hl=en\">Less often</a>"
#>
#> $questions$QID63$choices$`4`$imageDescription
#> NULL
#>
#> $questions$QID63$choices$`4`$variableName
#> NULL
#>
#> $questions$QID63$choices$`4`$analyze
#> [1] TRUE
#>
#>
#> $questions$QID63$choices$`5`
#> $questions$QID63$choices$`5`$recode
#> [1] "5"
#>
#> $questions$QID63$choices$`5`$description
#> [1] "Do not use"
#>
#> $questions$QID63$choices$`5`$choiceText
#> [1] "Do not use"
#>
#> $questions$QID63$choices$`5`$imageDescription
#> NULL
#>
#> $questions$QID63$choices$`5`$variableName
#> NULL
#>
#> $questions$QID63$choices$`5`$analyze
#> [1] TRUE
#>
#>
#>
#>
#> $questions$QID16
#> $questions$QID16$questionType
#> $questions$QID16$questionType$type
#> [1] "MC"
#>
#> $questions$QID16$questionType$selector
#> [1] "SAVR"
#>
#> $questions$QID16$questionType$subSelector
#> [1] "TX"
#>
#>
#> $questions$QID16$questionText
#> [1] "Overall, how satisfied are you with your beskar armor?"
#>
#> $questions$QID16$questionLabel
#> NULL
#>
#> $questions$QID16$validation
#> $questions$QID16$validation$doesForceResponse
#> [1] TRUE
#>
#>
#> $questions$QID16$questionName
#> [1] "Q16"
#>
#> $questions$QID16$choices
#> $questions$QID16$choices$`5`
#> $questions$QID16$choices$`5`$recode
#> [1] "5"
#>
#> $questions$QID16$choices$`5`$description
#> [1] "<strong>Extremely</strong> satisfied"
#>
#> $questions$QID16$choices$`5`$choiceText
#> [1] "<strong>Extremely</strong> satisfied"
#>
#> $questions$QID16$choices$`5`$imageDescription
#> NULL
#>
#> $questions$QID16$choices$`5`$variableName
#> NULL
#>
#> $questions$QID16$choices$`5`$analyze
#> [1] TRUE
#>
#>
#> $questions$QID16$choices$`4`
#> $questions$QID16$choices$`4`$recode
#> [1] "4"
#>
#> $questions$QID16$choices$`4`$description
#> [1] "<a href=\"https://giphy.com/explore/baby-yoda\">Somewhat satisfied</a>"
#>
#> $questions$QID16$choices$`4`$choiceText
#> [1] "<a href=\"https://giphy.com/explore/baby-yoda\">Somewhat satisfied</a>"
#>
#> $questions$QID16$choices$`4`$imageDescription
#> NULL
#>
#> $questions$QID16$choices$`4`$variableName
#> NULL
#>
#> $questions$QID16$choices$`4`$analyze
#> [1] TRUE
#>
#>
#> $questions$QID16$choices$`3`
#> $questions$QID16$choices$`3`$recode
#> [1] "3"
#>
#> $questions$QID16$choices$`3`$description
#> [1] "<span style=\"background-color:#e74c3c;\">Neither</span> <span style=\"background-color:#e67e22;\">satisfied</span> <span style=\"background-color:#f1c40f;\">nor</span> <span style=\"background-color:#27ae60;\">dissatisfied</span>"
#>
#> $questions$QID16$choices$`3`$choiceText
#> [1] "<span style=\"background-color:#e74c3c;\">Neither</span> <span style=\"background-color:#e67e22;\">satisfied</span> <span style=\"background-color:#f1c40f;\">nor</span> <span style=\"background-color:#27ae60;\">dissatisfied</span>"
#>
#> $questions$QID16$choices$`3`$imageDescription
#> NULL
#>
#> $questions$QID16$choices$`3`$variableName
#> NULL
#>
#> $questions$QID16$choices$`3`$analyze
#> [1] TRUE
#>
#>
#> $questions$QID16$choices$`2`
#> $questions$QID16$choices$`2`$recode
#> [1] "2"
#>
#> $questions$QID16$choices$`2`$description
#> [1] "<a href=\"https://www.gq.com/story/werner-herzog-baby-yoda\">Somewhat dissatisfied</a>"
#>
#> $questions$QID16$choices$`2`$choiceText
#> [1] "<a href=\"https://www.gq.com/story/werner-herzog-baby-yoda\">Somewhat dissatisfied</a>"
#>
#> $questions$QID16$choices$`2`$imageDescription
#> NULL
#>
#> $questions$QID16$choices$`2`$variableName
#> NULL
#>
#> $questions$QID16$choices$`2`$analyze
#> [1] TRUE
#>
#>
#> $questions$QID16$choices$`1`
#> $questions$QID16$choices$`1`$recode
#> [1] "1"
#>
#> $questions$QID16$choices$`1`$description
#> [1] "<em>Extremely</em> dissatisfied"
#>
#> $questions$QID16$choices$`1`$choiceText
#> [1] "<em>Extremely</em> dissatisfied"
#>
#> $questions$QID16$choices$`1`$imageDescription
#> NULL
#>
#> $questions$QID16$choices$`1`$variableName
#> NULL
#>
#> $questions$QID16$choices$`1`$analyze
#> [1] TRUE
#>
#>
#>
#>
#> $questions$QID17
#> $questions$QID17$questionType
#> $questions$QID17$questionType$type
#> [1] "MC"
#>
#> $questions$QID17$questionType$selector
#> [1] "SAHR"
#>
#> $questions$QID17$questionType$subSelector
#> [1] "TX"
#>
#>
#> $questions$QID17$questionText
#> [1] "Have you ever contacted customer service about your beskar armor?"
#>
#> $questions$QID17$questionLabel
#> NULL
#>
#> $questions$QID17$validation
#> $questions$QID17$validation$doesForceResponse
#> [1] TRUE
#>
#>
#> $questions$QID17$questionName
#> [1] "Q17"
#>
#> $questions$QID17$choices
#> $questions$QID17$choices$`1`
#> $questions$QID17$choices$`1`$recode
#> [1] "1"
#>
#> $questions$QID17$choices$`1`$description
#> [1] "Yes"
#>
#> $questions$QID17$choices$`1`$choiceText
#> [1] "Yes"
#>
#> $questions$QID17$choices$`1`$imageDescription
#> NULL
#>
#> $questions$QID17$choices$`1`$variableName
#> NULL
#>
#> $questions$QID17$choices$`1`$analyze
#> [1] TRUE
#>
#>
#> $questions$QID17$choices$`2`
#> $questions$QID17$choices$`2`$recode
#> [1] "2"
#>
#> $questions$QID17$choices$`2`$description
#> [1] "No"
#>
#> $questions$QID17$choices$`2`$choiceText
#> [1] "No"
#>
#> $questions$QID17$choices$`2`$imageDescription
#> NULL
#>
#> $questions$QID17$choices$`2`$variableName
#> NULL
#>
#> $questions$QID17$choices$`2`$analyze
#> [1] TRUE
#>
#>
#>
#>
#> $questions$QID18
#> $questions$QID18$questionType
#> $questions$QID18$questionType$type
#> [1] "MC"
#>
#> $questions$QID18$questionType$selector
#> [1] "SAVR"
#>
#> $questions$QID18$questionType$subSelector
#> [1] "TX"
#>
#>
#> $questions$QID18$questionText
#> [1] "Have all problems been resolved to your complete satisfaction?"
#>
#> $questions$QID18$questionLabel
#> NULL
#>
#> $questions$QID18$validation
#> $questions$QID18$validation$doesForceResponse
#> [1] FALSE
#>
#>
#> $questions$QID18$questionName
#> [1] "Q18"
#>
#> $questions$QID18$choices
#> $questions$QID18$choices$`1`
#> $questions$QID18$choices$`1`$recode
#> [1] "1"
#>
#> $questions$QID18$choices$`1`$description
#> [1] "Yes, by the tribe or its representatives \n<video class=\"qmedia\" controls=\"true\" height=\"268\" preload=\"auto\" width=\"268\"><source src=\"https://i.imgur.com/QlAme0q.mp4\" type=\"video/mp4\" /><embed align=\"middle\" autoplay=\"false\" bgcolor=\"white\" class=\"qmedia\" controller=\"true\" height=\"268\" pluginspage=\"http://www.apple.com/quicktime/download/\" src=\"https://i.imgur.com/QlAme0q.mp4\" type=\"video/quicktime\" width=\"268\" /></video>\n"
#>
#> $questions$QID18$choices$`1`$choiceText
#> [1] "Yes, by the tribe or its representatives \n<video class=\"qmedia\" controls=\"true\" height=\"268\" preload=\"auto\" width=\"268\"><source src=\"https://i.imgur.com/QlAme0q.mp4\" type=\"video/mp4\" /><embed align=\"middle\" autoplay=\"false\" bgcolor=\"white\" class=\"qmedia\" controller=\"true\" height=\"268\" pluginspage=\"http://www.apple.com/quicktime/download/\" src=\"https://i.imgur.com/QlAme0q.mp4\" type=\"video/quicktime\" width=\"268\" /></video>\n"
#>
#> $questions$QID18$choices$`1`$imageDescription
#> NULL
#>
#> $questions$QID18$choices$`1`$variableName
#> NULL
#>
#> $questions$QID18$choices$`1`$analyze
#> [1] TRUE
#>
#>
#> $questions$QID18$choices$`2`
#> $questions$QID18$choices$`2`$recode
#> [1] "2"
#>
#> $questions$QID18$choices$`2`$description
#> [1] "Yes, by me or someone outside the tribe \n<video class=\"qmedia\" controls=\"true\" height=\"268\" preload=\"auto\" width=\"268\"><source src=\"https://i.imgur.com/5sRVO4d.mp4\" type=\"video/mp4\" /><embed align=\"middle\" autoplay=\"false\" bgcolor=\"white\" class=\"qmedia\" controller=\"true\" height=\"268\" pluginspage=\"http://www.apple.com/quicktime/download/\" src=\"https://i.imgur.com/5sRVO4d.mp4\" type=\"video/quicktime\" width=\"268\" /></video>\n"
#>
#> $questions$QID18$choices$`2`$choiceText
#> [1] "Yes, by me or someone outside the tribe \n<video class=\"qmedia\" controls=\"true\" height=\"268\" preload=\"auto\" width=\"268\"><source src=\"https://i.imgur.com/5sRVO4d.mp4\" type=\"video/mp4\" /><embed align=\"middle\" autoplay=\"false\" bgcolor=\"white\" class=\"qmedia\" controller=\"true\" height=\"268\" pluginspage=\"http://www.apple.com/quicktime/download/\" src=\"https://i.imgur.com/5sRVO4d.mp4\" type=\"video/quicktime\" width=\"268\" /></video>\n"
#>
#> $questions$QID18$choices$`2`$imageDescription
#> NULL
#>
#> $questions$QID18$choices$`2`$variableName
#> NULL
#>
#> $questions$QID18$choices$`2`$analyze
#> [1] TRUE
#>
#>
#> $questions$QID18$choices$`3`
#> $questions$QID18$choices$`3`$recode
#> [1] "3"
#>
#> $questions$QID18$choices$`3`$description
#> [1] "No, the problem was not resolved \n<video class=\"qmedia\" controls=\"true\" height=\"168\" preload=\"auto\" width=\"268\"><source src=\"https://i.imgur.com/i40m72o.mp4\" type=\"video/mp4\" /><embed align=\"middle\" autoplay=\"false\" bgcolor=\"white\" class=\"qmedia\" controller=\"true\" height=\"168\" pluginspage=\"http://www.apple.com/quicktime/download/\" src=\"https://i.imgur.com/i40m72o.mp4\" type=\"video/quicktime\" width=\"268\" /></video>\n"
#>
#> $questions$QID18$choices$`3`$choiceText
#> [1] "No, the problem was not resolved \n<video class=\"qmedia\" controls=\"true\" height=\"168\" preload=\"auto\" width=\"268\"><source src=\"https://i.imgur.com/i40m72o.mp4\" type=\"video/mp4\" /><embed align=\"middle\" autoplay=\"false\" bgcolor=\"white\" class=\"qmedia\" controller=\"true\" height=\"168\" pluginspage=\"http://www.apple.com/quicktime/download/\" src=\"https://i.imgur.com/i40m72o.mp4\" type=\"video/quicktime\" width=\"268\" /></video>\n"
#>
#> $questions$QID18$choices$`3`$imageDescription
#> NULL
#>
#> $questions$QID18$choices$`3`$variableName
#> NULL
#>
#> $questions$QID18$choices$`3`$analyze
#> [1] TRUE
#>
#>
#>
#>
#> $questions$QID19
#> $questions$QID19$questionType
#> $questions$QID19$questionType$type
#> [1] "TE"
#>
#> $questions$QID19$questionType$selector
#> [1] "ESTB"
#>
#> $questions$QID19$questionType$subSelector
#> NULL
#>
#>
#> $questions$QID19$questionText
#> [1] "Why not?"
#>
#> $questions$QID19$questionLabel
#> NULL
#>
#> $questions$QID19$validation
#> $questions$QID19$validation$doesForceResponse
#> [1] FALSE
#>
#>
#> $questions$QID19$questionName
#> [1] "Q19"
#>
#>
#> $questions$QID22
#> $questions$QID22$questionType
#> $questions$QID22$questionType$type
#> [1] "TE"
#>
#> $questions$QID22$questionType$selector
#> [1] "ESTB"
#>
#> $questions$QID22$questionType$subSelector
#> NULL
#>
#>
#> $questions$QID22$questionText
#> [1] "If you would like to share any additional comments or experiences about your beskar armor, please enter them below."
#>
#> $questions$QID22$questionLabel
#> NULL
#>
#> $questions$QID22$validation
#> $questions$QID22$validation$doesForceResponse
#> [1] FALSE
#>
#>
#> $questions$QID22$questionName
#> [1] "Q22"
#>
#>
#>
#> $responsecounts
#> data frame with 0 columns and 0 rows Created on 2023-09-05 with reprex v2.0.2 |
Thanks for responding and for suggesting to look into the |
@essentialols I'm not sure, but the question about Meanwhile, @essentialols, the That said, my main concern is that this might not actually work as a general-purpose feature addition--at least not yet, and perhaps not without a lot more effort. Qualtrics has some rather non-intuitive ways it internally represents things in its metadata--for example, a Matrix-type question doesn't use the same structure to represent response options that a standard multiple-choice question uses. So the code so far might not work for that situation. So, actually implementing this (whether on top of So, this looks good as a start and I'm excited you're taking a stab at it, but having dealt with something similar I just wanted to make sure you had an honest take up front in case you decide you really want to tackle this. |
I think it would be really useful to be able to see the question block and the response options when getting the questions. With this change, the survey_questions function displays the name of the question block and a concatenated version of the response options. The concatenation isn't ideal but I couldn't think of a better way to keep the output tidy.