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