Rev 14537 | Rev 14788 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 14537 | Rev 14572 | ||
---|---|---|---|
Line 14... | Line 14... | ||
14 | !if $d2>$d1 |
14 | !if $d2>$d1 |
15 | toolate=yes |
15 | toolate=yes |
16 | !endif |
16 | !endif |
17 | 17 | ||
18 | !if $type>=2 and $activetest=1 |
18 | !if $type>=2 and $activetest=1 |
19 |
|
19 | !readproc adm/class/quotafree.proc proc |
20 |
|
20 | !readproc proc/findfile.proc $freework,$wims_user |
21 |
|
21 | oldsize=0 |
22 |
|
22 | !if $data_0!=$empty |
23 |
|
23 | du=!sh du -ks $wims_home/log/classes/$wims_class/freeworksdata/$freework/work/$(data_0[2]) |
24 |
|
24 | du=!word 1 of $du |
25 |
|
25 | oldsize=$[($du)/1024] |
26 |
|
26 | delold=rm -f $wims_home/log/classes/$wims_class/freeworksdata/$freework/work/$(data_0[2]) |
27 |
|
27 | test=!fileexists wimshome/sessions/$wims_session/getfile/freeworksdata/work$freework-$(data_0[2]) |
28 |
|
28 | !if $test=yes |
29 |
|
29 | delold=$delold;\ |
30 |
|
30 | rm -f $wims_home/sessions/$wims_session/getfile/freeworksdata/work$freework-$(data_0[2]) |
31 |
|
31 | !endif |
- | 32 | !endif |
|
- | 33 | !if $toolate!=yes and $wims_deposit!=$empty and / notin $wims_deposit and .. notin $wims_deposit |
|
- | 34 | du=!sh du -ks $wims_home/$wims_sesdir/user-deposit |
|
- | 35 | du=!word 1 of $du |
|
- | 36 | newsize=$[($du)/1024] |
|
- | 37 | !ifval $newsize>0.25*$sizelimitfile |
|
- | 38 | error=badstudentfilesize |
|
- | 39 | !exit |
|
32 | !endif |
40 | !endif |
33 | !if $toolate!=yes and $wims_deposit!=$empty and / notin $wims_deposit and .. notin $wims_deposit |
- | |
34 | du=!sh du -ks $wims_home/$wims_sesdir/user-deposit |
- | |
35 | du=!word 1 of $du |
- | |
36 | newsize=$[($du)/1024] |
- | |
37 | !ifval $newsize>0.25*$sizelimitfile |
- | |
38 | error=badstudentfilesize |
- | |
39 | !exit |
- | |
40 | !endif |
- | |
41 |
|
41 | !read proc/checkfilename.proc $freework |
42 |
|
42 | !if $error!=$empty |
43 |
|
43 | !exit |
44 |
|
44 | !else |
45 |
|
45 | exten=!replace internal . by , in $newfilename |
46 |
|
46 | n=!itemcnt $exten |
47 |
|
47 | !if $n>=2 |
48 |
|
48 | exten=!item -1 of $exten |
49 |
|
49 | exten=.$exten |
50 | !else |
- | |
51 | exten=$empty |
- | |
52 | !endif |
- | |
53 | !endif |
- | |
54 | success=goodaddfile |
- | |
55 | !if $quota_free-$newsize-$oldsize<0 |
- | |
56 | error=quota_filestudent |
- | |
57 | !reset success |
- | |
58 | !else |
50 | !else |
59 | !!mise en place du nouveau fichier (et destruction de l'ancien s'il existe et du lien de telechargement) |
- | |
60 | !sh mv $wims_home/$wims_sesdir/user-deposit $wims_home/log/classes/$wims_class/freeworksdata/$freework/work/$wims_user$exten;\ |
- | |
61 |
|
51 | exten=$empty |
62 | !endif |
52 | !endif |
63 | !readproc proc/findfile.proc $freework,$wims_user |
- | |
64 | !endif |
53 | !endif |
- | 54 | success=goodaddfile |
|
65 |
|
55 | !if $quota_free-$newsize-$oldsize<0 |
66 |
|
56 | error=quota_filestudent |
67 | !reset |
57 | !reset success |
- | 58 | !else |
|
68 |
|
59 | !!mise en place du nouveau fichier (et destruction de l'ancien s'il existe et du lien de telechargement) |
69 |
|
60 | !sh mv $wims_home/$wims_sesdir/user-deposit $wims_home/log/classes/$wims_class/freeworksdata/$freework/work/$wims_user$exten;\ |
70 |
|
61 | $delold |
- | 62 | !endif |
|
71 |
|
63 | !readproc proc/findfile.proc $freework,$wims_user |
72 |
|
64 | !endif |
- | 65 | !! ------ make download link for work and co if don't exists |
|
- | 66 | !if $data_0!=$empty |
|
73 |
|
67 | !reset m |
- | 68 | !if $codownload=1 and $(data_0[5])!=$empty |
|
74 | test=!fileexists wimshome/sessions/$wims_session/getfile/freeworksdata/ |
69 | test=!fileexists wimshome/sessions/$wims_session/getfile/freeworksdata/workco$freework-$(data_0[5]) |
75 | !if $test!=yes |
70 | !if $test!=yes |
76 |
|
71 | m=ln -s $wims_home/log/classes/$wims_class/freeworksdata/$freework/co/$(data_0[5]) workco$freework-$(data_0[5]); |
77 | m=!append line $t to $m |
- | |
78 | !endif |
- | |
79 | !if $m!=$empty |
- | |
80 | !sh cd $wims_home/sessions/$wims_session/getfile/freeworksdata/;\ |
- | |
81 | $m |
- | |
82 | !endif |
72 | !endif |
83 | !endif |
73 | !endif |
- | 74 | test=!fileexists wimshome/sessions/$wims_session/getfile/freeworksdata/work$freework-$(data_0[2]) |
|
- | 75 | !if $test!=yes |
|
- | 76 | t=ln -s $wims_home/log/classes/$wims_class/freeworksdata/$freework/work/$(data_0[2]) work$freework-$(data_0[2]); |
|
- | 77 | m=!append line $t to $m |
|
- | 78 | !endif |
|
- | 79 | !if $m!=$empty |
|
- | 80 | !sh cd $wims_home/sessions/$wims_session/getfile/freeworksdata/;\ |
|
- | 81 | $m |
|
- | 82 | !endif |
|
- | 83 | !endif |
|
84 |
|
84 | !! ---- end make... |
85 | !endif |
85 | !endif |