%3 ::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::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::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 ::nx::Object ::nx::Object __default_accessor __default_method_call_protection __object_configureparameter __resolve_method_path contains copy delete object method delete object property delete object variable destroy_on_cleanup info info info lookup parameters info lookup slots info lookup syntax info lookup variables info object method args info object method body info object method callprotection info object method debug info object method definition info object method definitionhandle info object method deprecated info object method exists info object method handle info object method origin info object method parameters info object method registrationhandle info object method returns info object method submethods info object method syntax info object method type info object slots info object variables info variable definition info variable name info variable parameter move object alias object forward object method object property object variable private protected public qn require namespace require object method require private object method require protected object method require public object method serialize ::xowf::test_item::AssessmentInterface->::nx::Object

Class ::xowf::test_item::Answer_manager

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

Public API: - create_workflow - delete_all_answer_data - allow_answering - get_answer_wf - get_wf_instances - get_answer_attributes - student_submissions_exist - runtime_panel - render_answers_with_edit_history - render_answers - marked_results - answers_panel - exam_results - grading_table - grading_scheme - grade - participants_table - get_duration - get_IPs - revisions_up_to - last_time_in_state - last_time_switched_to_state - state_periods - time_window_setup - waiting_room_message
Defined in packages/xowf/tcl/test-item-procs.tcl

Class Relations

  • class: ::nx::Class[i]
  • superclass: ::xowf::test_item::AssessmentInterface[i]

Methods (to be applied on instances)

  • allow_answering (scripted, public)

     <instance of xowf::test_item::Answer_manager[i]> allow_answering \
        [ -examwf examwf ] -ip ip 

    Tell if specified IP address is allowed to answer the exam.

    Switches:
    -examwf (optional, object)
    -ip (required)
    Returns:
    boolean

    Testcases:
    No testcase defined.
  • answer_form_field_objs (scripted, public)

     <instance of xowf::test_item::Answer_manager[i]> answer_form_field_objs \
        [ -clear ] [ -wf wf ] [ -generic ] form_info

    Instantiate the form_field objects of the provided form based on form_info.

    Switches:
    -clear (optional)
    -wf (optional, object)
    -generic (optional)
    Parameters:
    form_info (required)

    Testcases:
    No testcase defined.
  • answers_panel (scripted, public)

     <instance of xowf::test_item::Answer_manager[i]> answers_panel \
        [ -polling ] [ -heading heading ] \
        [ -submission_msg submission_msg ] [ -manager_obj manager_obj ] \
        [ -target_state target_state ] [ -wf wf ] \
        [ -current_question current_question ] [ -extra_text extra_text ]

    Produce HTML code for an answers panel, containing the number of participants of an e-assessment and the number of participants, who have already answered.

    Switches:
    -polling (optional, defaults to "false")
    when specified, provide live updates of the numbers via AJAX calls
    -heading (optional, defaults to "#xowf.submitted_answers#")
    -submission_msg (optional, defaults to "#xowf.participants_answered_question#")
    -manager_obj (optional, object)
    -target_state (optional)
    -wf (optional, object)
    -current_question (optional)
    -extra_text (optional)
    optional extra text for the panel, has to be provided with valid HTML markup.

    Testcases:
    No testcase defined.
  • countdown_timer (scripted, public)

     <instance of xowf::test_item::Answer_manager[i]> countdown_timer \
        -target_time target_time  -id id  [ -audio_alarm on|off ] \
        [ -audio_alarm_cookie audio_alarm_cookie ] \
        [ -audio_alarm_times audio_alarm_times ]

    Accepted formats for target_time, determined by JavaScript ISO 8601, e.g. YYYY-MM-DDTHH:mm:ss.sss" Set current time based on host time instead of new Date().getTime() to avoid surprises, in cases, the time at the client browser is set incorrectly.

    Switches:
    -target_time (required)
    -id (required)
    -audio_alarm (optional, boolean, defaults to "true")
    -audio_alarm_cookie (optional, defaults to "incass_exam_audio_alarm")
    -audio_alarm_times (optional, defaults to "60,30,20,10,5,2")

    Testcases:
    No testcase defined.
  • create_workflow (scripted, public)

     <instance of xowf::test_item::Answer_manager[i]> create_workflow \
        [ -answer_workflow answer_workflow ] \
        [ -master_workflow master_workflow ] parentObj

    Create a workflow based on the template provided in this method for answering the question for the students. The name of the workflow is derived from the workflow instance and recorded in the formfield "wfName". :log "create_answer_workflow $parentObj"

    Switches:
    -answer_workflow (optional, defaults to "/packages/xowf/lib/online-exam-answer.wf")
    -master_workflow (optional, defaults to "en:Workflow.form")
    Parameters:
    parentObj (required, object)

    Testcases:
    No testcase defined.
  • delete_all_answer_data (scripted, public)

     <instance of xowf::test_item::Answer_manager[i]> delete_all_answer_data \
        obj

    Delete all instances of the answer workflow

    Parameters:
    obj (required, object)

    Testcases:
    No testcase defined.
  • delete_scheduled_atjobs (scripted, public)

     <instance of xowf::test_item::Answer_manager[i]> delete_scheduled_atjobs \
        obj

    Delete previously scheduled atjobs ns_log notice "#### delete_scheduled_atjobs"

    Parameters:
    obj (required, object)

    Testcases:
    No testcase defined.
  • exam_results (scripted, public)

     <instance of xowf::test_item::Answer_manager[i]> exam_results \
        [ -manual_gradings manual_gradings ] \
        [ -gradingScheme gradingScheme ] [ -only_grades on|off ] \
        [ -reply ] [ -format format ] [ -orderby orderby ] results_dict

    Return results either as HTML table, as HTML chart or as csv. When "reply" is set. the result is returned directly to the browser (for downloading). When "gradingScheme" is empty, this method returns the following fields: participant, question, achieved_points, achievable points, comment When the "gradingScheme" is specified the results are per-participant. In this cases, when the "gradingScheme" is "....::none", the fields are participant, achieved, percentage otherwise the grade and rounding of achieved points and percentage are exported based on the rules of the grading scheme. participant, achieved, percentage, grade When additionally "only_grades" is specified, just participant and grad are returned/exported.

    Switches:
    -manual_gradings (optional)
    -gradingScheme (optional)
    needed for reporting grades, can be empty
    -only_grades (optional, boolean, defaults to "false")
    -reply (optional, defaults to "false")
    when false, csv will be returned as text, when true, it will be returned as response to the browser.
    -format (optional, defaults to "csv")
    -orderby (optional, defaults to "participant,desc")
    Parameters:
    results_dict (required)
    the results to format as csv, every key in the dict represents a user_id.
    Returns:
    csv as value or as response to the client

    Testcases:
    No testcase defined.
  • export_answer (scripted, public)

     <instance of xowf::test_item::Answer_manager[i]> export_answer \
        [ -combined_form_info combined_form_info ] -html html  \
        -recutil recutil  [ -submission submission ]

    Export the provided question and answer in GNU rectuil format. ns_log notice "answers: [$submission serialize]"

    Switches:
    -combined_form_info (optional)
    -html (required)
    -recutil (required, object)
    -submission (optional, object)

    Testcases:
    No testcase defined.
  • get_IPs (scripted, public)

     <instance of xowf::test_item::Answer_manager[i]> get_IPs \
        revision_sets

    Get the IP addresses for the given revision set. Should be actually only one. The revision_set must not be empty.

    Parameters:
    revision_sets (required)

    Testcases:
    No testcase defined.
  • get_answer_attributes (scripted, public)

     <instance of xowf::test_item::Answer_manager[i]> get_answer_attributes \
        [ -state state ] [ -extra_attributes extra_attributes ] wf

    Extracts wf instances as answers (e.g., extracting their answer-specific attributes)

    Switches:
    -state (optional)
    retrieve only instances in this state
    -extra_attributes (optional)
    return these attributes additionally as key/value pairs per tuple
    Parameters:
    wf (required, object)
    the workflow
    Returns:
    a list of dicts

    Testcases:
    No testcase defined.
  • get_answer_wf (scripted, public)

     <instance of xowf::test_item::Answer_manager[i]> get_answer_wf obj

    return the workflow denoted by the property wfName in obj

    Parameters:
    obj (required, object)

    Testcases:
    No testcase defined.
  • get_duration (scripted, public)

     <instance of xowf::test_item::Answer_manager[i]> get_duration \
        [ -exam_published_time exam_published_time ] revision_sets

    Get the duration from a set of revisions and return a dict containing "from", "fromClock","to", "toClock", "seconds", and "duration".

    Switches:
    -exam_published_time (optional)
    Parameters:
    revision_sets (required)

    Testcases:
    No testcase defined.
  • get_exam_results (scripted, public)

     <instance of xowf::test_item::Answer_manager[i]> get_exam_results \
        -obj obj  property [ default ]

    Retrieve a property value from the exam statistics result page. This page is an instance of the exam statistics workflow stored as a child of the exam object.

    Switches:
    -obj (required, object)
    the exam object
    Parameters:
    property (required)
    the property name
    default (optional)
    default value when property is not found

    Testcases:
    No testcase defined.
  • get_wf_instances (scripted, public)

     <instance of xowf::test_item::Answer_manager[i]> get_wf_instances \
        [ -initialize initialize ] [ -orderby orderby ] \
        [ -creation_user creation_user ] [ -item_id item_id ] \
        [ -state state ] wf

    get_wf_instances: return the workflow instances

    Switches:
    -initialize (optional, defaults to "false")
    -orderby (optional)
    -creation_user (optional, integer)
    -item_id (optional, integer)
    -state (optional)
    Parameters:
    wf (required, object)

    Testcases:
    No testcase defined.
  • grading_dialog_setup (scripted, public)

     <instance of xowf::test_item::Answer_manager[i]> grading_dialog_setup \
        examWf

    Define the modal dialog and everything necessary for reusing this dialog for multiple occasions. This method registers the pop-up and dismiss handlers for JavaScript and returns the HTML markup of the modal dialog.

    Parameters:
    examWf (required)
    Returns:
    HTML block for the modal dialog

    Testcases:
    No testcase defined.
  • grading_scheme (scripted, public)

     <instance of xowf::test_item::Answer_manager[i]> grading_scheme \
        -examWf examWf  [ -grading grading ] \
        [ -total_points total_points ]

    Return the grading scheme object based on the provided short name. In case the grading scheme belongs to the predefined grading schemes, the object can be directly loaded. When the name refers to a user-defined grading object, this might have to be loaded. We could consider some hints about the usefulness of the chosen grading scheme, E.g., when an exam has 40 points or less, rounding has the potential effect that a high percentage of the grade is just due to rounding. So, in such cases a non-rounding scheme should be preferred.

    Switches:
    -examWf (required, object)
    -grading (optional)
    -total_points (optional, defaults to "100")
    Returns:
    fully qualified grading scheme object

    Testcases:
    No testcase defined.
  • grading_table (scripted, public)

     <instance of xowf::test_item::Answer_manager[i]> grading_table \
        [ -csv csv ] grade_dict

    Produce HTML markup based on a dict with grades as keys and counts as values.

    Switches:
    -csv (optional)
    Parameters:
    grade_dict (required)

    Testcases:
    No testcase defined.
  • last_time_in_state (scripted, public)

     <instance of xowf::test_item::Answer_manager[i]> last_time_in_state \
        -state state  revision_sets

    Loops through revision sets and retrieves the latest date where state is equal the specified value.

    Switches:
    -state (required)
    Parameters:
    revision_sets (required)
    a list of ns_sets containing revision data. List is assumed to be sorted in descending creation_date order (as retrieved by get_revision_sets)
    Returns:
    a date

    Testcases:
    No testcase defined.
  • last_time_switched_to_state (scripted, public)

     <instance of xowf::test_item::Answer_manager[i]> last_time_switched_to_state \
        -state state  [ -before before ] revision_sets

    Loops through revision sets and retrieves the latest date where state is equal the specified value.

    Switches:
    -state (required)
    -before (optional)
    Parameters:
    revision_sets (required)
    a list of ns_sets containing revision data. List is assumed to be sorted in descending creation_date order (as retrieved by get_revision_sets)
    Returns:
    a date

    Testcases:
    No testcase defined.
  • marked_results (scripted, public)

     <instance of xowf::test_item::Answer_manager[i]> marked_results \
        [ -obj obj ] [ -wf wf ] form_info

    Return for every participant the individual results for an exam

    Switches:
    -obj (optional, object)
    -wf (optional, object)
    Parameters:
    form_info (required)

    Testcases:
    No testcase defined.
  • participants_table (scripted, public)

     <instance of xowf::test_item::Answer_manager[i]> participants_table \
        [ -package_id package_id ] -items items  \
        [ -view_all_method view_all_method ] [ -state state ] wf

    This method returns an HTML table containing a row for every participant with Name and short summary information. This table provides as well an interface for sending messages to this student.

    Switches:
    -package_id (optional, integer)
    -items (required, object)
    -view_all_method (optional, defaults to "print-answers")
    -state (optional, defaults to "done")
    Parameters:
    wf (required, object)

    Testcases:
    No testcase defined.
  • prevent_multiple_tabs (scripted, public)

     <instance of xowf::test_item::Answer_manager[i]> prevent_multiple_tabs \
        [ -cookie_name cookie_name ]

    Prevent answering the same survey from multiple, concurrently open tabs.

    Switches:
    -cookie_name (optional, defaults to "multiple_tabs")

    Testcases:
    No testcase defined.
  • recutil_create (scripted, public)

     <instance of xowf::test_item::Answer_manager[i]> recutil_create \
        [ -exam_id exam_id ] [ -fn fn ] [ -clear ]

    Create recfile

    Switches:
    -exam_id (optional, integer)
    -fn (optional, defaults to "answers.rec")
    -clear (optional)
    See Also:

    Testcases:
    No testcase defined.
  • render_answers (scripted, public)

     <instance of xowf::test_item::Answer_manager[i]> render_answers \
        [ -as_student on|off ] \
        [ -filter_submission_id filter_submission_id ] \
        [ -creation_user creation_user ] [ -revision_id revision_id ] \
        [ -filter_form_ids filter_form_ids ] [ -export on|off ] \
        [ -orderby orderby ] [ -grading grading ] \
        [ -with_grading_table on|off ] examWf

    Return the answers in HTML format in a somewhat printer friendly way, e.g. as the exam protocol.

    Switches:
    -as_student (optional, boolean, defaults to "false")
    -filter_submission_id (optional, integer, accept empty)
    -creation_user (optional, integer, accept empty)
    -revision_id (optional, integer, accept empty)
    -filter_form_ids (optional, integer)
    -export (optional, boolean, defaults to "false")
    -orderby (optional, defaults to "online-exam-userName")
    -grading (optional)
    -with_grading_table (optional, boolean, defaults to "false")
    Parameters:
    examWf (required, object)
    Returns:
    dict containing "do_stream" and "HTML" ns_log notice "RENDER ANSWERS 0"

    Testcases:
    No testcase defined.
  • render_answers_with_edit_history (scripted, public)

     <instance of xowf::test_item::Answer_manager[i]> render_answers_with_edit_history \
        examWf

    Analyze the student submissions an find situations, where input is "cleared" between revisions and return the HTML rendering. TODO: we should resolve this, move the exam protocol rendering (www-print-answers) also into the answer manager and make it configurable to provide this as an alternate item renderer. The current result is provided for all submission,s, but in general, this could be as well made available per question or per-student.

    Parameters:
    examWf (required, object)
    Returns:
    HTML

    Testcases:
    No testcase defined.
  • results_table (scripted, public)

     <instance of xowf::test_item::Answer_manager[i]> results_table \
        [ -package_id package_id ] -items items  \
        [ -view_all_method view_all_method ] [ -with_answers on|off ] \
        [ -state state ] [ -grading_scheme grading_scheme ] wf

    Render the results in format of a table and return HTML. Currently mostly deactivated (but potentially called by online-exam.wf and topic-assignment.wf).

    Switches:
    -package_id (optional, integer)
    -items (required, object)
    -view_all_method (optional, defaults to "print-answers")
    -with_answers (optional, boolean, defaults to "true")
    -state (optional, defaults to "done")
    -grading_scheme (optional, defaults to "::xowf::test_item::grading::none")
    Parameters:
    wf (required, object)

    Testcases:
    No testcase defined.
  • revisions_up_to (scripted, public)

     <instance of xowf::test_item::Answer_manager[i]> revisions_up_to \
        revision_sets revision_id

    Return the revisions of the provided revision set up the provided revision_id. If this revision_id does not exist, return the full set.

    Parameters:
    revision_sets (required)
    revision_id (required)

    Testcases:
    No testcase defined.
  • runtime_panel (scripted, public)

     <instance of xowf::test_item::Answer_manager[i]> runtime_panel \
        [ -revision_id revision_id ] [ -view view ] \
        [ -grading_info grading_info ] answerObj

    Return statistics for the provided object in the form of HTML: - minimal statistics: when view default - statistics with clickable revisions: when view = revision_overview - per-revision statistics: when view = revision_overview and revision_id is provided

    Switches:
    -revision_id (optional)
    -view (optional, defaults to "default")
    -grading_info (optional)
    Parameters:
    answerObj (required, object)
    Returns:
    HTML block

    Testcases:
    No testcase defined.
  • set_exam_results (scripted, public)

     <instance of xowf::test_item::Answer_manager[i]> set_exam_results \
        -obj obj  property value

    ns_log notice "SES '$property' bytes [string length $value]"

    Switches:
    -obj (required, object)
    Parameters:
    property (required)
    value (required)

    Testcases:
    No testcase defined.
  • state_periods (scripted, public)

     <instance of xowf::test_item::Answer_manager[i]> state_periods \
        -state state  revision_sets

    Return for the provided revision_sets the time ranges the workflow was in the provided state.

    Switches:
    -state (required)
    Parameters:
    revision_sets (required)

    Testcases:
    No testcase defined.
  • student_submissions_exist (scripted, public)

     <instance of xowf::test_item::Answer_manager[i]> student_submissions_exist \
        wf

    Returns 1 if there are student submissions. The method returns already true, when a student has started to work on this exam. This method could be optimized if necessary via caching the wf_instances or a more specific database query.

    Parameters:
    wf (required, object)

    Testcases:
    No testcase defined.
  • time_window_setup (scripted, public)

     <instance of xowf::test_item::Answer_manager[i]> time_window_setup \
        -time_window time_window  parentObj

    Check the provided time_window values, adjust it if necessary, and make sure, according atjobs are provided. This method was made public, since there configuration window update in inclass-exam.wf requires this for the update via update_attribute_from_slot. Probably, we should move the core of this function to this file, and make it protected again.

    Switches:
    -time_window (required)
    Parameters:
    parentObj (required, object)

    Testcases:
    No testcase defined.
  • waiting_room_message (scripted, public)

     <instance of xowf::test_item::Answer_manager[i]> waiting_room_message \
        obj

    Renders the waiting room message, including the JavaScript reacting to actions from the backend.

    Parameters:
    obj (required, object)

    Testcases:
    No testcase defined.