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 -r1.2.2.16 -r1.2.2.17
--- openacs-4/packages/xowf/catalog/xowf.de_DE.ISO-8859-1.xml 21 Mar 2020 09:43:13 -0000 1.2.2.16
+++ openacs-4/packages/xowf/catalog/xowf.de_DE.ISO-8859-1.xml 21 Mar 2020 19:59:09 -0000 1.2.2.17
@@ -127,5 +127,7 @@
Inclass-Exam ge�ffnet (Zur Bearbeitung freigegeben)
Inclass-Exam geschlossen
Anzahl der �nderungen
- Dauer
+ Dauer
+ Nicht Abgegeben
+
Index: openacs-4/packages/xowf/catalog/xowf.en_US.ISO-8859-1.xml
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowf/catalog/xowf.en_US.ISO-8859-1.xml,v
diff -u -r1.2.2.13 -r1.2.2.14
--- openacs-4/packages/xowf/catalog/xowf.en_US.ISO-8859-1.xml 21 Mar 2020 09:43:13 -0000 1.2.2.13
+++ openacs-4/packages/xowf/catalog/xowf.en_US.ISO-8859-1.xml 21 Mar 2020 19:59:09 -0000 1.2.2.14
@@ -147,5 +147,6 @@
Created Questions
Created Assessments
Number of changes
- Duration
+ Duration
+ Not Submitted
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.5 -r1.1.2.6
--- openacs-4/packages/xowf/lib/inclass-exam.wf 21 Mar 2020 12:22:37 -0000 1.1.2.5
+++ openacs-4/packages/xowf/lib/inclass-exam.wf 21 Mar 2020 19:59:09 -0000 1.1.2.6
@@ -319,6 +319,7 @@
set HTML [::xowf::test_item::answer_manager result_table \
-package_id ${:package_id} \
-items $items2 \
+ -state * \
[self]]
$items2 destroy
}
@@ -359,15 +360,22 @@
foreach i [$items children] {
set userName [$i set online-exam-userName]
set fullName [$i set online-exam-fullName]
+ set state [$i state]
- if {[$i state] ne "done"} {
- ns_log notice "online-exam: submission of $userName is not finished (state [$i state])"
- continue
+ if {$state ne "done"} {
+ ns_log notice "online-exam: submission of $userName is not finished (state $state)"
+ #continue
}
if {$filter_id ne "" && [$i item_id] ne $filter_id} {
continue
}
-
+ set revisions [$i get_revision_sets]
+ if {[llength $revisions] <=1 } {
+ # just an initial revision
+ ns_log notice "online-exam: submission of $userName is empty. Ignoring."
+ continue
+ }
+
#
# The call to "render_content" calls actually the
# "summary_form" of online-exam-answer.wf when the submit
@@ -394,15 +402,16 @@
set time [::xo::db::tcl_date [$i property _last_modified] tz_var]
set pretty_date [clock format [clock scan $time] -format "%Y-%m-%d %T"]
- set revisions [$i get_revision_sets]
set duration [xowf::test_item::answer_manager get_duration $revisions]
set IPs [xowf::test_item::answer_manager get_IPs $revisions]
+ set submissionState [expr {$state ne "done" ? "- #xowf.not_submitted#" : ""}]
append HTML [subst {
$userName · $fullName · $pretty_date
#xowf.nr_changes#: [llength $revisions]
- #xowf.duration#: [dict get $duration from] - [dict get $duration to] ([dict get $duration duration])
+ #xowf.duration#: [dict get $duration from] - [dict get $duration to]
+ ([dict get $duration duration]) $submissionState
IP: $IPs
$signatureString
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 -r1.7.2.33 -r1.7.2.34
--- openacs-4/packages/xowf/tcl/test-item-procs.tcl 21 Mar 2020 14:39:51 -0000 1.7.2.33
+++ openacs-4/packages/xowf/tcl/test-item-procs.tcl 21 Mar 2020 19:59:09 -0000 1.7.2.34
@@ -1286,6 +1286,8 @@
set last [lindex $revision_sets end]
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
dict set r from [clock format $fromClock -format "%H:%M:%S"]
dict set r to [clock format $toClock -format "%H:%M:%S"]
set timeDiff [expr {$toClock - $fromClock}]
@@ -1394,9 +1396,12 @@
set form_info [::xowf::test_item::question_manager combined_question_form $wf]
set answer_form_field_objs [:answer_form_field_objs -wf $wf $form_info]
- set form_field_objs [$wf create_raw_form_field \
- -name _online-exam-userName \
- -spec text,label=#xowf.participant#]
+ set form_field_objs {}
+ lappend form_field_objs \
+ [$wf create_raw_form_field \
+ -name _online-exam-userName \
+ -spec text,label=#xowf.participant#]
+
#
# Create for every answer field a matching grading field
#
@@ -1418,10 +1423,25 @@
lappend form_field_objs \
[$wf create_raw_form_field \
+ -name _online-exam-seconds \
+ -spec number,label=#xowf.Seconds#] \
+ [$wf create_raw_form_field \
-name _creation_date \
-spec date,label=#xowiki.Page-last_modified#]
#
+ # Check, if any of the answer form field objects is
+ # randomized. If so, it is necessary to recreate these eagerly,
+ # since the full object structure might be personalized.
+ #
+ set randomized_fields {}
+ foreach ff_obj $answer_form_field_objs {
+ if {[$ff_obj exists shuffle_kind] && [$ff_obj shuffle_kind] ne "none"} {
+ lappend randomized_fields $ff_obj
+ }
+ }
+
+ #
# Take "orderby" from the query parameter. If not set, order by
# the first field.
#
@@ -1442,12 +1462,29 @@
# values.
#
foreach p [$items children] {
+ #
+ # If we have randomized fields, we have to
+ # recreate/reinitialize these to get proper correction
+ # markings for this user. It might be possible to optimize
+ # this, when only a few fields are randomized.
+ #
+ if {[llength $randomized_fields] > 0} {
+ #ns_log notice "WORK ON [$p creation_user] "
+ :answer_form_field_objs -clear -wf $wf $form_info
+ $wf form_field_flush_cache
+ xo::cc eval_as_user -user_id [$p creation_user] {
+ set answer_form_field_objs [:answer_form_field_objs -wf $wf $form_info]
+ }
+ }
+
foreach ff_obj $answer_form_field_objs {
$ff_obj object $p
set property [$ff_obj name]
$ff_obj value [$p property $property]
$ff_obj set_feedback 3
+
+ #ns_log notice "[$p creation_user] [$ff_obj name] [$p property $property] -> [$ff_obj set evaluated_answer_result]"
if {[$ff_obj exists grading_score]} {
set r [$ff_obj set grading_score]
} else {
@@ -1456,6 +1493,10 @@
}
$p set_property -new 1 $property.score $r
}
+
+ set duration [:get_duration [$p get_revision_sets]]
+ $p set_property -new 1 _online-exam-seconds \
+ [expr {[dict get $duration toClock] - [dict get $duration fromClock]}]
}
if {$state eq "done"} {
@@ -1489,7 +1530,9 @@
set items [:get_wf_instances $wf]
set results ""
foreach i [$items children] {
- set participantResult [:participant_result -obj $obj $i $form_info $form_field_objs]
+ xo::cc eval_as_user -user_id [$i creation_user] {
+ set participantResult [:participant_result -obj $obj $i $form_info $form_field_objs]
+ }
append results $participantResult \n
}