Subversion Repositories wimsdev

Rev

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