- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables
Class ::xowiki::formfield::reorder_interaction
::xowiki::formfield::reorder_interaction create ... \
[ -nr (default "25") ]
Class Relations
::xotcl::Class create ::xowiki::formfield::reorder_interaction \ -superclass ::xowiki::formfield::TestItemFieldMethods (to be applied on instances)
convert_to_internal (scripted)
set intro_text [:get_named_sub_component_value text] set answerFields [:get_named_sub_component_value -from_repeat answer] set options {} set answer {} set count 0 foreach {fieldName value} $answerFields { #ns_log notice ...fieldName=$fieldName->$value lappend options [list $value $count] lappend answer $count incr count } set fc_dict {_name answer _type reorder_box} dict set fc_dict disabled_as_div 1 dict set fc_dict label "" dict set fc_dict options $options dict set fc_dict answer $answer dict set fc_dict grading [${:parent_field} get_named_sub_component_value grading] set form [:form_markup -interaction reorder -intro_text $intro_text -body @answer@] set fc {} lappend fc [:dict_to_spec $fc_dict] @categories:off @cr_fields:hidden #ns_log notice "reorder_interaction $form\n$fc" ${: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 ${:auto_correct} ${:object} set_property -new 1 has_solution false #ns_log notice "${:name} FINAL FC $fc"initialize (scripted)
if {${:__state} ne "after_specs"} return # # Create component structure. # set widget [test_item set richtextWidget] :create_components [subst { {text {$widget,height=100px,label=#xowf.exercise-text#,plugins=OacsFs}} {answer {text,repeat=1..${:nr},label=#xowf.reorder_question_elements#}} }] set :__initialized 1nr (setter)
- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables