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

 <instance of xowf::test_item::Question_manager[i]> exam_info_block \
    [ -combined_form_info combined_form_info ] obj

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

Provide a summative overview of an exam.

Switches:
-combined_form_info
(optional)
Parameters:
obj

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

Testcases:
create_test_items
Source code:
if {![info exists combined_form_info]} {
  set combined_form_info [:combined_question_form -with_numbers $obj]
}
set proctoring   [$obj property proctoring 0]
set synchronized [$obj property synchronized 0]
set allow_paste  [$obj property allow_paste 1]
set max_items    [$obj property max_items ""]
set time_window  [$obj property time_window ""]
set allow_spellcheck [$obj property allow_spellcheck true]
set allow_translation [$obj property allow_translation false]

append text [subst {<p>
  [expr {$synchronized ? "" : "Non-"}]Synchronized Exam
  [expr {$proctoring ? " with Proctoring" : ""}]
  </p>}]
set question_objs     [dict get $combined_form_info question_objs]
set nrQuestions       [llength [:question_names $obj]]
set randomizationOk   [dict get $combined_form_info randomization_for_exam]
set autograde         [dict get $combined_form_info autograde]

set revision_sets     [$obj get_revision_sets]
set published_periods [:AM state_periods $revision_sets -state published]
set review_periods    [:AM state_periods $revision_sets -state submission_review]
set total_minutes     [:total_minutes -max_items $max_items $combined_form_info]
set total_points      [:total_points -max_items $max_items $combined_form_info]
set questions_without_minutes [:questions_without_minutes -max_items $max_items $combined_form_info]
set max_items_msg     ""

if {$max_items ne ""} {
  set all_minutes [lmap t [dict get $combined_form_info title_infos] {
    dict get $t minutes
  }]
  if {[llength [lsort -unique $all_minutes]] != 1} {
    set max_items_msg [_ xowf.Max_items_not_ok_duration [list n $max_items]]
  } elseif {$max_items > [llength $all_minutes]} {
    set max_items_msg [_ xowf.Max_items_not_ok_number [list n $max_items]]
  } else {
    set max_items_msg [_ xowf.Max_items_ok [list n $max_items]]
  }
}

set time_window_msg ""
if {$time_window ne ""} {
  set dtstart [dict get $time_window time_window.dtstart]
  if {$dtstart ne ""} {
    regsub -all T $dtstart " " dtstart
    set dtend [dict get $time_window time_window.dtend]
    set time_window_msg <br>[_ xowf.Automatically_published_from_to [list from $dtstart to $dtend]]
    set time_window_msg "<br>Automatische Freischaltung der Prüfung von $dtstart bis $dtend"
  }
}
set question_hint_html ""
if {$questions_without_minutes > 0} {
  append question_hint_html  " ($questions_without_minutes #xowf.without_minutes#)"
}

append text [subst {
  <p>
  [expr {$max_items_msg ne "" ? "$max_items_msg" : ""}]
  $nrQuestions [expr {$nrQuestions == 1 ? "#xowf.question#" : "#xowf.questions#"}]$question_hint_html,
  $total_minutes #xowf.Minutes#, $total_points #xowf.Points#<br>
  [expr {$total_minutes <= 1 ? "#xowf.Countdown_timer_is_not_displayed#<br>" : ""}]
  [expr {$autograde ? "#xowf.exam_review_possible#" : "#xowf.exam_review_not_possible#"}]<br>
  [expr {$randomizationOk ? "#xowf.randomization_for_exam_ok#" : "#xowf.randomization_for_exam_not_ok#"}]<br>
  [expr {$allow_paste ? "#xowf.Cut_and_paste_allowed#" : "#xowf.Cut_and_paste_not_allowed#"}]<br>
  [expr {$allow_spellcheck ? "#xowf.Spellcheck_allowed#" : "#xowf.Spellcheck_not_allowed#"}]<br>
  [expr {$allow_translation ? "#xowf.Translation_allowed#" : "#xowf.Translation_not_allowed#"}]<br>
  $time_window_msg
  [expr {[llength $published_periods] > 0 ? "<br>#xowf.inclass-exam-open#: [join $published_periods {, }]<br>" : ""}]
  [expr {[llength $review_periods] > 0 ? "#xowf.inclass-exam-review#: [join $review_periods {, }]<br>" : ""}]
  </p>
}]
return "<div class='exam-info-block'>$text</div>"
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: