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