Rev 4176 | Rev 4590 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
23 | reyssat | 1 | !read scripts/check.class |
2 | |||
3 | !if $error!=$empty |
||
4 | !exit |
||
5 | !endif |
||
6 | |||
7 | quser=!translate internal ./;,?* to $ $ in $quser |
||
8 | !if $ $ isin $quser |
||
9 | quser= |
||
10 | !endif |
||
11 | !if $quser=$empty |
||
12 | :baduser |
||
13 | error=bad user |
||
14 | !exit |
||
15 | !endif |
||
16 | |||
17 | !if $quser=supervisor |
||
18 | deffile=supervisor |
||
19 | !else |
||
20 | deffile=.users/$quser |
||
21 | !endif |
||
1373 | bpr | 22 | class_superclass=!defof class_superclass in $classdeffile |
23 | reyssat | 23 | |
1373 | bpr | 24 | !if $class_superclass= |
4176 | obado | 25 | userdeffile=wimshome/log/classes/$qclass/$deffile |
1373 | bpr | 26 | test=!defof user_exists in $userdeffile |
27 | !if $test!=yes |
||
28 | !if $job!=getclassesuser |
||
29 | !goto baduser |
||
30 | !endif |
||
31 | !else |
||
32 | !if $job=getclassesuser |
||
33 | listclassesuser=!append item $qclass to $listclassesuser |
||
34 | !endif |
||
35 | !endif |
||
36 | !exit |
||
37 | !else |
||
4176 | obado | 38 | # on regarde si user existe dans la superclasse |
1373 | bpr | 39 | userdeffile=wimshome/log/classes/$class_superclass/$deffile |
40 | test=!defof user_exists in $userdeffile |
||
4176 | obado | 41 | !if $test!=yes |
42 | error=user not present in superclass. |
||
1373 | bpr | 43 | !exit |
44 | !endif |
||
45 | test=!defof user_participate in $userdeffile |
||
46 | ### contient les classes auxquelles est inscrit l'étudiant et les cours non obligatoires |
||
47 | test=!items2words $test |
||
48 | !if $qclass iswordof $test |
||
49 | !exit |
||
50 | !endif |
||
4365 | obado | 51 | |
1373 | bpr | 52 | class_typename=!defof class_typename in $classdeffile |
4365 | obado | 53 | |
54 | !if $class_typename iswordof class and $qclass notwordof $test |
||
55 | error=Sorry, this user does not participates to this subclass. |
||
56 | !exit |
||
57 | !endif |
||
58 | |||
1373 | bpr | 59 | !if $class_typename iswordof program and (mandatory notwordof $class_progstyles or $class_progstyles=$empty) |
60 | ###si le programme n'est pas obligatoire, user_participate contient ce qu'il faut |
||
61 | qlist=!record 0 of wimshome/log/classes/$qclass/courses |
||
62 | qcourses=!linecnt $qlist |
||
63 | !for q_c=1 to $qcourses |
||
64 | testc=!line $q_c of $qlist |
||
65 | test1=!replace internal / by , in $(testc[1]) |
||
66 | ###test1 doit avoir trois items dans le cas d'un établissement |
||
67 | !if $class_superclass/$(test1[1])/$(test1[2]) iswordof $test |
||
68 | qclass=$class_superclass/$(testc[1]) |
||
69 | #### il devrait n'y en avoir qu'un correspondant au programme ? |
||
70 | !if $job=getclassesuser |
||
71 | listclassesuser=!append item $qclass to $listclassesuser |
||
72 | !endif |
||
73 | !exit |
||
74 | !endif |
||
75 | !next |
||
76 | !endif |
||
4365 | obado | 77 | |
78 |