- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables
Class ::xowf::test_item::AssessmentInterface
::xowf::test_item::AssessmentInterface create ...Abstract class for common functionality
Defined in packages/xowf/tcl/test-item-procs.tcl
Class Relations
- class: ::nx::Class
- superclass: ::nx::Object
- subclass: ::xowf::test_item::Answer_manager, ::xowf::test_item::Question_manager, ::xowf::test_item::Renaming_form_loader
::nx::Class create ::xowf::test_item::AssessmentInterface \ -superclass ::nx::ObjectMethods (to be applied on instances)
render_feedback_files (scripted, public)
<instance of xowf::test_item::AssessmentInterface> render_feedback_files \ -question_name question_name [ -feedbackFiles feedbackFiles ]Render feedback files which are children of the submit instances. Note that one submit instances contains the feedback files for all questions. For associating the files with the right quesitions, the content repository name has to start with "file:${questions_name}/*
- Switches:
- -question_name (required)
- name (prefix) for selecting files to be shown
- -feedbackFiles (optional)
- is of pairs containing "item_id" and "name"
- Returns:
- HTML rendering
- Testcases:
- No testcase defined.
set chunkList [lmap pair $feedbackFiles { lassign $pair item_id name #ns_log warning "render_feedback_files: check '$name'" if {![regexp {^file:(.*)/(.*)$} $name . qn fileName]} { ns_log warning "render_feedback_files: ignoring file with unexpected name '$name'" continue } if {$qn ne $question_name} { # # The found file is for a different question # #ns_log notice "render_feedback_files: required '$question_name' found '$qn'" continue } set fileObj [::xowiki::File get_instance_from_db -item_id $item_id] # # Provide markup for delete likn. When the user has no rights # to delete the file, do not offer the delete link. # set local_return_url [ad_return_url] set package_id [$fileObj package_id] set deleteLink [::$package_id make_link $fileObj delete local_return_url] if {$deleteLink ne ""} { set deleteLinkHTML [subst [ns_trim -delimiter | { |<a class="delete" href="[ns_quotehtml $deleteLink]"> | <adp:icon name="trash" title="#xowiki.delete#"> |</a> }]] } else { set deleteLinkHTML "" } set viewLink [::$package_id make_link $fileObj download] if {$viewLink ne ""} { set viewHref [subst {href="[ns_quotehtml $viewLink]"}] set viewTitle {title="#xowiki.view#"} } else { set viewHref "" set viewTitle "" } set iconName [::template::CSS icon_name $fileName] subst [ns_trim -delimiter | { |<div class="thumbnail-file"> | <a class="thumbnail-file-icon" $viewHref><adp:icon name="$iconName" $viewTitle></a> | <div class="thumbnail-file-text"> | [ns_quotehtml $fileName]$deleteLinkHTML | </div> |</div>}] }] set HTML "" if {[llength $chunkList] > 0} { # # Since the content will be post-processed via tDOM, we have # to resolve the ADP tags already here. # append HTML {<div class="thumbnail-files">} [template::adp_parse_tags [join $chunkList \n]] {</div>} } return $HTML
- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables