Commit dbe54692 by Sven Marnach

Accessibility improvements.

parent 04b9e98a
...@@ -81,15 +81,24 @@ ...@@ -81,15 +81,24 @@
padding: 6px 10px 0; padding: 6px 10px 0;
color: #009fe6; color: #009fe6;
cursor: pointer; cursor: pointer;
line-height: 2em;
box-shadow: none;
text-shadow: none;
background: none;
border: none;
outline: none;
} }
.activetable_block #activetable-help-button:hover { .activetable_block #activetable-help-button:hover {
color: #bd9730; color: #bd9730;
} }
.activetable_block .status { .activetable_block .status {
margin: 1.5em 0 0.5em;
display: inline-block; display: inline-block;
margin: 1.5em 0 0.5em !important;
width: 20px; width: 20px;
height: 20px; height: 20px;
text-indent: 100%;
white-space: nowrap;
overflow: hidden;
background: url("/static/images/unanswered-icon.png") center no-repeat; background: url("/static/images/unanswered-icon.png") center no-repeat;
} }
.activetable_block .status.correct { .activetable_block .status.correct {
......
...@@ -8,9 +8,11 @@ function ActiveTableXBlock(runtime, element, init_args) { ...@@ -8,9 +8,11 @@ function ActiveTableXBlock(runtime, element, init_args) {
var $status_message = $('.status-message', element); var $status_message = $('.status-message', element);
if (num_total == num_correct) { if (num_total == num_correct) {
$status.removeClass('incorrect').addClass('correct'); $status.removeClass('incorrect').addClass('correct');
$status.text('correct');
$status_message.text('Great job!'); $status_message.text('Great job!');
} else { } else {
$status.removeClass('correct').addClass('incorrect'); $status.removeClass('correct').addClass('incorrect');
$status.text('incorrect');
$status_message.text( $status_message.text(
'You have ' + num_correct + ' out of ' + num_total + ' cells correct.' 'You have ' + num_correct + ' out of ' + num_total + ' cells correct.'
); );
...@@ -22,8 +24,13 @@ function ActiveTableXBlock(runtime, element, init_args) { ...@@ -22,8 +24,13 @@ function ActiveTableXBlock(runtime, element, init_args) {
$.each(correct_dict, function(cell_id, correct) { $.each(correct_dict, function(cell_id, correct) {
var $cell = $('#' + cell_id, element); var $cell = $('#' + cell_id, element);
$cell.removeClass('right-answer wrong-answer unchecked'); $cell.removeClass('right-answer wrong-answer unchecked');
if (correct) $cell.addClass('right-answer') if (correct) {
else $cell.addClass('wrong-answer'); $cell.addClass('right-answer');
$cell.prop('title', 'correct');
} else {
$cell.addClass('wrong-answer');
$cell.prop('title', 'incorrect');
}
num_total += 1; num_total += 1;
num_correct += correct; num_correct += correct;
}); });
......
<div class="activetable_block"> <div class="activetable_block">
{% if help_text %} {% if help_text %}
<div class="activetable-help" style="width: {{ total_width }}px;"> <div class="activetable-help" style="width: {{ total_width }}px;">
<a id="activetable-help-button">+help</a> <button id="activetable-help-button">+help</button>
<p id="activetable-help-text">{{ help_text }}</p> <p id="activetable-help-text">{{ help_text }}</p>
</div> </div>
{% endif %} {% endif %}
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
{% else %} {% else %}
<p>This component isn't configured properly and can't be displayed.</p> <p>This component isn't configured properly and can't be displayed.</p>
{% endif %} {% endif %}
<div class="status"></div> <p class="status">unanswered</p>
<div class="status-message"></div> <div class="status-message"></div>
<div class="action"> <div class="action">
<button class="check"><span class="check-label">Check</span><span class="sr"> your answer</span></button> <button class="check"><span class="check-label">Check</span><span class="sr"> your answer</span></button>
......
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