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
b08c156e
Commit
b08c156e
authored
Sep 23, 2017
by
Braden MacDonald
Committed by
GitHub
Sep 23, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #38 from murad-hubib/surveryResponseLable
Survery response lable
parents
fbb41118
e37ca68f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
2 deletions
+35
-2
poll/public/css/poll.css
+15
-0
poll/public/handlebars/survey_results.handlebars
+10
-1
poll/public/js/poll.js
+9
-0
setup.py
+1
-1
No files found.
poll/public/css/poll.css
View file @
b08c156e
...
...
@@ -302,6 +302,16 @@ th.survey-answer {
visibility
:
visible
;
}
.survey-percentage
span
{
display
:
inline-block
;
}
.survey-percentage
.percentage
{
width
:
50px
;
text-align
:
right
;
float
:
right
;
}
.survey-table
.survey-question
{
display
:
block
;
border
:
0
;
...
...
@@ -316,6 +326,11 @@ th.survey-answer {
.survey-table
.survey-option
.visible-mobile-only
{
width
:
calc
(
100%
-
20px
);
}
.survey-table
.survey-percentage
.visible-mobile-only
{
width
:
calc
(
100%
-
60px
);
}
.survey-table
.survey-option
{
display
:
block
;
border
:
1px
solid
#ccc
;
...
...
poll/public/handlebars/survey_results.handlebars
View file @
b08c156e
...
...
@@ -22,7 +22,16 @@
{{{
label
}}}
<
/th
>
{{#
each
answers
}}
<
td
class
=
"survey-percentage survey-option
{{#if
choice
}}
survey-choice
{{/if}}{{#if
top
}}
poll-top-choice
{{/if}}
"
aria
-
labelledby
=
"answer-
{{
key
}}
-
{{
..
/
..
/
block_id
}}
"
>
{{
percent
}}
%<
/td
>
<
td
class
=
"survey-percentage survey-option
{{#if
choice
}}
survey-choice
{{/if}}{{#if
top
}}
poll-top-choice
{{/if}}
"
aria
-
labelledby
=
"answer-
{{
key
}}
-
{{
..
/
..
/
block_id
}}
"
>
<
span
class
=
"visible-mobile-only"
>
{{#
each
..
/
..
/
answers
}}
{{#
if_eq
key
..
/
key
}}
{{
label
}}
{{/
if_eq
}}
{{/
each
}}
<
/span
>
<
span
class
=
"percentage"
>
{{
percent
}}
%<
/span
>
<
/td
>
{{/
each
}}
<
/tr
>
{{/
each
}}
...
...
poll/public/js/poll.js
View file @
b08c156e
...
...
@@ -37,6 +37,15 @@ function PollUtil (runtime, element, pollType) {
});
});
// Add helper for equality check
Handlebars
.
registerHelper
(
'if_eq'
,
function
(
a
,
b
,
opts
)
{
if
(
a
==
b
)
return
opts
.
fn
(
this
);
else
return
opts
.
inverse
(
this
);
});
this
.
resultsTemplate
=
Handlebars
.
compile
(
$
(
"."
+
pollType
+
"-results-template"
,
element
).
html
());
this
.
viewResultsButton
=
$
(
'.view-results-button'
,
element
);
...
...
setup.py
View file @
b08c156e
...
...
@@ -44,7 +44,7 @@ def package_data(pkg, roots):
setup
(
name
=
'xblock-poll'
,
version
=
'1.3.
4
'
,
version
=
'1.3.
5
'
,
description
=
'An XBlock for polling users.'
,
packages
=
[
'poll'
,
...
...
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