xowf::test_item::Answer_manager method result_table per_question (protected)
<instance of xowf::test_item::Answer_manager> result_table per_question \ [ -manual_gradings manual_gradings ] results_dict
Defined in packages/xowf/tcl/test-item-procs.tcl
- Switches:
- -manual_gradings (optional)
- Parameters:
- results_dict (required)
- Testcases:
- No testcase defined.
Source code: set table [::xowiki::TableWidget new -name results -columns { Field create participant -label #xowf.participant# -orderby participant Field create question -label #xowf.question# Field create achieved -label #xowf.Achieved_points# -orderby achieved -html {align right} Field create achievable -label #xowf.Achievable_points# -orderby achievable -html {align right} Field create comment -label #xowf.feedback# }] foreach user_id [dict keys $results_dict] { set manual_grading [:dict_value $manual_gradings $user_id] set participant [acs_user::get_element -user_id $user_id -element username] foreach qn [dict keys [dict get $results_dict $user_id]] { set achievable [dict get $results_dict $user_id $qn achievable] set achieved [:dict_value [:dict_value $manual_grading $qn] achieved] if {$achieved eq ""} { set achieved [dict get $results_dict $user_id $qn achieved] } $table add -participant $participant -question [string trimright $qn _] -achievable $achievable -achieved [expr {$achieved eq "" ? "" : [format %.2f $achieved]}] -comment [:dict_value [:dict_value $manual_grading $qn] comment] } } return $tableXQL Not present: Generic, PostgreSQL, Oracle