Skip to content

Track vote input method (hotkey vs mouse) in user_info.json - #74

Merged
IvoLeist merged 10 commits into
mainfrom
copilot/log-vote-usage-data
Mar 30, 2026
Merged

Track vote input method (hotkey vs mouse) in user_info.json#74
IvoLeist merged 10 commits into
mainfrom
copilot/log-vote-usage-data

Conversation

Copilot AI commented Feb 11, 2026

Copy link
Copy Markdown
Contributor

Median vote times range 2-15 seconds across users. This adds tracking to determine if hotkey usage explains the variance.

Implementation

JavaScript (hotkeys.js)

  • Detects input method on vote selection (hotkey keys 1-4/a/s/d/f vs mouse click)
  • Validates context to prevent tracking clicks outside voting area
  • Sends input$last_input_method to Shiny server via setInputValue()

R Server

  • main_server.R: Initializes vote_input_methods structure in user_info.json on login
  • mod_voting.R: Increments counters (hotkey/mouse/unknown) on each new vote cast

Data Structure

{
  "user_id": "User1",
  "voting_institute": "InstituteA",
  "images_randomisation_seed": 12345,
  "vote_input_methods": {
    "hotkey_count": 45,
    "mouse_count": 15,
    "unknown_count": 0
  }
}

Notes:

  • Only tracks initial votes, not vote changes
  • Uses "unknown" when method indeterminate (with warning logged)
  • unknown_count > 0 indicates tracking issues requiring investigation

Analysis: Correlate hotkey usage percentage with time_till_vote_casted_in_seconds from user_annotations.tsv to quantify speed impact.

Original prompt

This section details on the original issue you should resolve

<issue_title>Log for every vote if the user has clicked a radio button/checkbox or used the hotkeys</issue_title>
<issue_description>We realised that the current median time to vote ranges from 2 - 15sec
So we want to see how much of this difference is explained by the usage of hot keys

Store the hotkey/mouse usage inside the user_info.json of each user</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@IvoLeist IvoLeist changed the title [WIP] Log user vote usage for hotkeys and mouse clicks [WIP] Log usage of hotkeys and mouse clicks per user Feb 11, 2026
Copilot AI and others added 5 commits February 11, 2026 13:41
Co-authored-by: IvoLeist <28399610+IvoLeist@users.noreply.github.com>
Co-authored-by: IvoLeist <28399610+IvoLeist@users.noreply.github.com>
Co-authored-by: IvoLeist <28399610+IvoLeist@users.noreply.github.com>
…king

Co-authored-by: IvoLeist <28399610+IvoLeist@users.noreply.github.com>
…mment capitalization

Co-authored-by: IvoLeist <28399610+IvoLeist@users.noreply.github.com>
Copilot AI changed the title [WIP] Log usage of hotkeys and mouse clicks per user Track vote input method (hotkey vs mouse) in user_info.json Feb 11, 2026
Copilot AI requested a review from IvoLeist February 11, 2026 13:49
@IvoLeist
IvoLeist marked this pull request as ready for review February 23, 2026 15:50
@IvoLeist
IvoLeist merged commit 75e0f65 into main Mar 30, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Log for every vote if the user has clicked a radio button/checkbox or used the hotkeys

2 participants