• Publicity: Public Only All

test-item-procs.tcl

Test Item procs - support for different kind of tests and exercises.

This file defines the following Objects and Classes: ::xowf::test_item::Answer_manager[i], ::xowf::test_item::AssessmentInterface[i], ::xowf::test_item::Question_manager[i], ::xowf::test_item::Renaming_form_loader[i], ::xowf::test_item::renaming_form_loader[i], ::xowf::test_item::question_manager[i], ::xowf::test_item::answer_manager[i], ::xowf::test_item::Question_manager[i], ::xowf::test_item::Answer_manager[i], ::xowf::test_item::Answer_manager[i], ::xowf::test_item::Question_manager[i], ::xowf::test_item::Answer_manager[i], ::xowf::test_item::Answer_manager[i], ::xowf::test_item::Answer_manager[i], ::xowf::test_item::Answer_manager[i], ::xowf::test_item::Answer_manager[i], ::xowf::test_item::Answer_manager[i], ::xowf::test_item::Answer_manager[i], ::xowf::test_item::Answer_manager[i], ::xowf::test_item::Question_manager[i], ::xowf::test_item::Question_manager[i], ::xowf::test_item::Question_manager[i], ::xowf::test_item::Question_manager[i], ::xowf::test_item::Question_manager[i], ::xowf::test_item::Question_manager[i], ::xowf::test_item::Question_manager[i], ::xowf::test_item::Question_manager[i], ::xowf::test_item::Question_manager[i], ::xowf::test_item::Question_manager[i], ::xowf::test_item::Renaming_form_loader[i], ::xowf::test_item::Renaming_form_loader[i], ::xowf::test_item::Answer_manager[i]

Location:
packages/xowf/tcl/test-item-procs.tcl
Author:
Gustaf Neumann

Procedures in this file

Detailed information

Class ::xowf::test_item::Answer_manager (public)

 ::nx::Class ::xowf::test_item::Answer_manager[i]

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

Testcases:
No testcase defined.

Class ::xowf::test_item::AssessmentInterface (public)

 ::nx::Class ::xowf::test_item::AssessmentInterface[i]

Abstract class for common functionality

Testcases:
No testcase defined.

Class ::xowf::test_item::Question_manager (public)

 ::nx::Class ::xowf::test_item::Question_manager[i]

This code manages questions and the information related to a current (selected) question via qthe "position" instance attribute. It provides the following public API: - goto_page - more_ahead - pagination_actions - current_question_form - current_question_obj - current_question_name - current_question_title - nth_question_obj - nth_question_form - exam_configuration_popup - exam_configuration_modifiable_field_names - combined_question_form - question_objs - question_names - question_count - question_property - add_seeds - total_minutes - total_points - questions_without_minutes - total_minutes_for_exam - exam_target_time - exam_base_time - percent_substitute_in_form - item_substitute_markup - describe_form - question_summary - question_info_block - question_statistics_block

Testcases:
No testcase defined.

Class ::xowf::test_item::Renaming_form_loader (public)

 ::nx::Class ::xowf::test_item::Renaming_form_loader[i]

Form loader that renames "generic" form-field-names as provided by the test-item form-field classes (@answer@) into names based on the form name, such that multiple of these form names can be processed together without name clashes. - answer_attributes - answer_for_form - answers_for_form - form_name_based_attribute_stem - name_to_question_obj_dict - rename_attributes

Testcases:
No testcase defined.

Object ::xowf::test_item::answer_manager (public)

 ::xowf::test_item::Answer_manager ::xowf::test_item::answer_manager[i]

Interface object to Answer manager for the test items as used in inclass exam and similar learning workflows. It is used for general answer management of the submitted test items, including answer workflow creation and deletion of submissions.

See Also:

Testcases:
No testcase defined.

Object ::xowf::test_item::question_manager (public)

 ::xowf::test_item::Question_manager ::xowf::test_item::question_manager[i]

Interface object to Question manager for the test items as used in inclass exam and similar learning workflows. It is used for general question (test item) management of quizzes and exams. It is used, e.g., for navigation between test-items, obtaining information about test items, including achievable and achieved points, and for providing statistics across test items.

See Also:

Testcases:
No testcase defined.

xowf::test_item::Answer_manager method delete_scheduled_atjobs (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.

xowf::test_item::Answer_manager method exam_results (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.

xowf::test_item::Answer_manager method export_answer (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.

xowf::test_item::Answer_manager method recutil_create (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.

xowf::test_item::Answer_manager method render_answers_with_edit_history (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.

xowf::test_item::Answer_manager method results_table (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.

xowf::test_item::Answer_manager method waiting_room_message (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.

xowf::test_item::Question_manager method current_question_form (public)

 <instance of xowf::test_item::Question_manager[i]> current_question_form \
    [ -with_numbers ] [ -with_title ] obj

Return the current form object of the provided assessment.

Switches:
-with_numbers (optional, defaults to "false")
-with_title (optional, defaults to "false")
Parameters:
obj (required, object)

Testcases:
No testcase defined.

xowf::test_item::Question_manager method current_question_number (public)

 <instance of xowf::test_item::Question_manager[i]> current_question_number \
    obj

Translate the position of an object into its question number (as e.g. used by current_question_title).

Parameters:
obj (required, object)

Testcases:
No testcase defined.

xowf::test_item::Question_manager method current_question_obj (public)

 <instance of xowf::test_item::Question_manager[i]> current_question_obj \
    obj

Load the current question obj based on the current question name.

Parameters:
obj (required, object)

Testcases:
No testcase defined.

xowf::test_item::Question_manager method current_question_title (public)

 <instance of xowf::test_item::Question_manager[i]> current_question_title \
    [ -with_numbers ] obj

In case, with_numbers is provided, return a internationalized title for the question, such as "Question 1".

Switches:
-with_numbers (optional, defaults to "false")
Parameters:
obj (required, object)

Testcases:
No testcase defined.

xowf::test_item::Question_manager method get_pool_questions (public)

 <instance of xowf::test_item::Question_manager[i]> get_pool_questions \
    [ -allowed_forms allowed_forms ] [ -field_name field_name ] \
    pool_question_obj exam_question_names

Obtain for the specs in the pool_question_obj potential replacement items in form of a replacement dict. For raw forms (i.e., not obtained via the renaming form-loader), we have just the plain "answer", which can be provided via the "field_name" attribute.

Switches:
-allowed_forms (optional, defaults to "en:edit-interaction.wf")
-field_name (optional)
Parameters:
pool_question_obj (required)
exam_question_names (required)

Testcases:
No testcase defined.

xowf::test_item::Question_manager method goto_page (public)

 <instance of xowf::test_item::Question_manager[i]> goto_page obj \
    position

ns_log notice "===== goto_page $position" Set the position (test item number) of the workflow (exam). This sets the question number shown to the user.

Parameters:
obj (required, object)
position (required)

Testcases:
No testcase defined.

xowf::test_item::Question_manager method question_info_block (public)

 <instance of xowf::test_item::Question_manager[i]> question_info_block \
    obj

Provide question info block.

Parameters:
obj (required)

Testcases:
No testcase defined.

xowf::test_item::Question_manager method question_statistics_block (public)

 <instance of xowf::test_item::Question_manager[i]> question_statistics_block \
    obj

When we have results, we can provide statistics

Parameters:
obj (required)

Testcases:
No testcase defined.

xowf::test_item::Question_manager method question_summary (public)

 <instance of xowf::test_item::Question_manager[i]> question_summary \
    obj

Provide a summary of all questions of an exam.

Parameters:
obj (required)

Testcases:
No testcase defined.

xowf::test_item::Question_manager method replace_pool_question (public)

 <instance of xowf::test_item::Question_manager[i]> replace_pool_question \
    [ -position position ] [ -seed seed ] \
    [ -allowed_forms allowed_forms ] [ -field_name field_name ] \
    [ -pool_question_obj pool_question_obj ] \
    [ -exam_question_names exam_question_names ]
Switches:
-position (optional)
-seed (optional)
-allowed_forms (optional, defaults to "en:edit-interaction.wf")
-field_name (optional)
-pool_question_obj (optional)
-exam_question_names (optional)
Returns:
an initialized replacement form obj if this is possible

Testcases:
No testcase defined.

xowf::test_item::Renaming_form_loader method answer_for_form (public)

 <instance of xowf::test_item::Renaming_form_loader[i]> answer_for_form \
    formName instance_attributes

Return answer for the provided formName from instance_attributes of a single object.

Parameters:
formName (required)
instance_attributes (required)

Testcases:
No testcase defined.

xowf::test_item::Renaming_form_loader method answers_for_form (public)

 <instance of xowf::test_item::Renaming_form_loader[i]> answers_for_form \
    formName answers

Return a list of dicts for the provided formName from the answers (as returned from [answer_manager get_answer_attributes ...]).

Parameters:
formName (required)
answers (required)

Testcases:
No testcase defined.
[ show source ]