Commit 22249c62 by Braden MacDonald Committed by GitHub

Merge pull request #13 from arbrandes/SOL-1995

[SOL-1995] Ensure implicit row header cells use th elements
parents 482cbcb5 18d5f783
...@@ -146,7 +146,8 @@ li.poll-result .poll-image { ...@@ -146,7 +146,8 @@ li.poll-result .poll-image {
border-top: 0; border-top: 0;
} }
.survey-table tr:last-child td { .survey-table tbody tr:last-child td,
.survey-table tbody tr:last-child th {
border-bottom: 0; border-bottom: 0;
} }
...@@ -174,6 +175,10 @@ li.poll-result .poll-image { ...@@ -174,6 +175,10 @@ li.poll-result .poll-image {
background: none !important; background: none !important;
} }
.survey-table .survey-row .survey-question {
text-align: left;
}
.survey-table .survey-option label { .survey-table .survey-option label {
text-align: center; text-align: center;
vertical-align: middle; vertical-align: middle;
......
...@@ -17,13 +17,15 @@ ...@@ -17,13 +17,15 @@
font-size: 1em; font-size: 1em;
} }
.themed-xblock.poll-block .survey-row td { .themed-xblock.poll-block .survey-row td,
.themed-xblock.poll-block .survey-row th {
padding-top: 5px; padding-top: 5px;
padding-bottom: 5px; padding-bottom: 5px;
} }
/* LMS have very specific css selector that sets ~1.5em bottom margin */ /* LMS have very specific css selector that sets ~1.5em bottom margin */
.themed-xblock.poll-block table.survey-table .survey-row td p, .themed-xblock.poll-block table.survey-table .survey-row td p,
.themed-xblock.poll-block table.survey-table .survey-row th p,
.themed-xblock.poll-block ul.poll-answers li.poll-answer .poll-answer p, .themed-xblock.poll-block ul.poll-answers li.poll-answer .poll-answer p,
.themed-xblock.poll-block ul.poll-results li.poll-result .poll-answer-label p { .themed-xblock.poll-block ul.poll-results li.poll-result .poll-answer-label p {
margin-bottom: 0; margin-bottom: 0;
......
...@@ -11,14 +11,14 @@ ...@@ -11,14 +11,14 @@
</thead> </thead>
{{#each tally}} {{#each tally}}
<tr class="survey-row"> <tr class="survey-row">
<td class="survey-question"> <th class="survey-question">
{{#if img}} {{#if img}}
<div class="poll-image-td"> <div class="poll-image-td">
<img src="{{img}}" alt="img_alt"/> <img src="{{img}}" alt="img_alt"/>
</div> </div>
{{/if}} {{/if}}
{{{label}}} {{{label}}}
</td> </th>
{{#each answers}} {{#each answers}}
<td class="survey-percentage survey-option{{#if choice}} survey-choice{{/if}}{{#if top}} poll-top-choice{{/if}}">{{percent}}%</td> <td class="survey-percentage survey-option{{#if choice}} survey-choice{{/if}}{{#if top}} poll-top-choice{{/if}}">{{percent}}%</td>
{{/each}} {{/each}}
......
...@@ -14,14 +14,14 @@ ...@@ -14,14 +14,14 @@
</thead> </thead>
{% for key, question in questions %} {% for key, question in questions %}
<tr class="survey-row"> <tr class="survey-row">
<td class="survey-question"> <th class="survey-question">
{% if question.img %} {% if question.img %}
<div class="poll-image-td"> <div class="poll-image-td">
<img src="{{question.img}}" alt="{{question.img_alt|default_if_none:''}}"/> <img src="{{question.img}}" alt="{{question.img_alt|default_if_none:''}}"/>
</div> </div>
{% endif %} {% endif %}
{{question.label|safe}} {{question.label|safe}}
</td> </th>
{% for answer, label in answers %} {% for answer, label in answers %}
<td class="survey-option"> <td class="survey-option">
<label> <label>
......
...@@ -40,6 +40,6 @@ ddt_scenarios = [ ...@@ -40,6 +40,6 @@ ddt_scenarios = [
'Survey Studio', 'Survey Studio',
'question', 'question',
4, 4,
'td.survey-question' 'th.survey-question'
], ],
] ]
...@@ -73,8 +73,8 @@ class TestDefault(PollBaseTest): ...@@ -73,8 +73,8 @@ class TestDefault(PollBaseTest):
# Should now be on the results page. # Should now be on the results page.
for element in self.browser.find_elements_by_css_selector('table > tr'): for element in self.browser.find_elements_by_css_selector('table > tr'):
# First element is question, second is first answer result. # Questions are 'th', so the first 'td' is the first answer.
self.assertEqual(element.find_elements_by_css_selector('td')[1].text, '100%') self.assertEqual(element.find_elements_by_css_selector('td')[0].text, '100%')
# No feedback section. # No feedback section.
self.assertRaises(NoSuchElementException, self.browser.find_element_by_css_selector, '.poll-feedback') self.assertRaises(NoSuchElementException, self.browser.find_element_by_css_selector, '.poll-feedback')
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