Skip to content

Commit f6e3fab

Browse files
committed
added commentary tags to WritingUnitTests
1 parent 8f46817 commit f6e3fab

1 file changed

Lines changed: 23 additions & 22 deletions

File tree

pretext/UnitTesting/WritingUnitTests.ptx

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -163,28 +163,29 @@ assert grade(85) == 'B'
163163
assert grade(69) == 'F'
164164
</input></program>
165165

166-
167-
<!--.. reveal:: ac_grade_unittest_aux_reveal-->
168-
<!--:instructoronly:-->
169-
<!--.. actex:: ac_grade_unittest_aux-->
170-
<!--testA = False-->
171-
<!--testB = False-->
172-
<!--testF = False-->
173-
<!--illegal = False-->
174-
<!--def grade(score):-->
175-
<!--global illegal, testA, testB, testF-->
176-
<!--if score > 100 or score < 0:-->
177-
<!--illegal = True-->
178-
<!--return ''-->
179-
<!--elif score >= 90:-->
180-
<!--testA = True-->
181-
<!--return 'A'-->
182-
<!--elif score >= 80:-->
183-
<!--testB = True-->
184-
<!--return 'B'-->
185-
<!--else:-->
186-
<!--testF = True-->
187-
<!--return 'F'-->
166+
<commentary>
167+
ac_grade_unittest_aux_reveal
168+
instructoronly
169+
actex:: ac_grade_unittest_aux
170+
testA = False
171+
testB = False
172+
testF = False
173+
illegal = False
174+
def grade(score):
175+
global illegal, testA, testB, testF
176+
if score > 100 or score < 0:
177+
illegal = True
178+
return ''
179+
elif score >= 90:
180+
testA = True
181+
return 'A'
182+
elif score >= 80:
183+
testB = True
184+
return 'B'
185+
else:
186+
testF = True
187+
return 'F'
188+
</commentary>
188189
</solution>
189190
</exercise>
190191
</subsection>

0 commit comments

Comments
 (0)