File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,7 +45,9 @@ class Question:
4545
4646 # Settings are left out of the repr so that printing a question still shows its
4747 # content rather than nine lines of configuration.
48- skill : Optional [float ] = field (default = None , repr = False )
48+ # An int too: Lambda Feedback's export is written by JavaScript, which writes the
49+ # lowest and highest skill levels as 0 and 1.
50+ skill : Optional [Union [int , float ]] = field (default = None , repr = False )
4951 guidance : Optional [str ] = field (default = None , repr = False )
5052 duration_lower_bound : Optional [int ] = field (default = None , repr = False )
5153 duration_upper_bound : Optional [int ] = field (default = None , repr = False )
Original file line number Diff line number Diff line change @@ -118,7 +118,9 @@ def test_question_settings_are_written(tmp_path: Path) -> None:
118118 question_set .questions = [
119119 Question (
120120 title = "Configured" ,
121- skill = 1 / 3 ,
121+ # A whole number, as an export holds the highest skill level; the
122+ # fixture's questions cover fractional ones.
123+ skill = 1 ,
122124 guidance = "Try part a first." ,
123125 duration_lower_bound = 5 ,
124126 duration_upper_bound = 10 ,
@@ -147,7 +149,7 @@ def test_question_settings_are_written(tmp_path: Path) -> None:
147149 "displayChatbot" ,
148150 ]
149151 } == {
150- "skill" : 1 / 3 ,
152+ "skill" : 1 ,
151153 "guidance" : "Try part a first." ,
152154 "durationLowerBound" : 5 ,
153155 "durationUpperBound" : 10 ,
You can’t perform that action at this time.
0 commit comments