From 7749bbbe5161e95fd27f3f04f83207e229e2a907 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Andr=C3=A9s=20Rocha?= Date: Mon, 7 Oct 2013 18:06:52 -0400 Subject: [PATCH] Add module grade to problem_check tracking log event --- common/lib/xmodule/xmodule/capa_module.py | 6 +++++- .../internal_data_formats/tracking_logs.rst | 16 ++++++++++------ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/common/lib/xmodule/xmodule/capa_module.py b/common/lib/xmodule/xmodule/capa_module.py index 6ffbf7bd06..2516a9f9fc 100644 --- a/common/lib/xmodule/xmodule/capa_module.py +++ b/common/lib/xmodule/xmodule/capa_module.py @@ -884,6 +884,8 @@ class CapaModule(CapaFields, XModule): 'max_value': score['total'], }) + return {'grade': score['score'], 'max_grade': score['total']} + def check_problem(self, data): """ Checks whether answers to a problem are correct @@ -951,7 +953,7 @@ class CapaModule(CapaFields, XModule): return {'success': msg} raise - self.publish_grade() + published_grade = self.publish_grade() # success = correct if ALL questions in this problem are correct success = 'correct' @@ -961,6 +963,8 @@ class CapaModule(CapaFields, XModule): # NOTE: We are logging both full grading and queued-grading submissions. In the latter, # 'success' will always be incorrect + event_info['grade'] = published_grade['grade'] + event_info['max_grade'] = published_grade['max_grade'] event_info['correct_map'] = correct_map.get_dict() event_info['success'] = success event_info['attempts'] = self.attempts diff --git a/docs/data/source/internal_data_formats/tracking_logs.rst b/docs/data/source/internal_data_formats/tracking_logs.rst index 7af67cbc82..462dfbbf83 100644 --- a/docs/data/source/internal_data_formats/tracking_logs.rst +++ b/docs/data/source/internal_data_formats/tracking_logs.rst @@ -2,9 +2,9 @@ Tracking Logs =============== -The following is an inventory of all LMS event types. +The following is an inventory of all LMS event types. -This inventory is comprised of a table of Common Fields that appear in all events, a table of Student Event Types which lists all interaction with the LMS outside of the Instructor Dashboard, +This inventory is comprised of a table of Common Fields that appear in all events, a table of Student Event Types which lists all interaction with the LMS outside of the Instructor Dashboard, and a table of Instructor Event Types of all interaction with the Instructor Dashboard in the LMS. Common Fields @@ -38,16 +38,16 @@ This section contains a table of fields common to all events. | | string is empty for anonymous events (i.e., user not logged | | | | | in). | | | +---------------------------+-------------------------------------------------------------+-------------+------------------------------------+ - + Event Types =========== There are two tables of event types -- one for student events, and one for instructor events. Table columns describe what each event type represents, which component it originates from, what scripting language was used to fire the event, and what ``event`` fields are associated with it. -The ``event_source`` field from the "Common Fields" table above distinguishes between events that originated in the browser (in javascript) and events that originated on the server (during the processing of a request). +The ``event_source`` field from the "Common Fields" table above distinguishes between events that originated in the browser (in javascript) and events that originated on the server (during the processing of a request). -Event types with several different historical names are enumerated by forward slashes. +Event types with several different historical names are enumerated by forward slashes. Rows identical after the second column have been combined, with the corresponding event types enumerated by commas. @@ -162,6 +162,10 @@ The Student Event Type table lists the event types logged for interaction with t | | | | +---------------------+---------------+---------------------------------------------------------------------+ | | | | | ``attempts`` | integer | | | | | | +---------------------+---------------+---------------------------------------------------------------------+ +| | | | | ``grade`` | integer | Current grade value | +| | | | +---------------------+---------------+---------------------------------------------------------------------+ +| | | | | ``max_grade`` | integer | Maximum possible grade value | +| | | | +---------------------+---------------+---------------------------------------------------------------------+ | | | | | ``correct_map`` | string / JSON | **See the table in** | | | | | | | | **Addendum:** ``correct_map`` **Fields and Values below** | +-----------------------------------+-------------------------------+---------------------+-----------------+---------------------+---------------+---------------------------------------------------------------------+ @@ -241,7 +245,7 @@ Table of ``correct_map`` field types and values for the ``problem_check`` studen | | | string dump of a DateTime object of the form | | | | | `'%Y%m%d%H%M%S'`. | | +--------------------------------------------------+--------------------------------------------------+--------------------------------------------------+--------------------------------------------------+ - + Instructor Event Types ----------------------