Rev 16029 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
12274 | bpr | 1 | !!### score, mode (for mode=legend, score can be empty) |
2 | |||
7943 | bpr | 3 | !distribute items $wims_read_parm into t0_,tc_ |
12399 | bpr | 4 | !! last color is for unfinished exercise |
7770 | bpr | 5 | |
14838 | obado | 6 | !set colorhexa=#FF0000,#FF0000,#FF0000,#FF9922,#FF9922,#FF9922,#FFE338,#FFE338,#00B000,#008F00,#008F00,#FFFFFF |
7943 | bpr | 7 | !set class_scorecolor=!nonempty items $class_scorecolor |
12447 | bpr | 8 | !set class_scorecolorcnt=!itemcnt $class_scorecolor |
9 | !!color unfinished |
||
12463 | bpr | 10 | !if $class_scorecolorcnt<12 and $class_scorecolorcnt>0 |
12447 | bpr | 11 | !set class_scorecolor=$class_scorecolor,#D3D3D3 |
12 | !endif |
||
7943 | bpr | 13 | !if $class_scorecolor=$empty |
1953 | guerimand | 14 | !set class_scorecolor=!defof class_scorecolor in wimshome/log/classes/$wims_class/.def |
7770 | bpr | 15 | !set class_scorecolor=!nonempty items $class_scorecolor |
16 | !default class_scorecolor=$colorhexa |
||
7943 | bpr | 17 | !endif |
12463 | bpr | 18 | |
10454 | obado | 19 | !set class_scorecolor=!replace internal white by $(colorhexa[1]) in $class_scorecolor |
20 | !set class_scorecolor=!replace internal red by $(colorhexa[2]) in $class_scorecolor |
||
21 | !set class_scorecolor=!replace internal orange by $(colorhexa[5]) in $class_scorecolor |
||
22 | !set class_scorecolor=!replace internal yellow by $(colorhexa[8]) in $class_scorecolor |
||
23 | !set class_scorecolor=!replace internal green by $(colorhexa[10]) in $class_scorecolor |
||
7942 | obado | 24 | |
7943 | bpr | 25 | !default tc_=background |
7772 | bpr | 26 | |
7943 | bpr | 27 | !if $t0_=$empty |
28 | !exit |
||
29 | !endif |
||
7908 | obado | 30 | |
7943 | bpr | 31 | !goto $tc_ |
7908 | obado | 32 | |
7943 | bpr | 33 | :background |
34 | !set style_note="background-color:$(class_scorecolor[$t0_+1]);" class="wims_sheet_score" |
||
16772 | czzmrn | 35 | !exit |
7943 | bpr | 36 | |
16772 | czzmrn | 37 | :htmlcolor |
38 | !set note_color=$(class_scorecolor[$t0_+1]) |
||
7943 | bpr | 39 | !exit |
16772 | czzmrn | 40 | |
7943 | bpr | 41 | :color |
42 | |||
12264 | bpr | 43 | !set style_note=" |
16029 | bpr | 44 | !if $(class_scorecolor[$t0_+1]) issametext #FFFFFF |
13605 | obado | 45 | !set style_note=$style_note;color:#666; |
1953 | guerimand | 46 | !else |
16027 | bpr | 47 | !set style_note=$style_note;color:$(class_scorecolor[$t0_+1]); |
7943 | bpr | 48 | !endif |
12286 | obado | 49 | !set style_note=$style_note" class="wims_sheet_score |
7943 | bpr | 50 | |
13167 | bpr | 51 | !! Add Trophy icon fo scores >=8 |
52 | !if $t0_>=9.5 |
||
12342 | bpr | 53 | !set style_note=$style_note trophy3 |
12286 | obado | 54 | !endif |
13167 | bpr | 55 | !if $t0_>=9 and $t0_<9.5 |
12342 | bpr | 56 | !set style_note=$style_note trophy2 |
57 | !endif |
||
13167 | bpr | 58 | !if $t0_>=8 and $t0_<9 |
12342 | bpr | 59 | !set style_note=$style_note trophy1 |
60 | !endif |
||
12286 | obado | 61 | !set style_note=$style_note" |
7943 | bpr | 62 | !exit |
63 | :livret |
||
64 | |||
12264 | bpr | 65 | !let t_=!charcnt $t0_ |
66 | !if $t_>1 or ($t_=1 and $t0_>0) |
||
1953 | guerimand | 67 | !let t_=$t0_+0.0000001 |
12264 | bpr | 68 | !else |
1953 | guerimand | 69 | !let t_=0 |
12264 | bpr | 70 | !endif |
12440 | guerimand | 71 | |
12264 | bpr | 72 | !set style_note="background-color:$(wims_scorecolor[$[ceil(min($t_,10))+1]]);" |
7943 | bpr | 73 | |
74 | !! approximation of score in case of livret : |
||
12482 | guerimand | 75 | !set value_note=$[rint(($t0_)*10^(max(0,$wims_scoreview)))/10^(max(0,$wims_scoreview))] |
12264 | bpr | 76 | !if $wims_scoreview>=0 and $t_>0 |
12440 | guerimand | 77 | !set output_note=$value_note |
12264 | bpr | 78 | !else |
79 | !set output_note= |
||
80 | !endif |
||
12440 | guerimand | 81 | !if $t_=0 |
82 | !set value_note=-1 |
||
83 | !endif |
||
12274 | bpr | 84 | !exit |
85 | |||
86 | :legend |
||
12283 | bpr | 87 | !set output_legend=<fieldset class="wims_score_bar_legend">\ |
88 | <legend>$wims_name_legend</legend><ul>\ |
||
12399 | bpr | 89 | <li style="background-color:$(class_scorecolor[12])"> </li> |
12274 | bpr | 90 | !for j=0 to 10 |
12379 | obado | 91 | !set output_legend=$output_legend<li style="background-color:$(class_scorecolor[$j+1])">$j</li> |
12274 | bpr | 92 | !next |
12278 | obado | 93 | !set output_legend=$output_legend</ul></fieldset> |