Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
16087 | guerimand | 1 | !! process control page for student and type=4 |
2 | |||
3 | !if $activetest!=1 and $activetest!=2 |
||
4 | error=badallows |
||
5 | emptypage=yes |
||
6 | !exit |
||
7 | !endif |
||
8 | |||
9 | !read tabletheme |
||
10 | |||
11 | nbexo=!recordcnt wimshome/log/classes/$wims_class/freeworks/.freework$freework |
||
12 | |||
13 | d1=!text select char 0123456789 in $(deadline)$(timedeadline) |
||
14 | d2=!text select char 0123456789 in $wims_now |
||
15 | d2=!char 1 to 12 of $d2 |
||
16 | d3=!text select char 0123456789 in $(soldate)$(timesoldate) |
||
17 | !reset toolate |
||
18 | !if $d2>$d1 |
||
19 | toolate=yes |
||
20 | !endif |
||
21 | |||
22 | !if $job2=directexo and $toolate!=yes |
||
23 | !bound exonum between 1 and $nbexo default $empty |
||
24 | !if $exonum=$empty |
||
25 | error=exolog-noexo |
||
26 | !reset job2 |
||
27 | !else |
||
28 | test=!fileexists wimshome/log/classes/$wims_class/freeworksdata/$freework/work/$wims_user.$exolog |
||
29 | !if $test=yes |
||
30 | error=exolog-exoexists |
||
31 | !reset job2 |
||
32 | !else |
||
33 | data=!record $exonum of wimshome/log/classes/$wims_class/freeworks/.freework$freework |
||
34 | !distribute line $data into mod,cl,ti,desc |
||
35 | !restart module=$(mod)&cmd=new&wims_freework=$(freework),$exonum&intro_expert=yes&intro_sol=0&$cl |
||
36 | !endif |
||
37 | !endif |
||
38 | !endif |
||
39 | |||
40 | |||
41 | !if $sizelimitfile>0 and $activetest>=1 |
||
42 | !readproc proc/findfile4.proc $freework,$wims_user |
||
43 | !if $activetest=1 |
||
44 | !readproc adm/class/quotafree.proc proc |
||
45 | oldsize=0 |
||
46 | !if $data_0!=$empty |
||
47 | du=!sh du -ks $wims_home/log/classes/$wims_class/freeworksdata/$freework/work/$(data_0[2]) |
||
48 | du=!word 1 of $du |
||
49 | oldsize=$[($du)/1024] |
||
50 | delold=rm -f $wims_home/log/classes/$wims_class/freeworksdata/$freework/work/$(data_0[2]) |
||
51 | test=!fileexists wimshome/sessions/$wims_session/getfile/freeworksdata/work$freework-$(data_0[2]) |
||
52 | !if $test=yes |
||
53 | delold=$delold;\ |
||
54 | rm -f $wims_home/sessions/$wims_session/getfile/freeworksdata/work$freework-$(data_0[2]) |
||
55 | !endif |
||
56 | !endif |
||
57 | !if $toolate!=yes and $wims_deposit!=$empty and / notin $wims_deposit and .. notin $wims_deposit |
||
58 | du=!sh du -ks $wims_home/$wims_sesdir/user-deposit |
||
59 | du=!word 1 of $du |
||
60 | newsize=$[($du)/1024] |
||
61 | !ifval $newsize>0.25*$sizelimitfile |
||
62 | error=badstudentfilesize |
||
63 | !exit |
||
64 | !endif |
||
65 | !read proc/checkfilename.proc $freework |
||
66 | !if $error!=$empty |
||
67 | !exit |
||
68 | !else |
||
69 | exten=!replace internal . by , in $newfilename |
||
70 | n=!itemcnt $exten |
||
71 | !if $n>=2 |
||
72 | exten=!item -1 of $exten |
||
73 | exten=.$exten |
||
74 | !else |
||
75 | exten=$empty |
||
76 | !endif |
||
77 | !endif |
||
78 | success=goodaddfile |
||
79 | !if $quota_free-$newsize-$oldsize<0 |
||
80 | error=quota_filestudent |
||
81 | !reset success |
||
82 | !else |
||
83 | !!mise en place du nouveau fichier (et destruction de l'ancien s'il existe et du lien de telechargement) |
||
84 | !sh mv $wims_home/$wims_sesdir/user-deposit $wims_home/log/classes/$wims_class/freeworksdata/$freework/work/$(wims_user)-work$exten;\ |
||
85 | $delold |
||
86 | !endif |
||
87 | !readproc proc/findfile4.proc $freework,$wims_user |
||
88 | !endif |
||
89 | !! ------ make download link for work and co if don't exists |
||
90 | !if $data_0!=$empty |
||
91 | !reset m |
||
92 | !if $codownload=1 and $(data_0[5])!=$empty |
||
93 | test=!fileexists wimshome/sessions/$wims_session/getfile/freeworksdata/workco$freework-$(data_0[5]) |
||
94 | !if $test!=yes |
||
95 | m=ln -s $wims_home/log/classes/$wims_class/freeworksdata/$freework/co/$(data_0[5]) workco$freework-$(data_0[5]); |
||
96 | !endif |
||
97 | !endif |
||
98 | test=!fileexists wimshome/sessions/$wims_session/getfile/freeworksdata/work$freework-$(data_0[2]) |
||
99 | !if $test!=yes |
||
100 | t=ln -s $wims_home/log/classes/$wims_class/freeworksdata/$freework/work/$(data_0[2]) work$freework-$(data_0[2]); |
||
101 | m=!append line $t to $m |
||
102 | !endif |
||
103 | !if $m!=$empty |
||
104 | !sh cd $wims_home/sessions/$wims_session/getfile/freeworksdata/;\ |
||
105 | $m |
||
106 | !endif |
||
107 | !endif |
||
108 | !! ---- end make... |
||
109 | !endif |
||
110 | !endif |
||
111 |