Index: openacs-4/packages/xowf/catalog/xowf.de_DE.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowf/catalog/xowf.de_DE.ISO-8859-1.xml,v diff -u -N -r1.2.2.29 -r1.2.2.30 --- openacs-4/packages/xowf/catalog/xowf.de_DE.ISO-8859-1.xml 11 May 2020 14:14:10 -0000 1.2.2.29 +++ openacs-4/packages/xowf/catalog/xowf.de_DE.ISO-8859-1.xml 17 May 2020 18:52:23 -0000 1.2.2.30 @@ -101,7 +101,7 @@ Quiz ... Abgabe der Pr�fung - Pr�fung ist abgegeben + Ihre Pr�fung ist abgegeben und gespeichert. W�hlen Sie Fragen mittels Drag & Drop aus @@ -132,9 +132,9 @@ Anordnungsfrage Entwurf des Inclass-Exams (nicht freigegeben) - Inclass-Exam ge�ffnet (Zur Bearbeitung freigegeben) + Inclass-Exam freigeschaltet Inclass-Exam geschlossen - Inclass-Exam geschlossen (Einsicht ge�ffnet) + Einsicht ge�ffnet Die Einsicht f�r diese Pr�fung ist nicht ge�ffnet. Anzahl der �nderungen 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.32 -r1.1.2.33 --- openacs-4/packages/xowf/lib/inclass-exam.wf 3 May 2020 14:15:58 -0000 1.1.2.32 +++ openacs-4/packages/xowf/lib/inclass-exam.wf 17 May 2020 18:52:23 -0000 1.1.2.33 @@ -162,16 +162,21 @@ [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 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] + append text [subst { -

$nrQuestions [expr {$nrQuestions == 1 ? "#xowf.question#" : "#xowf.questions#"}], - [::xowf::test_item::question_manager total_minutes $combined_form_info] #xowf.Minutes#,
- [expr {$autograde ? "#xowf.exam_review_possible#" : "#xowf.exam_review_not_possible#"}],
- [expr {$randomizationOk ? "#xowf.randomization_for_exam_ok#" : "#xowf.randomization_for_exam_not_ok#"}]. +

$nrQuestions [expr {$nrQuestions == 1 ? "#xowf.question#" : "#xowf.questions#"}] + [::xowf::test_item::question_manager total_minutes $combined_form_info] #xowf.Minutes#
+ [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 {[llength $published_periods] > 0 ? "
#xowf.inclass-exam-open#: [join $published_periods {, }]
" : ""}] + [expr {[llength $review_periods] > 0 ? "#xowf.inclass-exam-review#: [join $review_periods {, }]
" : ""}]

}] 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.60 -r1.7.2.61 --- openacs-4/packages/xowf/tcl/test-item-procs.tcl 11 May 2020 14:14:10 -0000 1.7.2.60 +++ openacs-4/packages/xowf/tcl/test-item-procs.tcl 17 May 2020 18:52:23 -0000 1.7.2.61 @@ -1146,8 +1146,6 @@ # - get_wf_instances # - get_answers # - # - get_duration - # - get_IPs # - runtime_panel # # - marked_results @@ -1156,7 +1154,12 @@ # - grading_table # - grade # - participants_table + # + # - get_duration + # - get_IPs # - revisions_up_to + # - last_time_in_state + # - state_periods # :public method create_workflow { @@ -1318,7 +1321,7 @@ set first [lindex $revision_sets 0] set last [lindex $revision_sets end] - set fromClock [clock scan [::xo::db::tcl_date [ns_set get $first creation_date] tz]] + set fromClock [clock scan [::xo::db::tcl_date [ns_set get $first creation_date] tz]] set toClock [clock scan [::xo::db::tcl_date [ns_set get $last creation_date] tz]] dict set r fromClock $fromClock dict set r toClock $toClock @@ -1371,9 +1374,9 @@ } ######################################################################## - :method last_time_in_state { -obj:object -state:required } { + :public method last_time_in_state {revision_sets -state:required -with_until:switch } { set result "" - foreach ps [$obj get_revision_sets] { + foreach ps $revision_sets { if {$state eq [ns_set get $ps state]} { set result [ns_set get $ps creation_date] } @@ -1382,6 +1385,56 @@ } ######################################################################## + :method pretty_period {{-dayfmt %q} {-timefmt %H:%M} from to} { + set from_day [lc_time_fmt $from $dayfmt] + set from_time [lc_time_fmt $from $timefmt] + if {$to ne ""} { + set to_day [lc_time_fmt $to $dayfmt] + set to_time [lc_time_fmt $to $timefmt] + } else { + set to_day "" + set to_time "" + } + if {$to_day eq ""} { + set period "$from_day, $from_time -" + } elseif {$from_day eq $to_day} { + set period "$from_day, $from_time - $to_time" + } else { + set period "$from_day, $from_time - $to_day, $to_time" + } + return $period + } + + ######################################################################## + :public method state_periods {revision_sets -state:required} { + set periods "" + set from "" + set last_from "" + set until "" + foreach ps $revision_sets { + set current_state [ns_set get $ps state] + if {$state eq $current_state} { + if {$until ne ""} { + lappend periods [:pretty_period $last_from $until] + } + set from [ns_set get $ps creation_date] + set until "" + } elseif {$until eq "" && $current_state ne $state && $from ne ""} { + set until [ns_set get $ps creation_date] + set last_from $from + set from "" + } + } + if {$until ne ""} { + lappend periods [:pretty_period $last_from $until] + } elseif {$from ne ""} { + lappend periods [:pretty_period $from ""] + } + #ns_log notice "state_periods $state <$from> <$last_from> <$until> <$periods>" + return $periods + } + + ######################################################################## :public method achieved_points {-answer_object:object -answer_attributes:required } { # # This method has to be called after the instance was rendered, @@ -1422,6 +1475,7 @@ # - per-revision statistics: when view = revision_overview and revision_id is provided # set revision_sets [$answerObj get_revision_sets] + set parent_revsion_sets [[$answerObj parent_id] get_revision_sets] set item_id [$answerObj item_id] set live_revision_id [xo::dc get_value -prepare integer live_revision_id { select live_revision from cr_items where item_id = :item_id @@ -1486,7 +1540,7 @@ if {$revision_id eq ""} { set revision_sets [:revisions_up_to $revision_sets $live_revision_id] } - set last_published [:last_time_in_state -obj [$answerObj parent_id] -state published] + set last_published [:last_time_in_state $parent_revsion_sets -state published] set duration [:get_duration -exam_published_time $last_published $revision_sets] set state [$answerObj state] @@ -1752,7 +1806,7 @@ if {[$ff_obj exists grading_score]} { set r [$ff_obj set grading_score] # - # Add exericse score weighted to the total score. + # Add exercise score weighted to the total score. # if {[$ff_obj exists test_item_minutes]} { set minutes [$ff_obj set test_item_minutes]