Problem/Motivation
Currently it is impossible to export question answer data. A single result can be viewed, along with a per-question result, but it is not possible to see the user's answers because the answer format is stored differently across all the question types.
This could be done easily by using a custom Views field that loads the answer, however doing this on a large scale (100+ questions, 1000+ results) becomes infeasible.
Doing it in a custom report would work, however we would have to make logic trees and include all question types. We also lose the functionality in views to do things like add profile fields, Quiz fields, etc.
Additionally having dynamic columns in Views is not possible out of the box, to render a CSV like:
| Result ID | User ID | 1. Is the sky blue? | 2. What is hot? |
|---|---|---|---|
| 2 | 3 | True | Sun Stove |
Proposed resolution
Build a custom views handler that creates dynamic columns on a view, so that we can have one column per question in the Quiz. Provide a default, non-scalable default implementation, and warn other question types that they should implement a scalable one.
Remaining tasks
- Remove unused legacy Quiz views handlers
- Make wildcard field handler
- Add API method for Question answer helper
- Add tests
User interface changes
- Quiz result now has a CSV export using views_data_export (optional)
API changes
- viewsGetAnswers() added to QuizQuestionResponse
- views_data_export now required to export answer data
Data model changes
- None
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | export_results_with-2521904-4.patch | 43.19 KB | djdevin |
Comments
Comment #1
djdevinComment #2
djdevinComment #3
djdevinComment #4
djdevinComment #6
djdevinComment #7
djdevin