Rev 15771 | Blame | Compare with Previous | Last modification | View Log | RSS feed
sec=!defof class_secure in wimshome/log/classes/$wims_class/.def
sec=!trim $sec
htest=!checkhost $sec
!if ($sec=$empty or $htest<1) and $wims_ismanager<2
error=not_secure
!exit
!endif
!readdef wimshome/log/classes/$wims_class/neighbors
tmp_recshare=!defof class_recshare in wimshome/log/classes/$wims_class/.def
!if ($sharable_sheet!=$empty or $sharing_sheet!=$empty or $tmp_recshare=main) and share notwordof $confirmed
!reset tmp_recshare
!if $confirm=yes and $wims_ismanager>1
confirmed=share
confirm=
!else
!!!verification a faire ....
!if $wims_superclass=$empty or $wims_superclass=$wims_class
!for cl_ in $sharable_sheet
!set tmp=!defof sharing_sheet in wimshome/log/classes/$cl_/neighbors
!if $wims_class iswordof $tmp
confirm=
confirmed=
error=sharing_sheet
!reset tmp
!exit
!endif
!next
!else
confirm=
confirmed=
error=sharing_sheet
!exit
!endif
!endif
!endif
tmpcnt=!recordcnt wimshome/log/classes/$wims_class/exams/.exams
!for exa=1 to $tmpcnt
examtest=!sh grep '\<$sheet\.' $wims_home/log/classes/$wims_class/exams/.exam$exa | grep -v ':'
!if $examtest!=$empty
!!supplementary check
tmp=!recordcnt wimshome/log/classes/$wims_class/exams/.exam$exa
!for tmp2=1 to $tmp
tmp_l=!record $tmp2 of wimshome/log/classes/$wims_class/exams/.exam$exa
tmp_l=!line 2 of $tmp_l
examtest=!sh echo '$tmp_l' | grep '\<$sheet\.'
!if $examtest!=$empty
error=sheet_in_exam $exa
!exit
!endif
!next
!endif
!next
worktest=!sh cd $wims_home/log/classes/$wims_class\
list=`ls score | grep -v '\.exam$$'`\
if [ ! -e "$$list" ]; then\
cd score; awk 'length($$1)==17 && $$3==$sheet {print FILENAME; nextfile}' $$list\
fi
!if $worktest!=$empty
worktest2=!replace word supervisor by $ in $worktest
worktest2=!trim $worktest2
!if $confirm!=yes or (share iswordof $confirmed and $worktest2!=$empty)
error=non_empty_activities
!exit
!else
worktest=!singlespace $worktest
!sh cd $wims_home/log/classes/$wims_class\
for user in $worktest\
do\
awk 'length($$1)!=17 || $$3!=$sheet {print}' score/$$user >awk.tmp1\
awk 'length($$1)==17 && $$3==$sheet {print $$0" deact noscore"}' score/$$user >awk.tmp2\
mv awk.tmp1 score/$$user\
cat awk.tmp2 >>noscore/$$user\
done\
rm -f awk.tmp*
!endif
!endif
!distribute item 1,0 into update_field,update_content
!read update.sheet
!read adm/sheet/writeweights
job=
wims_class_log=deactivate sheet $sheet by $wims_realuser