Rev 9909 | Details | Compare with Previous | 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 |
9909 | obado | 2 | # Check.proc verifie que l'element #$n de type $type existe |
3261 | obado | 3 | |
4 | !if $type=$empty |
||
5 | error no type defined in a check request |
||
6 | !exit |
||
7 | !endif |
||
8 | |||
9 | !if $type=exams |
||
10 | type1=exam |
||
11 | q=!translate internal ./,;?* to $ $ in $qexam |
||
12 | !else |
||
13 | type1=sheet |
||
14 | q=!translate internal ./,;?* to $ $ in $qsheet |
||
15 | !endif |
||
16 | |||
13228 | obado | 17 | # Si le parametre $q contient un caractere special, on abandonne |
3261 | obado | 18 | |
19 | !if $ $ isin $q |
||
20 | q= |
||
21 | !endif |
||
22 | |||
23 | listfile=wimshome/log/classes/$qclass/$type/.$type |
||
24 | |||
13228 | obado | 25 | # On compte le nombre d'elements de type $qtype de la classe $qclass |
3261 | obado | 26 | cnt=!recordcnt $listfile |
27 | |||
13228 | obado | 28 | # Si l'element $q n'existe pas, on abandonne |
3261 | obado | 29 | !if $q=$empty |
5273 | obado | 30 | error=undefined query id for type $type1 |
3261 | obado | 31 | !exit |
32 | !else |
||
33 | !if $q>$cnt |
||
4176 | obado | 34 | error=element #$q of type $type1 does not exist in this class ($qclass) |
3261 | obado | 35 | !exit |
36 | !endif |
||
37 | !endif |
||
38 | |||
13228 | obado | 39 | # L'element existe. on initialise la variable $(type1)_id |
40 | !! WARNING : pour l'instant assigner une valeur à la variable wims_sheet fait planter WIMS !! |
||
41 | $(type1)_id=$q |
||
3261 | obado | 42 | qfile=wimshome/log/classes/$qclass/$type/.$type1$q |
43 | qproperties=!record $q of $listfile |