Index: openacs-4/packages/xowf/lib/inclass-exam.wf =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowf/lib/Attic/inclass-exam.wf,v diff -u -N -r1.1.2.65 -r1.1.2.66 --- openacs-4/packages/xowf/lib/inclass-exam.wf 23 Apr 2021 21:26:13 -0000 1.1.2.65 +++ openacs-4/packages/xowf/lib/inclass-exam.wf 24 Apr 2021 19:31:34 -0000 1.1.2.66 @@ -50,6 +50,7 @@ # - "print-answers" (for lecturers), # - "print-answer-table" (for lecturers), # - "print-participants" (for lecturers), +# - "exam-summary" (for lecturers), # - "delete" (for lecturers), # - "qrcode" (for lecturers) # @@ -169,6 +170,7 @@ :proc load_form {ctx title} { set obj [$ctx object] set state [$obj property _state] + set proctoring [$obj property proctoring 0] set combined_form_info [::xowf::test_item::question_manager combined_question_form -with_numbers $obj] set fullQuestionForm [dict get $combined_form_info form] @@ -177,72 +179,18 @@ #:log fullQuestionForm=$fullQuestionForm set text "

$title

" set menu "" - set proctoring [$obj property proctoring 0] - set synchronized [$obj property synchronized 0] - set allow_paste [$obj property allow_paste 1] - set max_items [$obj property max_items ""] - set time_window [$obj property time_window ""] - append text [subst {

- [expr {$synchronized ? "" : "Non-"}]Synchronized Exam - [expr {$proctoring ? " with Proctoring" : ""}] -

}] - set question_objs [dict get $combined_form_info question_objs] - set nrQuestions [llength $question_objs] - set randomizationOk [dict get $combined_form_info randomization_for_exam] - set autograde [dict get $combined_form_info autograde] - set revision_sets [$obj get_revision_sets] - set published_periods [xowf::test_item::answer_manager state_periods $revision_sets -state published] - set review_periods [xowf::test_item::answer_manager state_periods $revision_sets -state submission_review] - set total_minutes [xowf::test_item::question_manager total_minutes -max_items $max_items $combined_form_info] - set total_points [xowf::test_item::question_manager total_points -max_items $max_items $combined_form_info] - set max_items_msg "" + set text [::xowf::test_item::question_manager exam_info_block \ + -combined_form_info $combined_form_info \ + $obj] + set detail_link [$obj pretty_link -query m=exam-summary] + append text "

#xowf.detailed_summary#

" - if {$max_items ne ""} { - set all_minutes [lmap t [dict get $combined_form_info title_infos] { - dict get $t minutes - }] - if {[llength [lsort -unique $all_minutes]] != 1} { - set max_items_msg [_ xowf.Max_items_not_ok_duration [list n $max_items]] - } elseif {$max_items > [llength $all_minutes]} { - set max_items_msg [_ xowf.Max_items_not_ok_number [list n $max_items]] - } else { - set max_items_msg [_ xowf.Max_items_ok [list n $max_items]] - } - } - - set time_window_msg "" - if {$time_window ne ""} { - set dtstart [dict get $time_window time_window.dtstart] - if {$dtstart ne ""} { - regsub -all T $dtstart " " dtstart - set dtend [dict get $time_window time_window.dtend] - set time_window_msg
[_ xowf.Automatically_published_from_to [list from $dtstart to $dtend]] - set time_window_msg "
Automatische Freischaltung der Prüfung von $dtstart bis $dtend" - } - } - - append text [subst { -

- [expr {$max_items_msg ne "" ? "$max_items_msg" : ""}] - $nrQuestions [expr {$nrQuestions == 1 ? "#xowf.question#" : "#xowf.questions#"}], - $total_minutes #xowf.Minutes#, $total_points #xowf.Points#
- [expr {$autograde ? "#xowf.exam_review_possible#" : "#xowf.exam_review_not_possible#"}]
- [expr {$randomizationOk ? "#xowf.randomization_for_exam_ok#" : "#xowf.randomization_for_exam_not_ok#"}]
- [expr {$allow_paste ? "#xowf.Cut_and_paste_allowed#" : "#xowf.Cut_and_paste_not_allowed#"}]
- $time_window_msg - [expr {[llength $published_periods] > 0 ? "
#xowf.inclass-exam-open#: [join $published_periods {, }]
" : ""}] - [expr {[llength $review_periods] > 0 ? "#xowf.inclass-exam-review#: [join $review_periods {, }]
" : ""}] -

- }] - set wf [xowf::test_item::answer_manager get_answer_wf $obj] if {$wf eq ""} { :msg "cannot get current workflow for [$obj name]" - set lLink "." set tLink "." set aLink "." - set pLink "." } else { # # Always compute the test-run and answer link. @@ -270,7 +218,7 @@ set answers [xowf::test_item::answer_manager get_answers $wf] # - # Per default, the entries are disabled. when there are answers, + # Per default, the entries are disabled. When there are answers, # these will be enabled. # set link_disabled [expr {[llength $answers] == 0 ? "link-disabled" : ""}] @@ -531,6 +479,15 @@ } ######################################################################## + # web-callable method "exam-summary" + # + # Print a summary of the exam-questions. + # + :proc www-exam-summary {} { + :www-view [::xowf::test_item::question_manager exam_summary [self]] + } + + ######################################################################## # web-callable method "print-answers" # # Print the answers in a somewhat printer friendly way. @@ -566,7 +523,7 @@ set grading_scheme ::xowf::test_item::grading::wi1 } #ns_log notice "USE grading_scheme $grading_scheme" - + set grade_dict {} set grade_csv "" @@ -850,7 +807,7 @@ } set return_url [:query_parameter local_return_url:localurl [:pretty_link]] - append HTML "

#xowiki.back#

\n" + append HTML "

#xowiki.back#

\n" } #::xo::cc set_parameter template_file view-plain-master #::xo::cc set_parameter MenuBar 0