xowf::test_item::Question_manager method aggregated_form (public)
<instance of xowf::test_item::Question_manager> aggregated_form \ [ -titleless_form ] [ -with_feedback ] [ -with_correction_notes ] \ [ -with_grading_box with_grading_box ] question_infos
Defined in packages/xowf/tcl/test-item-procs.tcl
Compute an aggregated form (containing potentially multiple questions) based on the chunks available in question_infos.
- Switches:
- -titleless_form (optional, defaults to
"false"
)- -with_feedback (optional, defaults to
"false"
)- -with_correction_notes (optional, defaults to
"false"
)- -with_grading_box (optional)
- might be: "hidden" (but included), "true", "" (omitted)
- Parameters:
- question_infos (required)
- Returns:
- HTML form content
- Testcases:
- No testcase defined.
Source code: set full_form "" set count 0 foreach question_form [dict get $question_infos question_forms] title_info [dict get $question_infos title_infos] question_obj [dict get $question_infos question_objs] { set item_type [$question_obj property item_type] append full_form "<div class='test-item' data-item_type='$item_type'>" if {!$titleless_form} { append full_form "<h4>[dict get $title_info full_title]</h4>\n" } if {$with_grading_box ne ""} { set question_name [:FL form_name_based_attribute_stem [$question_obj name]] set hiddenCSSclass [expr {$with_grading_box eq "hidden" ? [::template::CSS class d-none] : ""}] if {$with_grading_box eq "hidden"} { set question_name answer_$question_name } set data_attribute [expr {[::template::CSS toolkit] eq "bootstrap5" ? "data-bs" : "data"}] append full_form [subst [ns_trim -delimiter | { |<div id='grading-box-[incr count]' class='grading-box $hiddenCSSclass' | data-question_name='$question_name' data-title='[$question_obj title]' | data-question_id='[$question_obj item_id]'> | #xowf.Points#: <span class='points'></span> | <span class='percentage'></span> | <span class='feedback-label'>#xowf.feedback#: </span><span class='comment'></span> | <a class='manual-grade' href='#' $data_attribute-toggle='modal' | $data_attribute-target='#grading-modal'> | <span class='manual-grade-edit'>[::xowiki::bootstrap::icon -name pencil]</span> | </a> | <div class="thumbnail-files-wrapper"></div> |</div> }]] } append full_form $question_form [:hint_boxes -question_obj $question_obj -with_feedback=$with_feedback -with_correction_notes=$with_correction_notes] </div>\n } regsub -all {<[/]?form>} $full_form "" full_form #ns_log notice "aggregated_form: STRIP FORM xxx times from full_form" return $full_formXQL Not present: Generic, PostgreSQL, Oracle