Skip to content

Commit

Permalink
Merge pull request #698 from oat-sa/backport/TAO-3531-options-with-im…
Browse files Browse the repository at this point in the history
…ages-navigation

Backport/tao 3531 options with images navigation
  • Loading branch information
ssipasseuth authored Jan 5, 2017
2 parents 4d2d36b + 1cd3396 commit 96057d9
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 13 deletions.
2 changes: 1 addition & 1 deletion manifest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
'label' => 'QTI test model',
'description' => 'TAO QTI test implementation',
'license' => 'GPL-2.0',
'version' => '5.51.1',
'version' => '5.51.2',
'author' => 'Open Assessment Technologies',
'requires' => array(
'taoTests' => '>=3.7.0',
Expand Down
6 changes: 3 additions & 3 deletions scripts/update/Updater.php
Original file line number Diff line number Diff line change
Expand Up @@ -954,7 +954,7 @@ public function update($initialVersion) {
}

$this->skip('5.48.0', '5.49.0');

if ($this->isVersion('5.49.0')) {

$extension = \common_ext_ExtensionsManager::singleton()->getExtensionById('taoQtiTest');
Expand All @@ -972,7 +972,7 @@ public function update($initialVersion) {

$this->setVersion('5.49.1');
}

if ($this->isVersion('5.49.1')) {
$extension = \common_ext_ExtensionsManager::singleton()->getExtensionById('taoQtiTest');

Expand Down Expand Up @@ -1002,6 +1002,6 @@ public function update($initialVersion) {
$this->setVersion('5.50.1');
}

$this->skip('5.50.1', '5.51.1');
$this->skip('5.50.1', '5.51.2');
}
}
2 changes: 1 addition & 1 deletion views/css/plugins/key-navigation.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion views/css/plugins/key-navigation.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 14 additions & 7 deletions views/js/runner/plugins/content/accessibility/keyNavigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ define([
cursor = 0;
//find the first input
_.forEach(focusables, function(focusable, index){
if(focusable.nodeName !== 'IMG'){
if ($(focusable).is(':input')) {
cursor = index;
focusable.focus();
return false;
Expand Down Expand Up @@ -151,12 +151,19 @@ define([
var $content = testRunner.getAreaBroker().getContentArea();
var index = 1;

focusables = $(':input,img', $content).addClass('key-navigation-focusable').each(function(){
var $this = $(this);
//redistribute focus order
$this.attr('tabindex', index);
index++;
}).toArray();
focusables = $(':input,img,.key-navigation-focusable', $content)
.filter(function removeImagesInChoices() {
var $this = $(this);
return !($this.is('img') && $this.closest('.qti-choice', $content).length);
})
.addClass('key-navigation-focusable')
.each(function(){
var $this = $(this);
//redistribute focus order
$this.attr('tabindex', index);
index++;
})
.toArray();

count = focusables.length || 1;
cursor = null;
Expand Down
5 changes: 5 additions & 0 deletions views/scss/plugins/key-navigation.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
@import "inc/bootstrap";

.qti-item div.key-navigation-focusable {
padding: 5px !important;
}

.qti-item div.key-navigation-focusable,
.qti-item img.key-navigation-focusable {
border: 2px solid transparent;
&:focus {
Expand Down

0 comments on commit 96057d9

Please sign in to comment.