Index: openacs-4/packages/xowf/lib/inclass-exam.wf =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowf/lib/inclass-exam.wf,v diff -u -r1.1.2.103 -r1.1.2.104 --- openacs-4/packages/xowf/lib/inclass-exam.wf 21 Nov 2022 19:46:19 -0000 1.1.2.103 +++ openacs-4/packages/xowf/lib/inclass-exam.wf 15 Dec 2022 19:28:20 -0000 1.1.2.104 @@ -43,17 +43,17 @@ # The policy has to allow the following methods on FormPages: # # - "answer" (for students), -# - "proctor" (for students), -# - "view-my-exam" (for students), +# - "delete" (for lecturers), # - "edit" (for students), +# - "exam-results" (for lecturers), # - "poll" (for lecturers), # - "print-answers" (for lecturers), -# - "print-answer-table" (for lecturers), # - "print-participants" (for lecturers), +# - "proctor" (for students), +# - "qrcode" (for lecturers) # - "question-summary" (for lecturers), -# - "delete" (for lecturers), # - "toggle-publish-status" (for lecturers), -# - "qrcode" (for lecturers) +# - "view-my-exam" (for students), # # Gustaf Neumann, Feb 2012-2021 ######################################################################## @@ -264,8 +264,10 @@ # } - set answers [$obj AM get_answer_attributes $wf] - + set answers [:AM get_answer_attributes $wf] + set results [:AM get_exam_results -obj $obj results] + set autograded [dict get $combined_form_info autograde] + set grading_scheme_name [$obj property grading] # # Per default, the entries are disabled. When there are answers, # these will be enabled. @@ -275,15 +277,23 @@ listing {obj $wf m list label #xowf.online-exam-exam_instances# icon list} participants {obj $obj m print-participants label #xowf.Participants# icon user} protocol {obj $obj m print-answers label #xowf.online-exam-protocol# icon list-alt} - results {obj $obj m print-answer-table label #xowf.online-exam-results-table# icon th-list} + grades {obj $obj m exam-results label #xowf.Points_and_grades# icon graph-up-arrow} }] if {![acs_user::site_wide_admin_p -user_id [::xo::cc user_id]]} { dict unset md listing } - dict unset md results ;# deactivate results for now - #ns_log notice ALL=$text + ns_log notice "ANSWERS grading_scheme_name $grading_scheme_name $answers resultsNr [llength $results], autograde [dict get $combined_form_info autograde]" + # + # We assume here that when we have results, we have also some points. + # + if {[llength $results] == 0} { + dict unset md grades + } elseif {$grading_scheme_name in {"" "none"}} { + dict set grades label "Points" + } + #ns_log notice ALL=$text set menu "