THINK FIRST·CODE LATER

← All labs

Analyse a usability test

Problem

Input: a CSV with one row per task attempt: participant,design,task,success,seconds,errors,sus1,…,sus10 (the SUS answers are repeated on each row of a participant).

For each design (alphabetical) print dashboard_A: completion 67% (6/9 task attempts), median time of successful attempts 55 s, errors per attempt 1.33, mean SUS 71.7 (n=3), where SUS per participant = 2.5 × Σ(odd items: rating − 1; even items: 5 − rating). Then print hardest task overall: locate (50% completed) (lowest completion rate across all attempts).

Data for this lab

Your program reads its data from standard input. Download the file, then give it to your program as shown below. Start with data set 1: its expected output is given.

v14-1-data-1.csv — first 14 lines of 19

participant,design,task,success,seconds,errors,sus1,sus2,sus3,sus4,sus5,sus6,sus7,sus8,sus9,sus10
P1,dashboard_A,lookup,1,40,0,4,2,4,2,4,2,4,2,4,2
P1,dashboard_A,compare,1,65,1,4,2,4,2,4,2,4,2,4,2
P1,dashboard_A,locate,0,120,3,4,2,4,2,4,2,4,2,4,2
P2,dashboard_A,lookup,1,35,0,5,1,5,2,4,1,5,1,4,2
P2,dashboard_A,compare,1,50,0,5,1,5,2,4,1,5,1,4,2
P2,dashboard_A,locate,1,95,1,5,1,5,2,4,1,5,1,4,2
P3,dashboard_A,lookup,1,60,1,3,3,3,3,3,3,3,3,3,3
P3,dashboard_A,compare,0,120,2,3,3,3,3,3,3,3,3,3,3
P3,dashboard_A,locate,0,120,4,3,3,3,3,3,3,3,3,3,3
P4,dashboard_B,lookup,1,30,0,4,1,5,1,5,1,5,1,4,1
P4,dashboard_B,compare,1,45,0,4,1,5,1,5,1,5,1,4,1
P4,dashboard_B,locate,1,70,1,4,1,5,1,5,1,5,1,4,1
P5,dashboard_B,lookup,1,25,0,5,2,4,1,5,2,4,1,5,2
What your program must print for v14-1-data-1.csv
dashboard_A: completion 67% (6/9 task attempts), median time of successful attempts 55 s, errors per attempt 1.33, mean SUS 71.7 (n=3)
dashboard_B: completion 89% (8/9 task attempts), median time of successful attempts 42.5 s, errors per attempt 0.44, mean SUS 87.5 (n=3)
hardest task overall: locate (50% completed)

Run your program first, then open this and compare line by line: your output must contain these lines exactly.

How to give the file to my program

Terminal (macOS, Linux, or Windows Command Prompt), in the folder that holds both files:

python my_lab.py < v14-1-data-1.csv

Windows PowerShell (the default terminal of VS Code on Windows) does not understand <:

Get-Content v14-1-data-1.csv | python my_lab.py

PyCharm: Run → Edit Configurations → tick Redirect input from and choose the file.

Jupyter: put this at the top of the cell that holds your program:

import sys
sys.stdin = open("v14-1-data-1.csv", encoding="utf-8")

Write it here, in Jupyter or in your IDE, then paste it. Run it on the sample input yourself before comparing. Your code stays in your browser — it is never sent to or stored on the server.