Subversion Repositories wimsdev

Rev

Rev 9106 | Go to most recent revision | Details | 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
 
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
 
21
!if $step=1
22
 sheets=
23
 !for i=1 to $sheettot
24
  sh=!record $i of wimshome/log/classes/$wims_class/sheets/.sheets
25
  !distribute lines $sh into a_,t_,title
26
  !if $a_<1
27
   sheets=!append line $i,$title to $sheets
28
  !endif
29
 !next i
30
 sheetcnt=!linecnt $sheets
31
 !ifval $sheetcnt=0
32
  error=no_sheet
33
  !exit
34
 !endif
35
 special_parm2=expert
36
 smodule=$dir
37
 !distribute line $wims_oefdefault_qnum\
38
$wims_oefdefault_qcmlevel\
39
$wims_oefdefault_scoredelay\
40
$wims_oefdefault_qcmpresent\
41
$wims_oefdefault_presentsol\
42
$wims_oefdefault_check into qnum,qcmlevel,scoredelay,intro_qcmpresent,intro_presentsol,intro_check
43
 
44
!endif
45
 
46
!! calcul du nombre d'exo dans le module.
47
exolist=!defof exolist in wimshome/public_html/modules/$smodule/Exindex
48
exolist=!char 17 to -2 of $exolist
49
exotitle=!defof titlelist in wimshome/public_html/modules/$smodule/Exindex
50
exotitle=!char 17 to -2 of $exotitle
51
exocnt=!itemcnt $exolist
52
 
53
!if $step=2
54
!! vérification des données de feuille.
55
 !if $picksheet=$empty
56
  error=no_pick
57
  !exit
58
 !endif
59
 picksheet=$[floor($picksheet)]
60
 !if $picksheet=NaN or $picksheet<1 or $picksheet>min($max_sheets,$sheettot)
61
  error=bad_sheet
62
  !exit
63
 !endif
64
 sh=!record $picksheet of wimshome/log/classes/$wims_class/sheets/.sheets
65
 a=!line 1 of $sh
66
 !if $a>0
67
  error=bad_sheet
68
  !exit
69
 !endif
70
 shexocnt=!recordcnt wimshome/log/classes/$wims_class/sheets/.sheet$picksheet
71
 !if $exocnt+shexocnt>$max_exos
72
  error=too_many_exos
73
  !exit
74
 !endif
75
 !if $scoring=yes
76
  require=$[$require]
77
  weight=$[$weight]
78
  !if NaN isin $require
79
   require=0
80
  !endif
81
  !if NaN isin $weight
82
   weight=0
83
  !endif
84
  !bound require between 0,$[10*$require_limit] default 0
85
  !bound weight between 0,10 default 0
86
 !endif
87
!! vérification des données d'exécution du module d'exo
88
 test_transl=!module translation_language $dir
89
 !if $lang iswordof $test_transl
90
   tr_lang=yes
91
   title=!module title_$lang $dir
92
   desc=!module description_$lang $dir
93
 !endif
94
 !default title=!module title $dir
95
 !default desc=!module description $dir
96
 cat=!module category $dir
97
 !if exercise notin $cat and oef notin $cat
98
  error=not_exo
99
  !exit
100
 !endif
101
 !bound qnum between integer 1 and 9 default $wims_oefdefault_qnum
102
 !bound qcmlevel between integer 1 and 9 default $wims_oefdefault_qcmlevel
103
 !bound intro_qcmpresent between integer 2 and 8 default $wims_oefdefault_qcmpresent
104
 !bound intro_presentsol between integer 0 and 2 default $wims_oefdefault_presentsol
105
 intro_check=!listintersect $intro_check and 1,2,3,4
106
 !bound random within 0,1 default 0
107
 !if $scoredelay!=$empty and $scoredelay!=0
108
  d_=!items2words $scoredelay
109
  !distribute words $d_ into delay1,delay2
110
  !bound delay1 between integer 0 and 2000 default 0
111
  !bound delay2 between integer $delay1 and 2000
112
  scoredelay=$delay1,$delay2
113
 !endif 
114
 iniparm=$empty
115
 !if $intro_check!=$empty
116
 	!for k in $intro_check
117
		iniparm=$(iniparm)&intro_check=$k
118
	!next k
119
 !endif
120
 iniparm=qnum=$qnum&qcmlevel=$qcmlevel&scoredelay=$scoredelay&intro_presentsol=$intro_presentsol$(iniparm)&intro_qcmpresent=$intro_presentsol&intro_expert=yes
121
!! ------  Ecriture des données dans le fichier de la feuille. 
122
 !! analyse des séries présentes dans la feuille
123
 listmod=$empty
124
 listiniparm=$empty
125
 !for i=1 to $shexocnt
126
	e=!record $i of wimshome/log/classes/$wims_class/sheets/.sheet$picksheet
127
	!distribute lines $e into wdi,win
128
  	listmod=!append line $wdi to $listmod
129
	listiniparm=!append line $win to $listiniparm
130
 !next i
131
 !! Ecriture
132
 writedon=$empty
133
 listalready=$empty
134
 !for j=1 to $exocnt
135
	 ex=!item $j of $exolist
136
	 lerror=0
137
	 exoiniparm=exo=$ex&$iniparm
138
	 !for i=1 to $shexocnt
139
		wdi=!line $i of $listmod
140
		win=!line $i of $listiniparm
141
  		!if $smodule=$wdi and $exoiniparm=$win
142
   			lerror=1
143
  		!endif
144
 	 !next i
145
	 !if $lerror=1
146
		listalready=!append item $ex to $listalready
147
   	 !else
148
		writedon=!append line :$smodule\
149
$exoiniparm\
150
$require\
151
$weight\
152
$(exotitle[$j])\
153
$desc\
154
 to $writedon
155
         !endif
156
 !next j
157
 !if $writedon!=$empty
158
  !appendfile wimshome/log/classes/$wims_class/sheets/.sheet$picksheet $writedon
159
 !endif
160
 last=!recordcnt wimshome/log/classes/$wims_class/sheets/.sheet$picksheet
161
 notadd=!itemcnt $listalready
162
 addexo=$[$exocnt-$notadd]
163
 wims_module_log=class $class: add  No$[$last-$addexo+1] to No$last to worksheet $picksheet
164
!endif
165