Subversion Repositories wimsdev

Rev

Rev 9963 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 9963 Rev 13228
Line 1... Line 1...
1
# AddExam
1
# AddExam
2
# permet d'ajouter un examen dans la classe qclass
2
# permet d'ajouter un examen dans la classe qclass
3
 
3
 
4
!read scripts/check.class
4
!read scripts/check.class
5
!if $error!=$empty
5
!if $error!=$empty
6
 !exit
6
  !exit
7
!endif
7
!endif
8
 
8
 
9
#################################
9
#################################
10
FORMAT OF THE /exams/.exams INDEX FILE :
10
FORMAT OF THE /exams/.exams INDEX FILE :
11
#:EXAM STATUS
11
#:EXAM STATUS
Line 30... Line 30...
30
# IP/Hours/Both - open for IP and/or hours defined
30
# IP/Hours/Both - open for IP and/or hours defined
31
######################################################
31
######################################################
32
 
32
 
33
examcnt=!recordcnt wimshome/log/classes/$qclass/exams/.exams
33
examcnt=!recordcnt wimshome/log/classes/$qclass/exams/.exams
34
!if $examcnt >= $MAX_EXAMS
34
!if $examcnt >= $MAX_EXAMS
35
 error= error : The number of exams is limited to $MAX_EXAMS. You may not create exam #$[$examcnt+1].
35
  error= error : The number of exams is limited to $MAX_EXAMS. You may not create exam #$[$examcnt+1].
36
 !exit
36
  !exit
37
!endif
37
!endif
38
 
38
 
39
data1=!nonempty lines $data1
39
data1=!nonempty lines $data1
40
n1=!linecnt $data1
40
n1=!linecnt $data1
41
!for i=1 to $n1
41
!for i=1 to $n1
42
 l=!line $i of $data1
42
  l=!line $i of $data1
43
 l=!translate = to $\
43
  l=!translate = to $\
44
$ in $l
44
$ in $l
45
 !distribute lines $l into n_,v_
45
  !distribute lines $l into n_,v_
46
 exam_$n_=$v_
46
  exam_$n_=$v_
47
!next i
47
!next i
48
 
48
 
49
exam_creation=!char 1 to 8 of $wims_now
49
exam_creation=!char 1 to 8 of $wims_now
50
exam_creation=!eval $exam_creation
50
exam_creation=!eval $exam_creation
51
!default exam_expiration=$[$exam_creation+10000]
51
!default exam_expiration=$[$exam_creation+10000]
Line 84... Line 84...
84
$exam_cut_hours
84
$exam_cut_hours
85
 
85
 
86
examcnt=!recordcnt wimshome/log/classes/$qclass/exams/.exams
86
examcnt=!recordcnt wimshome/log/classes/$qclass/exams/.exams
87
 
87
 
88
!if $examcnt!=$nb
88
!if $examcnt!=$nb
89
 error= error in exam count ($examcnt records / $nb files)
89
  error= error in exam count ($examcnt records / $nb files)
90
 !exit
90
  !exit
91
!endif
91
!endif
92
 
92
 
93
!writefile wimshome/log/classes/$qclass/exams/.exam$examcnt
93
!writefile wimshome/log/classes/$qclass/exams/.exam$examcnt
94
!writefile wimshome/log/classes/$qclass/.E$examcnt $exam_opening
94
!writefile wimshome/log/classes/$qclass/.E$examcnt $exam_opening
95
 
95
 
96
wims_exam=$examcnt
96
exam_id=$examcnt