@instructure/quiz-core 22.5.0 → 22.5.1-rc.1
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.5.
|
|
3
|
+
"version": "22.5.1-rc.1+4398afa5e",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "The Quiz React SDK by Instructure Inc.",
|
|
6
6
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
@@ -10,6 +10,27 @@
|
|
|
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
|
+
},
|
|
13
34
|
"keywords": [
|
|
14
35
|
"react",
|
|
15
36
|
"react-component",
|
|
@@ -25,6 +46,11 @@
|
|
|
25
46
|
"@instructure/emotion": "10.14.0",
|
|
26
47
|
"@instructure/grading-utils": "^1.0.0",
|
|
27
48
|
"@instructure/outcomes-ui": "3.2.3",
|
|
49
|
+
"@instructure/quiz-common": "22.5.1-rc.1+4398afa5e",
|
|
50
|
+
"@instructure/quiz-i18n": "22.5.1-rc.1+4398afa5e",
|
|
51
|
+
"@instructure/quiz-interactions": "22.5.1-rc.1+4398afa5e",
|
|
52
|
+
"@instructure/quiz-number-input": "22.5.1-rc.1+4398afa5e",
|
|
53
|
+
"@instructure/quiz-rce": "22.5.1-rc.1+4398afa5e",
|
|
28
54
|
"@instructure/ui-a11y-content": "10.14.0",
|
|
29
55
|
"@instructure/ui-alerts": "10.14.0",
|
|
30
56
|
"@instructure/ui-avatar": "10.14.0",
|
|
@@ -83,6 +109,7 @@
|
|
|
83
109
|
"file-saver": "~2.0.5",
|
|
84
110
|
"humps": "^2.0.0",
|
|
85
111
|
"immutable": "^3.8.1",
|
|
112
|
+
"instructure-validations": "22.5.1-rc.1+4398afa5e",
|
|
86
113
|
"ipaddr.js": "^1.5.4",
|
|
87
114
|
"isomorphic-fetch": "^2.2.0",
|
|
88
115
|
"isuuid": "^0.1.0",
|
|
@@ -110,15 +137,10 @@
|
|
|
110
137
|
"scriptjs": "^2.5.8",
|
|
111
138
|
"store": "^1.3.20",
|
|
112
139
|
"striptags": "^2.0.0",
|
|
113
|
-
"uuid": "^3.2.1"
|
|
114
|
-
"@instructure/quiz-common": "22.5.0",
|
|
115
|
-
"@instructure/quiz-i18n": "22.5.0",
|
|
116
|
-
"@instructure/quiz-interactions": "22.5.0",
|
|
117
|
-
"@instructure/quiz-number-input": "22.5.0",
|
|
118
|
-
"@instructure/quiz-rce": "22.5.0",
|
|
119
|
-
"instructure-validations": "22.5.0"
|
|
140
|
+
"uuid": "^3.2.1"
|
|
120
141
|
},
|
|
121
142
|
"devDependencies": {
|
|
143
|
+
"@instructure/quiz-scripts": "21.0.0",
|
|
122
144
|
"@instructure/ui-axe-check": "10.14.0",
|
|
123
145
|
"@instructure/ui-test-utils": "^7.22.1",
|
|
124
146
|
"@testing-library/react": "^12.1.5",
|
|
@@ -136,6 +158,7 @@
|
|
|
136
158
|
"jquery": "^2.2.3",
|
|
137
159
|
"karma-junit-reporter": "^2.0.1",
|
|
138
160
|
"most-subject": "^5.3.0",
|
|
161
|
+
"quiz-presets": "22.5.1-rc.1+4398afa5e",
|
|
139
162
|
"react": "^16.8.6",
|
|
140
163
|
"react-addons-test-utils": "^15.6.2",
|
|
141
164
|
"react-dom": "^16.8.6",
|
|
@@ -143,9 +166,7 @@
|
|
|
143
166
|
"redux-mock-store": "^1.3.0",
|
|
144
167
|
"request": "^2.74.0",
|
|
145
168
|
"sinon": "^6.1.3",
|
|
146
|
-
"sinon-chai": "^3.3.0"
|
|
147
|
-
"@instructure/quiz-scripts": "21.0.0",
|
|
148
|
-
"quiz-presets": "22.5.0"
|
|
169
|
+
"sinon-chai": "^3.3.0"
|
|
149
170
|
},
|
|
150
171
|
"peerDependencies": {
|
|
151
172
|
"react": "^15 || ^16"
|
|
@@ -153,25 +174,5 @@
|
|
|
153
174
|
"publishConfig": {
|
|
154
175
|
"access": "public"
|
|
155
176
|
},
|
|
156
|
-
"
|
|
157
|
-
|
|
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
|
-
}
|
|
177
|
+
"gitHead": "4398afa5ecd68d16a7af1bcf65b321ae7feaa17a"
|
|
178
|
+
}
|