- 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)- -ip
(required)- Returns:
- boolean
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- create_test_items
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)- -generic
(optional)- Parameters:
- form_info
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- create_test_items
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
(defaults to"false"
) (optional)- when specified, provide live updates of the numbers via AJAX calls
- -heading
(defaults to"#xowf.submitted_answers#"
) (optional)- -submission_msg
(defaults to"#xowf.participants_answered_question#"
) (optional)- -manager_obj
(optional)- -target_state
(optional)- -wf
(optional)- -current_question
(optional)- -extra_text
(optional)- optional extra text for the panel, has to be provided with valid HTML markup.
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- create_test_items
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
(boolean) (defaults to"true"
) (optional)- -audio_alarm_cookie
(defaults to"incass_exam_audio_alarm"
) (optional)- -audio_alarm_times
(defaults to"60,30,20,10,5,2"
) (optional)- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- create_test_items
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
(defaults to"/packages/xowf/lib/online-exam-answer.wf"
) (optional)- -master_workflow
(defaults to"en:Workflow.form"
) (optional)- Parameters:
- parentObj
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- create_test_items
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
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- create_test_items
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
- Partial Call Graph (max 5 caller/called nodes):
- 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
(boolean) (defaults to"false"
) (optional)- -reply
(defaults to"false"
) (optional)- when false, csv will be returned as text, when true, it will be returned as response to the browser.
- -format
(defaults to"csv"
) (optional)- -orderby
(defaults to"participant,desc"
) (optional)- Parameters:
- results_dict - 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
- Partial Call Graph (max 5 caller/called nodes):
- 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
(optional)- -submission
(optional)- Partial Call Graph (max 5 caller/called nodes):
- 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
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- create_test_items
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 - the workflow
- Returns:
- a list of dicts
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- create_test_items
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
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- create_test_items
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
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- create_test_items
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
(optional)- the exam object
- Parameters:
- property - the property name
default (optional) - default value when property is not found
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- create_test_items
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
(defaults to"false"
) (optional)- -orderby
(optional)- -creation_user
(optional)- -item_id
(optional)- -state
(optional)- Parameters:
- wf
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- create_test_items
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
- Returns:
- HTML block for the modal dialog
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- create_test_items
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
(optional)- -grading
(optional)- -total_points
(defaults to"100"
) (optional)- Returns:
- fully qualified grading scheme object
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- create_test_items
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
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- create_test_items
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 - 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
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- create_test_items
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 - 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
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- create_test_items
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)- -wf
(optional)- Parameters:
- form_info
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- create_test_items
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)- -items
(optional)- -view_all_method
(defaults to"print-answers"
) (optional)- -state
(defaults to"done"
) (optional)- Parameters:
- wf
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- create_test_items
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
(defaults to"multiple_tabs"
) (optional)- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- create_test_items
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)- -fn
(defaults to"answers.rec"
) (optional)- -clear
(optional)- See Also:
- Partial Call Graph (max 5 caller/called nodes):
- 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
(boolean) (defaults to"false"
) (optional)- -filter_submission_id
(optional)- -creation_user
(optional)- -revision_id
(optional)- -filter_form_ids
(optional)- -export
(boolean) (defaults to"false"
) (optional)- -orderby
(defaults to"online-exam-userName"
) (optional)- -grading
(optional)- -with_grading_table
(boolean) (defaults to"false"
) (optional)- Parameters:
- examWf
- Returns:
- dict containing "do_stream" and "HTML" ns_log notice "RENDER ANSWERS 0"
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- create_test_items
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
- Returns:
- HTML
- Partial Call Graph (max 5 caller/called nodes):
- 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)- -items
(optional)- -view_all_method
(defaults to"print-answers"
) (optional)- -with_answers
(boolean) (defaults to"true"
) (optional)- -state
(defaults to"done"
) (optional)- -grading_scheme
(defaults to"::xowf::test_item::grading::none"
) (optional)- Parameters:
- wf
- Partial Call Graph (max 5 caller/called nodes):
- 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
revision_id
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- create_test_items
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
(defaults to"default"
) (optional)- -grading_info
(optional)- Parameters:
- answerObj
- Returns:
- HTML block
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- create_test_items
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
(optional)- Parameters:
- property
value
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- create_test_items
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
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- create_test_items
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
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- create_test_items
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
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- create_test_items
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
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables