Rev 7354 | Rev 8817 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 7354 | Rev 8255 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | !! add exercise in a sheet |
1 | !! add exercise in a sheet |
2 | 2 | ||
3 |
|
3 | max_exos=!defof MAX_EXOS in wimshome/public_html/bases/sys/define.conf |
- | 4 | max_sheets=!defof MAX_SHEETS in wimshome/public_html/bases/sys/define.conf |
|
4 | title_limit=50 |
5 | title_limit=50 |
5 | desc_limit=255 |
6 | desc_limit=255 |
6 | 7 | ||
7 | !if $scoring=yes |
8 | !if $scoring=yes |
8 | !default require=10 |
9 | !default require=10 |
Line 51... | Line 52... | ||
51 | !if $picksheet=$empty |
52 | !if $picksheet=$empty |
52 | error=no_pick |
53 | error=no_pick |
53 | !exit |
54 | !exit |
54 | !endif |
55 | !endif |
55 | picksheet=$[floor($picksheet)] |
56 | picksheet=$[floor($picksheet)] |
56 | !if $picksheet=NaN or $picksheet<1 or $picksheet>min( |
57 | !if $picksheet=NaN or $picksheet<1 or $picksheet>min($max_sheets,$sheettot) |
57 | error=bad_sheet |
58 | error=bad_sheet |
58 | !exit |
59 | !exit |
59 | !endif |
60 | !endif |
60 | sh=!record $picksheet of wimshome/log/classes/$wims_class/sheets/.sheets |
61 | sh=!record $picksheet of wimshome/log/classes/$wims_class/sheets/.sheets |
61 | a=!line 1 of $sh |
62 | a=!line 1 of $sh |
62 | !if $a>0 |
63 | !if $a>0 |
63 | error=bad_sheet |
64 | error=bad_sheet |
64 | !exit |
65 | !exit |
65 | !endif |
66 | !endif |
66 | exocnt=!recordcnt wimshome/log/classes/$wims_class/sheets/.sheet$picksheet |
67 | exocnt=!recordcnt wimshome/log/classes/$wims_class/sheets/.sheet$picksheet |
67 | !if $exocnt> |
68 | !if $exocnt>=$max_exos |
68 | error=too_many_exos |
69 | error=too_many_exos |
69 | !exit |
70 | !exit |
70 | !endif |
71 | !endif |
71 | idesc=!singlespace $new_desc |
72 | idesc=!singlespace $new_desc |
72 | idesc=!char 1 to $desc_limit of $idesc |
73 | idesc=!char 1 to $desc_limit of $idesc |
Line 79... | Line 80... | ||
79 | require=0 |
80 | require=0 |
80 | !endif |
81 | !endif |
81 | !if NaN isin $weight |
82 | !if NaN isin $weight |
82 | weight=0 |
83 | weight=0 |
83 | !endif |
84 | !endif |
84 | !bound require between |
85 | !bound require between 0,$[10*$require_limit] default 0 |
85 | !bound weight between 0,10 default 0 |
86 | !bound weight between 0,10 default 0 |
86 | !endif |
87 | !endif |
87 | !for i=1 to $exocnt |
88 | !for i=1 to $exocnt |
88 | e=!record $i of wimshome/log/classes/$wims_class/sheets/.sheet$picksheet |
89 | e=!record $i of wimshome/log/classes/$wims_class/sheets/.sheet$picksheet |
89 | !distribute lines $e into wdi,win |
90 | !distribute lines $e into wdi,win |