Index: openacs-4/packages/xowf/tcl/test-item-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowf/tcl/test-item-procs.tcl,v diff -u -N -r1.7.2.206 -r1.7.2.207 --- openacs-4/packages/xowf/tcl/test-item-procs.tcl 24 Jan 2022 18:11:37 -0000 1.7.2.206 +++ openacs-4/packages/xowf/tcl/test-item-procs.tcl 27 Jan 2022 09:29:20 -0000 1.7.2.207 @@ -3340,8 +3340,24 @@ return "" } } - set answerAttributes \ + + # + # We have to distinguish between the answered attributes (based + # on the instance attributes in the database) and the answer + # attributes, which should be rendered. The latter one might be + # a subset, especially in cases, where filtering (e.g., show + # only one question of all candidates) happens. + # + set answeredAnswerAttributes \ [:FL answer_attributes [$submission instance_attributes]] + set formAnswerAttributeNames \ + [dict keys [:FL name_to_question_obj_dict $form_objs]] + set usedAnswerAttributes {} + foreach {k v} $answeredAnswerAttributes { + if {$k in $formAnswerAttributeNames} { + dict set usedAnswerAttributes $k $v + } + } # # "render_full_submission_form" calls "summary_form" to obtain the @@ -3372,7 +3388,7 @@ -manual_grading [:dict_value $manual_gradings $user_id] \ -submission $submission \ -exam_question_dict $exam_question_dict \ - -answer_attributes $answerAttributes] + -answer_attributes $usedAnswerAttributes] dict set achieved_points totalPoints $totalPoints #ns_log notice "achieved_points [dict get $achieved_points details]"