xowf::test_item::Question_manager method describe_form (public)
<instance of xowf::test_item::Question_manager> describe_form \ [ -asHTML ] [ -field_name field_name ] form_obj
Defined in packages/xowf/tcl/test-item-procs.tcl
Call for every form field of the form_obj the "describe" method and return these infos in a form of a list.
- Switches:
- -asHTML (optional)
- -field_name (optional)
- Parameters:
- form_obj (required)
- Testcases:
- No testcase defined.
Source code: set describe_infos {} if {[$form_obj property item_type] eq "Composite"} { # # In the case of a composite Composite question type, describe # the components rather than the compound part (maybe, we # should describe in the future also the container, but this # actually less interesting). # set selection [dict get [$form_obj instance_attributes] question question.interaction question.interaction.selection] set form_objs [[$form_obj package_id] instantiate_forms -forms [join [split $selection \n] |] -default_lang en] set describe_infos [join [lmap form_obj_tmp $form_objs { set describe_info [join [:describe_form -field_name $field_name $form_obj_tmp]] list [lappend describe_info is_composite_subquestion 1] }]] set fc {selection:form_page} } else { set fc [$form_obj property form_constraints] } # # We might be willing in the future to get the full set of all # options, i.e. remove "show_max" constraints etc. # #ns_log notice DESCRIBE-BEFORE--$fc #set fc [:replace_in_fc -fc $fc shuffle_kind none] #set fc [:replace_in_fc -fc $fc show_max ""] #ns_log notice DESCRIBE-changed set form_fields [$form_obj create_form_fields_from_form_constraints -lookup $fc] set ff_describe_infos [lmap form_field $form_fields { $form_field describe -field_name $field_name }] #ns_log notice "describe_form [$form_obj name]: $question_infos" set describe_infos [:pretty_nr_alternatives "$ff_describe_infos $describe_infos"] if {!$asHTML} { #ns_log notice "OOO [$form_obj name] early exit $describe_infos" return $describe_infos } else { set HTML [:render_describe_infos $describe_infos] return $HTML }XQL Not present: Generic, PostgreSQL, Oracle