Rev 16338 | 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 |
||
16338 | guerimand | 45 | !if $error!=badfilename |
14297 | guerimand | 46 | exten=!replace internal . by , in $newfilename |
47 | n=!itemcnt $exten |
||
48 | !if $n>=2 |
||
49 | exten=!item -1 of $exten |
||
50 | exten=.$exten |
||
51 | !else |
||
52 | exten=$empty |
||
53 | !endif |
||
16338 | guerimand | 54 | success=goodaddfile |
55 | !if $quota_free-$newsize-$oldsize<0 |
||
56 | error=quota_filestudent |
||
57 | !reset success |
||
58 | !else |
||
59 | !!mise en place du nouveau fichier (et destruction de l'ancien s'il existe) |
||
60 | !sh $delold mv $wims_home/$wims_sesdir/user-deposit $wims_home/log/classes/$wims_class/freeworksdata/$freework/co/$student$exten; |
||
61 | !if $(data_0[5])=$empty |
||
62 | !increase nbcorrectedcopies |
||
63 | notcorrected=$[$nbcopies-$nbcorrectedcopies] |
||
14537 | guerimand | 64 | !endif |
65 | !endif |
||
14297 | guerimand | 66 | !endif |
67 | !endif |
||
14766 | guerimand | 68 | !! ------------ save new score (only if scoring>0) |
69 | !if $scoring>0 |
||
70 | m=!record 0 of wimshome/log/classes/$wims_class/sheets/.severity |
||
71 | maxscore=!word 1 of $m |
||
72 | !bound maxscore between 0 and 100000 default 10 |
||
73 | key2=!positionof item $student in $ulist |
||
16338 | guerimand | 74 | sendscore=$(score$key2) |
14766 | guerimand | 75 | !bound score$key2 between 0 and $maxscore default $empty |
16338 | guerimand | 76 | !if $sendscore!=$(score$key2) |
77 | error=badscore |
||
78 | !endif |
||
14766 | guerimand | 79 | key=!positionof item $student in $uulist |
80 | list=!values 0 for v=1 to $nbscore |
||
81 | list=!replace internal 0 by $empty in $list |
||
82 | !if $key=$empty |
||
83 | list=!replace item number $scoring by $(score$key2) in $list |
||
84 | !appendfile wimshome/log/classes/$wims_class/.grades :$student,$(flist[$key2]) $(llist[$key2]),$list |
||
85 | uulist=!append item $student to $uulist |
||
86 | !else |
||
87 | update_content=!record $[$key+1] of wimshome/log/classes/$wims_class/.grades |
||
88 | update_content=!append item $list to $update_content |
||
89 | update_content=!item 1 to $[$nbscore+2] of $update_content |
||
90 | update_content=!replace item number $[$scoring+2] by $(score$key2) in $update_content |
||
91 | update_field=$[$key+1] |
||
92 | update_nbline=$empty |
||
93 | !read adm/uprecord wimshome/log/classes/$wims_class/.grades |
||
94 | !endif |
||
14339 | guerimand | 95 | !endif |
96 | !reset wims_deposit |
||
16340 | guerimand | 97 | !if $notcorrected=0 |
98 | !restart module=$module&freework=$freework&job=configfw |
||
99 | !else |
||
100 | job=configfw |
||
101 | !changeto $job.proc |
||
102 | !endif |