xowf::test_item::AssessmentInterface method export_links (protected)

 <instance of xowf::test_item::AssessmentInterface[i]> export_links \
    [ -examWf examWf ] [ -filter_form_ids filter_form_ids ] \
    [ -b_aggregate on|off ]

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

Creates export links and markup

Switches:
-examWf
(optional)
-filter_form_ids
(optional)
-b_aggregate
(boolean) (defaults to "false") (optional)
Returns:
HTML

Partial Call Graph (max 5 caller/called nodes):
%3 export_vars export_vars (public) template::adp_parse_tags template::adp_parse_tags (public) xowf::test_item::AssessmentInterface instproc export_links xowf::test_item::AssessmentInterface instproc export_links xowf::test_item::AssessmentInterface instproc export_links->export_vars xowf::test_item::AssessmentInterface instproc export_links->template::adp_parse_tags

Testcases:
No testcase defined.
Source code:
set export_formats {
  cvs
}
if {[::namespace which ::ooxml::xl_write] ne ""} {
  lappend export_formats xls
}

#case: specific question
if {$filter_form_ids ne "" && [string is integer $filter_form_ids]} {
  #check if this id has entries
  set results [::xowf::test_item::answer_manager get_exam_results -obj $examWf results]
  set fos_exists 0
  foreach {user answers} $results {
    foreach {qn attributes} $answers {
      if {[dict exists $attributes question_id] &&
          [dict get $attributes question_id] eq $filter_form_ids} {
        set fos_exists 1
      }
    }
  }
  if {!$fos_exists} {return}
  foreach format $export_formats {
    set href [$examWf pretty_link -query [export_vars {
      {m exam-results} {onlygrades 0} {format $format} {per-question 1} {fos $filter_form_ids}
    }]]
    append HTML [subst {
      <p>#xowf.export_results_title#: <a title="#xowf.export_results_title#" href="[ns_quotehtml $href]">
      [string toupper $format] <adp:icon name="download"></a>
    }]
  }
  return [template::adp_parse_tags $HTML]
}
#case: aggregated view
if {$b_aggregate} {
  foreach format $export_formats {
    set href [$examWf pretty_link -query [export_vars {
      {m exam-results} {onlygrades 0} {format $format} {per-question 0}
    }]]
    append HTML [subst {
      <p>#xowf.export_results#: <a title="#xowf.export_results#" href="[ns_quotehtml $href]">
      [string toupper $format] <adp:icon name="download"></a>
    }]
  }
  return [template::adp_parse_tags $HTML]
}
#default case: all questions
foreach format $export_formats {
  set href_export [$examWf pretty_link -query [export_vars {
    {m exam-results} {onlygrades 0} {format $format} {per-question 1}
  }]]
  append HTML [subst {
    <p>#xowf.export_results_title#: <a title="#xowf.export_results_title#" href="[ns_quotehtml $href_export]">
    [string toupper $format] <adp:icon name="download"></a>
    </p>}]
}
return [template::adp_parse_tags $HTML]
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: