Rev 16513 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
16087 | guerimand | 1 | sdir=$wims_home/$wims_sesdir |
2 | cdir=$wims_home/log/classes/$wims_class |
||
3 | |||
16307 | guerimand | 4 | nbexo=!recordcnt wimshome/log/classes/$wims_class/freeworks/.Wfreework$freework |
16087 | guerimand | 5 | !bound exolog between 1 and $nbexo default $empty |
6 | !if $exolog=$empty |
||
7 | error=exolog-noexo |
||
8 | job=student |
||
9 | !changeto var.proc |
||
10 | !endif |
||
16647 | guerimand | 11 | !! --------- checking work is valid exolog and freework |
12 | test=!defof w_wims_fwexo,w_wims_fwnumber in wimshome/sessions/$wims_session/var |
||
13 | !distribute item $test into fwexo,fwnumber |
||
14 | !if $fwexo!=$exolog or $fwnumber!=$freework |
||
15 | error=exolog-badparameter |
||
16 | job=student |
||
17 | !changeto var.proc |
||
18 | !endif |
||
16087 | guerimand | 19 | |
20 | !! ------ no register if exercise already exists |
||
16307 | guerimand | 21 | test=!fileexists wimshome/log/classes/$wims_class/freeworksdata/$freework/work/$(wims_user)-wimsexo/$exolog |
16087 | guerimand | 22 | !if $test=yes |
23 | error=exolog-exoexists |
||
24 | job=student |
||
25 | !changeto var.proc |
||
26 | !endif |
||
27 | |||
16647 | guerimand | 28 | !! ------ testing if score is enough for exo to be registered |
29 | score=!defof w_module_score in wimshome/$wims_sesdir/exolog |
||
16513 | guerimand | 30 | !if $score<$wims_fwminscore |
31 | error=exolog-badscore |
||
32 | job=student |
||
33 | !changeto var.proc |
||
34 | !endif |
||
16087 | guerimand | 35 | |
16647 | guerimand | 36 | |
16307 | guerimand | 37 | !sh mkdir -p $cdir/freeworksdata/$freework/work/$(wims_user)-wimsexo;\ |
38 | mv $sdir/exolog $cdir/freeworksdata/$freework/work/$(wims_user)-wimsexo/$exolog; |
||
16087 | guerimand | 39 | !! replace the name of images by rename by the true name when saving |
40 | rename_list =!record 0 of wimshome/$wims_sesdir/.rename |
||
41 | rename_list_cnt=!linecnt $rename_list |
||
42 | !for l=1 to $rename_list_cnt |
||
43 | rename_l=!line $l of $rename_list |
||
44 | rename_l=!replace internal : by , in $rename_l |
||
45 | rename_l=!replace internal ? by \? in $rename_l |
||
16307 | guerimand | 46 | !sh perl -np -i -e 's:$(rename_l[2]):$(rename_l[1]):g' $cdir/freeworksdata/$freework/work/$(wims_user)-wimsexo/$exolog |
16087 | guerimand | 47 | !next l |
48 | wims_fwlistexo=!listcomplement $exolog in $wims_fwlistexo |
||
49 | !setdef wims_fwlistexo=$wims_fwlistexo in wimshome/sessions/$wims_session/var.stat |
||
50 | job=student |
||
51 | !changeto var.proc |