Subversion Repositories wimsdev

Rev

Rev 17598 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
14537 guerimand 1
!! process control page for student and type=3
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
 
14788 guerimand 22
!set appletnum=0
23
 
24
!! ----- check of authorisation for student to modify his work (studentmode=0 no studentmode=1 yes)
25
!set studentmode=1
26
!if $activetest=1
27
  !readproc adm/class/quotafree.proc proc
28
  !readproc proc/findfile3.proc $freework,$wims_user
29
  d1=!text select char 0123456789 in $(deadline)$(timedeadline)
30
  d2=!text select char 0123456789 in $wims_now
31
  d2=!char 1 to 12 of $d2
32
  !reset toolate
33
  !if $d2>$d1
34
    toolate=yes
35
    studentmode=0
36
  !endif
37
!else
38
  studentmode=0
39
!endif
40
 
17593 czzmrn 41
!if $studentclose=1
42
  !if $job2=confirm and $confirm=$name_close_confirm
17598 czzmrn 43
    !setdef freework_closeco_$wims_user=$wims_now in wimshome/log/classes/$wims_class/freeworksdata/$freework/.closeco
17593 czzmrn 44
  !endif
45
 
46
  !if $job2=consigne and $consigne=$name_close_doclose
47
    studentmode=0
48
  !endif
49
 
50
  test_close=!defof freework_closeco_$wims_user in wimshome/log/classes/$wims_class/freeworksdata/$freework/.closeco
51
 
52
  !if $test_close!=$empty
53
    studentmode=0
54
  !endif
55
 
56
  !reset consigne confirm giveup  
57
!endif
58
 
14537 guerimand 59
!! ---- read structure of the freework
16324 guerimand 60
!distribute item 0,0,$empty into nbrezoneteacher,nbrezonestudent,ltdownloadzone
14537 guerimand 61
nb=!recordcnt wimshome/log/classes/$wims_class/freeworks/.freework$freework
62
!for k=1 to $nb
63
  dt=!record $k of wimshome/log/classes/$wims_class/freeworks/.freework$freework
64
  l=!line 1 of $dt
65
  !distribute word $l into t,u
66
  !bound u within teacher,student default teacher
14788 guerimand 67
  !bound t within solution,$listfilename_ztype default $(listfilename_ztype[1])
14537 guerimand 68
  !if $t=solution
69
    flistsolution=!line 2 to -1 of $dt
70
    flistsolution=!nonempty line $flistsolution
71
    flistsolution=!lines2items $flistsolution
72
  !else
73
    !increase nbrezone$u
74
    ztype$(u)$(nbrezone$u)=$t
75
    script_data=!line 2 to -1 of $dt
76
    !readproc applet/$t pararead $u $(nbrezone$u)
14788 guerimand 77
    !! -- read display parameters for each zone
17565 czzmrn 78
    !if $u!=student or $job2!=savezone or $t isitemof $studentfile_ztype
14796 guerimand 79
      !read applet/$t displayread $u $(nbrezone$u) $studentmode $wims_user
80
    !endif
14537 guerimand 81
  !endif
82
!next k
14796 guerimand 83
ltdownloadzone=!listintersection $ltdownloadzone and $zonelistlabelstudent
14537 guerimand 84
 
14796 guerimand 85
!! ---- save zone content (only student zone)
86
!if $job2=savezone and $toolate!=yes
87
  !for zone=1 to $(nbrezonestudent)
88
    !readproc applet/$(ztypestudent$zone) displaysave student $zone 1 $wims_user
89
  !next zone
90
!endif
91
!readproc proc/studentusedspace.proc
92
!! ---- save file for zonetype=file
93
l=!makelist deposit X,erase X for X in $zonelistlabelstudent
94
l=!nospace $l
95
!if $job2 isitemof $l and $toolate!=yes
96
  nb=!char -1 of $job2
97
  !if $(ztypestudent$nb)=file
98
    job2=!char 1 to -2 of $job2
99
    !readproc applet/file displaysave student $nb 1 $wims_user
100
  !endif
101
  !reset job2
102
  !readproc proc/studentusedspace.proc
103
!endif
104
 
16568 guerimand 105
!if $seealltime=1
106
  remark=!record 0 of wimshome/log/classes/$wims_class/freeworksdata/$freework/co/.$wims_user
14537 guerimand 107
  remark=!replace internal : by : in $remark
108
!endif
109
 
16568 guerimand 110
!if $codownload=1 or $activetest>=2
111
  finalremark=!record 0 of wimshome/log/classes/$wims_class/freeworksdata/$freework/co/$wims_user
112
  finalremark=!replace internal : by : in $finalremark
113
!endif
14796 guerimand 114