Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xblock-poll
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
xblock-poll
Commits
1603aaba
Unverified
Commit
1603aaba
authored
Mar 13, 2018
by
Matjaz Gregoric
Committed by
GitHub
Mar 13, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #39 from zamanafzal/MCKIN-7018
Add attributes to student_view_data for both Poll and Survey
parents
c7f34db7
04bcf089
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
1 deletions
+29
-1
README.md
+7
-0
poll/poll.py
+7
-0
tests/unit/test_xblock_poll.py
+15
-1
No files found.
README.md
View file @
1603aaba
...
...
@@ -261,6 +261,9 @@ GET https://<lms_server_url>/api/courses/v1/blocks/?course_id=<course_id>&userna
Example poll return value:
```
"student_view_data": {
"feedback": "This is feedback message survey.",
"private_results": false,
"max_submissions": 1,
"question": "Did the explanation above make sense to you?",
"answers": [
[
...
...
@@ -302,6 +305,10 @@ Example poll return value:
Example survey return value:
```
"student_view_data": {
"feedback": "This is feedback message survey.",
"private_results": false,
"max_submissions": 1,
"block_name": "Poll2",
"answers": [
[
"Y",
...
...
poll/poll.py
View file @
1603aaba
...
...
@@ -562,6 +562,9 @@ class PollBlock(PollBase, CSVExportMixin):
return
{
'question'
:
self
.
question
,
'answers'
:
self
.
answers
,
'max_submissions'
:
self
.
max_submissions
,
'private_results'
:
self
.
private_results
,
'feedback'
:
self
.
feedback
,
}
@XBlock.handler
...
...
@@ -846,6 +849,10 @@ class SurveyBlock(PollBase, CSVExportMixin):
return
{
'questions'
:
self
.
questions
,
'answers'
:
self
.
answers
,
'max_submissions'
:
self
.
max_submissions
,
'private_results'
:
self
.
private_results
,
'block_name'
:
self
.
block_name
,
'feedback'
:
self
.
feedback
,
}
@XBlock.handler
...
...
tests/unit/test_xblock_poll.py
View file @
1603aaba
...
...
@@ -27,6 +27,9 @@ class TestPollBlock(unittest.TestCase):
[
'O'
,
{
'label'
:
'Other'
}],
],
'submissions_count'
:
5
,
'max_submissions'
:
1
,
'private_results'
:
False
,
'feedback'
:
'My Feedback'
,
}
self
.
poll_block
=
PollBlock
(
self
.
runtime
,
...
...
@@ -41,6 +44,9 @@ class TestPollBlock(unittest.TestCase):
expected_poll_data
=
{
'question'
:
self
.
poll_data
[
'question'
],
'answers'
:
self
.
poll_data
[
'answers'
],
'max_submissions'
:
self
.
poll_data
[
'max_submissions'
],
'private_results'
:
self
.
poll_data
[
'private_results'
],
'feedback'
:
self
.
poll_data
[
'feedback'
],
}
student_view_data
=
self
.
poll_block
.
student_view_data
()
...
...
@@ -86,7 +92,11 @@ class TestSurveyBlock(unittest.TestCase):
[
'N'
,
'No'
],
[
'M'
,
'Maybe'
]
],
'submissions_count'
:
5
'submissions_count'
:
5
,
'max_submissions'
:
1
,
'private_results'
:
False
,
'feedback'
:
'My Feedback'
,
'block_name'
:
'My Block Name'
,
}
self
.
survey_block
=
SurveyBlock
(
self
.
runtime
,
...
...
@@ -101,6 +111,10 @@ class TestSurveyBlock(unittest.TestCase):
expected_survery_data
=
{
'questions'
:
self
.
survery_data
[
'questions'
],
'answers'
:
self
.
survery_data
[
'answers'
],
'max_submissions'
:
self
.
survery_data
[
'max_submissions'
],
'private_results'
:
self
.
survery_data
[
'private_results'
],
'feedback'
:
self
.
survery_data
[
'feedback'
],
'block_name'
:
self
.
survery_data
[
'block_name'
],
}
student_view_data
=
self
.
survey_block
.
student_view_data
()
...
...
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