Rev 17419 | Rev 17423 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 17419 | Rev 17420 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | !! make a progress bar for exam |
1 | !! make a progress bar for exam |
2 | !! for the moment only compatible for course mode |
2 | !! for the moment only compatible for course mode |
3 | !! wims_read_parm is list of |
3 | !! wims_read_parm is list of scores for each exercise (-1=noscore) |
4 | !! output : wims_progressbar |
4 | !! output : wims_progressbar |
5 | !! if $wims_read_parm is empty list of score is calculated |
5 | !! if $wims_read_parm is empty list of score is calculated |
6 | 6 | ||
7 | !if $wims_read_parm!=$empty |
7 | !if $wims_read_parm!=$empty |
8 | progressbar_=$wims_read_parm |
8 | progressbar_=$wims_read_parm |
9 | !goto html |
9 | !goto html |
10 | !endif |
10 | !endif |
11 | 11 | ||
12 | !! ---- calculate list of score only work for exam in course mode |
12 | !! ---- calculate list of score only work for exam in course mode |
13 |
|
13 | wims_pses=!translate _ to , in $wims_session |
14 |
|
14 | t_=!replace internal exam by $empty in $(wims_pses[2]) |
15 |
|
15 | t_=!replace internal t by , in $t_ |
16 |
|
16 | !distribute item $t_ into bl,bl,exo_ |
17 |
|
17 | pos_=!positionof item $exo_ in $(wims_exrandomlist[1;]) |
18 |
|
18 | !if $pos_>1 |
19 |
|
19 | progressbar_=!values 10 for v=1 to $[$pos_-1] |
20 |
|
20 | !else |
21 |
|
21 | !reset progressbar_ |
22 |
|
22 | !endif |
23 |
|
23 | sco_=$module_score |
24 |
|
24 | !default sco_=-1 |
25 |
|
25 | progressbar_=!append item $sco_ to $progressbar_ |
26 |
|
26 | tmp_=!itemcnt $(wims_exrandomlist[1;]) |
27 |
|
27 | !if $pos_<$tmp_ |
28 |
|
28 | tmp_=!values -1 for v=$[$pos_+1] to $tmp_ |
29 |
|
29 | progressbar_=!append item $tmp_ to $progressbar_ |
30 |
|
30 | !endif |
31 | 31 | ||
32 | :html |
32 | :html |
33 | wims_progressbar=<div class="inline wims_score_bar"> |
33 | wims_progressbar=<div class="inline wims_score_bar"> |
34 | !for i_ in $progressbar_ |
34 | !for i_ in $progressbar_ |
35 | !if $i_=10 |
35 | !if $i_=10 |