Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: adaptlearning/adapt_framework
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v5.11.0
Choose a base ref
...
head repository: adaptlearning/adapt_framework
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v5.12.0
Choose a head ref
  • 19 commits
  • 28 files changed
  • 6 contributors

Commits on Mar 10, 2021

  1. Screen readers reads out blank at the top of the screen after navigat…

    …ing elements on the page (#3058)
    
    * removed the role from the a11y-focuser element and added bottom style to the element so screen readers do not highlight the element at the top of the page
    * removed top 0 and put the width back to auto so that the element gains focus at the bottom left corner
    eleanor-heath authored Mar 10, 2021
    Copy the full SHA
    2278c74 View commit details

Commits on Mar 11, 2021

  1. Copy the full SHA
    91bc022 View commit details
  2. issue/3061 Fixed router history (#3063)

    * issue/3061 Fixed router history
    oliverfoster authored Mar 11, 2021
    Copy the full SHA
    36a31d2 View commit details
  3. Copy the full SHA
    be493c9 View commit details
  4. Copy the full SHA
    23e501b View commit details
  5. Copy the full SHA
    a4a1023 View commit details
  6. Copy the full SHA
    8de7eb5 View commit details

Commits on Mar 12, 2021

  1. allow correct answer/hide correct answer buttons to be keyboard/scree…

    …n reader accessible (#3051)
    
    * allow for 'correct answer' & 'my answer' functionality to work with screen readers
    * add new 'correct/user answer' functionality in for components like MCQ/GMCQ that use itemsQuestionModel.js
    * refactor buttonsView to reduce amount of else & else..if code blocks
    * remove unused parameters from updateAttemptsCount
    moloko authored Mar 12, 2021
    Copy the full SHA
    812fe01 View commit details
  2. fixes #3068 (#3069)

    moloko authored Mar 12, 2021
    Copy the full SHA
    42d9758 View commit details

Commits on Mar 15, 2021

  1. Merge pull request #3067 from adaptlearning/issue/3066

    Write Less error to stderr
    tomgreenfield authored Mar 15, 2021
    Copy the full SHA
    ce54f0f View commit details

Commits on Mar 16, 2021

  1. fix for bad PLP scroll (#3075)

    * fix for #3074
    * return early
    moloko authored Mar 16, 2021
    Copy the full SHA
    087d72f View commit details
  2. bump version

    update CHANGELOG.md
    moloko committed Mar 16, 2021
    Copy the full SHA
    38a70bc View commit details
  3. amend release date

    moloko committed Mar 16, 2021
    Copy the full SHA
    8211f96 View commit details
  4. minor amends

    moloko committed Mar 16, 2021
    Copy the full SHA
    daa7fca View commit details
  5. move 3066 into 'changed'

    moloko committed Mar 16, 2021
    Copy the full SHA
    2554350 View commit details
  6. add link to spoor plugin

    moloko committed Mar 16, 2021
    Copy the full SHA
    7405203 View commit details
  7. consistency

    moloko committed Mar 16, 2021
    Copy the full SHA
    a8c7785 View commit details

Commits on Mar 17, 2021

  1. capitalisation

    moloko committed Mar 17, 2021
    Copy the full SHA
    6b1d977 View commit details
  2. Copy the full SHA
    73aafa1 View commit details
6 changes: 4 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -2,13 +2,15 @@
"env": {
"browser": true,
"commonjs": false,
"es6": false,
"es2020": true,
"amd": true
},
"extends": [
"standard"
],
"globals": {
"ReactDOM": true,
"React": true,
"Promise": true,
"requirejs": true,
"Backbone": true,
@@ -39,4 +41,4 @@
"requirejs/no-commonjs-wrapper": 2,
"requirejs/no-object-define": 1
}
}
}
23 changes: 20 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
## [5.12.0] - 2021-03-17
### Added
* Support for keyboard/screen reader accessibility for the correct answer toggle button (Part of [#2942](https://github.com/adaptlearning/adapt_framework/issues/2942))
* Support for React JSX templates (Part of [#2944](https://github.com/adaptlearning/adapt_framework/issues/2944))

### Changed
* The 'skip navigation' button now becomes visible when it has focus ([#3040](https://github.com/adaptlearning/adapt_framework/issues/3040))
* Less errors are now written to `stderr` to enable reliable error handling in the AAT ([#3066](https://github.com/adaptlearning/adapt_framework/issues/3066))

### Fixed
* Screen readers reading out 'blank' at the top of the screen after nagivating through the page ([#3057](https://github.com/adaptlearning/adapt_framework/issues/3057))
* History state issue when routing is prevented by plugins like [pageIncompletePrompt](https://github.com/cgkineo/adapt-pageIncompletePrompt) ([#3061](https://github.com/adaptlearning/adapt_framework/issues/3061))
* Error 'exception thrown but not caught' in IE11 whenever clicking on the page ([#3064](https://github.com/adaptlearning/adapt_framework/issues/3064))
* The `tracking-remove` task wouldn't run if the [Spoor plugin](https://github.com/adaptlearning/adapt-contrib-spoor) was not installed ([#3068](https://github.com/adaptlearning/adapt_framework/issues/3068))
* Odd scrolling behaviour when clicking on any Drawer item that caused Adapt to scroll to an element ([#3074](https://github.com/adaptlearning/adapt_framework/issues/3074))

## [5.11.0] - 2021-02-26
### Added
* A method of identifying models based upon the course's `_trackingId` properties, regardless of whether they are located on blocks or components (Part of [#2805](https://github.com/adaptlearning/adapt_framework/issues/2805))
@@ -74,10 +90,10 @@
* A `save` method to the `offlineStorage` API ([#2754](https://github.com/adaptlearning/adapt_framework/issues/2754))
* New `DeepClone` API ([#2758](https://github.com/adaptlearning/adapt_framework/issues/2758))
* New `ChildViews` API for rendering control ([#2760](https://github.com/adaptlearning/adapt_framework/issues/2760))
* Option to track content at component level instead of block level ([#2805](https://github.com/adaptlearning/adapt_framework/issues/2805)). Note: requires [v3.5.0 of the spoor plugin](https://github.com/adaptlearning/adapt-contrib-spoor/releases/tag/v3.5.0).
* Option to track content at component level instead of block level ([#2805](https://github.com/adaptlearning/adapt_framework/issues/2805)). Note: requires [v3.5.0 of the Spoor plugin](https://github.com/adaptlearning/adapt-contrib-spoor/releases/tag/v3.5.0).
* Ability to exclude plugins from a 'production' build ([#2836](https://github.com/adaptlearning/adapt_framework/issues/2836))
* Image compression via new `grunt compress` command ([#2866](https://github.com/adaptlearning/adapt_framework/issues/2866))
* Ability to have the state of presentation components saved between sessions ([#2845](https://github.com/adaptlearning/adapt_framework/issues/2845)). Note: requires [v3.5.0 of the spoor plugin](https://github.com/adaptlearning/adapt-contrib-spoor/releases/tag/v3.5.0).
* Ability to have the state of presentation components saved between sessions ([#2845](https://github.com/adaptlearning/adapt_framework/issues/2845)). Note: requires [v3.5.0 of the Spoor plugin](https://github.com/adaptlearning/adapt-contrib-spoor/releases/tag/v3.5.0).

### Changed
* Underscore library updated to v1.10.2 ([#2773](https://github.com/adaptlearning/adapt_framework/issues/2773))
@@ -431,7 +447,7 @@ For a more detailed overview of the changes see ([#2711](https://github.com/adap
- Updated JQuery from v2.2.3 to v3.3.1 ([#1303](https://github.com/adaptlearning/adapt_framework/issues/1303))
- Moved trickle's `jquery.resize` plugin and model functions into core ([#1576](https://github.com/adaptlearning/adapt_framework/issues/1576))
- Amended `offlineStorage` in preparation for the addition of xAPI support ([#1699](https://github.com/adaptlearning/adapt_framework/issues/1699))
- Moved course completion settings and logic out of the spoor plugin and into core in preparation for the addition of xAPI support ([#1700](https://github.com/adaptlearning/adapt_framework/issues/1700))
- Moved course completion settings and logic out of the Spoor plugin and into core in preparation for the addition of xAPI support ([#1700](https://github.com/adaptlearning/adapt_framework/issues/1700))
- Tidy up of router.js ([#1757](https://github.com/adaptlearning/adapt_framework/issues/1757))
- Amended `startController` to allow a class name as well as a selector ([#1843](https://github.com/adaptlearning/adapt_framework/issues/1843))
- Updated Modernizr to v3.5.0 ([#1934](https://github.com/adaptlearning/adapt_framework/issues/1934))
@@ -990,6 +1006,7 @@ The initial version of the Adapt framework.
### Added
- Everything!

[5.12.0]: https://github.com/adaptlearning/adapt_framework/compare/v5.11.0...v5.12.0
[5.11.0]: https://github.com/adaptlearning/adapt_framework/compare/v5.10.1...v5.11.0
[5.10.1]: https://github.com/adaptlearning/adapt_framework/compare/v5.10.0...v5.10.1
[5.10.0]: https://github.com/adaptlearning/adapt_framework/compare/v5.9.0...v5.10.0
22 changes: 22 additions & 0 deletions grunt/config/javascript.js
Original file line number Diff line number Diff line change
@@ -19,6 +19,17 @@ module.exports = function(grunt, options) {
return grunt.config('helpers').includedFilter(filepath);
},
umdImports: [
'../node_modules/object.assign/dist/browser.js',
'../node_modules/react/umd/react.development.js',
'../node_modules/react-dom/umd/react-dom.development.js',
'../node_modules/html-react-parser/dist/html-react-parser.min.js'
],
reactTemplates: [
'<%= sourcedir %>core/templates/**/*.jsx',
'<%= sourcedir %>components/*/templates/**/*.jsx',
'<%= sourcedir %>extensions/*/templates/**/*.jsx',
'<%= sourcedir %>menu/*/templates/**/*.jsx',
'<%= sourcedir %>theme/*/templates/**/*.jsx'
],
external: {
jquery: 'empty:',
@@ -74,6 +85,17 @@ module.exports = function(grunt, options) {
return grunt.config('helpers').includedFilter(filepath);
},
umdImports: [
'../node_modules/object.assign/dist/browser.js',
'../node_modules/react/umd/react.production.min.js',
'../node_modules/react-dom/umd/react-dom.production.min.js',
'../node_modules/html-react-parser/dist/html-react-parser.min.js'
],
reactTemplates: [
'<%= sourcedir %>core/templates/**/*.jsx',
'<%= sourcedir %>components/*/templates/**/*.jsx',
'<%= sourcedir %>extensions/*/templates/**/*.jsx',
'<%= sourcedir %>menu/*/templates/**/*.jsx',
'<%= sourcedir %>theme/*/templates/**/*.jsx'
],
external: {
jquery: 'empty:',
2 changes: 1 addition & 1 deletion grunt/config/watch.js
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ module.exports = {
tasks: ['newer:copy:courseAssets']
},
js: {
files: ['<%= sourcedir %>**/*.js'],
files: ['<%= sourcedir %>**/*.js', '<%= sourcedir %>**/*.jsx'],
options: {
spawn: false
},
33 changes: 31 additions & 2 deletions grunt/tasks/javascript.js
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ module.exports = function(grunt) {
const isDisableCache = process.argv.includes('--disable-cache');
let cache;

const extensions = ['.js'];
const extensions = ['.js', '.jsx'];

const restoreCache = async (cachePath, basePath) => {
if (isDisableCache || cache || !fs.existsSync(cachePath)) return;
@@ -161,6 +161,14 @@ module.exports = function(grunt) {
});
}

// Collect react templates
const reactTemplatePaths = [];
options.reactTemplates.forEach(pattern => {
grunt.file.expand({
filter: options.pluginsFilter
}, pattern).forEach(templatePath => reactTemplatePaths.push(templatePath.replace(convertSlashes, '/')));
});

// Process remapping and external model configurations
const mapParts = Object.keys(options.map);
const externalParts = Object.keys(options.external);
@@ -257,6 +265,8 @@ module.exports = function(grunt) {
// Dynamically construct plugins.js with plugin dependencies
code = `define([${pluginPaths.map(filename => {
return `"${filename}"`;
}).join(',')}, ${reactTemplatePaths.map(filename => {
return `"${filename}"`;
}).join(',')}], function() {});`;
return code;
}
@@ -280,6 +290,12 @@ module.exports = function(grunt) {
'**/node_modules/**'
],
presets: [
[
'@babel/preset-react',
{
runtime: 'classic'
}
],
[
'@babel/preset-env',
{
@@ -302,7 +318,20 @@ module.exports = function(grunt) {
ignoreNestedRequires: true,
defineFunctionName: '__AMD',
defineModuleId: (moduleId) => moduleId.replace(convertSlashes, '/').replace(basePath, '').replace('.js', ''),
excludes: []
excludes: [
'**/templates/**/*.jsx'
]
}
],
[
'transform-react-templates',
{
includes: [
'**/templates/**/*.jsx'
],
importRegisterFunctionFromModule: path.resolve(basePath, 'core/js/reactHelpers.js').replace(convertSlashes, '/'),
registerFunctionName: 'register',
registerTemplateName: (moduleId) => path.parse(moduleId).name
}
]
]
4 changes: 3 additions & 1 deletion grunt/tasks/less.js
Original file line number Diff line number Diff line change
@@ -120,7 +120,9 @@ module.exports = function(grunt) {
visitors.flushLog();

if (error) {
grunt.fail.fatal(JSON.stringify(error, null, 1));
const errorString = error.toString();
console.error(errorString);
grunt.fail.fatal(errorString);
return;
}

1 change: 0 additions & 1 deletion grunt/tasks/tracking-remove.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
module.exports = function(grunt) {
const Helpers = require('../helpers')(grunt);
grunt.registerTask('tracking-remove', 'Removes all tracking IDs', function() {
if (!Helpers.isPluginInstalled('adapt-contrib-spoor')) return;
const data = Helpers.getFramework().getData();
data.removeTrackingIds();
});
Loading