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