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
84f4361d
Commit
84f4361d
authored
Jun 25, 2013
by
Renzo Lucioni
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid changing format of data sent to our logs, and prevent problem_check event from firing twice
parent
bcbce3ef
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
6 deletions
+11
-6
common/lib/xmodule/xmodule/js/src/capa/display.coffee
+5
-4
common/static/coffee/src/logger.coffee
+6
-2
No files found.
common/lib/xmodule/xmodule/js/src/capa/display.coffee
View file @
84f4361d
...
...
@@ -138,7 +138,7 @@ class @Problem
# maybe preferable to consolidate all dispatches to use FormData
###
check_fd
:
=>
Logger
.
log
'problem_check'
,
answers
:
@
answers
Logger
.
log
'problem_check'
,
@
answers
# If there are no file inputs in the problem, we can fall back on @check
if
$
(
'input:file'
).
length
==
0
...
...
@@ -212,7 +212,8 @@ class @Problem
$
.
ajaxWithPrefix
(
"
#{
@
url
}
/problem_check"
,
settings
)
check
:
=>
Logger
.
log
'problem_check'
,
answers
:
@
answers
# Calling check from within check_fd will result in firing the 'problem_check' event twice
# Logger.log 'problem_check', @answers
$
.
postWithPrefix
"
#{
@
url
}
/problem_check"
,
@
answers
,
(
response
)
=>
switch
response
.
success
when
'incorrect'
,
'correct'
...
...
@@ -224,7 +225,7 @@ class @Problem
@
gentle_alert
response
.
success
reset
:
=>
Logger
.
log
'problem_reset'
,
answers
:
@
answers
Logger
.
log
'problem_reset'
,
@
answers
$
.
postWithPrefix
"
#{
@
url
}
/problem_reset"
,
id
:
@
id
,
(
response
)
=>
@
render
(
response
.
html
)
@
updateProgress
response
...
...
@@ -284,7 +285,7 @@ class @Problem
@
el
.
find
(
'.capa_alert'
).
css
(
opacity
:
0
).
animate
(
opacity
:
1
,
700
)
save
:
=>
Logger
.
log
'problem_save'
,
answers
:
@
answers
Logger
.
log
'problem_save'
,
@
answers
$
.
postWithPrefix
"
#{
@
url
}
/problem_save"
,
@
answers
,
(
response
)
=>
saveMessage
=
response
.
msg
@
gentle_alert
saveMessage
...
...
common/static/coffee/src/logger.coffee
View file @
84f4361d
...
...
@@ -3,9 +3,13 @@ class @Logger
SEGMENT_IO_WHITELIST
=
[
"seq_goto"
,
"seq_next"
,
"seq_prev"
,
"problem_check"
,
"problem_reset"
,
"problem_show"
,
"problem_save"
]
@
log
:
(
event_type
,
data
)
->
# Segment.io event tracking
if
event_type
in
SEGMENT_IO_WHITELIST
# Segment.io event tracking
analytics
.
track
event_type
,
data
# to avoid changing the format of data sent to our servers, we only massage it here
if
typeof
data
isnt
'object'
or
data
is
null
analytics
.
track
event_type
,
value
:
data
else
analytics
.
track
event_type
,
data
$
.
getWithPrefix
'/event'
,
event_type
:
event_type
...
...
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