Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-analytics-data-api
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-analytics-data-api
Commits
846e0424
Commit
846e0424
authored
Mar 14, 2014
by
Brian Wilson
Committed by
Gerrit Code Review
Mar 14, 2014
Browse files
Options
Browse Files
Download
Plain Diff
Merge "Fix seeds and correctness in non-submission problem check events."
parents
49daee78
6d3d69a2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
6 deletions
+16
-6
edx/analytics/tasks/answer_dist.py
+16
-6
edx/analytics/tasks/tests/test_answer_dist.py
+0
-0
No files found.
edx/analytics/tasks/answer_dist.py
View file @
846e0424
...
@@ -168,13 +168,16 @@ class LastProblemCheckEventMixin(object):
...
@@ -168,13 +168,16 @@ class LastProblemCheckEventMixin(object):
# of any actual values selected by the student.
# of any actual values selected by the student.
# For now, let's just dump an error and skip it,
# For now, let's just dump an error and skip it,
# so that it becomes the equivalent of a hidden
# so that it becomes the equivalent of a hidden
# answer. Eventually we would probably want to treat
# answer.
# it explicitly as a hidden answer.
# TODO: Eventually treat it explicitly as a hidden
# answer.
if
answer_id
not
in
correct_map
:
if
answer_id
not
in
correct_map
:
log
.
error
(
"Unexpected answer_id
%
s not in correct_map:
%
s"
,
answer_id
,
event
)
log
.
error
(
"Unexpected answer_id
%
s not in correct_map:
%
s"
,
answer_id
,
event
)
continue
continue
correctness
=
correct_map
[
answer_id
]
.
get
(
'correctness'
)
in
[
'correct'
]
correct_entry
=
correct_map
[
answer_id
]
variant
=
event
.
get
(
'state'
,
{})
.
get
(
'seed'
)
# We do not know the values for 'input_type',
# We do not know the values for 'input_type',
# 'response_type', or 'question'. We also don't know if
# 'response_type', or 'question'. We also don't know if
...
@@ -185,8 +188,8 @@ class LastProblemCheckEventMixin(object):
...
@@ -185,8 +188,8 @@ class LastProblemCheckEventMixin(object):
# an 'answer' and only sometimes have an 'answer_value_id'.
# an 'answer' and only sometimes have an 'answer_value_id'.
submission
=
{
submission
=
{
'answer_value_id'
:
answer_value
,
'answer_value_id'
:
answer_value
,
'correct'
:
correct
_entry
.
get
(
'correctness'
)
,
'correct'
:
correct
ness
,
'variant'
:
event
.
get
(
'seed'
)
,
'variant'
:
variant
,
}
}
append_submission
(
answer_id
,
submission
)
append_submission
(
answer_id
,
submission
)
...
@@ -457,7 +460,14 @@ class AnswerDistributionPerCourseMixin(object):
...
@@ -457,7 +460,14 @@ class AnswerDistributionPerCourseMixin(object):
def
get_answer_grouping_key
(
self
,
answer
):
def
get_answer_grouping_key
(
self
,
answer
):
"""Return value to use for uniquely identify an answer value in the distribution."""
"""Return value to use for uniquely identify an answer value in the distribution."""
variant
=
answer
.
get
(
'variant'
,
'NO_VARIANT'
)
# For variants, we want to treat missing variants with the
# same value as used for events that lack 'submission'
# information, so that they will be grouped together. That
# value is a seed value of '1'. We want to map both missing
# values and zero-length values to this default value.
variant
=
answer
.
get
(
'variant'
,
''
)
if
variant
==
''
:
variant
=
'1'
# Events that lack 'submission' information will have a value
# Events that lack 'submission' information will have a value
# for 'answer_value_id' and none for 'answer'. Events with
# for 'answer_value_id' and none for 'answer'. Events with
# 'submission' information will have the reverse situation
# 'submission' information will have the reverse situation
...
...
edx/analytics/tasks/tests/test_answer_dist.py
View file @
846e0424
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment