- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables
Class ::xowiki::formfield::enumeration
::xowiki::formfield::enumeration create ... \
[ -category_tree category_tree ] \
[ -descriptions (default "") ]
Defined in
Class Relations
- class: ::xotcl::Class
- superclass: ::xowiki::formfield::ShuffleField
- subclass: ::xowiki::formfield::checkbox, ::xowiki::formfield::select, ::xowiki::formfield::radio
::xotcl::Class create ::xowiki::formfield::enumeration \ -superclass ::xowiki::formfield::ShuffleFieldMethods (to be applied on instances)
scores (scripted, public)
<instance of xowiki::formfield::enumeration> scores [ -r r ] \ [ -f f ] [ -rk rk ] [ -fk fk ] [ -R R ] [ -W W ]
- Switches:
- -r (optional, defaults to
"0"
)- number of answers which are true
- -f (optional, defaults to
"0"
)- number of answers which are false
- -rk (optional, defaults to
"0"
)- number checkmarks to a true answer
- -fk (optional, defaults to
"0"
)- number checkmarks to a false answer
- -R (optional)
- number correct answered
- -W (optional)
- number incorrect answered
- Testcases:
- create_test_items
# # Now calculate the scores of different scoring schemes. # if {$r > 0} { # # Certain correction schemes divide by $r. We cannot use # these schemes in such cases. # if {$f == 0} { # # No penalty for marking a wrong solution, when there is # no wrong solution. # set wi1 [expr {max((100.0/$r) * $rk, 0)}] set wi2 [expr {max((100.0/$r) * $rk, 0)}] } else { set wi1 [expr {max((100.0/$r) * $rk - (100.0/$f) * $fk, 0)}] if {$f == 1} { # # Special rule when there is just one wrong solution. # set wi2 [expr {max((100.0/$r) * $rk - min(50.0, (100.0/$f)) * $fk, 0)}] } else { set wi2 $wi1 } } set canvas [expr {max(($rk * 100.0/$r) - ($fk * 100.0/$r), 0)}] set etk [expr {100.0 * (($r*1.0+$f) /$r) * ($rk - $fk) / ($R + $W) }] } else { set wi1 0.0 set wi2 0.0 set etk 0.0 set canvas 0.0 } set s1 [expr {100.0 * $R / ($R + $W) }] set s2 [expr {100.0 * ($R - $W/2.0) / ($R + $W) }] set ggw0 [expr {100.0 * ($R - $W) / ($R + $W) }] set ggw [:ggw $R $W] return [list wi1 $wi1 wi2 $wi2 s1 $s1 s2 $s2 etk $etk ggw0 $ggw0 ggw $ggw canvas $canvas]
- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables