From 028a61fd3fcf522ea30d4152e98670d32eef39b3 Mon Sep 17 00:00:00 2001 From: Ilya Yarkavets Date: Tue, 30 Jan 2018 12:19:03 +0300 Subject: [PATCH 1/2] Fix for bug with click-to-speak and associate interactions (drag&drop was enabled but not released on clicking at answer when click-to-speak was activated) --- .../interactions/AssociateInteraction.js | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/views/js/qtiCommonRenderer/renderers/interactions/AssociateInteraction.js b/views/js/qtiCommonRenderer/renderers/interactions/AssociateInteraction.js index 3deccf2912..67fc04107e 100755 --- a/views/js/qtiCommonRenderer/renderers/interactions/AssociateInteraction.js +++ b/views/js/qtiCommonRenderer/renderers/interactions/AssociateInteraction.js @@ -380,10 +380,15 @@ define([ // Point & click handlers - interact($container.selector).on('tap', function() { + interact($container.selector).on('tap', function(e) { //if tts component is loaded and click-to-speak function is activated - we should prevent this listener to go further if ($(e.currentTarget).closest('.qti-item').hasClass('prevent-click-handler')) { + isDragAndDropEnabled = false; return; + } else { + if (self.getOption && self.getOption("enableDragAndDrop") && self.getOption("enableDragAndDrop").associate) { + isDragAndDropEnabled = self.getOption("enableDragAndDrop").associate; + } } _resetSelection(); @@ -394,7 +399,12 @@ define([ //if tts component is loaded and click-to-speak function is activated - we should prevent this listener to go further if ($target.closest('.qti-item').hasClass('prevent-click-handler')) { + isDragAndDropEnabled = false; return; + } else { + if (self.getOption && self.getOption("enableDragAndDrop") && self.getOption("enableDragAndDrop").associate) { + isDragAndDropEnabled = self.getOption("enableDragAndDrop").associate; + } } e.stopPropagation(); @@ -407,7 +417,12 @@ define([ //if tts component is loaded and click-to-speak function is activated - we should prevent this listener to go further if ($target.closest('.qti-item').hasClass('prevent-click-handler')) { + isDragAndDropEnabled = false; return; + } else { + if (self.getOption && self.getOption("enableDragAndDrop") && self.getOption("enableDragAndDrop").associate) { + isDragAndDropEnabled = self.getOption("enableDragAndDrop").associate; + } } e.stopPropagation(); @@ -418,7 +433,12 @@ define([ interact(binSelector).on('tap', function (e) { //if tts component is loaded and click-to-speak function is activated - we should prevent this listener to go further if ($(e.currentTarget).closest('.qti-item').hasClass('prevent-click-handler')) { + isDragAndDropEnabled = false; return; + } else { + if (self.getOption && self.getOption("enableDragAndDrop") && self.getOption("enableDragAndDrop").associate) { + isDragAndDropEnabled = self.getOption("enableDragAndDrop").associate; + } } e.stopPropagation(); From 74e7de331d5800ec941be35a77b820acc4cca5bc Mon Sep 17 00:00:00 2001 From: Ilya Yarkavets Date: Tue, 30 Jan 2018 12:19:50 +0300 Subject: [PATCH 2/2] Version bump; --- manifest.php | 2 +- scripts/update/Updater.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.php b/manifest.php index 73117b54a3..a86736dcb4 100755 --- a/manifest.php +++ b/manifest.php @@ -28,7 +28,7 @@ 'name' => 'taoQtiItem', 'label' => 'QTI item model', 'license' => 'GPL-2.0', - 'version' => '12.7.1', + 'version' => '12.7.2', 'author' => 'Open Assessment Technologies', 'requires' => array( 'taoItems' => '>=4.2.4', diff --git a/scripts/update/Updater.php b/scripts/update/Updater.php index afca614861..e9c3c0fbda 100644 --- a/scripts/update/Updater.php +++ b/scripts/update/Updater.php @@ -501,6 +501,6 @@ public function update($initialVersion){ $this->setVersion('12.6.0'); } - $this->skip('12.6.0', '12.7.1'); + $this->skip('12.6.0', '12.7.2'); } }