Subversion Repositories wimsdev

Rev

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