From 9f488b23350254c6d076c0e5e2170d852f9059c2 Mon Sep 17 00:00:00 2001 From: Brad Simpson Date: Fri, 21 Jun 2024 14:51:20 -0600 Subject: [PATCH 1/3] Add the ability for Mac users to use option-click instead of control-click --- README.md | 13 +++++++------ js/auto-answer.js | 4 ++-- js/map.js | 2 +- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index be58130..8a6195e 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ Allows the user to toggle visual indicators which reveal how to answer correctly ### Auto correct -When enabled, automatically provides the correct answer when submit is selected. If not enabled the user can control-click the submit button to have the correct answer provided. Standard question components will be answered naturally; revealing the correct responses, feedback and marking if applicable. The plugin will not attempt to do this for bespoke questions or questions that do not have correct answers (e.g. confidence slider), but their models will still be modified to indicate that they are complete and correct. +When enabled, automatically provides the correct answer when submit is selected. If not enabled, the user can control-click (or option-click for Mac users) the submit button to have the correct answer provided. Standard question components will be answered naturally; revealing the correct responses, feedback and marking if applicable. The plugin will not attempt to do this for bespoke questions or questions that do not have correct answers (e.g. confidence slider), but their models will still be modified to indicate that they are complete and correct. ### Tutor @@ -56,13 +56,14 @@ Once selected adapt-devtools will disable Adapt core locking (>=v2.0.9) througho ### Course map -Select this button to reveal an interactive diagram of the course structure. The diagram will reveal all structural elements (content objects, articles, blocks and components) arranged in an intuitive way, reflecting both the hierarchical relationship of the elements and the vertical arrangement of content within each page. The map can be used to navigate directly to any element in the course. Performing a control-click will reveal the model of the selected course element in the browser console. +Select this button to reveal an interactive diagram of the course structure. The diagram will reveal all structural elements (content objects, articles, blocks and components) arranged in an intuitive way, reflecting both the hierarchical relationship of the elements and the vertical arrangement of content within each page. The map can be used to navigate directly to any element in the course. Performing a control-click (or option-click for Mac users) will reveal the model of the selected course element in the browser console. The course map uses the following legend: -+ **Green fill:** element is complete -+ **Red fill:** element is incomplete -+ **Yellow triangle:** element is [trickled](https://github.com/adaptlearning/adapt-contrib-trickle) -+ **Grey fill:** element is optional (_isOptional:true) + +* **Green fill:** element is complete +* **Red fill:** element is incomplete +* **Yellow triangle:** element is [trickled](https://github.com/adaptlearning/adapt-contrib-trickle) +* **Grey fill:** element is optional (`_isOptional: true`) ### Spoor log diff --git a/js/auto-answer.js b/js/auto-answer.js index d81ef40..e766ce4 100644 --- a/js/auto-answer.js +++ b/js/auto-answer.js @@ -36,9 +36,9 @@ class AutoAnswer extends Backbone.Controller { onQuestionMouseDown (view, e) { // remove hinting if enabled if (Adapt.devtools.get('_hintingEnabled')) Hinting.setHinting(view.$el, view.model, false); - if ((e.ctrlKey && !e.shiftKey) || Adapt.devtools.get('_autoCorrectEnabled')) { + if ((e.ctrlKey && !e.shiftKey) || (e.altKey && !e.shiftKey) || Adapt.devtools.get('_autoCorrectEnabled')) { this.answer(view); - } else if (e.ctrlKey && e.shiftKey) { + } else if ((e.ctrlKey && e.shiftKey) || (e.altKey && e.shiftKey)) { this.answer(view, true); } } diff --git a/js/map.js b/js/map.js index c0c71cc..3bf3c2d 100644 --- a/js/map.js +++ b/js/map.js @@ -84,7 +84,7 @@ class MapView extends Backbone.View { let id = $target.attr('href').slice(1); const model = data.findById(id); e.preventDefault(); - if (e.ctrlKey && this.el.defaultView) { + if ((e.ctrlKey || e.altKey) && this.el.defaultView) { id = id.replace(/-/g, ''); this.el.defaultView[id] = model; this.el.defaultView.console.log('devtools: add property window.' + id + ':'); From 3bad27bb6f250239703b007bb004cceb5ce325a6 Mon Sep 17 00:00:00 2001 From: Brad Simpson Date: Fri, 21 Jun 2024 15:40:46 -0600 Subject: [PATCH 2/3] Update readme --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8a6195e..5045376 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ Allows the user to toggle visual indicators which reveal how to answer correctly ### Auto correct -When enabled, automatically provides the correct answer when submit is selected. If not enabled, the user can control-click (or option-click for Mac users) the submit button to have the correct answer provided. Standard question components will be answered naturally; revealing the correct responses, feedback and marking if applicable. The plugin will not attempt to do this for bespoke questions or questions that do not have correct answers (e.g. confidence slider), but their models will still be modified to indicate that they are complete and correct. +When enabled, automatically provides the correct answer when submit is selected. If not enabled, the user can Control+Click or Alt+Click on Windows / Option+Click for macOS the submit button to have the correct answer provided. Standard question components will be answered naturally; revealing the correct responses, feedback and marking if applicable. The plugin will not attempt to do this for bespoke questions or questions that do not have correct answers (e.g. confidence slider), but their models will still be modified to indicate that they are complete and correct. ### Tutor @@ -56,7 +56,7 @@ Once selected adapt-devtools will disable Adapt core locking (>=v2.0.9) througho ### Course map -Select this button to reveal an interactive diagram of the course structure. The diagram will reveal all structural elements (content objects, articles, blocks and components) arranged in an intuitive way, reflecting both the hierarchical relationship of the elements and the vertical arrangement of content within each page. The map can be used to navigate directly to any element in the course. Performing a control-click (or option-click for Mac users) will reveal the model of the selected course element in the browser console. +Select this button to reveal an interactive diagram of the course structure. The diagram will reveal all structural elements (content objects, articles, blocks and components) arranged in an intuitive way, reflecting both the hierarchical relationship of the elements and the vertical arrangement of content within each page. The map can be used to navigate directly to any element in the course. Performing a Control+Click or Alt+Click on Windows / Option+Click for macOS will reveal the model of the selected course element in the browser console. The course map uses the following legend: From 45e5b6e34fb955d6ffe871cec00c1c3821ce4e6f Mon Sep 17 00:00:00 2001 From: Brad Simpson Date: Fri, 21 Jun 2024 15:46:34 -0600 Subject: [PATCH 3/3] Minor grammatical fix --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5045376..42c0e3b 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ Allows the user to toggle visual indicators which reveal how to answer correctly ### Auto correct -When enabled, automatically provides the correct answer when submit is selected. If not enabled, the user can Control+Click or Alt+Click on Windows / Option+Click for macOS the submit button to have the correct answer provided. Standard question components will be answered naturally; revealing the correct responses, feedback and marking if applicable. The plugin will not attempt to do this for bespoke questions or questions that do not have correct answers (e.g. confidence slider), but their models will still be modified to indicate that they are complete and correct. +When enabled, automatically provides the correct answer when submit is selected. If not enabled, the user can Control+Click or Alt+Click for Windows / Option+Click for macOS the submit button to have the correct answer provided. Standard question components will be answered naturally; revealing the correct responses, feedback and marking if applicable. The plugin will not attempt to do this for bespoke questions or questions that do not have correct answers (e.g. confidence slider), but their models will still be modified to indicate that they are complete and correct. ### Tutor @@ -56,7 +56,7 @@ Once selected adapt-devtools will disable Adapt core locking (>=v2.0.9) througho ### Course map -Select this button to reveal an interactive diagram of the course structure. The diagram will reveal all structural elements (content objects, articles, blocks and components) arranged in an intuitive way, reflecting both the hierarchical relationship of the elements and the vertical arrangement of content within each page. The map can be used to navigate directly to any element in the course. Performing a Control+Click or Alt+Click on Windows / Option+Click for macOS will reveal the model of the selected course element in the browser console. +Select this button to reveal an interactive diagram of the course structure. The diagram will reveal all structural elements (content objects, articles, blocks and components) arranged in an intuitive way, reflecting both the hierarchical relationship of the elements and the vertical arrangement of content within each page. The map can be used to navigate directly to any element in the course. Performing a Control+Click or Alt+Click for Windows / Option+Click for macOS will reveal the model of the selected course element in the browser console. The course map uses the following legend: