Rev 16338 | Rev 16568 | 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 |
14537 | guerimand | 32 | remark=!char 1 to 1000 of $remark |
33 | remark=!replace internal : by : in $remark |
||
34 | !writefile wimshome/log/classes/$wims_class/freeworksdata/$freework/co/$userv $remark |
||
16324 | guerimand | 35 | |
14766 | guerimand | 36 | !! ------------ save new score (only if scoring>0) |
37 | !if $scoring>0 |
||
38 | key2=!positionof item $userv in $ulist |
||
16338 | guerimand | 39 | sendscore=$score |
14766 | guerimand | 40 | !bound score between 0 and $maxscore default $empty |
16338 | guerimand | 41 | !if $sendscore!=$score |
42 | error=badscore |
||
43 | !endif |
||
14766 | guerimand | 44 | key=!positionof item $userv in $uulist |
45 | list=!values 0 for v=1 to $nbscore |
||
46 | list=!replace internal 0 by $empty in $list |
||
47 | !if $key=$empty |
||
16066 | guerimand | 48 | !if $nbscore>1 |
49 | list=!replace item number $scoring by $score in $list |
||
50 | !else |
||
51 | list=$score |
||
52 | !endif |
||
14766 | guerimand | 53 | !appendfile wimshome/log/classes/$wims_class/.grades :$userv,$(flist[$key2]) $(llist[$key2]),$list |
54 | uulist=!append item $userv to $uulist |
||
55 | !else |
||
56 | update_content=!record $[$key+1] of wimshome/log/classes/$wims_class/.grades |
||
57 | update_content=!append item $list to $update_content |
||
58 | update_content=!item 1 to $[$nbscore+2] of $update_content |
||
59 | update_content=!replace item number $[$scoring+2] by $score in $update_content |
||
60 | update_field=$[$key+1] |
||
61 | update_nbline=$empty |
||
62 | !read adm/uprecord wimshome/log/classes/$wims_class/.grades |
||
63 | !endif |
||
14537 | guerimand | 64 | !endif |
16324 | guerimand | 65 | |
66 | !! -------- save new file |
||
67 | !readproc adm/class/quotafree.proc proc |
||
68 | oldsize=0 |
||
69 | !if $wims_deposit!=$empty and $wims_deposit!=noname.file and / notin $wims_deposit and .. notin $wims_deposit |
||
70 | du=!sh du -ks $wims_home/$wims_sesdir/user-deposit |
||
71 | du=!word 1 of $du |
||
72 | newsize=$[($du)/1024] |
||
73 | !read proc/checkfilename.proc |
||
16338 | guerimand | 74 | !if $error!=badfilename |
75 | success=goodaddfile |
||
76 | !if $quota_free-$newsize<0 |
||
77 | error=quota_filestudent |
||
78 | !reset success |
||
79 | !else |
||
80 | !!mise en place du nouveau fichier |
||
16545 | guerimand | 81 | !sh mkdir -p $wims_home/log/classes/$wims_class/freeworksdata/$freework/co/$(userv)-file;\ |
82 | mv $wims_home/$wims_sesdir/user-deposit $wims_home/log/classes/$wims_class/freeworksdata/$freework/co/$(userv)-file/$newfilename; |
||
16338 | guerimand | 83 | !endif |
16324 | guerimand | 84 | !endif |
85 | !endif |
||
86 | |||
16338 | guerimand | 87 | job=viewuser3 |
88 | !changeto $job.proc |