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
ada51a3b
Commit
ada51a3b
authored
Jun 08, 2015
by
Jonathan Piacenti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tweaked names of badge events.
parent
77395bdf
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
6 deletions
+6
-6
lms/djangoapps/certificates/badge_handler.py
+1
-1
lms/djangoapps/certificates/tests/test_badge_handler.py
+1
-1
lms/djangoapps/certificates/tests/test_views.py
+2
-2
lms/djangoapps/certificates/views.py
+2
-2
No files found.
lms/djangoapps/certificates/badge_handler.py
View file @
ada51a3b
...
@@ -157,7 +157,7 @@ class BadgeHandler(object):
...
@@ -157,7 +157,7 @@ class BadgeHandler(object):
Send an analytics event to record the creation of a badge assertion.
Send an analytics event to record the creation of a badge assertion.
"""
"""
tracker
.
emit
(
tracker
.
emit
(
'edx.badge
s
.assertion.created'
,
{
'edx.badge.assertion.created'
,
{
'user_id'
:
user
.
id
,
'user_id'
:
user
.
id
,
'course_id'
:
unicode
(
self
.
course_key
),
'course_id'
:
unicode
(
self
.
course_key
),
'enrollment_mode'
:
assertion
.
mode
,
'enrollment_mode'
:
assertion
.
mode
,
...
...
lms/djangoapps/certificates/tests/test_badge_handler.py
View file @
ada51a3b
...
@@ -190,7 +190,7 @@ class BadgeHandlerTestCase(ModuleStoreTestCase, EventTrackingTestCase):
...
@@ -190,7 +190,7 @@ class BadgeHandlerTestCase(ModuleStoreTestCase, EventTrackingTestCase):
'evidence'
:
'https://edx.org/certificates/user/2/course/edX/course_test/test_run?evidence_visit=1'
'evidence'
:
'https://edx.org/certificates/user/2/course/edX/course_test/test_run?evidence_visit=1'
})
})
assert_event_matches
({
assert_event_matches
({
'name'
:
'edx.badge
s
.assertion.created'
,
'name'
:
'edx.badge.assertion.created'
,
'data'
:
{
'data'
:
{
'user_id'
:
self
.
user
.
id
,
'user_id'
:
self
.
user
.
id
,
'course_id'
:
unicode
(
self
.
course
.
location
.
course_key
),
'course_id'
:
unicode
(
self
.
course
.
location
.
course_key
),
...
...
lms/djangoapps/certificates/tests/test_views.py
View file @
ada51a3b
...
@@ -439,7 +439,7 @@ class CertificatesViewsTests(ModuleStoreTestCase, EventTrackingTestCase):
...
@@ -439,7 +439,7 @@ class CertificatesViewsTests(ModuleStoreTestCase, EventTrackingTestCase):
self
.
assertEqual
(
response
.
status_code
,
200
)
self
.
assertEqual
(
response
.
status_code
,
200
)
assert_event_matches
(
assert_event_matches
(
{
{
'name'
:
'edx.badge
s.assertion.evidence_visit
'
,
'name'
:
'edx.badge
.assertion.evidence_visited
'
,
'data'
:
{
'data'
:
{
'course_id'
:
'testorg/run1/refundable_course'
,
'course_id'
:
'testorg/run1/refundable_course'
,
# pylint: disable=no-member
# pylint: disable=no-member
...
@@ -491,7 +491,7 @@ class TrackShareRedirectTest(ModuleStoreTestCase, EventTrackingTestCase):
...
@@ -491,7 +491,7 @@ class TrackShareRedirectTest(ModuleStoreTestCase, EventTrackingTestCase):
self
.
assertEqual
(
response
[
'Location'
],
'http://www.example.com/image.png'
)
self
.
assertEqual
(
response
[
'Location'
],
'http://www.example.com/image.png'
)
assert_event_matches
(
assert_event_matches
(
{
{
'name'
:
'edx.badge
s
.assertion.shared'
,
'name'
:
'edx.badge.assertion.shared'
,
'data'
:
{
'data'
:
{
'course_id'
:
'testorg/run1/trackable_course'
,
'course_id'
:
'testorg/run1/trackable_course'
,
'social_network'
:
'social_network'
,
'social_network'
:
'social_network'
,
...
...
lms/djangoapps/certificates/views.py
View file @
ada51a3b
...
@@ -531,7 +531,7 @@ def render_html_view(request, user_id, course_id):
...
@@ -531,7 +531,7 @@ def render_html_view(request, user_id, course_id):
try
:
try
:
badge
=
BadgeAssertion
.
objects
.
get
(
user
=
user
,
course_id
=
course_key
)
badge
=
BadgeAssertion
.
objects
.
get
(
user
=
user
,
course_id
=
course_key
)
tracker
.
emit
(
tracker
.
emit
(
'edx.badge
s.assertion.evidence_visit
'
,
'edx.badge
.assertion.evidence_visited
'
,
{
{
'user_id'
:
user
.
id
,
'user_id'
:
user
.
id
,
'course_id'
:
unicode
(
course_key
),
'course_id'
:
unicode
(
course_key
),
...
@@ -581,7 +581,7 @@ def track_share_redirect(request__unused, course_id, network, student_username):
...
@@ -581,7 +581,7 @@ def track_share_redirect(request__unused, course_id, network, student_username):
course_id
=
CourseLocator
.
from_string
(
course_id
)
course_id
=
CourseLocator
.
from_string
(
course_id
)
assertion
=
get_object_or_404
(
BadgeAssertion
,
user__username
=
student_username
,
course_id
=
course_id
)
assertion
=
get_object_or_404
(
BadgeAssertion
,
user__username
=
student_username
,
course_id
=
course_id
)
tracker
.
emit
(
tracker
.
emit
(
'edx.badge
s
.assertion.shared'
,
{
'edx.badge.assertion.shared'
,
{
'course_id'
:
unicode
(
course_id
),
'course_id'
:
unicode
(
course_id
),
'social_network'
:
network
,
'social_network'
:
network
,
'assertion_id'
:
assertion
.
id
,
'assertion_id'
:
assertion
.
id
,
...
...
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