-
Notifications
You must be signed in to change notification settings - Fork 285
Description
Description 📝
The Manager dashboard's Beta components (StudyOverview, ParticipantsInfo, TasksInfo, StorageInfo) display 0 for all metrics (Total Participants, Completed, In Progress, Average Time, Task Completion Rate, Success Rate, Avg. Task Duration, media file counts, etc.) even when participants have submitted answers.
The root cause is that all four components read answer data from props.test.answers, but the Study model (src/shared/models/Study.js) does not define an answers property. It only stores answersDocId — a reference to a separate document in the answers Firestore collection. The actual answer data is loaded into the Vuex store via the Answer.js module and accessed through store.getters.testAnswerDocument.taskAnswers.
Since props.test.answers is always undefined, the fallback || [] produces an empty array, causing every downstream metric to compute as 0.
Additionally, TasksInfo.vue gates task iteration on task.attempted, which defaults to false in the TaskAnswer model. This means that even if data were flowing, metrics like completion rate and duration would be undercounted.
Link 🔗
/userTest/unmoderated/manager/{study_id} — Manager view for any unmoderated study
Steps to Reproduce 🔄
- Go to the Home page and click Create Study to create a new Unmoderated User Test with at least one task.
- Click on Cooperators and invite at least one user.
- Have the invited cooperator (or yourself as the admin) open the test link and complete all tasks, then submit.
- Go back to the Manager view for the study (
/userTest/unmoderated/manager/{study_id}). - Scroll down to the Beta dashboard cards — Study Overview, Participants Info, Tasks Info, and Storage Info.
- See that all metrics (Total Participants, Completed, In Progress, Average Time, Task Completion Rate, Success Rate, Avg. Task Duration, media counts) display
0despite answers existing in Firestore.
Screenshots 📸
Expected Behavior 🤔
The dashboard should display accurate metrics reflecting the actual submitted test answers:
- Total Participants should count all users who have taken the test
- Completed should count users who submitted their answers
- In Progress should count users who started but haven't submitted
- Average Time, Task Completion Rate, Success Rate, and Avg. Task Duration should compute from actual task answer data
Actual Behavior 😱
All metrics display 0 regardless of how many participants have submitted answers. The Beta cards appear functional but show no data because the underlying computed properties always receive an empty array.
Environment 🌍
- Vue component:
StudyOverview.vue,ParticipantsInfo.vue,TasksInfo.vue,StorageInfo.vue - Git branch:
develop - OS: All OS
- Browser: All browsers
Additional Information ℹ️
The existing GeneralAnalytics.vue component (under Reports/Answers) correctly reads answer data from store.getters.visibleUserAnswers, which is why the analytics page works while the Manager dashboard does not. The fix involves switching the four dashboard components to read from the same Answer.js Vuex store module.
Additionally, ParticipantsInfo.vue has a secondary bug in its notStartedParticipants calculation: it subtracts completedAnswers from acceptedCooperators, which can produce a negative value when the study admin takes the test without being in the cooperators list (e.g., 2 accepted cooperators − 3 completed answers = −1). The dashboard would then display "-1 Not Started".