@instructure/quiz-core 22.5.1-rc.0 → 22.6.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.
|
@@ -207,6 +207,7 @@ export var QuizSession = /*#__PURE__*/function (_ReduxRecord) {
|
|
|
207
207
|
user: Map(),
|
|
208
208
|
// Good candidate for another Record - Still relevant?
|
|
209
209
|
bolaSessionItemsCount: null,
|
|
210
|
-
buildOnLastAttempt: null
|
|
210
|
+
buildOnLastAttempt: null,
|
|
211
|
+
multipleSessionAttempt: false
|
|
211
212
|
}));
|
|
212
213
|
export default QuizSession;
|
|
@@ -21,7 +21,7 @@ function _callSuper(_this, derived, args) {
|
|
|
21
21
|
}
|
|
22
22
|
/** @jsx jsx */
|
|
23
23
|
/* eslint "array-callback-return": "warn" */
|
|
24
|
-
import { Component } from 'react';
|
|
24
|
+
import React, { Component } from 'react';
|
|
25
25
|
import PropTypes from 'prop-types';
|
|
26
26
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
27
27
|
import { AccessibleContent, PresentationContent } from '@instructure/ui-a11y-content';
|
|
@@ -31,7 +31,7 @@ import { Link } from '@instructure/ui-link';
|
|
|
31
31
|
import { Avatar } from '@instructure/ui-avatar';
|
|
32
32
|
import { View } from '@instructure/ui-view';
|
|
33
33
|
import { Table } from '@instructure/ui-table';
|
|
34
|
-
import { IconEditLine, IconWarningLine } from '@instructure/ui-icons';
|
|
34
|
+
import { IconEditLine, IconWarningLine, IconWarningSolid } from '@instructure/ui-icons';
|
|
35
35
|
import { IconButton } from '@instructure/ui-buttons';
|
|
36
36
|
import { jsx } from '@instructure/emotion';
|
|
37
37
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
@@ -39,6 +39,7 @@ import { withI18nSupport, withStyleOverrides } from '@instructure/quiz-common';
|
|
|
39
39
|
import FormattedDuration from '../../../../common/components/shared/FormattedDuration';
|
|
40
40
|
import generateStyle from './styles';
|
|
41
41
|
import generateComponentTheme from './theme';
|
|
42
|
+
import { Tooltip } from '@instructure/ui-tooltip';
|
|
42
43
|
var DASHES = '---';
|
|
43
44
|
export var ModerateTableRow = (_dec = withStyleOverrides(generateStyle, generateComponentTheme), _dec(_class = (_ModerateTableRow = /*#__PURE__*/function (_withI18nSupport) {
|
|
44
45
|
function ModerateTableRow() {
|
|
@@ -223,6 +224,26 @@ export var ModerateTableRow = (_dec = withStyleOverrides(generateStyle, generate
|
|
|
223
224
|
}, message);
|
|
224
225
|
});
|
|
225
226
|
}
|
|
227
|
+
}, {
|
|
228
|
+
key: "renderLogMessage",
|
|
229
|
+
value: function renderLogMessage() {
|
|
230
|
+
var multipleSessionAttempt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
231
|
+
var message = arguments.length > 1 ? arguments[1] : undefined;
|
|
232
|
+
return jsx(React.Fragment, null, jsx(Text, {
|
|
233
|
+
color: multipleSessionAttempt ? 'danger' : 'brand'
|
|
234
|
+
}, message), multipleSessionAttempt && jsx(Tooltip, {
|
|
235
|
+
renderTip: t('Multiple sessions detected'),
|
|
236
|
+
placement: "end",
|
|
237
|
+
on: ['click', 'hover', 'focus']
|
|
238
|
+
}, jsx(IconButton, {
|
|
239
|
+
screenReaderLabel: t('Multiple sessions detected'),
|
|
240
|
+
color: 'danger',
|
|
241
|
+
size: 'small',
|
|
242
|
+
renderIcon: IconWarningSolid,
|
|
243
|
+
withBackground: false,
|
|
244
|
+
withBorder: false
|
|
245
|
+
})));
|
|
246
|
+
}
|
|
226
247
|
}, {
|
|
227
248
|
key: "renderLogLinks",
|
|
228
249
|
value: function renderLogLinks(quizSessions) {
|
|
@@ -240,6 +261,7 @@ export var ModerateTableRow = (_dec = withStyleOverrides(generateStyle, generate
|
|
|
240
261
|
return quizSessions.map(function (quizSession) {
|
|
241
262
|
var quizSessionId = quizSession.get('id');
|
|
242
263
|
var message = quizSession.inProgress() || quizSession.reopeningGraded() ? t('In Progress') : t('View Log');
|
|
264
|
+
var logMessage = _this7.renderLogMessage(quizSession.get('multipleSessionAttempt'), message);
|
|
243
265
|
function onClick(event) {
|
|
244
266
|
onModerateLogClick({
|
|
245
267
|
id: id,
|
|
@@ -253,7 +275,7 @@ export var ModerateTableRow = (_dec = withStyleOverrides(generateStyle, generate
|
|
|
253
275
|
}, jsx(Link, {
|
|
254
276
|
onClick: onClick,
|
|
255
277
|
"data-automation": "sdk-moderation-moderate-session-log-link"
|
|
256
|
-
},
|
|
278
|
+
}, logMessage));
|
|
257
279
|
});
|
|
258
280
|
}
|
|
259
281
|
}, {
|
|
@@ -214,6 +214,7 @@ var QuizSession = exports.QuizSession = /*#__PURE__*/function (_ReduxRecord) {
|
|
|
214
214
|
user: (0, _immutable.Map)(),
|
|
215
215
|
// Good candidate for another Record - Still relevant?
|
|
216
216
|
bolaSessionItemsCount: null,
|
|
217
|
-
buildOnLastAttempt: null
|
|
217
|
+
buildOnLastAttempt: null,
|
|
218
|
+
multipleSessionAttempt: false
|
|
218
219
|
}));
|
|
219
220
|
var _default = exports["default"] = QuizSession;
|
|
@@ -11,7 +11,7 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
|
|
|
11
11
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
12
12
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
13
13
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
14
|
-
var _react = require("react");
|
|
14
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
15
15
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
16
16
|
var _reactImmutableProptypes = _interopRequireDefault(require("react-immutable-proptypes"));
|
|
17
17
|
var _uiA11yContent = require("@instructure/ui-a11y-content");
|
|
@@ -29,9 +29,12 @@ var _quizCommon = require("@instructure/quiz-common");
|
|
|
29
29
|
var _FormattedDuration = _interopRequireDefault(require("../../../../common/components/shared/FormattedDuration"));
|
|
30
30
|
var _styles = _interopRequireDefault(require("./styles"));
|
|
31
31
|
var _theme = _interopRequireDefault(require("./theme"));
|
|
32
|
+
var _uiTooltip = require("@instructure/ui-tooltip");
|
|
32
33
|
var _dec, _class, _ModerateTableRow;
|
|
33
34
|
/** @jsx jsx */
|
|
34
35
|
/* eslint "array-callback-return": "warn" */
|
|
36
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
37
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
35
38
|
function _callSuper(_this, derived, args) {
|
|
36
39
|
function isNativeReflectConstruct() {
|
|
37
40
|
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
@@ -230,6 +233,26 @@ var ModerateTableRow = exports.ModerateTableRow = (_dec = (0, _quizCommon.withSt
|
|
|
230
233
|
}, message);
|
|
231
234
|
});
|
|
232
235
|
}
|
|
236
|
+
}, {
|
|
237
|
+
key: "renderLogMessage",
|
|
238
|
+
value: function renderLogMessage() {
|
|
239
|
+
var multipleSessionAttempt = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
240
|
+
var message = arguments.length > 1 ? arguments[1] : undefined;
|
|
241
|
+
return (0, _emotion.jsx)(_react["default"].Fragment, null, (0, _emotion.jsx)(_uiText.Text, {
|
|
242
|
+
color: multipleSessionAttempt ? 'danger' : 'brand'
|
|
243
|
+
}, message), multipleSessionAttempt && (0, _emotion.jsx)(_uiTooltip.Tooltip, {
|
|
244
|
+
renderTip: (0, _formatMessage["default"])('Multiple sessions detected'),
|
|
245
|
+
placement: "end",
|
|
246
|
+
on: ['click', 'hover', 'focus']
|
|
247
|
+
}, (0, _emotion.jsx)(_uiButtons.IconButton, {
|
|
248
|
+
screenReaderLabel: (0, _formatMessage["default"])('Multiple sessions detected'),
|
|
249
|
+
color: 'danger',
|
|
250
|
+
size: 'small',
|
|
251
|
+
renderIcon: _uiIcons.IconWarningSolid,
|
|
252
|
+
withBackground: false,
|
|
253
|
+
withBorder: false
|
|
254
|
+
})));
|
|
255
|
+
}
|
|
233
256
|
}, {
|
|
234
257
|
key: "renderLogLinks",
|
|
235
258
|
value: function renderLogLinks(quizSessions) {
|
|
@@ -247,6 +270,7 @@ var ModerateTableRow = exports.ModerateTableRow = (_dec = (0, _quizCommon.withSt
|
|
|
247
270
|
return quizSessions.map(function (quizSession) {
|
|
248
271
|
var quizSessionId = quizSession.get('id');
|
|
249
272
|
var message = quizSession.inProgress() || quizSession.reopeningGraded() ? (0, _formatMessage["default"])('In Progress') : (0, _formatMessage["default"])('View Log');
|
|
273
|
+
var logMessage = _this7.renderLogMessage(quizSession.get('multipleSessionAttempt'), message);
|
|
250
274
|
function onClick(event) {
|
|
251
275
|
onModerateLogClick({
|
|
252
276
|
id: id,
|
|
@@ -260,7 +284,7 @@ var ModerateTableRow = exports.ModerateTableRow = (_dec = (0, _quizCommon.withSt
|
|
|
260
284
|
}, (0, _emotion.jsx)(_uiLink.Link, {
|
|
261
285
|
onClick: onClick,
|
|
262
286
|
"data-automation": "sdk-moderation-moderate-session-log-link"
|
|
263
|
-
},
|
|
287
|
+
}, logMessage));
|
|
264
288
|
});
|
|
265
289
|
}
|
|
266
290
|
}, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/quiz-core",
|
|
3
|
-
"version": "22.
|
|
3
|
+
"version": "22.6.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "The Quiz React SDK by Instructure Inc.",
|
|
6
6
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
@@ -10,27 +10,6 @@
|
|
|
10
10
|
"type": "git",
|
|
11
11
|
"url": "https://gerrit.instructure.com/quizzes-ui.git"
|
|
12
12
|
},
|
|
13
|
-
"scripts": {
|
|
14
|
-
"clean": "ui-build --clean",
|
|
15
|
-
"build": "build-if-changed",
|
|
16
|
-
"build:all": "ui-build --modules es,cjs",
|
|
17
|
-
"build:watch": "ui-build --watch",
|
|
18
|
-
"extract": "extract-translations",
|
|
19
|
-
"lint": "ui-test --lint",
|
|
20
|
-
"lint:fix": "ui-test --lint --fix",
|
|
21
|
-
"eslint:fix": "eslint --fix .",
|
|
22
|
-
"prelint": "pnpm build",
|
|
23
|
-
"pretest": "pnpm build",
|
|
24
|
-
"test": "pnpm test:karma",
|
|
25
|
-
"test:karma": "ui-test",
|
|
26
|
-
"test:watch": "ui-test --watch",
|
|
27
|
-
"snyk:monitor": "snyk monitor",
|
|
28
|
-
"postbuild": "cp src/banks/components/noResults.svg lib/banks/components/; cp src/banks/components/noResults.svg es/banks/components/; pnpm postbuild:errorImage",
|
|
29
|
-
"postbuild:all": "pnpm postbuild",
|
|
30
|
-
"postbuild:errorImage": "cp src/reporting/components/resources/NewQuizAndItemAnalysis/downForRepair.svg es/reporting/components/resources/NewQuizAndItemAnalysis/; cp src/reporting/components/resources/NewQuizAndItemAnalysis/downForRepair.svg lib/reporting/components/resources/NewQuizAndItemAnalysis/",
|
|
31
|
-
"format": "prettier --write \"src/**/*.{js,jsx,ts,tsx}\"",
|
|
32
|
-
"typecheck": "tsc --noEmit"
|
|
33
|
-
},
|
|
34
13
|
"keywords": [
|
|
35
14
|
"react",
|
|
36
15
|
"react-component",
|
|
@@ -46,11 +25,6 @@
|
|
|
46
25
|
"@instructure/emotion": "10.14.0",
|
|
47
26
|
"@instructure/grading-utils": "^1.0.0",
|
|
48
27
|
"@instructure/outcomes-ui": "3.2.3",
|
|
49
|
-
"@instructure/quiz-common": "22.5.1-rc.0+a38ba1888",
|
|
50
|
-
"@instructure/quiz-i18n": "22.5.1-rc.0+a38ba1888",
|
|
51
|
-
"@instructure/quiz-interactions": "22.5.1-rc.0+a38ba1888",
|
|
52
|
-
"@instructure/quiz-number-input": "22.5.1-rc.0+a38ba1888",
|
|
53
|
-
"@instructure/quiz-rce": "22.5.1-rc.0+a38ba1888",
|
|
54
28
|
"@instructure/ui-a11y-content": "10.14.0",
|
|
55
29
|
"@instructure/ui-alerts": "10.14.0",
|
|
56
30
|
"@instructure/ui-avatar": "10.14.0",
|
|
@@ -109,7 +83,6 @@
|
|
|
109
83
|
"file-saver": "~2.0.5",
|
|
110
84
|
"humps": "^2.0.0",
|
|
111
85
|
"immutable": "^3.8.1",
|
|
112
|
-
"instructure-validations": "22.5.1-rc.0+a38ba1888",
|
|
113
86
|
"ipaddr.js": "^1.5.4",
|
|
114
87
|
"isomorphic-fetch": "^2.2.0",
|
|
115
88
|
"isuuid": "^0.1.0",
|
|
@@ -137,10 +110,15 @@
|
|
|
137
110
|
"scriptjs": "^2.5.8",
|
|
138
111
|
"store": "^1.3.20",
|
|
139
112
|
"striptags": "^2.0.0",
|
|
140
|
-
"uuid": "^3.2.1"
|
|
113
|
+
"uuid": "^3.2.1",
|
|
114
|
+
"@instructure/quiz-i18n": "22.6.0",
|
|
115
|
+
"@instructure/quiz-common": "22.6.0",
|
|
116
|
+
"@instructure/quiz-rce": "22.6.0",
|
|
117
|
+
"@instructure/quiz-interactions": "22.6.0",
|
|
118
|
+
"instructure-validations": "22.6.0",
|
|
119
|
+
"@instructure/quiz-number-input": "22.6.0"
|
|
141
120
|
},
|
|
142
121
|
"devDependencies": {
|
|
143
|
-
"@instructure/quiz-scripts": "21.0.0",
|
|
144
122
|
"@instructure/ui-axe-check": "10.14.0",
|
|
145
123
|
"@instructure/ui-test-utils": "^7.22.1",
|
|
146
124
|
"@testing-library/react": "^12.1.5",
|
|
@@ -158,7 +136,6 @@
|
|
|
158
136
|
"jquery": "^2.2.3",
|
|
159
137
|
"karma-junit-reporter": "^2.0.1",
|
|
160
138
|
"most-subject": "^5.3.0",
|
|
161
|
-
"quiz-presets": "22.5.1-rc.0+a38ba1888",
|
|
162
139
|
"react": "^16.8.6",
|
|
163
140
|
"react-addons-test-utils": "^15.6.2",
|
|
164
141
|
"react-dom": "^16.8.6",
|
|
@@ -166,7 +143,9 @@
|
|
|
166
143
|
"redux-mock-store": "^1.3.0",
|
|
167
144
|
"request": "^2.74.0",
|
|
168
145
|
"sinon": "^6.1.3",
|
|
169
|
-
"sinon-chai": "^3.3.0"
|
|
146
|
+
"sinon-chai": "^3.3.0",
|
|
147
|
+
"@instructure/quiz-scripts": "21.0.0",
|
|
148
|
+
"quiz-presets": "22.6.0"
|
|
170
149
|
},
|
|
171
150
|
"peerDependencies": {
|
|
172
151
|
"react": "^15 || ^16"
|
|
@@ -174,5 +153,25 @@
|
|
|
174
153
|
"publishConfig": {
|
|
175
154
|
"access": "public"
|
|
176
155
|
},
|
|
177
|
-
"
|
|
178
|
-
|
|
156
|
+
"scripts": {
|
|
157
|
+
"clean": "ui-build --clean",
|
|
158
|
+
"build": "build-if-changed",
|
|
159
|
+
"build:all": "ui-build --modules es,cjs",
|
|
160
|
+
"build:watch": "ui-build --watch",
|
|
161
|
+
"extract": "extract-translations",
|
|
162
|
+
"lint": "ui-test --lint",
|
|
163
|
+
"lint:fix": "ui-test --lint --fix",
|
|
164
|
+
"eslint:fix": "eslint --fix .",
|
|
165
|
+
"prelint": "pnpm build",
|
|
166
|
+
"pretest": "pnpm build",
|
|
167
|
+
"test": "pnpm test:karma",
|
|
168
|
+
"test:karma": "ui-test",
|
|
169
|
+
"test:watch": "ui-test --watch",
|
|
170
|
+
"snyk:monitor": "snyk monitor",
|
|
171
|
+
"postbuild": "cp src/banks/components/noResults.svg lib/banks/components/; cp src/banks/components/noResults.svg es/banks/components/; pnpm postbuild:errorImage",
|
|
172
|
+
"postbuild:all": "pnpm postbuild",
|
|
173
|
+
"postbuild:errorImage": "cp src/reporting/components/resources/NewQuizAndItemAnalysis/downForRepair.svg es/reporting/components/resources/NewQuizAndItemAnalysis/; cp src/reporting/components/resources/NewQuizAndItemAnalysis/downForRepair.svg lib/reporting/components/resources/NewQuizAndItemAnalysis/",
|
|
174
|
+
"format": "prettier --write \"src/**/*.{js,jsx,ts,tsx}\"",
|
|
175
|
+
"typecheck": "tsc --noEmit"
|
|
176
|
+
}
|
|
177
|
+
}
|