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
a4fe83d0
Commit
a4fe83d0
authored
Aug 03, 2014
by
dragonfi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Publish feedback closed event
parent
053f9d61
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
0 deletions
+21
-0
mentoring/mentoring.py
+14
-0
mentoring/public/js/questionnaire.js
+7
-0
No files found.
mentoring/mentoring.py
View file @
a4fe83d0
...
...
@@ -147,6 +147,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
):
"""
...
...
mentoring/public/js/questionnaire.js
View file @
a4fe83d0
...
...
@@ -27,9 +27,16 @@ function MessageView(element) {
popupDOM
.
css
(
'height'
,
''
)
}
popupDOM
.
show
();
$
(
'.close'
,
popupDOM
).
on
(
'click'
,
function
()
{
self
.
clearPopupEvents
();
console
.
log
(
popupDOM
);
$
.
ajax
({
type
:
"POST"
,
url
:
runtime
.
handlerUrl
(
element
,
'publish_event'
),
data
:
JSON
.
stringify
({
event_type
:
'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