Subversion Repositories wimsdev

Rev

Rev 9106 | Rev 9110 | 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
 
47
!! calcul du nombre d'exo dans le module.
48
exolist=!defof exolist in wimshome/public_html/modules/$smodule/Exindex
49
exolist=!char 17 to -2 of $exolist
50
exotitle=!defof titlelist in wimshome/public_html/modules/$smodule/Exindex
51
exotitle=!char 17 to -2 of $exotitle
52
exocnt=!itemcnt $exolist
53
 
54
!if $step=2
9106 bpr 55
!! vérification des données de feuille.
8817 guerimand 56
 !if $picksheet=$empty
57
  error=no_pick
58
  !exit
59
 !endif
60
 picksheet=$[floor($picksheet)]
61
 !if $picksheet=NaN or $picksheet<1 or $picksheet>min($max_sheets,$sheettot)
62
  error=bad_sheet
63
  !exit
64
 !endif
65
 sh=!record $picksheet of wimshome/log/classes/$wims_class/sheets/.sheets
66
 a=!line 1 of $sh
67
 !if $a>0
68
  error=bad_sheet
69
  !exit
70
 !endif
71
 shexocnt=!recordcnt wimshome/log/classes/$wims_class/sheets/.sheet$picksheet
9106 bpr 72
 !if $exocnt+$shexocnt>$max_exos
8817 guerimand 73
  error=too_many_exos
74
  !exit
75
 !endif
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,$[10*$require_limit] default 0
86
  !bound weight between 0,10 default 0
87
 !endif
9108 bpr 88
!! vérification des donnees d'execution du module d'exo
8817 guerimand 89
 test_transl=!module translation_language $dir
90
 !if $lang iswordof $test_transl
91
   tr_lang=yes
92
   title=!module title_$lang $dir
93
   desc=!module description_$lang $dir
94
 !endif
95
 !default title=!module title $dir
96
 !default desc=!module description $dir
97
 cat=!module category $dir
98
 !if exercise notin $cat and oef notin $cat
99
  error=not_exo
100
  !exit
101
 !endif
102
 !bound qnum between integer 1 and 9 default $wims_oefdefault_qnum
103
 !bound qcmlevel between integer 1 and 9 default $wims_oefdefault_qcmlevel
104
 !bound intro_qcmpresent between integer 2 and 8 default $wims_oefdefault_qcmpresent
105
 !bound intro_presentsol between integer 0 and 2 default $wims_oefdefault_presentsol
9108 bpr 106
 !bound intro_expow between integer 1 and 3 default $wims_oefdefault_expow
107
 !bound intro_sepow between integer 1 and 3 default $wims_oefdefault_sepow
108
 !bound intro_precw between integer 1 and 3 default $wims_oefdefault_precw
109
 
8817 guerimand 110
 intro_check=!listintersect $intro_check and 1,2,3,4
111
 !bound random within 0,1 default 0
112
 !if $scoredelay!=$empty and $scoredelay!=0
113
  d_=!items2words $scoredelay
114
  !distribute words $d_ into delay1,delay2
115
  !bound delay1 between integer 0 and 2000 default 0
116
  !bound delay2 between integer $delay1 and 2000
9106 bpr 117
  scoredelay=$delay1 $delay2
118
 !endif
8817 guerimand 119
 iniparm=$empty
9108 bpr 120
 !if $expert_=yes
121
  !if $intro_check!=$empty
8817 guerimand 122
 	!for k in $intro_check
123
		iniparm=$(iniparm)&intro_check=$k
124
	!next k
9108 bpr 125
  !endif
126
    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
127
!else
128
  iniparm=qnum=$qnum&qcmlevel=$qcmlevel&scoredelay=$scoredelay
129
!endif
9106 bpr 130
!! ------  write data in the sheet file.
131
 !! analyse series already in the sheet
8817 guerimand 132
 listmod=$empty
133
 listiniparm=$empty
134
 !for i=1 to $shexocnt
135
	e=!record $i of wimshome/log/classes/$wims_class/sheets/.sheet$picksheet
136
	!distribute lines $e into wdi,win
137
  	listmod=!append line $wdi to $listmod
138
	listiniparm=!append line $win to $listiniparm
139
 !next i
140
 !! Ecriture
141
 writedon=$empty
142
 listalready=$empty
143
 !for j=1 to $exocnt
144
	 ex=!item $j of $exolist
145
	 lerror=0
146
	 exoiniparm=exo=$ex&$iniparm
147
	 !for i=1 to $shexocnt
148
		wdi=!line $i of $listmod
149
		win=!line $i of $listiniparm
150
  		!if $smodule=$wdi and $exoiniparm=$win
151
   			lerror=1
152
  		!endif
153
 	 !next i
154
	 !if $lerror=1
155
		listalready=!append item $ex to $listalready
156
   	 !else
157
		writedon=!append line :$smodule\
158
$exoiniparm\
159
$require\
160
$weight\
161
$(exotitle[$j])\
162
$desc\
163
 to $writedon
164
         !endif
165
 !next j
166
 !if $writedon!=$empty
167
  !appendfile wimshome/log/classes/$wims_class/sheets/.sheet$picksheet $writedon
168
 !endif
169
 last=!recordcnt wimshome/log/classes/$wims_class/sheets/.sheet$picksheet
170
 notadd=!itemcnt $listalready
171
 addexo=$[$exocnt-$notadd]
172
 wims_module_log=class $class: add  No$[$last-$addexo+1] to No$last to worksheet $picksheet
173
!endif
174