Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/tao 5505/tts cannot click to speak choice content #1109

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion manifest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion scripts/update/Updater.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better to avoid repeating the same piece of code multiple time whenever possible by wrapping this into a function like self.isDragAndDropEnabled(). Could you add it into a function that will make the code easier to read. Also you can save one code block level by directly assignation like else { isDragAndDropEnabled = self.isDragAndDropEnabled()}

}

_resetSelection();
Expand All @@ -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();
Expand All @@ -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();
Expand All @@ -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();
Expand Down