Feature/ranking question type vue3#3248
Feature/ranking question type vue3#3248datapumpernickel wants to merge 5 commits intonextcloud:refactor/vue3from
Conversation
1966d50 to
ed1a5de
Compare
|
@datapumpernickel please don't merge the other branch into this one, use |
Adds a new 'ranking' question type that allows respondents to drag-and-drop predefined options into their preferred order. Based on refactor/vue3 branch, using vue-draggable-plus. Signed-off-by: paul bochtler <65470117+datapumpernickel@users.noreply.github.com>
Signed-off-by: paul bochtler <65470117+datapumpernickel@users.noreply.github.com>
8448797 to
ddfa037
Compare
Signed-off-by: paul bochtler <65470117+datapumpernickel@users.noreply.github.com>
|
In the current implementation, respondents drag options into their preferred order. Since there is always an order (the default one), there is no way to distinguish "the respondent actively chose this order" from "the respondent skipped the question." Making the question required would be meaningless because a valid answer is always present. To support a true "required" behavior, we would need one of:
For now, ranking questions simply always submit the current order, defaulting to the original option order if unchanged. |
…ttest for blank answer Signed-off-by: paul bochtler <65470117+datapumpernickel@users.noreply.github.com>
|
Ok, it is now implemented as a tap-and-drag interface, which allows to set a required-flag or leave it blank. 🎊 See attached video for demonstration: https://github.com/user-attachments/assets/9745e93c-87db-49ae-990f-ed305827deee |
|
Looks good :) One thing I noticed: in submit view you can't change the order by keyboard. And for consistency we should move the drag handle to the end of the options like in create view. |
…e keyboard menu Signed-off-by: paul bochtler <65470117+datapumpernickel@users.noreply.github.com>
|
Hah, good catch. I tried to be more consistent with the design now. Keyboard should work now, but I do find the whole keyboard use a little unreliable still. I think I might be out of my depth for that. |
As proposed in #1278: Add Ranking question type
Refactored to Vue3, after closing: #3247
This adds a new question type that lets respondents rank options by dragging them into order.
Results are scored using Borda count — first place gets the most points, last place gets the least. The summary shows each option's total score and average rank with a visual bar, along with a short explanation of how scoring works.
For export, ranking questions get one column per option (like grid questions do), with the rank number as the value. Answers are stored as a JSON array of option IDs, which keeps things consistent with how grid answers are stored.
There's also an optional shuffle setting.
Again disclaimer: heavy use of genAI, I did try to check the code to the best of my abilities and ran it on nextcloud-docker-dev to actually interact with it and export data.