Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
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-platform
Commits
630a0b08
Commit
630a0b08
authored
Apr 01, 2014
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Capture metrics for problem attempts and histograms of problem grades
parent
363702ea
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
common/lib/xmodule/xmodule/capa_base.py
+24
-0
No files found.
common/lib/xmodule/xmodule/capa_base.py
View file @
630a0b08
...
@@ -9,6 +9,13 @@ import traceback
...
@@ -9,6 +9,13 @@ import traceback
import
struct
import
struct
import
sys
import
sys
# We don't want to force a dependency on datadog, so make the import conditional
try
:
from
dogapi
import
dog_stats_api
except
ImportError
:
# pylint: disable=invalid-name
dog_stats_api
=
None
from
pkg_resources
import
resource_string
from
pkg_resources
import
resource_string
from
capa.capa_problem
import
LoncapaProblem
,
LoncapaSystem
from
capa.capa_problem
import
LoncapaProblem
,
LoncapaSystem
...
@@ -869,18 +876,24 @@ class CapaMixin(CapaFields):
...
@@ -869,18 +876,24 @@ class CapaMixin(CapaFields):
answers_without_files
=
convert_files_to_filenames
(
answers
)
answers_without_files
=
convert_files_to_filenames
(
answers
)
event_info
[
'answers'
]
=
answers_without_files
event_info
[
'answers'
]
=
answers_without_files
metric_name
=
'capa.check_problem'
_
=
self
.
runtime
.
service
(
self
,
"i18n"
)
.
ugettext
_
=
self
.
runtime
.
service
(
self
,
"i18n"
)
.
ugettext
# Too late. Cannot submit
# Too late. Cannot submit
if
self
.
closed
():
if
self
.
closed
():
event_info
[
'failure'
]
=
'closed'
event_info
[
'failure'
]
=
'closed'
self
.
runtime
.
track_function
(
'problem_check_fail'
,
event_info
)
self
.
runtime
.
track_function
(
'problem_check_fail'
,
event_info
)
if
dog_stats_api
:
dog_stats_api
.
increment
(
metric_name
,
[
u'result:failed'
,
u'failure:closed'
])
raise
NotFoundError
(
_
(
"Problem is closed."
))
raise
NotFoundError
(
_
(
"Problem is closed."
))
# Problem submitted. Student should reset before checking again
# Problem submitted. Student should reset before checking again
if
self
.
done
and
self
.
rerandomize
==
"always"
:
if
self
.
done
and
self
.
rerandomize
==
"always"
:
event_info
[
'failure'
]
=
'unreset'
event_info
[
'failure'
]
=
'unreset'
self
.
runtime
.
track_function
(
'problem_check_fail'
,
event_info
)
self
.
runtime
.
track_function
(
'problem_check_fail'
,
event_info
)
if
dog_stats_api
:
dog_stats_api
.
increment
(
metric_name
,
[
u'result:failed'
,
u'failure:unreset'
])
raise
NotFoundError
(
_
(
"Problem must be reset before it can be checked again."
))
raise
NotFoundError
(
_
(
"Problem must be reset before it can be checked again."
))
# Problem queued. Students must wait a specified waittime before they are allowed to submit
# Problem queued. Students must wait a specified waittime before they are allowed to submit
...
@@ -948,6 +961,17 @@ class CapaMixin(CapaFields):
...
@@ -948,6 +961,17 @@ class CapaMixin(CapaFields):
event_info
[
'submission'
]
=
self
.
get_submission_metadata_safe
(
answers_without_files
,
correct_map
)
event_info
[
'submission'
]
=
self
.
get_submission_metadata_safe
(
answers_without_files
,
correct_map
)
self
.
runtime
.
track_function
(
'problem_check'
,
event_info
)
self
.
runtime
.
track_function
(
'problem_check'
,
event_info
)
if
dog_stats_api
:
dog_stats_api
.
increment
(
metric_name
,
[
u'result:success'
])
dog_stats_api
.
histogram
(
u'{}.correct_pct'
.
format
(
metric_name
),
float
(
published_grade
[
'grade'
])
/
published_grade
[
'max_grade'
],
)
dog_stats_api
.
histogram
(
u'{}.attempts'
.
format
(
metric_name
),
self
.
attempts
,
)
if
hasattr
(
self
.
runtime
,
'psychometrics_handler'
):
# update PsychometricsData using callback
if
hasattr
(
self
.
runtime
,
'psychometrics_handler'
):
# update PsychometricsData using callback
self
.
runtime
.
psychometrics_handler
(
self
.
get_state_for_lcp
())
self
.
runtime
.
psychometrics_handler
(
self
.
get_state_for_lcp
())
...
...
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