xowf::test_item::Question_manager method aggregated_form (public)

 <instance of xowf::test_item::Question_manager[i]> 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
(defaults to "false") (optional)
-with_feedback
(defaults to "false") (optional)
-with_correction_notes
(defaults to "false") (optional)
-with_grading_box
(optional)
might be: "hidden" (but included), "true", "" (omitted)
Parameters:
question_infos
Returns:
HTML form content

Partial Call Graph (max 5 caller/called nodes):
%3 test_create_composite_test_item create_composite_test_item (test xowf) xowf::test_item::Question_manager instproc aggregated_form xowf::test_item::Question_manager instproc aggregated_form test_create_composite_test_item->xowf::test_item::Question_manager instproc aggregated_form xowiki::bootstrap::icon xowiki::bootstrap::icon (public) xowf::test_item::Question_manager instproc aggregated_form->xowiki::bootstrap::icon

Testcases:
create_composite_test_item
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 visible [expr {$with_grading_box eq "hidden" ? "hidden" : ""}]
        if {$with_grading_box eq "hidden"} {
          set question_name answer_$question_name
        }
        set data_attribute [expr {[::xowiki::CSS toolkit] eq "bootstrap5" ? "data-bs" : "data"}]
        append full_form [subst [ns_trim -delimiter | {
          |<div id='grading-box-[incr count]' class='grading-box $visible'
          |     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_form
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: