Index: openacs-4/packages/xowf/xowf.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowf/xowf.info,v diff -u -r1.12.2.27 -r1.12.2.28 --- openacs-4/packages/xowf/xowf.info 18 Jan 2021 14:20:51 -0000 1.12.2.27 +++ openacs-4/packages/xowf/xowf.info 4 Feb 2021 13:22:16 -0000 1.12.2.28 @@ -10,16 +10,16 @@ t xowf - + Gustaf Neumann XoWiki Content Flow - an XoWiki based workflow system implementing state-based behavior of wiki pages and forms 2017-08-06 WU Vienna BSD-Style 2 - - + + 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.105 -r1.7.2.106 --- openacs-4/packages/xowf/tcl/test-item-procs.tcl 2 Feb 2021 03:14:36 -0000 1.7.2.105 +++ openacs-4/packages/xowf/tcl/test-item-procs.tcl 4 Feb 2021 13:22:16 -0000 1.7.2.106 @@ -569,10 +569,39 @@ set count 0 foreach {fieldName value} $answerFields { - #ns_log notice ...fieldName=$fieldName->$value + # ns_log notice ...fieldName=$fieldName->$value set af answer[incr count] lappend options [list [dict get $value $fieldName.text] $af] - lappend answer [dict get $value $fieldName.correct_when] + + set correct_whens {} + set raw_correct_whens [dict get $value $fieldName.correct_when] + foreach {compound_key compound_entries} $raw_correct_whens { + if {![string match "*.0" $compound_key]} { + # ns_log notice "key $compound_key, value $compound_entries" + set d {} + foreach {entry_key entry_value} $compound_entries { + set tail [lindex [split $entry_key .] end] + # ns_log notice "... entry_key $tail, entry_value $entry_value" + dict set d $tail $entry_value + } + set text [string trim [dict get $d text]] + if {$text ne ""} { + set correct_when "[dict get $d operator] " + append correct_when [expr {[dict get $d nocase] ? "-nocase " : ""}] + append correct_when $text + lappend correct_whens $correct_when + } else { + set correct_when "" + } + } + } + if {[llength $correct_whens] < 2} { + set correct_when [lindex $correct_whens 0] + } else { + set correct_when "AND $correct_whens" + } + ns_log notice FINAL-correct_when='$correct_when' + lappend answer $correct_when lappend solution [dict get $value $fieldName.solution] lappend render_hints [list \ words [dict get $value $fieldName.options] \ @@ -641,7 +670,12 @@ #:log "[:name] auto_correct ${:auto_correct}" if {${:auto_correct}} { - set autoCorrectSpec {{correct_when {correct_when,label=#xowf.correct_when#}}} + set dict "" + dict set dict repeat 0..10 + dict set dict repeat_add_label #xowiki.form-repeatable-add-condition# + dict set dict help_text #xowiki.formfield-comp_correct_when-help_text# + dict set dict label #xowf.correct_when# + set autoCorrectSpec [list [list correct_when [:dict_to_fc -type comp_correct_when $dict]]] } else { set autoCorrectSpec "" } Index: openacs-4/packages/xowf/www/resources/form-generator.css =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowf/www/resources/form-generator.css,v diff -u -r1.1.2.6 -r1.1.2.7 --- openacs-4/packages/xowf/www/resources/form-generator.css 18 Jan 2021 14:20:51 -0000 1.1.2.6 +++ openacs-4/packages/xowf/www/resources/form-generator.css 4 Feb 2021 13:22:16 -0000 1.1.2.7 @@ -41,3 +41,13 @@ display: inline; margin-right: 6px; } + +.xowiki-content fieldset fieldset.comp_correct_when div.form-inline { + padding: 0 0 0 0; +} +.xowiki-content fieldset fieldset.comp_correct_when div.form-inline div.form-label { + padding: 0 0 0 0; +} +.xowiki-content fieldset fieldset.comp_correct_when div.form-inline label.nocase { + margin: 0 2px 0 6px; +} 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.30 -r1.1.2.31 --- openacs-4/packages/xowf/www/resources/test-item.css 18 Jan 2021 14:20:51 -0000 1.1.2.30 +++ openacs-4/packages/xowf/www/resources/test-item.css 4 Feb 2021 13:22:16 -0000 1.1.2.31 @@ -178,13 +178,20 @@ border-style: solid; 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;*/ +div.text_interaction div.textarea span.match-contains, +div.short_text_interaction div.textarea span.match-contains, +div.short_text_interaction div.text span.match-contains { + background: #DDFF99; /*#FFFFAA;*/ margin: 0px 2px; /* otherwise two spans separated by space merge visually */ } +div.text_interaction div.textarea span.match-contains-not, +div.short_text_interaction div.textarea span.match-contains-not, +div.short_text_interaction div.text span.match-contains-not { + background: #FFDDA0; /*#FFFFAA;*/ + margin: 0px 2px; /* otherwise two spans separated by space merge visually */ +} + div.short_text_interaction div.description { white-space: pre-wrap; }