- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables
Class ::xowf::test_item::Answer_manager
::xowf::test_item::Answer_manager 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
Methods (to be applied on instances)
allow_answering (scripted, public)
<instance of xowf::test_item::Answer_manager> allow_answering \ [ -examwf examwf ] -ip ipTell 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> answer_form_field_objs \ [ -clear ] [ -wf wf ] [ -generic ] form_infoInstantiate 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> 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> 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> create_workflow \ [ -answer_workflow answer_workflow ] \ [ -master_workflow master_workflow ] parentObjCreate 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> delete_all_answer_data \ objDelete 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> delete_scheduled_atjobs \ objDelete 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> exam_results \ [ -manual_gradings manual_gradings ] \ [ -gradingScheme gradingScheme ] [ -only_grades on|off ] \ [ -reply ] [ -format format ] [ -orderby orderby ] results_dictReturn 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> 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> get_IPs \ revision_setsGet 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> get_answer_attributes \ [ -state state ] [ -extra_attributes extra_attributes ] wfExtracts 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> get_answer_wf objreturn 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> get_duration \ [ -exam_published_time exam_published_time ] revision_setsGet 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> 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> get_wf_instances \ [ -initialize initialize ] [ -orderby orderby ] \ [ -creation_user creation_user ] [ -item_id item_id ] \ [ -state state ] wfget_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> grading_dialog_setup \ examWfDefine 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> 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> grading_table \ [ -csv csv ] grade_dictProduce 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> last_time_in_state \ -state state revision_setsLoops 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> last_time_switched_to_state \ -state state [ -before before ] revision_setsLoops 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> marked_results \ [ -obj obj ] [ -wf wf ] form_infoReturn 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> participants_table \ [ -package_id package_id ] -items items \ [ -view_all_method view_all_method ] [ -state state ] wfThis 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> 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> 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> 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 ] examWfReturn 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> render_answers_with_edit_history \ examWfAnalyze 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> results_table \ [ -package_id package_id ] -items items \ [ -view_all_method view_all_method ] [ -with_answers on|off ] \ [ -state state ] [ -grading_scheme grading_scheme ] wfRender 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> revisions_up_to \ revision_sets revision_idReturn 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> runtime_panel \ [ -revision_id revision_id ] [ -view view ] \ [ -grading_info grading_info ] answerObjReturn 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> set_exam_results \ -obj obj property valuens_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> state_periods \ -state state revision_setsReturn 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> student_submissions_exist \ wfReturns 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> time_window_setup \ -time_window time_window parentObjCheck 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> waiting_room_message \ objRenders the waiting room message, including the JavaScript reacting to actions from the backend.
- Parameters:
- obj (required, object)
- Testcases:
- No testcase defined.
- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables