Subversion Repositories wimsdev

Rev

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

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