Skip to content

Commit

Permalink
New: Add the ability for Mac users to use option-click (fixes #92) (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
swashbuck authored Jun 25, 2024
1 parent ffd7369 commit bce9c8c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 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

Expand All @@ -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 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:
+ **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

Expand Down
4 changes: 2 additions & 2 deletions js/auto-answer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
2 changes: 1 addition & 1 deletion js/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 + ':');
Expand Down

0 comments on commit bce9c8c

Please sign in to comment.