%3 ::nx::Object ::nx::Object ::xowf::test_item::AssessmentInterface ::xowf::test_item::AssessmentInterface add_to_fc assert_answer_instance assert_assessment assert_assessment_container export_links list_equal render_feedback_files replace_in_fc ::xowf::test_item::AssessmentInterface->::nx::Object ::xowf::test_item::Answer_manager ::xowf::test_item::Answer_manager achieved_points allow_answering answer_form_field_objs answers_panel countdown_timer create_workflow delete_all_answer_data delete_scheduled_atjobs dom class add dom class remove dom node appendXML dom node delete dom node replace dom node replaceXML exam_results export_answer export_file_submission get_IPs get_answer_attributes get_answer_wf get_duration get_exam_results get_label_from_options get_non_empty_file_formfields get_wf_instances grading_dialog_setup grading_scheme grading_table last_time_in_state last_time_switched_to_state marked_results participant_result participants_table postprocess_question_html pretty_formfield_name pretty_period prevent_multiple_tabs recutil_create render_answers render_answers_with_edit_history render_filter_bar render_full_submission_form render_print_button render_proctor_images render_submission=edit_history render_submission=exam_protocol render_submissions=edit_history result_table per_participant result_table per_question results_table revisions_up_to runtime_panel set_exam_results state_periods student_submissions_exist submissions time_window_setup waiting_room_message ::xowf::test_item::Answer_manager->::xowf::test_item::AssessmentInterface ::xowf::test_item::Question_manager ::xowf::test_item::Question_manager add_seeds aggregated_form combined_question_form current_question_form current_question_name current_question_number current_question_obj current_question_title describe_form disable_text_field_feature disallow_paste disallow_spellcheck disallow_translation exam_base_time exam_configuration_block exam_configuration_modifiable_field_names exam_configuration_popup exam_configuration_render_fields exam_info_block exam_target_time get_pool_questions get_pool_replacement_candidates goto_page hint_box hint_boxes initialize item_substitute_markup load_question_objs max_items minutes_string more_ahead nth_question_form nth_question_obj pagination_actions pagination_button_css_class percent_substitute percent_substitute_in_form points_string pretty_ncorrect pretty_nr_alternatives pretty_shuffle qualified_question_names question_count question_info question_info_block question_is_autograded question_names question_objs question_overview_block question_property question_randomization_ok question_statistics_block question_summary questions_without_minutes render_describe_infos replace_pool_question replace_pool_questions shuffled_index title_infos total total_minutes total_minutes_for_exam total_points ::xowf::test_item::Question_manager->::xowf::test_item::AssessmentInterface ::xowf::test_item::Renaming_form_loader ::xowf::test_item::Renaming_form_loader answer_attributes answer_for_form answers_for_form form_name_based_attribute_stem map_form_constraints name_to_question_obj_dict rename_attributes ::xowf::test_item::Renaming_form_loader->::xowf::test_item::AssessmentInterface

Class ::xowf::test_item::AssessmentInterface

::xowf::test_item::AssessmentInterface[i] create ...

Abstract class for common functionality
Defined in packages/xowf/tcl/test-item-procs.tcl

Class Relations

  • class: ::nx::Class[i]
  • superclass: ::nx::Object[i]
  • subclass: ::xowf::test_item::Answer_manager[i], ::xowf::test_item::Question_manager[i], ::xowf::test_item::Renaming_form_loader[i]
::nx::Class create ::xowf::test_item::AssessmentInterface \
     -superclass ::nx::Object

Methods (to be applied on instances)

  • render_feedback_files (scripted, public)

     <instance of xowf::test_item::AssessmentInterface[i]> 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