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 -N -r1.2.2.18 -r1.2.2.19 --- openacs-4/packages/xowf/lib/online-exam-answer.wf 27 Jan 2020 11:21:42 -0000 1.2.2.18 +++ openacs-4/packages/xowf/lib/online-exam-answer.wf 30 Jan 2020 18:12:31 -0000 1.2.2.19 @@ -179,7 +179,7 @@ # proc working_form_loader {ctx form_name} { set obj [$ctx object] - set position [$obj property position] + set item_nr [$obj property position] set parent_id [$obj parent_id] #:msg "working_form_loader [$obj instance_attributes]" @@ -192,7 +192,7 @@ set shuffle_id [expr {[$parent_obj property shuffle_items 0] ? [$obj creation_user] : -1}] set position [::xowf::test_item::question_manager shuffled_index \ -shuffle_id $shuffle_id \ - $parent_obj $position] + $parent_obj $item_nr] # # Load the form. # @@ -208,7 +208,7 @@ # # Update the title of the page # - :set_title $obj -position $position -for_question -with_minutes + :set_title $obj -position $position -item_nr $item_nr -for_question -with_minutes return $form_obj } @@ -219,16 +219,18 @@ :proc set_title { obj -position:integer + -item_nr:integer {-for_question:switch false} {-with_minutes:switch false} } { - set parent_obj [::xo::db::CrClass get_instance_from_db -item_id [$obj parent_id]] + 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 $position \ + -item_nr $item_nr \ $parent_obj] set titleString [dict get $form_info title_infos full_title] set title [list [string trim $titleString]] @@ -340,6 +342,10 @@ } else { lappend actions logout } + if {${:state} in {"working" "done"}} { + ::xo::cc set_parameter MenuBar 0 + ::xo::cc set_parameter template_file view-plain-master + } ${container}::${:state} actions $actions } } Index: openacs-4/packages/xowf/lib/online-exam.wf =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowf/lib/online-exam.wf,v diff -u -N -r1.6.2.14 -r1.6.2.15 --- openacs-4/packages/xowf/lib/online-exam.wf 29 Jan 2020 10:02:46 -0000 1.6.2.14 +++ openacs-4/packages/xowf/lib/online-exam.wf 30 Jan 2020 18:12:31 -0000 1.6.2.15 @@ -22,11 +22,13 @@ # An admin might with to add the following entries to the folder to ease # creation of exercises and exams # +# {clear_menu -menu New} +# # {entry -name New.Item.TextInteraction -label "Text Interaction" -form en:TestItemText.form} # {entry -name New.Item.ShortTextInteraction -label "Short Text Interaction" -form en:TestItemShortText.form} # {entry -name New.Item.MCInteraction -label "MC Interaction" -form en:TestItemMC.form} # {entry -name New.Item.SCInteraction -label "SC Interaction" -form en:TestItemSC.form} -# {entry -name New.App.Exam -label Exam -form en:online-exam.wf} +# {entry -name New.App.Exam -label "Online Exam" -form en:online-exam.wf} # # The policy has to allow the following methods on FormPages: # @@ -41,7 +43,7 @@ set :autoname 1 ;# to avoid editable name field set :policy ::xowf::test_item::test-item-policy-publish set :debug 0 -set :live_updates 0 +set :live_updates 1 Action select -next_state created -label #xowf.online-exam-select# \ -title #xowf.online-exam-title-select# @@ -151,8 +153,8 @@ set aLink [$obj pretty_link -query m=answer] set pLink [$obj pretty_link -query m=print-answers] #util_user_message -html -message "$survey is available as $pLink" - set menu "\[#xowf.refresh#,\ - #xowf.online-exam-exam_instances#,\ + # [#xowf.refresh#, + set menu "\[#xowf.online-exam-exam_instances#,\ #xowf.online-exam-protocol#\]" } @@ -185,7 +187,7 @@ set answerStats "" } - append text "$menu $answerStats\n" + append text "$answerStats\n" append report "$menu $extraAction" # Remove wrapping forms 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.20 -r1.7.2.21 --- openacs-4/packages/xowf/tcl/test-item-procs.tcl 29 Jan 2020 09:59:02 -0000 1.7.2.20 +++ openacs-4/packages/xowf/tcl/test-item-procs.tcl 30 Jan 2020 18:12:31 -0000 1.7.2.21 @@ -172,7 +172,7 @@ dict lappend grading_dict options [list $o $o] } dict set grading_dict form_item_wrapper_CSSclass form-inline - dict set grading_dict label #xowf.Grading-Schema# + dict set grading_dict label #xowf.Grading-Scheme# set gradingSpec [list [list grading [:dict_to_fc -type select $grading_dict]]] } else { set gradingSpec "" @@ -1454,6 +1454,7 @@ :public object method nth_question_form { {-position:integer} + {-item_nr:integer} {-with_numbers:switch false} {-with_title:switch false} {-with_minutes:switch false} @@ -1462,9 +1463,12 @@ if {![info exists position]} { set position [$obj property position] } + if {![info exists item_nr]} { + set item_nr $position + } set form_objs [:nth_question_obj $obj $position] if {$with_numbers} { - set number [expr {$position + 1}] + set number [expr {$item_nr + 1}] set extra_flags [list -numbers $number] } else { set extra_flags ""