Subversion Repositories wimsdev

Rev

Rev 9436 | Rev 12315 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
8817 guerimand 1
!if $step=$empty
2
    step=1
3
!endif
4
 
5
max_exos=!defof MAX_EXOS in wimshome/public_html/bases/sys/define.conf
6
max_sheets=!defof MAX_SHEETS in wimshome/public_html/bases/sys/define.conf
7
title_limit=50
8
desc_limit=255
9
 
10
!if $scoring=yes
11
 !default require=10
12
 !default weight=1
13
!else
14
 require=0
15
 weight=0
16
!endif
17
 
18
!if $step=1
19
 sheets=
20
 !for i=1 to $sheettot
21
  sh=!record $i of wimshome/log/classes/$wims_class/sheets/.sheets
22
  !distribute lines $sh into a_,t_,title
23
  !if $a_<1
24
   sheets=!append line $i,$title to $sheets
25
  !endif
26
 !next i
27
 sheetcnt=!linecnt $sheets
28
 !ifval $sheetcnt=0
29
  error=no_sheet
30
  !exit
31
 !endif
32
 special_parm2=expert
33
 smodule=$dir
34
 !distribute line $wims_oefdefault_qnum\
35
$wims_oefdefault_qcmlevel\
36
$wims_oefdefault_scoredelay\
37
$wims_oefdefault_qcmpresent\
38
$wims_oefdefault_presentsol\
9108 bpr 39
$wims_oefdefault_check\
40
wims_oefdefault_expow\
41
wims_oefdefault_sepow\
42
wims_oefdefault_precw\
43
  into qnum,qcmlevel,scoredelay,intro_qcmpresent,intro_presentsol,intro_check,\
44
  expow,sepow,precw
8817 guerimand 45
!endif
46
 
9436 bpr 47
!! calcul du nombre d'exercices
9174 guerimand 48
!if /////classes/ isin /////$smodule
49
    !! adresse du module d'exo d'une classe
50
    dir_header=wimshome/log/classes/$wims_class
51
!else
52
    !! adresse d'un module public ou modtool
53
    dir_header=wimshome/public_html/modules/$smodule
54
!endif
55
exolist=!defof exolist in $dir_header/Exindex
8817 guerimand 56
exolist=!char 17 to -2 of $exolist
9174 guerimand 57
exotitle=!defof titlelist in $dir_header/Exindex
8817 guerimand 58
exotitle=!char 17 to -2 of $exotitle
59
exocnt=!itemcnt $exolist
60
 
9174 guerimand 61
 
8817 guerimand 62
!if $step=2
9106 bpr 63
!! vérification des données de feuille.
8817 guerimand 64
 !if $picksheet=$empty
65
  error=no_pick
66
  !exit
67
 !endif
68
 picksheet=$[floor($picksheet)]
69
 !if $picksheet=NaN or $picksheet<1 or $picksheet>min($max_sheets,$sheettot)
70
  error=bad_sheet
71
  !exit
72
 !endif
73
 sh=!record $picksheet of wimshome/log/classes/$wims_class/sheets/.sheets
74
 a=!line 1 of $sh
75
 !if $a>0
76
  error=bad_sheet
77
  !exit
78
 !endif
79
 shexocnt=!recordcnt wimshome/log/classes/$wims_class/sheets/.sheet$picksheet
9106 bpr 80
 !if $exocnt+$shexocnt>$max_exos
8817 guerimand 81
  error=too_many_exos
82
  !exit
83
 !endif
84
 !if $scoring=yes
85
  require=$[$require]
86
  weight=$[$weight]
87
  !if NaN isin $require
88
   require=0
89
  !endif
90
  !if NaN isin $weight
91
   weight=0
92
  !endif
9110 bpr 93
  !bound require between 0 and $[10*$require_limit] default 0
94
  !bound weight between 0 and 10 default 0
8817 guerimand 95
 !endif
9108 bpr 96
!! vérification des donnees d'execution du module d'exo
8817 guerimand 97
 test_transl=!module translation_language $dir
98
 !if $lang iswordof $test_transl
99
   tr_lang=yes
100
   title=!module title_$lang $dir
101
   desc=!module description_$lang $dir
102
 !endif
103
 !default title=!module title $dir
104
 !default desc=!module description $dir
12116 bpr 105
 desc_module=$desc
8817 guerimand 106
 cat=!module category $dir
107
 !if exercise notin $cat and oef notin $cat
108
  error=not_exo
109
  !exit
110
 !endif
111
 !bound qnum between integer 1 and 9 default $wims_oefdefault_qnum
112
 !bound qcmlevel between integer 1 and 9 default $wims_oefdefault_qcmlevel
113
 !bound intro_qcmpresent between integer 2 and 8 default $wims_oefdefault_qcmpresent
114
 !bound intro_presentsol between integer 0 and 2 default $wims_oefdefault_presentsol
9110 bpr 115
 !bound intro_expow between 1 and 6 default $wims_oefdefault_expow
116
 !bound intro_sepow between 1 and 6 default $wims_oefdefault_sepow
117
 !bound intro_precw between 0 and 1 default $wims_oefdefault_precw
9108 bpr 118
 
8817 guerimand 119
 intro_check=!listintersect $intro_check and 1,2,3,4
120
 !bound random within 0,1 default 0
121
 !if $scoredelay!=$empty and $scoredelay!=0
122
  d_=!items2words $scoredelay
123
  !distribute words $d_ into delay1,delay2
124
  !bound delay1 between integer 0 and 2000 default 0
125
  !bound delay2 between integer $delay1 and 2000
9110 bpr 126
  scoredelay=$delay1,$delay2
9106 bpr 127
 !endif
8817 guerimand 128
 iniparm=$empty
9108 bpr 129
 !if $expert_=yes
130
  !if $intro_check!=$empty
8817 guerimand 131
 	!for k in $intro_check
132
		iniparm=$(iniparm)&intro_check=$k
133
	!next k
9108 bpr 134
  !endif
135
    iniparm=qnum=$qnum&qcmlevel=$qcmlevel&scoredelay=$scoredelay&intro_presentsol=$intro_presentsol$(iniparm)&intro_qcmpresent=$intro_presentsol&intro_expow=$intro_expow&intro_sepow=$intro_sepow&intro_precw=$intro_precw&intro_expert=yes
136
!else
137
  iniparm=qnum=$qnum&qcmlevel=$qcmlevel&scoredelay=$scoredelay
138
!endif
9106 bpr 139
!! ------  write data in the sheet file.
140
 !! analyse series already in the sheet
8817 guerimand 141
 listmod=$empty
142
 listiniparm=$empty
143
 !for i=1 to $shexocnt
144
	e=!record $i of wimshome/log/classes/$wims_class/sheets/.sheet$picksheet
145
	!distribute lines $e into wdi,win
146
  	listmod=!append line $wdi to $listmod
147
	listiniparm=!append line $win to $listiniparm
148
 !next i
149
 !! Ecriture
150
 writedon=$empty
151
 listalready=$empty
152
 !for j=1 to $exocnt
153
	 ex=!item $j of $exolist
154
	 lerror=0
155
	 exoiniparm=exo=$ex&$iniparm
156
	 !for i=1 to $shexocnt
157
		wdi=!line $i of $listmod
158
		win=!line $i of $listiniparm
159
  		!if $smodule=$wdi and $exoiniparm=$win
160
   			lerror=1
161
  		!endif
162
 	 !next i
163
	 !if $lerror=1
164
		listalready=!append item $ex to $listalready
165
   	 !else
12116 bpr 166
   	   !reset desc
9436 bpr 167
   	   desc_=!lookup $ex in wimshome/public_html/modules/$smodule/Descindex
168
   	   !if $desc_!=$empty
169
   	     desc=$desc_
170
   	   !endif
12116 bpr 171
   	   !default desc=$desc_module
9436 bpr 172
   	   obs_=!lookup $ex in wimshome/public_html/modules/$smodule/Obsindex
8817 guerimand 173
		writedon=!append line :$smodule\
174
$exoiniparm\
175
$require\
176
$weight\
177
$(exotitle[$j])\
178
$desc\
9436 bpr 179
\
180
$obs_\
8817 guerimand 181
 to $writedon
182
         !endif
183
 !next j
184
 !if $writedon!=$empty
185
  !appendfile wimshome/log/classes/$wims_class/sheets/.sheet$picksheet $writedon
186
 !endif
187
 last=!recordcnt wimshome/log/classes/$wims_class/sheets/.sheet$picksheet
188
 notadd=!itemcnt $listalready
189
 addexo=$[$exocnt-$notadd]
190
 wims_module_log=class $class: add  No$[$last-$addexo+1] to No$last to worksheet $picksheet
9174 guerimand 191
 sh=!record $picksheet of wimshome/log/classes/$wims_class/sheets/.sheets
192
 title=!line 3 of $sh
8817 guerimand 193
!endif
194