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.165 -r1.7.2.166 --- openacs-4/packages/xowf/tcl/test-item-procs.tcl 18 Oct 2021 13:18:14 -0000 1.7.2.165 +++ openacs-4/packages/xowf/tcl/test-item-procs.tcl 21 Oct 2021 08:54:23 -0000 1.7.2.166 @@ -4215,19 +4215,19 @@ #---------------------------------------------------------------------- # Class: Question_manager - # Method: disallow_paste + # Method: disable_text_field_feature #---------------------------------------------------------------------- - :public method disallow_paste {form_obj:object} { + :method disable_text_field_feature {form_obj:object feature} { # # This function changes the form_constraints of the provided - # form object by adding "paste=false" properties to textarea or + # form object by adding "$feature=false" properties to textarea or # text_fields entries. # set fc {} foreach e [$form_obj property form_constraints] { if {[regexp {^[^:]+_:(textarea|text_fields)} $e]} { - #ns_log notice "======= turn paste off" - append e , paste=false + #ns_log notice "======= turn $feature off" + append e , $feature=false } lappend fc $e } @@ -4236,6 +4236,31 @@ #---------------------------------------------------------------------- # Class: Question_manager + # Method: disallow_paste + #---------------------------------------------------------------------- + :public method disallow_paste {form_obj:object} { + # + # This function changes the form_constraints of the provided + # form object by adding "paste=false" properties to textarea or + # text_fields entries. + :disable_text_field_feature $form_obj paste + } + + #---------------------------------------------------------------------- + # Class: Question_manager + # Method: disallow_spellcheck + #---------------------------------------------------------------------- + :public method disallow_spellcheck {form_obj:object} { + # + # This function changes the form_constraints of the provided + # form object by adding "spellcheck=false" properties to textarea or + # text_fields entries. + # + :disable_text_field_feature $form_obj spellcheck + } + + #---------------------------------------------------------------------- + # Class: Question_manager # Method: add_to_fc #---------------------------------------------------------------------- :method add_to_fc {-fc:required -position -minutes -points} { @@ -4770,6 +4795,7 @@ set allow_paste [$obj property allow_paste 1] set max_items [$obj property max_items ""] set time_window [$obj property time_window ""] + set allow_spellcheck [$obj property allow_spellcheck true] append text [subst {

[expr {$synchronized ? "" : "Non-"}]Synchronized Exam @@ -4818,6 +4844,7 @@ [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 {$allow_spellcheck ? "#xowf.Spellcheck_allowed#" : "#xowf.Spellcheck_not_allowed#"}]
$time_window_msg [expr {[llength $published_periods] > 0 ? "
#xowf.inclass-exam-open#: [join $published_periods {, }]
" : ""}] [expr {[llength $review_periods] > 0 ? "#xowf.inclass-exam-review#: [join $review_periods {, }]
" : ""}]