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

 <instance of xowf::test_item::Question_manager[i]> combined_question_form \
    [ -with_numbers ] [ -with_title ] [ -with_minutes ] \
    [ -with_points ] [ -user_specific ] [ -shuffle_id shuffle_id ] \
    [ -user_answers user_answers ] [ -form_objs form_objs ] obj

Defined in packages/xowf/tcl/test-item-procs.tcl

For the provided assessment, return a combined question_form as a single (combined) form, containing the content of all question forms. The result is a dict, containing also title information etc. depending on the provided parameters.

Switches:
-with_numbers
(defaults to "false") (optional)
-with_title
(defaults to "false") (optional)
-with_minutes
(defaults to "false") (optional)
-with_points
(defaults to "false") (optional)
-user_specific
(defaults to "false") (optional)
-shuffle_id
(defaults to "-1") (optional)
used only for selecting form_objs
-user_answers
(optional)
instance of the answer-wf. Needed for user-specific percent substitutions.
-form_objs
(optional)
Parameters:
obj - is the exam

Partial Call Graph (max 5 caller/called nodes):
%3 test_create_test_items create_test_items (test xowf) xowf::test_item::Question_manager instproc combined_question_form xowf::test_item::Question_manager instproc combined_question_form test_create_test_items->xowf::test_item::Question_manager instproc combined_question_form

Testcases:
create_test_items
Source code:
#ns_log notice "combined_question_form called with user_answers <$user_answers> for $obj [$obj name]"
#if {$user_answers eq ""} {xo::show_stack}

set all_form_objs [:question_objs -shuffle_id $shuffle_id $obj]
set positions {}
if {[llength $form_objs] > 0} {
  foreach form_obj $form_objs {
    lappend positions [lsearch $all_form_objs $form_obj]
  }
}
#ns_log notice "XXX combined_question_form fos=$form_objs all_form_objs=$all_form_objs <$positions>"

if {$user_specific} {
  set form_objs [:max_items [$obj property max_items ""$form_objs]
}
if {$with_numbers} {
  set numbers ""
  for {set i 1} {$i <= [llength $all_form_objs]} {incr i} {
    lappend numbers $i
  }
  if {[llength $form_objs] > 0} {
    set new_numbers {}
    set new_form_objs {}
    foreach form_obj $all_form_objs number $numbers {
      if {$form_obj in $form_objs} {
        lappend new_numbers $number
        lappend new_form_objs $form_obj
      }
    }
    set numbers $new_numbers
    set form_objs $new_form_objs
  } else {
    set form_objs $all_form_objs
  }
  set extra_flags [list -numbers $numbers]
} else {
  set form_objs $all_form_objs
  set extra_flags ""
}
return [:question_info  -with_title=$with_title  -with_minutes=$with_minutes  -with_points=$with_points  {*}$extra_flags  -obj $obj  -user_answers $user_answers  -positions $positions  $form_objs]
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: