Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
DoneXBlock
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
DoneXBlock
Commits
b4d9d42a
Commit
b4d9d42a
authored
Nov 25, 2015
by
Piotr Mitros
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better testability
parent
c6444920
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
10 deletions
+12
-10
done/done.py
+12
-10
No files found.
done/done.py
View file @
b4d9d42a
...
...
@@ -61,16 +61,18 @@ class DoneXBlock(XBlock):
with one boolean field: `done`. This will save this in the
XBlock field, and then issue an appropriate grade.
"""
self
.
done
=
data
[
'done'
]
if
data
[
'done'
]:
grade
=
1
else
:
grade
=
0
self
.
runtime
.
publish
(
self
,
'grade'
,
{
'value'
:
grade
,
'max_value'
:
1
})
# Above should emit a similar event. Once it does, we should be
# able to eliminate this
tracker
.
emit
(
"edx.done.toggle"
,
{
'done'
:
self
.
done
})
if
'done'
in
data
:
self
.
done
=
data
[
'done'
]
if
data
[
'done'
]:
grade
=
1
else
:
grade
=
0
grade_event
=
{
'value'
:
grade
,
'max_value'
:
1
}
self
.
runtime
.
publish
(
self
,
'grade'
,
grade_event
)
# This should move to self.runtime.publish, once that pipeline
# is finished for XBlocks.
tracker
.
emit
(
"edx.done.toggle"
,
{
'done'
:
self
.
done
})
return
{
'state'
:
self
.
done
}
def
student_view
(
self
,
context
=
None
):
# pylint: disable=unused-argument
...
...
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