- 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
, ::xowf::test_item::AssessmentInterface
, ::xowf::test_item::Question_manager
, ::xowf::test_item::Renaming_form_loader
, ::xowf::test_item::renaming_form_loader
, ::xowf::test_item::question_manager
, ::xowf::test_item::answer_manager
, ::xowf::test_item::Question_manager
, ::xowf::test_item::Answer_manager
, ::xowf::test_item::Answer_manager
, ::xowf::test_item::Question_manager
, ::xowf::test_item::Answer_manager
, ::xowf::test_item::Answer_manager
, ::xowf::test_item::Answer_manager
, ::xowf::test_item::Answer_manager
, ::xowf::test_item::Answer_manager
, ::xowf::test_item::Answer_manager
, ::xowf::test_item::Answer_manager
, ::xowf::test_item::Answer_manager
, ::xowf::test_item::Question_manager
, ::xowf::test_item::Question_manager
, ::xowf::test_item::Question_manager
, ::xowf::test_item::Question_manager
, ::xowf::test_item::Question_manager
, ::xowf::test_item::Question_manager
, ::xowf::test_item::Question_manager
, ::xowf::test_item::Question_manager
, ::xowf::test_item::Question_manager
, ::xowf::test_item::Question_manager
, ::xowf::test_item::Renaming_form_loader
, ::xowf::test_item::Renaming_form_loader
, ::xowf::test_item::Answer_manager
- Location:
- packages/xowf/tcl/test-item-procs.tcl
- Author:
- Gustaf Neumann
Procedures in this file
- Class ::xowf::test_item::Answer_manager (public)
- Class ::xowf::test_item::AssessmentInterface (public)
- Class ::xowf::test_item::Question_manager (public)
- Class ::xowf::test_item::Renaming_form_loader (public)
- Object ::xowf::test_item::answer_manager (public)
- Object ::xowf::test_item::question_manager (public)
- Object ::xowf::test_item::renaming_form_loader (public)
- xowf::test_item::Answer_manager instproc delete_scheduled_atjobs (public)
- xowf::test_item::Answer_manager instproc exam_results (public)
- xowf::test_item::Answer_manager instproc export_answer (public)
- xowf::test_item::Answer_manager instproc recutil_create (public)
- xowf::test_item::Answer_manager instproc render_answers_with_edit_history (public)
- xowf::test_item::Answer_manager instproc results_table (public)
- xowf::test_item::Answer_manager instproc waiting_room_message (public)
- xowf::test_item::Question_manager instproc current_question_form (public)
- xowf::test_item::Question_manager instproc current_question_number (public)
- xowf::test_item::Question_manager instproc current_question_obj (public)
- xowf::test_item::Question_manager instproc current_question_title (public)
- xowf::test_item::Question_manager instproc get_pool_questions (public)
- xowf::test_item::Question_manager instproc goto_page (public)
- xowf::test_item::Question_manager instproc question_info_block (public)
- xowf::test_item::Question_manager instproc question_statistics_block (public)
- xowf::test_item::Question_manager instproc question_summary (public)
- xowf::test_item::Question_manager instproc replace_pool_question (public)
- xowf::test_item::Renaming_form_loader instproc answer_for_form (public)
- xowf::test_item::Renaming_form_loader instproc answers_for_form (public)
Detailed information
Class ::xowf::test_item::Answer_manager (public)
::nx::Class ::xowf::test_item::Answer_manager
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
Abstract class for common functionality
- Testcases:
- No testcase defined.
Class ::xowf::test_item::Question_manager (public)
::nx::Class ::xowf::test_item::Question_manager
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
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
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:
- ::xowf::test_item::answer_manager answers_panel ?-polling? ?-heading /value/? ?-submission_msg /value/? ?-manager_obj /object/? ?-target_state /value/? ?-wf /object/? ?-current_question /value/? ?-extra_text /value/?
- ::xowf::test_item::answer_manager grading_dialog_setup /examWf/
- ::xowf::test_item::answer_manager recutil_create ?-exam_id /integer/? ?-fn /value/? ?-clear?
- ::xowf::test_item::answer_manager exam_results ?-manual_gradings /value/? ?-gradingScheme /value/? ?-only_grades /boolean/? ?-reply? ?-format /value/? ?-orderby /value/? /results_dict/
- ::xowf::test_item::answer_manager get_duration ?-exam_published_time /value/? /revision_sets/
- ::xowf::test_item::answer_manager set_exam_results -obj /object/ /property/ /value/
- ::xowf::test_item::answer_manager last_time_in_state /revision_sets/ -state /value/
- ::xowf::test_item::answer_manager revisions_up_to /revision_sets/ /revision_id/
- ::xowf::test_item::answer_manager render_answers_with_edit_history /examWf/
- ::xowf::test_item::answer_manager grading_scheme -examWf /object/ ?-grading /token .../? ?-total_points /value/?
- ::xowf::test_item::answer_manager prevent_multiple_tabs ?-cookie_name /value/?
- ::xowf::test_item::answer_manager grading_table ?-csv /value/? /grade_dict/
- ::xowf::test_item::answer_manager last_time_switched_to_state /revision_sets/ -state /value/ ?-before /value/?
- ::xowf::test_item::answer_manager render_answers ?-as_student /boolean/? ?-filter_submission_id /integer/? ?-creation_user /integer/? ?-revision_id /integer/? ?-filter_form_ids /integer .../? ?-export /boolean/? ?-orderby /token/? ?-grading /token .../? ?-with_grading_table /boolean/? /examWf/
- ::xowf::test_item::answer_manager get_exam_results -obj /object/ /property/ ?/default/?
- ::xowf::test_item::answer_manager time_window_setup /parentObj/ -time_window /value/
- ::xowf::test_item::answer_manager create_workflow ?-answer_workflow /value/? ?-master_workflow /value/? /parentObj/
- ::xowf::test_item::answer_manager state_periods /revision_sets/ -state /value/
- ::xowf::test_item::answer_manager export_answer ?-combined_form_info /value/? -html /value/ -recutil /object/ ?-submission /object/?
- ::xowf::test_item::answer_manager answer_form_field_objs ?-clear? ?-wf /object/? ?-generic? /form_info/
- ::xowf::test_item::answer_manager get_wf_instances ?-initialize /value/? ?-orderby /value/? ?-creation_user /integer/? ?-item_id /integer/? ?-state /value/? /wf/
- ::xowf::test_item::answer_manager student_submissions_exist /wf/
- ::xowf::test_item::answer_manager countdown_timer -target_time /value/ -id /value/ ?-audio_alarm /boolean/? ?-audio_alarm_cookie /value/? ?-audio_alarm_times /value/?
- ::xowf::test_item::answer_manager results_table ?-package_id /integer/? -items /object/ ?-view_all_method /value/? ?-with_answers /boolean/? ?-state /value/? ?-grading_scheme /value/? /wf/
- ::xowf::test_item::answer_manager waiting_room_message /obj/
- ::xowf::test_item::answer_manager get_answer_wf /obj/
- ::xowf::test_item::answer_manager runtime_panel ?-revision_id /value/? ?-view /value/? ?-grading_info /value/? /answerObj/
- ::xowf::test_item::answer_manager get_answer_attributes ?-state /value/? ?-extra_attributes /value/? /wf/
- ::xowf::test_item::answer_manager result_table ...
- ::xowf::test_item::answer_manager participants_table ?-package_id /integer/? -items /object/ ?-view_all_method /value/? ?-state /value/? /wf/
- ::xowf::test_item::answer_manager allow_answering ?-examwf /object/? -ip /value/
- ::xowf::test_item::answer_manager dom ...
- ::xowf::test_item::answer_manager delete_all_answer_data /obj/
- ::xowf::test_item::answer_manager get_IPs /revision_sets/
- ::xowf::test_item::answer_manager delete_scheduled_atjobs /obj/
- ::xowf::test_item::answer_manager marked_results ?-obj /object/? ?-wf /object/? /form_info/
- ::xowf::test_item::answer_manager dict_value ...
- ::xowf::test_item::answer_manager render_feedback_files -question_name /value/ ?-feedbackFiles /value/?
- Testcases:
- No testcase defined.
Object ::xowf::test_item::question_manager (public)
::xowf::test_item::Question_manager ::xowf::test_item::question_manager
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:
- ::xowf::test_item::question_manager exam_info_block ?-combined_form_info /value/? /obj/
- ::xowf::test_item::question_manager get_pool_questions ?-allowed_forms /value/? ?-field_name /value/? /pool_question_obj/ /exam_question_names/
- ::xowf::test_item::question_manager minutes_string /form_obj/
- ::xowf::test_item::question_manager question_info ?-numbers /value/? ?-with_title? ?-with_minutes? ?-with_points? ?-titleless_form? ?-obj /object/? ?-user_answers /object/? ?-no_position? ?-question_number_label /value/? ?-positions /integer .../? ?-with_question_count_in_title /boolean/? /form_objs/
- ::xowf::test_item::question_manager replace_pool_question ?-position /value/? ?-seed /value/? ?-allowed_forms /value/? ?-field_name /value/? ?-pool_question_obj /value/? ?-exam_question_names /value/?
- ::xowf::test_item::question_manager question_property /form_obj/ /attribute/ ?/default/?
- ::xowf::test_item::question_manager current_question_form ?-with_numbers? ?-with_title? /obj/
- ::xowf::test_item::question_manager item_substitute_markup ?-obj /object/? ?-form_obj /object/? ?-position /integer/? ?-do_substitutions?
- ::xowf::test_item::question_manager exam_configuration_modifiable_field_names /obj/
- ::xowf::test_item::question_manager nth_question_obj /obj/ /position/
- ::xowf::test_item::question_manager question_names /obj/
- ::xowf::test_item::question_manager disallow_spellcheck /form_obj/
- ::xowf::test_item::question_manager disallow_translation /form_obj/
- ::xowf::test_item::question_manager percent_substitute_in_form ?-obj /object/? ?-form_obj /object/? ?-position /integer/? /html/
- ::xowf::test_item::question_manager shuffled_index ?-shuffle_id /integer/? /obj/ /position/
- ::xowf::test_item::question_manager questions_without_minutes ?-max_items /integer/? /form_info/
- ::xowf::test_item::question_manager pagination_actions ?-container /object/? ?-question_count /integer/? ?-visited /integer .../? ?-flagged /integer .../? ?-current_position /integer/? ?-CSSclass /value/?
- ::xowf::test_item::question_manager nth_question_form ?-position /integer/? ?-item_nr /integer/? ?-with_numbers? ?-with_title? ?-titleless_form? ?-with_minutes? /obj/
- ::xowf::test_item::question_manager replace_pool_questions ?-answer_obj /object/? ?-exam_obj /object/?
- ::xowf::test_item::question_manager question_count ?-all? /obj/
- ::xowf::test_item::question_manager points_string /form_obj/
- ::xowf::test_item::question_manager add_seeds ?-obj /object/? ?-seed /integer/? ?-number /integer/?
- ::xowf::test_item::question_manager more_ahead ?-position /value/? /obj/
- ::xowf::test_item::question_manager aggregated_form ?-titleless_form? ?-with_feedback? ?-with_correction_notes? ?-with_grading_box /value/? /question_infos/
- ::xowf::test_item::question_manager current_question_title ?-with_numbers? /obj/
- ::xowf::test_item::question_manager exam_base_time ?-manager /object/? ?-answer_obj /object/?
- ::xowf::test_item::question_manager describe_form ?-asHTML? ?-field_name /value/? /form_obj/
- ::xowf::test_item::question_manager load_question_objs /obj/ /names/
- ::xowf::test_item::question_manager current_question_number /obj/
- ::xowf::test_item::question_manager disallow_paste /form_obj/
- ::xowf::test_item::question_manager hint_boxes ?-question_obj /object/? ?-with_feedback? ?-with_correction_notes?
- ::xowf::test_item::question_manager exam_configuration_popup /obj/
- ::xowf::test_item::question_manager question_statistics_block /obj/
- ::xowf::test_item::question_manager current_question_obj /obj/
- ::xowf::test_item::question_manager question_summary /obj/
- ::xowf::test_item::question_manager question_objs ?-shuffle_id /integer/? /obj/
- ::xowf::test_item::question_manager total_points ?-max_items /integer/? /form_info/
- ::xowf::test_item::question_manager total_minutes_for_exam ?-manager /object/?
- ::xowf::test_item::question_manager total_minutes ?-max_items /integer/? /form_info/
- ::xowf::test_item::question_manager initialize ?-wfi /object/?
- ::xowf::test_item::question_manager combined_question_form ?-with_numbers? ?-with_title? ?-with_minutes? ?-with_points? ?-user_specific? ?-shuffle_id /integer/? ?-user_answers /object/? ?-form_objs /object/? /obj/
- ::xowf::test_item::question_manager goto_page /obj/ /position/
- ::xowf::test_item::question_manager question_info_block /obj/
- ::xowf::test_item::question_manager exam_target_time ?-manager /object/? ?-base_time /value/?
- ::xowf::test_item::question_manager dict_value ...
- ::xowf::test_item::question_manager render_feedback_files -question_name /value/ ?-feedbackFiles /value/?
- Testcases:
- No testcase defined.
Object ::xowf::test_item::renaming_form_loader (public)
::xowf::test_item::Renaming_form_loader ::xowf::test_item::renaming_form_loader
Interface object to the renaming form loader
- See Also:
- ::xowf::test_item::renaming_form_loader answers_for_form /formName/ /answers/
- ::xowf::test_item::renaming_form_loader form_name_based_attribute_stem /formName/
- ::xowf::test_item::renaming_form_loader answer_for_form /formName/ /instance_attributes/
- ::xowf::test_item::renaming_form_loader rename_attributes /form_obj/
- ::xowf::test_item::renaming_form_loader answer_attributes /instance_attributes/
- ::xowf::test_item::renaming_form_loader name_to_question_obj_dict /question_objs/
- ::xowf::test_item::renaming_form_loader dict_value ...
- ::xowf::test_item::renaming_form_loader render_feedback_files -question_name /value/ ?-feedbackFiles /value/?
- Testcases:
- No testcase defined.
xowf::test_item::Answer_manager method delete_scheduled_atjobs (public)
<instance of xowf::test_item::Answer_manager> 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> 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> 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> 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> 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> 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> 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> 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> 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> 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> 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> 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> 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> 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> 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> 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> 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> 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> 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.