xowf::test_item::Answer_manager method grading_scheme (public)
<instance of xowf::test_item::Answer_manager> grading_scheme \ -examWf examWf [ -grading grading ] \ [ -total_points total_points ]
Defined in packages/xowf/tcl/test-item-procs.tcl
Return the grading scheme object based on the provided short name. In case the grading scheme belongs to the predefined grading schemes, the object can be directly loaded. When the name refers to a user-defined grading object, this might have to be loaded. We could consider some hints about the usefulness of the chosen grading scheme, E.g., when an exam has 40 points or less, rounding has the potential effect that a high percentage of the grade is just due to rounding. So, in such cases a non-rounding scheme should be preferred.
- Switches:
- -examWf (required, object)
- -grading (optional)
- -total_points (optional, defaults to
"100"
)- Returns:
- fully qualified grading scheme object
- Testcases:
- No testcase defined.
Source code: # # When not grading is provided, this muse be a legacy question. # if {$grading eq ""} { #set grading [expr {$total_points < 40 ? "round-none" : "round-points"}] set grading "none" ns_log notice "--- legacy grading scheme -> none" } set grading_scheme ::xowf::test_item::grading::$grading if {![nsf::is object $grading_scheme]} { # # Maybe we have to load this grading scheme... # #ns_log notice "grading_scheme_name load loaded yet: '$grading'" #::xo::show_stack ::xowf::test_item::grading::load_grading_schemes -package_id [$examWf package_id] -parent_id [$examWf parent_id] ns_log notice "--- grading schemes loaded" } if {![nsf::is object $grading_scheme]} { set grading_scheme ::xowf::test_item::grading::round-points ns_log notice "--- fallback to default grading scheme object" } #ns_log notice "USE grading_scheme $grading_scheme" return $grading_schemeXQL Not present: Generic, PostgreSQL, Oracle