Commit b08c156e by Braden MacDonald Committed by GitHub

Merge pull request #38 from murad-hubib/surveryResponseLable

Survery response lable
parents fbb41118 e37ca68f
......@@ -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;
......
......@@ -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}}
......
......@@ -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);
......
......@@ -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',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment