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.1 -r1.7.2.2 --- openacs-4/packages/xowf/tcl/test-item-procs.tcl 8 May 2019 14:38:41 -0000 1.7.2.1 +++ openacs-4/packages/xowf/tcl/test-item-procs.tcl 24 Jun 2019 11:38:40 -0000 1.7.2.2 @@ -338,24 +338,28 @@ # # create component structure # + # "inplace" is ignored :create_components [subst { - {text {richtext,required,editor=ckeditor4,height=150px,label=#xowf.exercise-text#,plugins=OacsFs,javascript=$javascript,inplace=$inplace}} + {text {richtext,required,editor=ckeditor4,height=150px,label=#xowf.exercise-text#,plugins=OacsFs}} {lines {numeric,default=10,size=3,label=#xowf.lines#}} {columns {numeric,default=60,size=3,label=#xowf.columns#}} }] set :__initialized 1 } text_interaction instproc convert_to_internal {} { - set form "
\n" - set fc "@categories:off @cr_fields:hidden\n" set intro_text [:get_named_sub_component_value text] set lines [:get_named_sub_component_value lines] set columns [:get_named_sub_component_value columns] - append form "
$intro_text
\n" - append form "\n" - append fc "answer:textarea" - append form "
\n" + append form \ + "
\n" \ + "
$intro_text
\n" \ + "@answer@\n" \ + "
\n" +# "\n" + append fc \ + "@categories:off @cr_fields:hidden\n" \ + "answer:textarea,label=Answer" ${:object} set_property -new 1 form $form ${:object} set_property -new 1 form_constraints $fc set anon_instances true ;# TODO make me configurable @@ -365,7 +369,46 @@ } } +namespace eval ::xowiki::formfield { + ########################################################### + # + # ::xowiki::formfield::upload_interaction + # + ########################################################### + Class create upload_interaction -superclass FormGeneratorField -parameter { + {feedback_level full} + } + upload_interaction set auto_correct false + + upload_interaction instproc initialize {} { + if {${:__state} ne "after_specs"} return + :create_components [subst { + {text {richtext,required,editor=ckeditor4,height=150px,label=#xowf.exercise-text#,plugins=OacsFs}} + }] + set :__initialized 1 + } + + upload_interaction instproc convert_to_internal {} { + set intro_text [:get_named_sub_component_value text] + append form \ + "
\n" \ + "
$intro_text
\n" \ + "@answer@" \ + "
\n" + append fc \ + "@categories:off @cr_fields:hidden\n" \ + "answer:file" + ${:object} set_property -new 1 form $form + ${:object} set_property -new 1 form_constraints $fc + set anon_instances true ;# TODO make me configurable + ${:object} set_property -new 1 anon_instances $anon_instances + ${:object} set_property -new 1 auto_correct [[self class] set auto_correct] + ${:object} set_property -new 1 has_solution false + } +} + + namespace eval ::xowiki::formfield { ###########################################################