Subversion Repositories wimsdev

Rev

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

Rev Author Line No. Line
14537 guerimand 1
!! not allow for other than type=3
2
!if $type!=3
3
  job=configfw
4
  !changeto $job.proc
5
!endif
6
 
7
!if $putiworkco!=1
8
  error=putworknotallow
9
  job=configfw
10
  !changeto $job.proc
11
!endif
12
 
13
!! -------- check for valid student (in class)
14
!bound userv within $ulist default $empty
15
!if $userv=$empty
16
  error=putworkusernotexists
17
  job=configfw
18
  !changeto $job.proc
19
!endif
20
 
21
 
22
!! -------- test si la copie de l'etudiant existe (pas de depot de correction si pas de copie)
23
 
24
!readproc proc/findfile3.proc $freework,$userv
25
!if $output=$empty
26
  error=studentwithoutfw
27
  job=configfw
28
  !changeto $job.proc
29
!endif
30
 
16324 guerimand 31
!! -------- save remark
16568 guerimand 32
finalremark=!char 1 to 1000 of $finalremark
33
finalremark=!replace internal : by : in $finalremark
34
!writefile wimshome/log/classes/$wims_class/freeworksdata/$freework/co/$userv $finalremark
16324 guerimand 35
 
16568 guerimand 36
 
14766 guerimand 37
!! ------------ save new score (only if scoring>0)
38
!if $scoring>0
39
  key2=!positionof item $userv in $ulist
16338 guerimand 40
  sendscore=$score
14766 guerimand 41
  !bound score between 0 and $maxscore default $empty
16338 guerimand 42
  !if $sendscore!=$score
43
    error=badscore
44
  !endif
14766 guerimand 45
  key=!positionof item $userv in $uulist
46
  list=!values 0 for v=1 to $nbscore
47
  list=!replace internal 0 by $empty in $list
48
  !if $key=$empty
16066 guerimand 49
    !if $nbscore>1
50
      list=!replace item number $scoring by $score in $list
51
    !else
52
      list=$score
53
    !endif
14766 guerimand 54
    !appendfile wimshome/log/classes/$wims_class/.grades :$userv,$(flist[$key2]) $(llist[$key2]),$list
55
    uulist=!append item $userv to $uulist
56
  !else
57
    update_content=!record $[$key+1] of wimshome/log/classes/$wims_class/.grades
58
    update_content=!append item $list to $update_content
59
    update_content=!item 1 to $[$nbscore+2] of $update_content
60
    update_content=!replace item number $[$scoring+2] by $score in $update_content
61
    update_field=$[$key+1]
62
    update_nbline=$empty
63
    !read adm/uprecord wimshome/log/classes/$wims_class/.grades
64
  !endif
14537 guerimand 65
!endif
16324 guerimand 66
 
67
!! -------- save new file
68
!readproc adm/class/quotafree.proc proc
69
oldsize=0
70
!if $wims_deposit!=$empty and $wims_deposit!=noname.file and / notin $wims_deposit and .. notin $wims_deposit
71
  du=!sh du -ks $wims_home/$wims_sesdir/user-deposit
72
  du=!word 1 of $du
73
  newsize=$[($du)/1024]
74
  !read proc/checkfilename.proc
16338 guerimand 75
  !if $error!=badfilename
76
    success=goodaddfile
77
    !if $quota_free-$newsize<0
78
      error=quota_filestudent
79
      !reset success
80
    !else
81
      !!mise en place du nouveau fichier
16545 guerimand 82
      !sh mkdir -p $wims_home/log/classes/$wims_class/freeworksdata/$freework/co/$(userv)-file;\
83
          mv $wims_home/$wims_sesdir/user-deposit $wims_home/log/classes/$wims_class/freeworksdata/$freework/co/$(userv)-file/$newfilename;
16338 guerimand 84
    !endif
16324 guerimand 85
  !endif
86
!endif
87
 
16338 guerimand 88
job=viewuser3
89
!changeto $job.proc