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.268 -r1.7.2.269 --- openacs-4/packages/xowf/tcl/test-item-procs.tcl 20 Jan 2023 07:53:00 -0000 1.7.2.268 +++ openacs-4/packages/xowf/tcl/test-item-procs.tcl 28 Jan 2023 14:25:18 -0000 1.7.2.269 @@ -934,9 +934,15 @@ #ns_log notice ...fieldName=$fieldName->$value #set af answer[incr count] set text [dict get $value $fieldName.text] - # trim leading

since this causes a newline in the checkbox label - regexp {^\s*(

)(.*)$} $text . . text - regexp {^(.*)(

)\s*$} $text . text . + + # Trim leading

and whitespace. Trimming leading

is + # necessary since this causes a newline in the checkbox label + regsub -all {^(\s|

)+} $text "" text + regsub -all {(\s|

)+$} $text "" text + # skip empty entries + if {$text eq ""} { + continue + } lappend options [list $text [incr count]] lappend correct [dict get $value $fieldName.correct] lappend solution [dict get $value $fieldName.solution]