Rev 7260 | Rev 10235 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
23 | reyssat | 1 | mailchar=.-@_$alnum |
2 | |||
3 | !if $modreq!=$empty |
||
4 | modreq=!word 1 of $modreq |
||
5 | !if / isin $modreq or .. isin $modreq |
||
6 | modreq= |
||
7 | !endif |
||
8 | mtest=!filelist $devdir/$modreq |
||
9 | !if $mtest=$empty and ($modreq!=.new or $inddef=$empty) |
||
10 | modreq= |
||
11 | !endif |
||
12 | !if $modreq=$empty |
||
13 | job=modname |
||
14 | !changeto $job.proc |
||
15 | !endif |
||
16 | |||
17 | !read scripts/getindex $modreq |
||
18 | !if $title=$empty and $inddef=$empty |
||
19 | job=modname |
||
20 | modreq= |
||
21 | !changeto $job.proc |
||
22 | !endif |
||
23 | |||
24 | mod=$modreq |
||
25 | |||
26 | !if $inddef!=$empty |
||
27 | inddef= |
||
28 | !if $mod=.new |
||
29 | !read scripts/target |
||
30 | !if $error!=$empty or $target=$empty |
||
31 | job=create |
||
32 | !distribute item $target1,$t2,$t3,$target4 into o1,o2,o3,o4 |
||
33 | !changeto create.proc |
||
34 | !endif |
||
35 | mod=$target |
||
36 | !endif |
||
37 | !for i in title, description, category |
||
38 | i_$i=!trim $(i_$i) |
||
39 | !if $(i_$i)=$empty |
||
40 | error=empty_data |
||
41 | empty_data=$i |
||
42 | job=index |
||
43 | mod= |
||
44 | !exit |
||
45 | !endif |
||
46 | !next i |
||
47 | !if exercise isitemof $i_category or oef isitemof $i_category or\ |
||
48 | deductio isitemof $i_category |
||
49 | !if exercise notitemof $i_category |
||
50 | i_category=$i_category, exercise |
||
51 | !endif |
||
52 | !if oef isitemof $i_category or $deductio isitemof $i_category |
||
53 | default=yes |
||
54 | !else |
||
55 | default=no |
||
56 | !endif |
||
57 | !bound i_scoring within yes, no default $default |
||
58 | !else |
||
59 | i_scoring=no |
||
60 | !endif |
||
61 | !if deductio isitemof $i_category |
||
62 | i_vardef=deduc/var.def |
||
63 | !endif |
||
64 | !if oef isitemof $i_category |
||
65 | i_vardef=oef/var.def |
||
66 | !endif |
||
67 | !if document isitemof $i_category |
||
68 | i_vardef=docu/var.def |
||
69 | !endif |
||
9932 | bpr | 70 | |
23 | reyssat | 71 | c=!char 1 of $i_description |
72 | c=!lower $c |
||
73 | i_description=!replace char number 1 by $c in $i_description |
||
74 | c=!char -1 of $i_description |
||
75 | !if $c!=. |
||
76 | i_description=$i_description. |
||
77 | !endif |
||
6326 | bpr | 78 | !if $i_translation_language!=$empty |
79 | !for l_ in $i_translation_language |
||
80 | c=!char 1 of $(i_description_$l_) |
||
81 | c=!lower $c |
||
82 | i_description_$l_=!replace char number 1 by $c in $(i_description_$l_) |
||
83 | c=!char -1 of $(i_description_$l_) |
||
6422 | bpr | 84 | !if $c!=. and $(i_description_$l_)!= $empty |
6326 | bpr | 85 | i_description_$l_=$(i_description_$l_). |
86 | !endif |
||
87 | !next |
||
88 | !endif |
||
9932 | bpr | 89 | |
23 | reyssat | 90 | !bound i_language within $langlist default $module_language |
91 | i_level=!listintersect $i_level and $levellist |
||
6870 | bpr | 92 | i_level_cnt=!itemcnt $i_level |
93 | !if $i_level issametext $levellist or $i_level_cnt >= 10 |
||
6824 | bpr | 94 | !reset i_level |
95 | !endif |
||
96 | level_def=!replace internal ~ by , in $modreq |
||
97 | !default i_level=!listintersect $(level_def[1]) and $levellist |
||
23 | reyssat | 98 | i_copyright=$copyright |
99 | !default i_copyright=$gnu |
||
6972 | bpr | 100 | i_copyright=!replace internal \COPYING\> by "COPYING"> in $i_copyright |
23 | reyssat | 101 | !if $year notwordof $i_copyright |
102 | i_copyright=$i_copyright $year |
||
103 | !endif |
||
104 | i_require=!listintersect $i_require and $swlist |
||
105 | !default i_author=$auth_name |
||
106 | i_author=!char 1 to 100 of $i_author |
||
4410 | bpr | 107 | !if , notin in $i_author |
108 | author1=!word 1 of $i_author |
||
109 | author2=!word 2 to -1 of $i_author |
||
110 | i_author=$author1, $author2 |
||
111 | !endif |
||
23 | reyssat | 112 | !default i_address=$auth_email |
113 | i_address=!items2words $i_address |
||
5612 | bpr | 114 | !!i_address=!word 1 of $i_address |
115 | i_address=!words2items $i_address |
||
4521 | bpr | 116 | i_address=!text select ;,$mailchar in $i_address |
23 | reyssat | 117 | i_translator=!char 1 to 100 of $i_translator |
118 | i_translator_address=!word 1 of $i_translator_address |
||
119 | i_translator_address=!text select $mailchar in $i_translator_address |
||
9932 | bpr | 120 | |
6326 | bpr | 121 | !if $i_translation_language!=$empty |
122 | !for l_ in $i_translation_language |
||
123 | i_translator_$l_=!char 1 to 100 of $(i_translator_$l_) |
||
124 | i_translator_address_$l_=!word 1 of $(i_translator_address_$l_) |
||
125 | i_translator_address_$l_=!text select $mailchar in $(i_translator_address_$l_) |
||
126 | !next |
||
127 | !endif |
||
23 | reyssat | 128 | i_version=!word 1 of $i_version |
129 | i_wims_version=!word 1 of $i_wims_version |
||
130 | !default i_version=1.00 |
||
131 | !default i_wims_version=$wims_version |
||
9932 | bpr | 132 | |
554 | bpr | 133 | !for l in $deflist1 |
6312 | bpr | 134 | i_$l=$(i_$l) |
554 | bpr | 135 | !next |
5113 | bpr | 136 | i_translation_language=!items2words $i_translation_language |
6312 | bpr | 137 | ###add fields not accessible by the interface for the moment |
138 | ### will be useful in case of translation in the module itself |
||
3999 | bpr | 139 | i_mod_related=!words2items $i_mod_related |
140 | i_mod_related=!text select _.-/,$alnum in $i_mod_related |
||
141 | !default i_mod_related=$mod_related |
||
142 | !if .. isin $i_mod_related |
||
143 | i_mod_related= |
||
144 | !endif |
||
6312 | bpr | 145 | |
23 | reyssat | 146 | !default i_data=$data |
147 | !if .. isin $i_data |
||
148 | i_data= |
||
149 | !endif |
||
150 | ind=# This file is automatically generated by $module_title $module_version.\ |
||
151 | # Do not edit by hand.\ |
||
152 | \ |
||
153 | |||
554 | bpr | 154 | !if dialog isitemof $category |
549 | bpr | 155 | i_category=exercise,dialog |
156 | !endif |
||
572 | bpr | 157 | !if scenario isitemof $category |
158 | i_category=exercise,scenario |
||
159 | !endif |
||
23 | reyssat | 160 | cat1=!item 1 of $i_category |
161 | !if document isin $i_category |
||
162 | i_category=document |
||
163 | cat1=doc |
||
164 | !endif |
||
3999 | bpr | 165 | |
554 | bpr | 166 | !for i in $deflist,$deflist1 |
23 | reyssat | 167 | ind=$ind$i=$(i_$i)\ |
168 | |||
169 | !next i |
||
170 | !if $cat1=exercise and , isin $i_category |
||
171 | cat1=!item 2 of $i_category |
||
172 | !endif |
||
173 | !if $cat1=recreation |
||
174 | cat1=exercise |
||
175 | !endif |
||
176 | dest=$devdir/$mod |
||
177 | src=modules/template/$cat1.$i_language |
||
6972 | bpr | 178 | ind=!replace " by \\" in $ind |
23 | reyssat | 179 | !sh if [ ! -e "$dest" ]; then\ |
180 | mkdir -p $dest\ |
||
181 | cp -pR $src/* $dest\ |
||
182 | if [ "$cat1" = "doc" ]; then\ |
||
183 | echo '*' >$dest/doc/1/.code\ |
||
184 | cat >$dest/doc/1/.def <<@\ |
||
185 | tit=$i_title\ |
||
186 | author=$i_author\ |
||
187 | email=$i_address\ |
||
188 | copyright=gnu\ |
||
189 | dlang=$i_language\ |
||
190 | docopen=yes\ |
||
191 | header=\ |
||
192 | @\ |
||
193 | fi\ |
||
194 | fi\ |
||
195 | echo "$ind" >$dest/INDEX |
||
196 | !read scripts/getindex $mod |
||
197 | wims_module_log=$mod/INDEX |
||
198 | !endif |
||
199 | |||
200 | !read files |
||
6322 | bpr | 201 | !default useropts1=2 |
202 | !default useropts2=1 |
||
203 | !default useropts3=0 |
||
7150 | bpr | 204 | !set usersize=$[$wims_texbasesize + ($useropts4)] |
7130 | bpr | 205 | |
206 | !setdef wims_useropts=$(usersize)$(useropts1)$(useropts2)$(useropts3) in wimshome/sessions/$wims_session/var.stat |