Subversion Repositories wimsdev

Rev

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 for configfw : make general parameters of a freework
2
 
3
!! ---- make symbolic link to data file if needed
4
!if $type>1 and $activetest>0
14297 guerimand 5
  !sh cd $wims_home/$wims_sesdir;\
14572 bpr 6
    mkdir -p getfile;\
7
    cd getfile;\
8
    mkdir -p freeworksdata;\
9
    cd freeworksdata;\
10
    rm -f $freework;\
11
    ln -s $wims_home/log/classes/$wims_class/freeworksdata/$freework $freework;
14297 guerimand 12
!endif
13
 
17639 czzmrn 14
!! ---- access management
15
!read proc/access.proc
16
 
14297 guerimand 17
!if $save!=$empty and $job2=$empty
18
  success=goodsave
19
  !if $d2<=$d1
20
    warning=badsoldate
21
    !reset success
22
  !endif
23
  !if $freework>$nbfreework
14936 guerimand 24
    !bound scoring within 0,no default no
14297 guerimand 25
    update_content=0\
26
$class_expiration\
27
$title\
28
$desc\
29
$comment\
30
$type\
31
$deadline.$timedeadline\
32
$soldate.$timesoldate\
14339 guerimand 33
$sizelimitfile\
14537 guerimand 34
$scoring\
35
 
14297 guerimand 36
    activetest=0
37
    !sh mkdir -p $wims_home/log/classes/$wims_class/freeworks/$freework;
38
    !if $type>=2
14572 bpr 39
      !sh mkdir -p $wims_home/log/classes/$wims_class/freeworksdata/$freework/work;\
14297 guerimand 40
        mkdir -p $wims_home/log/classes/$wims_class/freeworksdata/$freework/co;
41
    !endif
42
  !else
43
    olddata=!record $freework of wimshome/log/classes/$wims_class/freeworks/.freeworks
17593 czzmrn 44
    !distribute line $olddata into activetest,bl,old_title,old_desc,old_comment,old_type,old_deadline,old_soldate,old_sizelimitfile,old_scoring,old_seealltime,old_studentclose
14889 guerimand 45
    !if $activetest>=2 or $warning=badsoldate
46
      soldate=!char 1 to 8 of $old_soldate
47
      timesoldate=!char 10 to 14 of $old_soldate
48
    !endif
14297 guerimand 49
    !if $activetest>=1
50
      deadline=!char 1 to 8 of $old_deadline
51
      timedeadline=!char 10 to 14 of $old_deadline
52
      sizelimitfile=$old_sizelimitfile
14537 guerimand 53
      seealltime=$old_seealltime
17593 czzmrn 54
      studentclose=$old_studentclose
14537 guerimand 55
      scoring=$old_scoring
14936 guerimand 56
    !else
57
      !if $old_scoring!=0 and $old_scoring!=no
58
        !if $scoring=no
59
          scoring=$[-abs($old_scoring)]
60
        !else
61
          scoring=$[abs($old_scoring)]
62
        !endif
63
      !else
64
        !bound scoring within 0,no default $old_scoring
65
      !endif
14297 guerimand 66
    !endif
14537 guerimand 67
    !bound seealltime between 0 and 1 default 0
17593 czzmrn 68
    !bound studentclose between 0 and 1 default 0
14297 guerimand 69
    update_content=$activetest\
70
$class_expiration\
71
$title\
72
$desc\
73
$comment\
74
$type\
75
$deadline.$timedeadline\
76
$soldate.$timesoldate\
14339 guerimand 77
$sizelimitfile\
14537 guerimand 78
$scoring\
17593 czzmrn 79
$seealltime\
80
$studentclose
14297 guerimand 81
  !endif
82
  update_field=$freework
17634 czzmrn 83
  update_nbline=$fw_nbline
14297 guerimand 84
 
85
  !read adm/uprecord wimshome/log/classes/$wims_class/freeworks/.freeworks
86
  !reset save
87
  nbfreework=!recordcnt wimshome/log/classes/$wims_class/freeworks/.freeworks
88
  name_title=$name_managefreework
14960 guerimand 89
  !readproc proc/mkglobalvar.proc
14297 guerimand 90
!endif
91
 
92
!! ---- job to add file to solution or subject
93
!for val in subject,solution
14537 guerimand 94
  !reset conditiontest
14297 guerimand 95
  !if $val=subject
14537 guerimand 96
    !if $activetest=0
97
      conditiontest=1
98
    !endif
14297 guerimand 99
  !else
14537 guerimand 100
    conditiontest=$putworkco
14297 guerimand 101
  !endif
102
  !if $job2=deposit$val and $wims_deposit!=$empty \
14537 guerimand 103
and / notin $wims_deposit and .. notin $wims_deposit and noname.file!=$wims_deposit
14297 guerimand 104
   !read proc/checkfilename.proc
105
   !if $error!=$empty
106
     !exit
107
   !endif
108
   success=goodaddfile
14537 guerimand 109
   !ifval $conditiontest!=1
14297 guerimand 110
      error=badstatut$val
111
      !reset success
112
   !else
113
      !sh mkdir -p $wims_home/log/classes/$wims_class/freeworks/$freework;\
114
          mv $wims_home/$wims_sesdir/user-deposit $wims_home/log/classes/$wims_class/freeworks/$freework/$newfilename
115
      !readproc adm/class/quotafree.proc proc
116
      !if $quota_free<0
117
        !sh rm -f $wims_home/log/classes/$wims_class/freeworks/$freework/$newfilename
118
        error=quota_file
119
        !reset success
120
      !else
14537 guerimand 121
        !default field_$val=$[$nb+1]
122
        update_field=$(field_$val)
123
        !if $newfilename notitemof $(flist$val)
124
          flist$val=!append item $newfilename to $(flist$val)
125
          update_content=!items2lines $(flist$val)
14313 guerimand 126
          update_content=!nonempty line $update_content
14537 guerimand 127
          update_content=$val\
128
$update_content
14313 guerimand 129
          !read adm/uprecord wimshome/log/classes/$wims_class/freeworks/.freework$freework
130
        !endif
14297 guerimand 131
      !endif
132
    !endif
14796 guerimand 133
    !reset job2
14297 guerimand 134
  !endif
135
!next val
136
 
14537 guerimand 137
!!------  job to erase file
138
!reset eraselist
139
!if $putworkco=1
14297 guerimand 140
  !if $activetest=0
141
    eraselist=!append item $flistsubject to $flistsolution
142
    eraselist=!listuniq $eraselist
143
  !else
144
    eraselist=$flistsolution
14537 guerimand 145
    eraselist=!listcomplement $flistsubject in $eraselist
14297 guerimand 146
  !endif
14796 guerimand 147
  !if $job2 isitemof erasesubject,erasesolution and $namefile!=$empty
148
    namefile=!listintersect $namefile and $eraselist
14297 guerimand 149
    !sh rm -f $wims_home/log/classes/$wims_class/freeworks/$freework/$namefile
14537 guerimand 150
    !for val in subject,solution
151
      !if $namefile isitemof $(flist$val)
152
        flist$val=!listcomplement $namefile in $(flist$val)
153
        update_field=$(field_$val)
154
        update_content=!items2lines $(flist$val)
155
        update_content=!nonempty line $update_content
156
        update_content=$val\
157
$update_content
158
        !read adm/uprecord wimshome/log/classes/$wims_class/freeworks/.freework$freework
159
      !endif
160
    !next val
14297 guerimand 161
    success=gooderasefile
14537 guerimand 162
    eraselist=!listcomplement $namefile in $eraselist
14796 guerimand 163
    !reset job2
14297 guerimand 164
  !endif
165
!endif
14537 guerimand 166
 
167
!! ---- manage file of the freework
168
!read adm/class/quotafree.proc proc
169
 
16554 guerimand 170
!if $codownload=1
171
  !readproc wimshome/log/classes/$wims_class/freeworksdata/$freework/.seeco
172
!endif
173
 
17681 czzmrn 174
!if $studentclose=1 and $activetest>0
17598 czzmrn 175
  !if $job2=reopen and $quser!=$empty and $now<$d1
176
    !setdef freework_closeco_$quser=$empty in wimshome/log/classes/$wims_class/freeworksdata/$freework/.closeco
17681 czzmrn 177
    !reset job2 quser
17598 czzmrn 178
  !endif
17593 czzmrn 179
  !readproc wimshome/log/classes/$wims_class/freeworksdata/$freework/.closeco
180
!endif
181
 
16087 guerimand 182
!if $type>=3
14537 guerimand 183
  !read proc/freeworkdata$(lpara_type[$type]).proc
184
!endif
185
 
14297 guerimand 186
!readproc proc/iserasable.proc $freework
16542 guerimand 187
!read tabletheme