Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
problem-builder
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
OpenEdx
problem-builder
Commits
5aecad0d
Commit
5aecad0d
authored
Aug 11, 2014
by
Xavier Antoviaque
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #55 from dragonfi/tracking-logs
Tracking logs
parents
3559a127
475ad034
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
0 deletions
+43
-0
mentoring/mentoring.py
+24
-0
mentoring/public/js/mentoring.js
+6
-0
mentoring/public/js/questionnaire.js
+13
-0
No files found.
mentoring/mentoring.py
View file @
5aecad0d
...
...
@@ -143,6 +143,20 @@ class MentoringBlock(XBlockWithLightChildren):
return
fragment
@XBlock.json_handler
def
publish_event
(
self
,
data
,
suffix
=
''
):
try
:
event_type
=
data
.
pop
(
'event_type'
)
except
KeyError
as
e
:
return
{
'result'
:
'error'
,
'message'
:
'Missing event_type in JSON data'
}
data
[
'component_id'
]
=
self
.
scope_ids
.
usage_id
data
[
'user_id'
]
=
self
.
runtime
.
user_id
self
.
runtime
.
publish
(
self
,
event_type
,
data
)
return
{
'result'
:
'success'
}
@property
def
title
(
self
):
"""
...
...
@@ -227,6 +241,16 @@ class MentoringBlock(XBlockWithLightChildren):
self
.
completed
=
bool
(
completed
)
raw_score
=
self
.
score
[
0
]
self
.
runtime
.
publish
(
self
,
'xblock.mentoring.submitted'
,
{
'component_id'
:
self
.
scope_ids
.
usage_id
,
'user_id'
:
self
.
runtime
.
user_id
,
'num_attempts'
:
self
.
num_attempts
,
'submitted_answer'
:
submissions
,
'grade'
:
raw_score
,
})
return
{
'submitResults'
:
submit_results
,
'completed'
:
self
.
completed
,
...
...
mentoring/public/js/mentoring.js
View file @
5aecad0d
...
...
@@ -92,4 +92,10 @@ function MentoringBlock(runtime, element) {
else
if
(
data
.
mode
===
'assessment'
)
{
MentoringAssessmentView
(
runtime
,
element
,
mentoring
);
}
$
.
ajax
({
type
:
"POST"
,
url
:
runtime
.
handlerUrl
(
element
,
'publish_event'
),
data
:
JSON
.
stringify
({
event_type
:
"xblock.mentoring.loaded"
})
});
}
mentoring/public/js/questionnaire.js
View file @
5aecad0d
...
...
@@ -28,8 +28,21 @@ function MessageView(element) {
}
popupDOM
.
show
();
function
publish_event
(
data
)
{
$
.
ajax
({
type
:
"POST"
,
url
:
runtime
.
handlerUrl
(
element
,
'publish_event'
),
data
:
JSON
.
stringify
(
data
)
});
}
publish_event
({
event_type
:
'xblock.mentoring.feedback.opened'
});
$
(
'.close'
,
popupDOM
).
on
(
'click'
,
function
()
{
self
.
clearPopupEvents
();
console
.
log
(
popupDOM
);
publish_event
({
event_type
:
'xblock.mentoring.feedback.closed'
});
});
},
showMessage
:
function
(
message
)
{
...
...
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