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
d76241e6
Commit
d76241e6
authored
Oct 23, 2012
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
prefix metrics with lms, use tags for enrollment
parent
e02d8403
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
common/djangoapps/student/views.py
+4
-4
common/lib/capa/capa/correctmap.py
+2
-2
No files found.
common/djangoapps/student/views.py
View file @
d76241e6
...
...
@@ -206,7 +206,7 @@ def change_enrollment(request):
return
{
'success'
:
False
,
'error'
:
'enrollment in {} not allowed at this time'
.
format
(
course
.
display_name
)}
statsd
.
increment
(
"
user.enrollment_in_"
+
str
(
course_id
)
)
statsd
.
increment
(
"
lms.user.enrollment"
,
tags
=
[
"course:"
+
str
(
course_id
)]
)
enrollment
,
created
=
CourseEnrollment
.
objects
.
get_or_create
(
user
=
user
,
course_id
=
course
.
id
)
return
{
'success'
:
True
}
...
...
@@ -214,7 +214,7 @@ def change_enrollment(request):
try
:
enrollment
=
CourseEnrollment
.
objects
.
get
(
user
=
user
,
course_id
=
course_id
)
enrollment
.
delete
()
statsd
.
increment
(
"
user.unenrollment_in_"
+
str
(
course_id
)
)
statsd
.
increment
(
"
lms.user.unenrollment"
,
tags
=
[
"course:"
+
str
(
course_id
)]
)
return
{
'success'
:
True
}
except
CourseEnrollment
.
DoesNotExist
:
return
{
'success'
:
False
,
'error'
:
'You are not enrolled for this course.'
}
...
...
@@ -263,7 +263,7 @@ def login_user(request, error=""):
log
.
info
(
"Login success - {0} ({1})"
.
format
(
username
,
email
))
try_change_enrollment
(
request
)
statsd
.
increment
(
"user.successful_login"
)
statsd
.
increment
(
"
lms.
user.successful_login"
)
return
HttpResponse
(
json
.
dumps
({
'success'
:
True
}))
log
.
warning
(
"Login failed - Account not active for user {0}, resending activation"
.
format
(
username
))
...
...
@@ -469,7 +469,7 @@ def create_account(request, post_override=None):
log
.
debug
(
'bypassing activation email'
)
login_user
.
is_active
=
True
login_user
.
save
()
statsd
.
increment
(
"user.account_created"
)
statsd
.
increment
(
"
lms.
user.account_created"
)
js
=
{
'success'
:
True
}
return
HttpResponse
(
json
.
dumps
(
js
),
mimetype
=
"application/json"
)
...
...
common/lib/capa/capa/correctmap.py
View file @
d76241e6
...
...
@@ -55,9 +55,9 @@ class CorrectMap(object):
}
if
correctness
==
"correct"
:
statsd
.
increment
(
"user.correct_answer"
)
statsd
.
increment
(
"
lms.
user.correct_answer"
)
else
:
statsd
.
increment
(
"user.incorrect_answer"
)
statsd
.
increment
(
"
lms.
user.incorrect_answer"
)
def
__repr__
(
self
):
return
repr
(
self
.
cmap
)
...
...
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