Rev 4176 | Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
3261 | obado | 1 | # Utilise pour verifier l'existence d'une feuille ou d'un examen |
2 | # Check.proc verifie que l'element #$n de type $type existe |
||
3 | |||
4 | #Pour commencer, on verifie la classe |
||
5 | !read scripts/check.class |
||
6 | !if $error!=$empty |
||
7 | !exit |
||
8 | !endif |
||
9 | |||
10 | !if $type=$empty |
||
11 | error no type defined in a check request |
||
12 | !exit |
||
13 | !endif |
||
14 | |||
15 | !if $type=exams |
||
16 | type1=exam |
||
17 | q=!translate internal ./,;?* to $ $ in $qexam |
||
18 | !else |
||
19 | type1=sheet |
||
20 | q=!translate internal ./,;?* to $ $ in $qsheet |
||
21 | !endif |
||
22 | |||
23 | #si le parametre $q contient un caractere special, on abandonne |
||
24 | |||
25 | !if $ $ isin $q |
||
26 | q= |
||
27 | !endif |
||
28 | |||
29 | listfile=wimshome/log/classes/$qclass/$type/.$type |
||
30 | |||
31 | #On compte le nombre d'elements de type $qtype de la classe $qclass |
||
32 | cnt=!recordcnt $listfile |
||
33 | |||
34 | #Si l'element $q n'existe pas, on abandonne |
||
35 | !if $q=$empty |
||
36 | error=undefined query for type $type1 |
||
37 | !exit |
||
38 | !else |
||
39 | !if $q>$cnt |
||
40 | error=element of type $type1 #$q does not exist in class #$qclass |
||
41 | !exit |
||
42 | !endif |
||
43 | !endif |
||
44 | |||
45 | # L'element existe. on initialise la varible wims_$type1 |
||
46 | wims_$type1=$q |
||
47 | qfile=wimshome/log/classes/$qclass/$type/.$type1$q |
||
48 | qproperties=!record $q of $listfile |
||
49 | |||
50 |