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.31 -r1.2.2.32 --- openacs-4/packages/xowf/catalog/xowf.de_DE.ISO-8859-1.xml 9 Jun 2020 19:24:22 -0000 1.2.2.31 +++ openacs-4/packages/xowf/catalog/xowf.de_DE.ISO-8859-1.xml 14 Jun 2020 20:26:29 -0000 1.2.2.32 @@ -151,8 +151,18 @@ Verwende f�r diese Pr�fung eine Online-Beaufsichtigung Synchronisierte Abwicklung Wird die angezeigte Bearbeitungszeit strikt vom Lehrenden vorgegeben, oder hat jeder Student die Anzeige seiner aktuellen Bearbeitsdauer, auch wenn er etwas sp�ter beginnt - Cut und Paste erlaubt - Darf der Studierende in mehrzeiligen Textfeldern Cut-und-Paste verwenden? + Ausschneiden und Einf�gen erlaubt + Darf der Studierende in mehrzeiligen Textfeldern Ausschneiden und Einf�gen verwenden? + Ausschneiden und Einf�gen in mehrzeiligen Textfeldern ist erlaubt + Ausschneiden und Einf�gen in mehrzeiligen Textfeldern ist nicht erlaubt + + Beschr�nkte Fragenzahl + Beschr�nke die Zahl der Fragen auf + diesen Wert. Sinnvoll in Kombination mit radomisierter Fragenfolge. Einschr�nkung: Alle Fragen m�ssen gleiche Dauer haben, + Beschr�nkung auf %n% Fragen ok, zeige Studierenden %n% von + Beschr�nkung auf %n% Fragen NICHT ok (unterschiedliche Dauer), + Beschr�nkung auf %n% Fragen NICHT ok (Fragenanzahl zu gering), + Ver�ffentlichung der Pr�fung seit der Ver�ffentlichung Erreichte Punkte 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.28 -r1.2.2.29 --- openacs-4/packages/xowf/catalog/xowf.en_US.ISO-8859-1.xml 9 Jun 2020 19:24:22 -0000 1.2.2.28 +++ openacs-4/packages/xowf/catalog/xowf.en_US.ISO-8859-1.xml 14 Jun 2020 20:26:29 -0000 1.2.2.29 @@ -172,8 +172,21 @@ Use E-Proctoring for this exam Synchronized Exam Is the exam duration strictly controlled by the lecturer, or does every student get his working time displayed, independent from his starting time. - Allow Paste + Allow Cut and Paste Is the student allow to use cut and paste in multiline text fields? + Cut and Paste is allowed in multi-line text fields + Cut and Paste is not allowed in multi-line text fields + + Restrict Items + Restrict item selection to this number of Items (requires same number weight of every item) + Restriction to %n% items ok, %n% of + Item Restriction to %n% items NOT ok (duration varies), + Item Restriction to %n% items NOT ok (not enough test items), + + Is the student allow to use cut and paste in multiline text fields? + Cut and Paste is allowed in multi-line text fields + Cut and Paste is not allowed in multi-line text fields + Exam Published since published Achieved Points @@ -182,7 +195,7 @@ automated exam review possible automated exam review not possible randomization for exam ok - randomization for exam not ok ("always" should not be used) + randomization for exam NOT ok ("always" should not be used) %achievedPoints% (rounded%rounded%) of possible %totalPoints% points, %percentage%%, grade: %grade% Index: openacs-4/packages/xowf/lib/inclass-exam-answer.wf =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowf/lib/inclass-exam-answer.wf,v diff -u -r1.1.2.18 -r1.1.2.19 --- openacs-4/packages/xowf/lib/inclass-exam-answer.wf 9 Jun 2020 19:24:22 -0000 1.1.2.18 +++ openacs-4/packages/xowf/lib/inclass-exam-answer.wf 14 Jun 2020 20:26:29 -0000 1.1.2.19 @@ -52,7 +52,7 @@ # set ctx [:wf_context] set exam_is_open [[$ctx wf_container] exam_is_open $obj] - + if {!$exam_is_open} { set current_state [$obj property _state] set locking_state [expr {$current_state eq "initial" ? "initial" : "done"}] @@ -327,6 +327,7 @@ -with_numbers \ -with_title \ -with_minutes \ + -user_specific \ -shuffle_id $shuffle_id \ $parent_obj] @@ -362,7 +363,7 @@ # or closed it already). But allow always usage in try-out-mode. # set parent_obj [::xo::db::CrClass get_instance_from_db -item_id [$obj parent_id]] - + return [expr {[$parent_obj state] eq "published" || [$obj property try_out_mode 0] == 1}] } @@ -392,12 +393,12 @@ if {${:state} in {initial working done}} { set parent_obj [::xo::db::CrClass get_instance_from_db -item_id [:parent_id]] - set question_names [::xowf::test_item::question_manager question_names $parent_obj] + set question_count [::xowf::test_item::question_manager question_count $parent_obj] if {${:state} eq "initial" && [:property seeds] eq ""} { ::xowf::test_item::question_manager add_seeds \ -obj [self] \ -seed ${:creation_user} \ - -number [llength $question_names] + -number $question_count } # # Use the current_position in the sense of the nth question of the @@ -411,9 +412,8 @@ # lappend actions prevQuestion #} if {${:state} ne "done"} { - set count 0 - foreach question $question_names { - incr count + + for {set count 1} {$count <= $question_count} {incr count} { ${container}::Action create ${container}::$count \ -label "$count" \ -next_state working \ 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.34 -r1.1.2.35 --- openacs-4/packages/xowf/lib/inclass-exam.wf 6 Jun 2020 16:30:11 -0000 1.1.2.34 +++ openacs-4/packages/xowf/lib/inclass-exam.wf 14 Jun 2020 20:26:29 -0000 1.1.2.35 @@ -155,8 +155,10 @@ #:log fullQuestionForm=$fullQuestionForm set text "

$title

" set menu "" - set proctoring [$obj property proctoring 0] + 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 ""] append text [subst {

[expr {$synchronized ? "" : "Non-"}]Synchronized Exam @@ -169,12 +171,29 @@ 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 max_items_msg "" + + 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]] + } + } append text [subst { -

$nrQuestions [expr {$nrQuestions == 1 ? "#xowf.question#" : "#xowf.questions#"}] - [::xowf::test_item::question_manager total_minutes $combined_form_info] #xowf.Minutes#
+

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

@@ -454,8 +473,9 @@ set combined_form_info [::xowf::test_item::question_manager combined_question_form [self]] set autograde [dict get $combined_form_info autograde] - set totalPoints [::xowf::test_item::question_manager total_minutes $combined_form_info] - set percentage_to_grade {50.0 60.0 70.0 80.0} ;# WI + set totalPoints [::xowf::test_item::question_manager total_minutes \ + -max_items [:property max_items ""] \ + $combined_form_info] set grading_scheme ::xowf::test_item::grading::wi1 set grade_dict {} set grade_csv "" @@ -785,7 +805,7 @@ }]] } } - + :proc www-proctor-image {} { set type [${:package_id} query_parameter type:ascii ""] set ts [${:package_id} query_parameter ts:integer ""] 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.67 -r1.7.2.68 --- openacs-4/packages/xowf/tcl/test-item-procs.tcl 9 Jun 2020 19:24:22 -0000 1.7.2.67 +++ openacs-4/packages/xowf/tcl/test-item-procs.tcl 14 Jun 2020 20:26:29 -0000 1.7.2.68 @@ -2275,6 +2275,7 @@ # - combined_question_form # - question_objs # - question_names + # - question_count # - question_property # - add_seeds # - total_minutes @@ -2289,7 +2290,7 @@ set position [$obj property position] } set questions [dict get [$obj instance_attributes] question] - return [expr {$position + 1 < [llength $questions]}] + return [expr {$position + 1 < [:question_count $obj]}] } :method load_question_objs {obj:object names} { @@ -2344,6 +2345,22 @@ return [$obj property question] } + :public method question_count {obj:object} { + # + # Return the number questions in an exam. It is either the + # number of defined questions, or it might be restricted by the + # max_items (if specified). + # + set nr_questions [llength [$obj property question]] + set max_items [$obj property max_items ""] + if {$max_items ne ""} { + if {$max_items < $nr_questions} { + set nr_questions $max_items + } + } + return $nr_questions + } + :public method add_seeds {-obj:object -seed:integer -number:integer} { # # Add property "seed" to the provided object, consisting of a @@ -2368,7 +2385,7 @@ :public method disallow_paste {form_obj:object} { # - # This function changes the the form_constraints of the provided + # This function changes the form_constraints of the provided # form object by adding "paste=false" properties to textarea or # text_fields entries. # @@ -2515,10 +2532,17 @@ {-with_numbers:switch false} {-with_title:switch false} {-with_minutes:switch false} + {-user_specific:switch false} {-shuffle_id:integer -1} obj:object } { set form_objs [:question_objs -shuffle_id $shuffle_id $obj] + if {$user_specific} { + set max_items [$obj property max_items ""] + if {$max_items ne ""} { + set form_objs [lrange $form_objs 0 $max_items-1] + } + } if {$with_numbers} { set numbers "" for {set i 1} {$i <= [llength $form_objs]} {incr i} { @@ -2535,18 +2559,27 @@ $form_objs] } - :public method total_minutes {form_info} { + :public method total_minutes {{-max_items:integer,0..1 ""} form_info} { + # + # Compute the duration of an exam. When max_items is non-empty, + # sum the duration of all items. Otherwise, sum the duration + # of the specified number of items. + # + set title_infos [dict get $form_info title_infos] + if {$max_items ne ""} { + set title_infos [lrange $title_infos 0 $max_items-1] + } set minutes 0 - foreach title_info [dict get $form_info title_infos] { - if {[dict exists $title_info minutes]} { - set title_minutes [dict get $title_info minutes] - if {$title_minutes eq ""} { - ns_log notice "missing minutes in '$title_info'" - set title_minutes 0 + foreach title_info $title_infos { + if {[dict exists $title_info minutes]} { + set title_minutes [dict get $title_info minutes] + if {$title_minutes eq ""} { + ns_log notice "missing minutes in '$title_info'" + set title_minutes 0 + } + set minutes [expr {$minutes + $title_minutes}] } - set minutes [expr {$minutes + $title_minutes}] } - } return $minutes } @@ -2559,8 +2592,11 @@ # @param manager exam workflow # @param base_time time in SQL format # + set max_items [$manager property max_items ""] set combined_form_info [:combined_question_form $manager] - set total_minutes [::xowf::test_item::question_manager total_minutes $combined_form_info] + set total_minutes [::xowf::test_item::question_manager total_minutes \ + -max_items $max_items \ + $combined_form_info] # Use "try" for backward compatibility, versions before # factional seconds. TODO: remove me. Index: openacs-4/packages/xowf/www/prototypes/select_question.form.page =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowf/www/prototypes/Attic/select_question.form.page,v diff -u -r1.1.2.6 -r1.1.2.7 --- openacs-4/packages/xowf/www/prototypes/select_question.form.page 9 Jun 2020 19:24:22 -0000 1.1.2.6 +++ openacs-4/packages/xowf/www/prototypes/select_question.form.page 14 Jun 2020 20:26:29 -0000 1.1.2.7 @@ -4,12 +4,13 @@ -title "Select Question" \ -anon_instances f \ -text {} \ - -form {{
@question@ @shuffle_items@ @allow_paste@ @synchronized@ @signature@ @proctoring@
} text/html} \ + -form {{
@question@ @shuffle_items@ @max_items@ @allow_paste@ @synchronized@ @signature@ @proctoring@
} text/html} \ -form_constraints { @cr_fields:hidden {_title:text,label=#xowf.online-exam-name#,default=#xowf.online-exam-default_name#} {question:form_page,multiple=true,form=en:TestItemText.form|en:TestItemShortText.form|en:TestItemMC.form|en:TestItemSC.form|en:TestItemUpload.form|en:TestItemReorder.form,required,help_text=#xowf.select_question_help_text#,label=#xowiki.questions#} {shuffle_items:boolean,horizontal=true,label=#xowf.randomized_items#,help_text=#xowf.randomized_items_help_text#} + {max_items:number,min=1,label=#xowf.Max_items#,help_text=#xowf.Max_items_help_text#} {allow_paste:boolean,horizontal=true,default=t,label=#xowf.Allow_paste#,help_text=#xowf.Allow_paste_help_text#} {synchronized:boolean,horizontal=true,default=f,label=#xowf.Synchronized#,help_text=#xowf.Synchronized_help_text#} {signature:boolean,horizontal=true,default=f,label=#xowf.Signature#,help_text=#xowf.Signature_help_text#}