xowf::test_item::Question_manager method question_overview_block (protected)

 <instance of xowf::test_item::Question_manager[i]> question_overview_block \
    obj

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

Parameters:
obj

Partial Call Graph (max 5 caller/called nodes):
%3 xowiki::bootstrap::card xowiki::bootstrap::card (public) xowf::test_item::Question_manager instproc question_overview_block xowf::test_item::Question_manager instproc question_overview_block xowf::test_item::Question_manager instproc question_overview_block->xowiki::bootstrap::card

Testcases:
No testcase defined.
Source code:
set href [$obj pretty_link -query m=print-answers]

set form_objs [:question_objs $obj]

set chunks {}
foreach form_obj $form_objs {
  foreach chunk [:describe_form $form_obj] {
    set structure ""
    foreach att {
      question_structure choice_options sub_questions
    } {
      if {[dict exists $chunk $att]} {
        append structure [dict get $chunk $att]
        break
      }
    }
    if {[dict exists $chunk available_pool_items]} {
      append structure  " " [dict get $chunk available_pool_items] " " #xowf.questions#  " " ([dict get $chunk available_pool_item_stats])
    }
    if {[dict exists $chunk nrcorrect]} {
      append structure " " [:pretty_ncorrect [dict get $chunk nrcorrect]]
    }
    if {[dict exists $chunk is_composite_subquestion]} {
      dict set chunk title_value "&emsp;&emsp;[ns_quotehtml [dict get $chunk question_title]]"
    } else {
      if {[$obj state] in {done submission_review}
          && ![dict exists $chunk available_pool_items]
        } {
        dict set chunk title_value [subst {
          <a href='$href&fos=[$form_obj item_id]'>[ns_quotehtml [$form_obj title]]</a>
        }]
      } else {
        dict set chunk title_value [ns_quotehtml [$form_obj title]]
      }
    }
    dict set chunk structure $structure
    lappend chunks $chunk
  }
}

set body [ns_trim -delimiter | {
  |<div class='table-responsive'><table class='question_summary table table-condensed'>
  | <tr>
  |  <th></th><th>#xowf.question_structure#</th>
  |  <th style='text-align: center;'>#xowf.Minutes#</th>
  |  <th style='text-align: center;'>#xowf.Points#</th>
  |  <th style='text-align: center;'>#xowf.Shuffle#</th>
  |  <th style='text-align: center;'></th>
  | </tr>
}]

foreach chunk $chunks {
  append body [subst [ns_trim -delimiter | {
    | <tr>
    |  <td>[:dict_value $chunk title_value]</td>
    |  <td>[:dict_value $chunk type]: [:dict_value $chunk structure]</td>
    |  <td style='text-align: center;'>[:dict_value $chunk Minutes]</td>
    |  <td style='text-align: center;'>[:dict_value $chunk Points]</td>
    |  <td style='text-align: center;'>[:pretty_shuffle [:dict_value $chunk shuffle]]</td>
    |  <td style='text-align: center;'>[:dict_value $chunk grading]</td>
    | </tr>
  }]]
}
append body [ns_trim -delimiter | {
  |</table></div>
}]

return [::xowiki::bootstrap::card  -title #xowf.question_summary#  -body $body]
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: