@instructure/quiz-core 17.67.1-rc.0 → 18.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,42 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [18.0.0](https://gerrit.instructure.com/quizzes-ui/compare/v17.67.0...v18.0.0) (2023-09-08)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **calculator:** use window.LearnosityApp rather than async loading at runtime ([bba81e9](https://gerrit.instructure.com/quizzes-ui/commits/bba81e92aab7db0f764077bdb90381a1a2475b6c))
12
+ * **itemanalysis:** refactor status report polling logic ([7afeb9e](https://gerrit.instructure.com/quizzes-ui/commits/7afeb9ec94ab66b70ef4c1cf9dbd19b8eb9f8acd))
13
+
14
+
15
+ ### BREAKING CHANGES
16
+
17
+ * **calculator:** relies on window.learnosityApp being available.
18
+ Therefore, consumers must load the learnosity script via script
19
+ tag in the page header so that window.LearnosityApp is available.
20
+ ie. <script src="https://questions.learnosity.com?v2023.2.LTS">
21
+ regional variations are available:
22
+ https://help.learnosity.com/hc/en-us/articles/360000754798-What-Regions-and-Endpoints-Should-I-Use-
23
+
24
+ refs QUIZ-11213
25
+
26
+ test plan:
27
+ - to be tested with associated quiz_lti PS:
28
+ https://gerrit.instructure.com/c/quiz_lti/+/326968
29
+ - see the test plan on that PS
30
+
31
+ Change-Id: I8693b5ef5279b41fd42d765472805d8b6c1fe37c
32
+ Reviewed-on: https://gerrit.instructure.com/c/quizzes-ui/+/326969
33
+ Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
34
+ Reviewed-by: Griffin Zody <griffin.zody@instructure.com>
35
+ QA-Review: Griffin Zody <griffin.zody@instructure.com>
36
+ Product-Review: Marissa Pio Roda <marissa.pioroda@instructure.com>
37
+
38
+
39
+
40
+
41
+
6
42
  # [17.67.0](https://gerrit.instructure.com/quizzes-ui/compare/v17.66.1...v17.67.0) (2023-09-06)
7
43
 
8
44
 
@@ -1,8 +1,6 @@
1
1
  import _regeneratorRuntime from "@babel/runtime/regenerator";
2
- import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
3
2
  import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
4
3
  import Fetcher from "../../common/util/Fetcher.js";
5
- import loadLearnositySdk from "./loader.js";
6
4
  var questionsApp;
7
5
  var authPromise;
8
6
  export function appendFeature(_x, _x2, _x3) {
@@ -86,16 +84,11 @@ function featureContainer(featureId) {
86
84
  }
87
85
 
88
86
  function authenticate(quizSessionId) {
89
- var loader = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : loadLearnositySdk;
90
- var fetcher = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null;
87
+ var fetcher = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null;
91
88
  authPromise = authPromise || new Promise(function (resolve, reject) {
92
89
  var f = fetcher || new Fetcher();
93
- Promise.all([loader(), f.post("/api/quiz_sessions/".concat(quizSessionId, "/learnosity_authentication?domain=").concat(window.location.hostname))]).then(function (_ref) {
94
- var _ref2 = _slicedToArray(_ref, 2),
95
- app = _ref2[0],
96
- response = _ref2[1];
97
-
98
- var questionsApp = app.init(response, {
90
+ f.post("/api/quiz_sessions/".concat(quizSessionId, "/learnosity_authentication?domain=").concat(window.location.hostname)).then(function (response) {
91
+ var questionsApp = window.LearnosityApp.init(response, {
99
92
  errorListener: function errorListener(e) {
100
93
  authPromise = null;
101
94
  reject(e);
@@ -12,14 +12,10 @@ exports.reset = reset;
12
12
 
13
13
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
14
14
 
15
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
16
-
17
15
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
18
16
 
19
17
  var _Fetcher = _interopRequireDefault(require("../../common/util/Fetcher.js"));
20
18
 
21
- var _loader = _interopRequireDefault(require("./loader.js"));
22
-
23
19
  var questionsApp;
24
20
  var authPromise;
25
21
 
@@ -105,16 +101,11 @@ function featureContainer(featureId) {
105
101
  }
106
102
 
107
103
  function authenticate(quizSessionId) {
108
- var loader = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : _loader.default;
109
- var fetcher = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null;
104
+ var fetcher = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null;
110
105
  authPromise = authPromise || new Promise(function (resolve, reject) {
111
106
  var f = fetcher || new _Fetcher.default();
112
- Promise.all([loader(), f.post("/api/quiz_sessions/".concat(quizSessionId, "/learnosity_authentication?domain=").concat(window.location.hostname))]).then(function (_ref) {
113
- var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
114
- app = _ref2[0],
115
- response = _ref2[1];
116
-
117
- var questionsApp = app.init(response, {
107
+ f.post("/api/quiz_sessions/".concat(quizSessionId, "/learnosity_authentication?domain=").concat(window.location.hostname)).then(function (response) {
108
+ var questionsApp = window.LearnosityApp.init(response, {
118
109
  errorListener: function errorListener(e) {
119
110
  authPromise = null;
120
111
  reject(e);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/quiz-core",
3
- "version": "17.67.1-rc.0+7afeb9ec9",
3
+ "version": "18.0.0",
4
4
  "license": "MIT",
5
5
  "description": "The Quiz React SDK by Instructure Inc.",
6
6
  "author": "Instructure, Inc. Engineering and Product Design",
@@ -42,11 +42,11 @@
42
42
  "dependencies": {
43
43
  "@instructure/grading-utils": "^1.0.0",
44
44
  "@instructure/outcomes-ui": "^2.1.9",
45
- "@instructure/quiz-common": "17.67.1-rc.0+7afeb9ec9",
46
- "@instructure/quiz-i18n": "17.67.1-rc.0+7afeb9ec9",
47
- "@instructure/quiz-interactions": "17.67.1-rc.0+7afeb9ec9",
48
- "@instructure/quiz-number-input": "17.67.1-rc.0+7afeb9ec9",
49
- "@instructure/quiz-rce": "17.67.1-rc.0+7afeb9ec9",
45
+ "@instructure/quiz-common": "^18.0.0",
46
+ "@instructure/quiz-i18n": "^18.0.0",
47
+ "@instructure/quiz-interactions": "^18.0.0",
48
+ "@instructure/quiz-number-input": "^18.0.0",
49
+ "@instructure/quiz-rce": "^18.0.0",
50
50
  "@instructure/ui-a11y-content": "^7.20.0",
51
51
  "@instructure/ui-alerts": "^7.20.0",
52
52
  "@instructure/ui-avatar": "^7.20.0",
@@ -107,7 +107,7 @@
107
107
  "eventemitter3": "^3.1.0",
108
108
  "humps": "^2.0.0",
109
109
  "immutable": "^3.8.1",
110
- "instructure-validations": "17.67.1-rc.0+7afeb9ec9",
110
+ "instructure-validations": "^18.0.0",
111
111
  "ipaddr.js": "^1.5.4",
112
112
  "isomorphic-fetch": "^2.2.0",
113
113
  "isuuid": "^0.1.0",
@@ -139,7 +139,7 @@
139
139
  "uuid": "^3.2.1"
140
140
  },
141
141
  "devDependencies": {
142
- "@instructure/quiz-scripts": "17.67.0",
142
+ "@instructure/quiz-scripts": "^18.0.0",
143
143
  "@instructure/ui-axe-check": "^7.20.0",
144
144
  "@instructure/ui-babel-preset": "^7.20.0",
145
145
  "@instructure/ui-karma-config": "^7.20.0",
@@ -158,7 +158,7 @@
158
158
  "intl": "^1.2.4",
159
159
  "jquery": "^2.2.3",
160
160
  "most-subject": "^5.3.0",
161
- "quiz-presets": "17.67.1-rc.0+7afeb9ec9",
161
+ "quiz-presets": "^18.0.0",
162
162
  "react": "^16.8.6",
163
163
  "react-addons-test-utils": "^15.6.2",
164
164
  "react-dom": "^16.8.6",
@@ -174,5 +174,5 @@
174
174
  "publishConfig": {
175
175
  "access": "public"
176
176
  },
177
- "gitHead": "7afeb9ec94ab66b70ef4c1cf9dbd19b8eb9f8acd"
177
+ "gitHead": "cfc3450829b081d81b1d0aff451c8ecd42741c65"
178
178
  }
@@ -1,76 +0,0 @@
1
- import _regeneratorRuntime from "@babel/runtime/regenerator";
2
- import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
3
-
4
- /* global LearnosityApp */
5
- var learnosityURL = 'https://questions.learnosity.com/?v2';
6
- var promise;
7
- export default function loadLearnositySdk() {
8
- return _loadLearnositySdk.apply(this, arguments);
9
- }
10
-
11
- function _loadLearnositySdk() {
12
- _loadLearnositySdk = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
13
- return _regeneratorRuntime.wrap(function _callee$(_context) {
14
- while (1) {
15
- switch (_context.prev = _context.next) {
16
- case 0:
17
- if (!promise) {
18
- promise = fetchSdk();
19
- }
20
-
21
- return _context.abrupt("return", promise);
22
-
23
- case 2:
24
- case "end":
25
- return _context.stop();
26
- }
27
- }
28
- }, _callee);
29
- }));
30
- return _loadLearnositySdk.apply(this, arguments);
31
- }
32
-
33
- function fetchSdk() {
34
- return _fetchSdk.apply(this, arguments);
35
- }
36
-
37
- function _fetchSdk() {
38
- _fetchSdk = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
39
- var response, learnositySdk, addScript;
40
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
41
- while (1) {
42
- switch (_context2.prev = _context2.next) {
43
- case 0:
44
- _context2.next = 2;
45
- return window.fetch(learnosityURL);
46
-
47
- case 2:
48
- response = _context2.sent;
49
-
50
- if (response.ok) {
51
- _context2.next = 5;
52
- break;
53
- }
54
-
55
- throw new Error('Failed to load the Learnosity SDK');
56
-
57
- case 5:
58
- _context2.next = 7;
59
- return response.text();
60
-
61
- case 7:
62
- learnositySdk = _context2.sent;
63
- addScript = document.createElement('script');
64
- addScript.textContent = learnositySdk;
65
- document.body.appendChild(addScript);
66
- return _context2.abrupt("return", LearnosityApp);
67
-
68
- case 12:
69
- case "end":
70
- return _context2.stop();
71
- }
72
- }
73
- }, _callee2);
74
- }));
75
- return _fetchSdk.apply(this, arguments);
76
- }
@@ -1,87 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.default = loadLearnositySdk;
9
-
10
- var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
11
-
12
- var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
13
-
14
- /* global LearnosityApp */
15
- var learnosityURL = 'https://questions.learnosity.com/?v2';
16
- var promise;
17
-
18
- function loadLearnositySdk() {
19
- return _loadLearnositySdk.apply(this, arguments);
20
- }
21
-
22
- function _loadLearnositySdk() {
23
- _loadLearnositySdk = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
24
- return _regenerator.default.wrap(function _callee$(_context) {
25
- while (1) {
26
- switch (_context.prev = _context.next) {
27
- case 0:
28
- if (!promise) {
29
- promise = fetchSdk();
30
- }
31
-
32
- return _context.abrupt("return", promise);
33
-
34
- case 2:
35
- case "end":
36
- return _context.stop();
37
- }
38
- }
39
- }, _callee);
40
- }));
41
- return _loadLearnositySdk.apply(this, arguments);
42
- }
43
-
44
- function fetchSdk() {
45
- return _fetchSdk.apply(this, arguments);
46
- }
47
-
48
- function _fetchSdk() {
49
- _fetchSdk = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
50
- var response, learnositySdk, addScript;
51
- return _regenerator.default.wrap(function _callee2$(_context2) {
52
- while (1) {
53
- switch (_context2.prev = _context2.next) {
54
- case 0:
55
- _context2.next = 2;
56
- return window.fetch(learnosityURL);
57
-
58
- case 2:
59
- response = _context2.sent;
60
-
61
- if (response.ok) {
62
- _context2.next = 5;
63
- break;
64
- }
65
-
66
- throw new Error('Failed to load the Learnosity SDK');
67
-
68
- case 5:
69
- _context2.next = 7;
70
- return response.text();
71
-
72
- case 7:
73
- learnositySdk = _context2.sent;
74
- addScript = document.createElement('script');
75
- addScript.textContent = learnositySdk;
76
- document.body.appendChild(addScript);
77
- return _context2.abrupt("return", LearnosityApp);
78
-
79
- case 12:
80
- case "end":
81
- return _context2.stop();
82
- }
83
- }
84
- }, _callee2);
85
- }));
86
- return _fetchSdk.apply(this, arguments);
87
- }