xowf::test_item::AssessmentInterface method export_links (protected)
<instance of xowf::test_item::AssessmentInterface> 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, object)
- -filter_form_ids (optional, integer)
- -b_aggregate (optional, boolean, defaults to
"false"
)- Returns:
- HTML
- Testcases:
- No testcase defined.
Source code: set export_formats { csv } 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