Subversion Repositories wimsdev

Rev

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