Subversion Repositories wimsdev

Rev

Rev 14766 | Rev 16307 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
16087 guerimand 1
!! uploadco for type=2 or type=4
2
!if $type!=2 and $type!=4
14297 guerimand 3
  job=configfw
4
  !changeto $job.proc
5
!endif
6
 
7
!! -------------- check right for download/upload participant correction file
14537 guerimand 8
!if $putiworkco!=1
14297 guerimand 9
  error=putworknotallow
10
  job=configfw
11
  !changeto $job.proc
12
!endif
13
 
14339 guerimand 14
!! -------- check for valid student (in class)
15
!bound student within $ulist default $empty
16
!if $student=$empty
17
  error=putworkusernotexists
18
  job=configfw
19
  !changeto $job.proc
20
!endif
21
 
22
 
14297 guerimand 23
!! -------- test si la copie de l'etudiant existe (pas de depot de correction si pas de copie)
24
 
16087 guerimand 25
!if $type=2
26
  !readproc proc/findfile.proc $freework,$student
27
!else
28
  !readproc proc/findfile4.proc $freework,$student
29
!endif
14297 guerimand 30
!if $data_0=$empty
31
  error=studentwithoutfw
32
  job=configfw
33
  !changeto $job.proc
34
!endif
35
 
36
!readproc adm/class/quotafree.proc proc
37
oldsize=0
38
!if $(data_0[5])!=$empty
14572 bpr 39
  du=!sh du -ks $wims_home/log/classes/$wims_class/freeworksdata/$freework/co/$(data_0[5])
40
  du=!word 1 of $du
41
  oldsize=$[($du)/1024]
42
  delold=rm -f $wims_home/log/classes/$wims_class/freeworksdata/$freework/co/$(data_0[5]);
14297 guerimand 43
!endif
14339 guerimand 44
!if $wims_deposit!=$empty and $wims_deposit!=noname.file and / notin $wims_deposit and .. notin $wims_deposit
14297 guerimand 45
  du=!sh du -ks $wims_home/$wims_sesdir/user-deposit
46
  du=!word 1 of $du
47
  newsize=$[($du)/1024]
48
  !read proc/checkfilename.proc $freework
49
  !if $error!=$empty
50
    !exit
51
  !else
52
    exten=!replace internal . by , in $newfilename
53
    n=!itemcnt $exten
54
    !if $n>=2
55
      exten=!item -1 of $exten
56
      exten=.$exten
57
    !else
58
      exten=$empty
59
    !endif
60
  !endif
61
  success=goodaddfile
62
  !if $quota_free-$newsize-$oldsize<0
63
    error=quota_filestudent
64
    !reset success
65
  !else
14339 guerimand 66
    !!mise en place du nouveau fichier (et destruction de l'ancien s'il existe)
14537 guerimand 67
    !sh $delold mv $wims_home/$wims_sesdir/user-deposit $wims_home/log/classes/$wims_class/freeworksdata/$freework/co/$student$exten;
68
    !if $(data_0[5])=$empty
69
      !if $notcorrected=1
70
        !restart module=$module&freework=$freework&job=configfw
71
      !else
72
        !increase nbcorrectedcopies
73
        notcorrected=$[$nbcopies-$nbcorrectedcopies]
74
      !endif
75
    !endif
14297 guerimand 76
  !endif
77
!endif
14766 guerimand 78
!! ------------ save new score (only if scoring>0)
79
!if $scoring>0
80
  m=!record 0 of wimshome/log/classes/$wims_class/sheets/.severity
81
  maxscore=!word 1 of $m
82
  !bound maxscore between 0 and 100000 default 10
83
  key2=!positionof item $student in $ulist
84
  !bound score$key2 between 0 and $maxscore default $empty
85
  key=!positionof item $student in $uulist
86
  list=!values 0 for v=1 to $nbscore
87
  list=!replace internal 0 by $empty in $list
88
  !if $key=$empty
89
    list=!replace item number $scoring by $(score$key2) in $list
90
    !appendfile wimshome/log/classes/$wims_class/.grades :$student,$(flist[$key2]) $(llist[$key2]),$list
91
    uulist=!append item $student to $uulist
92
  !else
93
    update_content=!record $[$key+1] of wimshome/log/classes/$wims_class/.grades
94
    update_content=!append item $list to $update_content
95
    update_content=!item 1 to $[$nbscore+2] of $update_content
96
    update_content=!replace item number $[$scoring+2] by $(score$key2) in $update_content
97
    update_field=$[$key+1]
98
    update_nbline=$empty
99
    !read adm/uprecord wimshome/log/classes/$wims_class/.grades
100
  !endif
14339 guerimand 101
!endif
102
!reset wims_deposit
14297 guerimand 103
job=configfw
104
!changeto $job.proc