Index: openacs-4/packages/xowf/lib/online-exam-answer.wf =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowf/lib/online-exam-answer.wf,v diff -u -r1.2.2.12 -r1.2.2.13 --- openacs-4/packages/xowf/lib/online-exam-answer.wf 26 Nov 2019 18:16:54 -0000 1.2.2.12 +++ openacs-4/packages/xowf/lib/online-exam-answer.wf 13 Dec 2019 17:56:28 -0000 1.2.2.13 @@ -180,7 +180,7 @@ proc working_form_loader {ctx form_name} { set obj [$ctx object] set position [$obj property position] - + set parent_id [$obj parent_id] #:msg "waiting_form_loader $form_title [$obj instance_attributes]" set parent_obj [::xo::db::CrClass get_instance_from_db -item_id $parent_id] @@ -189,7 +189,7 @@ # # Load the form. # - set form_obj [::xowf::test_item::question_manager nth_question_obj $parent_obj $position] + set form_obj [::xowf::test_item::question_manager nth_question_obj $parent_obj $position] # # Update IP address each time the form is loaded. @@ -201,26 +201,24 @@ # # Update the title of the page # - set minutes [::xowf::test_item::question_manager minutes_string $form_obj] + :set_title $obj -for_question -with_minutes - :set_title $obj -question true -minutes $minutes - return $form_obj } # # Set "title" with question/user/IP information. # -:proc set_title {obj {-question:boolean true} {-minutes ""}} { - set parent_obj [::xo::db::CrClass get_instance_from_db -item_id [$obj parent_id]] - if {$question && [$obj state] eq "working"} { +:proc set_title {obj {-for_question:switch false} {-with_minutes:switch false}} { + set parent_obj [::xo::db::CrClass get_instance_from_db -item_id [$obj parent_id]] + if {$for_question && [$obj state] eq "working"} { set form_info [::xowf::test_item::question_manager nth_question_form \ -with_numbers \ + -with_title \ + -with_minutes=$with_minutes \ -position [$obj property position] \ $parent_obj] - set question_title [dict get $form_info title_infos title] - set number [dict get $form_info title_infos number] - set titleString "[_ xowf.question] $number: $question_title $minutes" + set titleString [dict get $form_info title_infos full_title] set title [list [string trim $titleString]] } lappend title \ @@ -244,13 +242,14 @@ set form_info [::xowf::test_item::question_manager combined_question_form \ -with_numbers \ -with_title \ + -with_minutes \ $parent_obj] set summary_form [dict get $form_info form] set summary_fc [dict get $form_info disabled_form_constraints] regsub -all {]*>} $summary_form {} summary_form - :set_title $obj -question false + :set_title $obj return [::xowiki::Form new \ -destroy_on_cleanup \ 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.12 -r1.7.2.13 --- openacs-4/packages/xowf/tcl/test-item-procs.tcl 29 Nov 2019 07:24:47 -0000 1.7.2.12 +++ openacs-4/packages/xowf/tcl/test-item-procs.tcl 13 Dec 2019 17:56:28 -0000 1.7.2.13 @@ -1315,6 +1315,7 @@ :object method question_info { {-numbers ""} {-with_title:switch false} + {-with_minutes:switch false} form_objs } { set full_form {} @@ -1324,18 +1325,24 @@ foreach form_obj $form_objs number $numbers { set form_obj [::xowf::test_item::renaming_form_loader rename_attributes $form_obj] set form_title [$form_obj title] + set minutes [:question_property $form_obj minutes] set title "" if {$number ne ""} { append title "#xowf.question# $number:" } if {$with_title} { append title " $form_title" } + if {$with_minutes} { + append title " - [:minutes_string $form_obj]" + } + append full_form "

$title

\n" append full_form [$form_obj property form] \n lappend title_infos \ + full_title $title \ title $form_title \ - minutes [:question_property $form_obj minutes] \ + minutes $minutes \ number $number lappend full_fc [$form_obj property form_constraints] lappend full_disabled_fc [$form_obj property disabled_form_constraints] @@ -1376,6 +1383,7 @@ :public object method combined_question_form { {-with_numbers:switch false} {-with_title:switch false} + {-with_minutes:switch false} obj:object } { set form_objs [:question_objs $obj] @@ -1384,10 +1392,15 @@ for {set i 1} {$i <= [llength $form_objs]} {incr i} { lappend numbers $i } - return [:question_info -with_title=$with_title -numbers $numbers $form_objs] + set extra_flags [list -numbers $numbers] } else { - return [:question_info -with_title=$with_title $form_objs] + set extra_flags "" } + return [:question_info \ + -with_title=$with_title \ + -with_minutes=$with_minutes \ + {*}$extra_flags \ + $form_objs] } :public object method current_question_form { @@ -1402,6 +1415,7 @@ {-position:integer} {-with_numbers:switch false} {-with_title:switch false} + {-with_minutes:switch false} obj:object } { if {![info exists position]} { @@ -1410,10 +1424,15 @@ set form_objs [:nth_question_obj $obj $position] if {$with_numbers} { set number [expr {$position + 1}] - return [:question_info -with_title=$with_title -numbers $number $form_objs] + set extra_flags [list -numbers $number] } else { - return [:question_info -with_title=$with_title $form_objs] + set extra_flags "" } + return [:question_info \ + -with_title=$with_title \ + -with_minutes=$with_minutes \ + {*}$extra_flags \ + $form_objs] } :public object method current_question_number {obj:object} { Index: openacs-4/packages/xowf/www/resources/test-item.css =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowf/www/resources/test-item.css,v diff -u -r1.1.2.8 -r1.1.2.9 --- openacs-4/packages/xowf/www/resources/test-item.css 29 Nov 2019 07:25:32 -0000 1.1.2.8 +++ openacs-4/packages/xowf/www/resources/test-item.css 13 Dec 2019 17:56:28 -0000 1.1.2.9 @@ -93,6 +93,7 @@ background: #ffdddd; } div.text_interaction div.textarea, +div.short_text_interaction div.textarea, div.short_text_interaction div.text { background: #eee; white-space: pre-wrap; @@ -122,6 +123,7 @@ border-color: red; } div.text_interaction div.textarea span.match, +div.short_text_interaction div.textarea span.match, div.short_text_interaction div.text span.match { background: #FFFF2F; /*#FFFFAA;*/ }