Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1from config import Names as N 

2from control.html import HtmlElements as H 

3from control.utils import E 

4from control.record import Record 

5 

6 

7class ScoreR(Record): 

8 """Logic for score records. 

9 

10 A `wrapHelp` method is added which presents the score 

11 as a term-definition pair, where the title of the record is the term, 

12 and the description is the definition. 

13 """ 

14 

15 def __init__(self, *args, **kwargs): 

16 super().__init__(*args, **kwargs) 

17 

18 def wrapHelp(self): 

19 term = self.title() 

20 definition = H.div( 

21 [ 

22 self.field(field).wrap( 

23 empty=True, 

24 action=N.view, 

25 cls="scoredesc" if field == N.description else E, 

26 ) 

27 for field in [N.description, N.remarks] 

28 ] 

29 ) 

30 return (term, definition)