Rev 3587 | Rev 3921 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
23 | reyssat | 1 | # Variable calculations should be done in this file. |
2 | # It is read and interpreted by wims for all valid calls to the module. |
||
2368 | bpr | 3 | !read adm/class/classlang names.phtml |
23 | reyssat | 4 | |
5 | max_exo=64 |
||
6 | title_limit=50 |
||
7 | desc_limit=255 |
||
8 | sheettot=!recordcnt wimshome/log/classes/$wims_class/sheets/.sheets |
||
9 | wims_helper=chapter=3 |
||
10 | wims_prefix=none |
||
11 | |||
12 | !if $scoring=yes |
||
13 | !default require=10 |
||
14 | !default weight=1 |
||
15 | !else |
||
16 | require=0 |
||
17 | weight=0 |
||
18 | !endif |
||
19 | |||
20 | sup=$wims_user |
||
21 | class=$wims_class |
||
22 | !if $sup!=supervisor |
||
23 | error=not_supervisor |
||
24 | !exit |
||
25 | !endif |
||
26 | |||
27 | !if $cmd=new or $cmd=resume |
||
28 | sheets= |
||
29 | !for i=1 to $sheettot |
||
30 | sh=!record $i of wimshome/log/classes/$wims_class/sheets/.sheets |
||
31 | !distribute lines $sh into a_,t_,title |
||
32 | !if $a_<1 |
||
33 | sheets=!append line $i,$title to $sheets |
||
34 | !endif |
||
35 | !next i |
||
36 | sheetcnt=!linecnt $sheets |
||
37 | !ifval $sheetcnt=0 |
||
38 | error=no_sheet |
||
39 | !exit |
||
40 | !endif |
||
41 | title=!module title $dir |
||
42 | desc=!module description $dir |
||
43 | !exit |
||
44 | !endif |
||
45 | |||
46 | !if $cmd=reply |
||
47 | !if ../adm/ isin ../$dir or $dir=home or \ |
||
48 | (../devel/ isin ../$dir and $wims_devel_modules notwordof open) |
||
49 | error=insert_fail |
||
50 | !exit |
||
51 | !endif |
||
52 | !if $picksheet=$empty |
||
53 | error=no_pick |
||
54 | !exit |
||
55 | !endif |
||
56 | picksheet=$[floor($picksheet)] |
||
57 | !if $picksheet=NaN or $picksheet<1 or $picksheet>min(64,$sheettot) |
||
58 | error=bad_sheet |
||
59 | !exit |
||
60 | !endif |
||
61 | sh=!record $picksheet of wimshome/log/classes/$wims_class/sheets/.sheets |
||
62 | a=!line 1 of $sh |
||
63 | !if $a>0 |
||
64 | error=bad_sheet |
||
65 | !exit |
||
66 | !endif |
||
67 | exocnt=!recordcnt wimshome/log/classes/$wims_class/sheets/.sheet$picksheet |
||
68 | !if $exocnt>=$max_exo |
||
69 | error=too_many_exos |
||
70 | !exit |
||
71 | !endif |
||
72 | idesc=!singlespace $new_desc |
||
73 | idesc=!char 1 to $desc_limit of $idesc |
||
74 | ititle=!singlespace $title |
||
75 | ititle=!char 1 to $title_limit of $ititle |
||
76 | !if $scoring=yes |
||
77 | require=$[$require] |
||
78 | weight=$[$weight] |
||
79 | !if NaN isin $require |
||
80 | require=0 |
||
81 | !endif |
||
82 | !if NaN isin $weight |
||
83 | weight=0 |
||
84 | !endif |
||
85 | !bound require between 0,1000 default 0 |
||
86 | !bound weight between 0,10 default 0 |
||
87 | !endif |
||
88 | !for i=1 to $exocnt |
||
89 | e=!record $i of wimshome/log/classes/$wims_class/sheets/.sheet$picksheet |
||
90 | !distribute lines $e into wdi,win |
||
91 | !if $dir=$wdi and $iniparm=$win |
||
92 | test=$picksheet |
||
93 | error=already_exist |
||
94 | !exit |
||
95 | !endif |
||
96 | !next i |
||
97 | !appendfile wimshome/log/classes/$wims_class/sheets/.sheet$picksheet :$dir\ |
||
98 | $iniparm\ |
||
99 | $require\ |
||
100 | $weight\ |
||
101 | $ititle\ |
||
102 | $idesc |
||
103 | |||
104 | exocnt=!recordcnt wimshome/log/classes/$wims_class/sheets/.sheet$picksheet |
||
105 | wims_module_log=class $class: add No$exocnt to sheet $picksheet |
||
106 | !endif |
||
107 |