@instructure/quiz-core 21.2.3 → 21.2.4
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/es/moderating/components/resources/EventDetails.js +3 -3
- package/es/moderating/components/resources/SessionBreachAlert.js +1 -1
- package/es/moderating/components/resources/util/checkIsBreach.js +1 -1
- package/es/moderating/components/resources/util/extractSessionData.js +7 -3
- package/lib/moderating/components/resources/EventDetails.js +3 -3
- package/lib/moderating/components/resources/SessionBreachAlert.js +1 -1
- package/lib/moderating/components/resources/util/checkIsBreach.js +1 -1
- package/lib/moderating/components/resources/util/extractSessionData.js +7 -3
- package/package.json +8 -8
|
@@ -30,13 +30,13 @@ export var EventDetails = function EventDetails(_ref) {
|
|
|
30
30
|
id: "system-details-attribute"
|
|
31
31
|
}, t('Attribute')), /*#__PURE__*/React.createElement(Table.ColHeader, {
|
|
32
32
|
id: "system-details-value"
|
|
33
|
-
}, t('Value')))), /*#__PURE__*/React.createElement(Table.Body, null, /*#__PURE__*/React.createElement(Table.Row, null, /*#__PURE__*/React.createElement(Table.Cell, null, t('Client IP address')), /*#__PURE__*/React.createElement(Table.Cell, null, /*#__PURE__*/React.createElement(Text, {
|
|
33
|
+
}, t('Value')))), /*#__PURE__*/React.createElement(Table.Body, null, currentEventData.ipAddress && /*#__PURE__*/React.createElement(Table.Row, null, /*#__PURE__*/React.createElement(Table.Cell, null, t('Client IP address')), /*#__PURE__*/React.createElement(Table.Cell, null, /*#__PURE__*/React.createElement(Text, {
|
|
34
34
|
color: validationErrors.ipAddress ? 'danger' : 'primary'
|
|
35
35
|
}, currentEventData.ipAddress), validationErrors.ipAddress && renderTooltip(validationErrors.ipAddress))), /*#__PURE__*/React.createElement(Table.Row, null, /*#__PURE__*/React.createElement(Table.Cell, null, t('Browser session ID')), /*#__PURE__*/React.createElement(Table.Cell, null, /*#__PURE__*/React.createElement(Text, {
|
|
36
36
|
color: validationErrors.browserSessionID ? 'danger' : 'primary'
|
|
37
|
-
}, currentEventData.browserSessionID), validationErrors.browserSessionID && renderTooltip(validationErrors.browserSessionID))), /*#__PURE__*/React.createElement(Table.Row, null, /*#__PURE__*/React.createElement(Table.Cell, null, t('Browser')), /*#__PURE__*/React.createElement(Table.Cell, null, /*#__PURE__*/React.createElement(Text, {
|
|
37
|
+
}, currentEventData.browserSessionID), validationErrors.browserSessionID && renderTooltip(validationErrors.browserSessionID))), currentEventData.browserString && /*#__PURE__*/React.createElement(Table.Row, null, /*#__PURE__*/React.createElement(Table.Cell, null, t('Browser')), /*#__PURE__*/React.createElement(Table.Cell, null, /*#__PURE__*/React.createElement(Text, {
|
|
38
38
|
color: validationErrors.browserString ? 'danger' : 'primary'
|
|
39
|
-
}, currentEventData.browserString),
|
|
39
|
+
}, currentEventData.browserString), renderTooltip(validationErrors.browserString))), currentEventData.userPlatform && /*#__PURE__*/React.createElement(Table.Row, null, /*#__PURE__*/React.createElement(Table.Cell, null, t('Operating System')), /*#__PURE__*/React.createElement(Table.Cell, null, /*#__PURE__*/React.createElement(Text, {
|
|
40
40
|
color: validationErrors.userPlatform ? 'danger' : 'primary'
|
|
41
41
|
}, currentEventData.userPlatform), validationErrors.userPlatform && renderTooltip(validationErrors.userPlatform))), answerValue && /*#__PURE__*/React.createElement(Table.Row, null, /*#__PURE__*/React.createElement(Table.Cell, null, t('Answer value')), /*#__PURE__*/React.createElement(Table.Cell, null, answerValue)))));
|
|
42
42
|
};
|
|
@@ -5,5 +5,5 @@ export var SessionBreachAlert = function SessionBreachAlert() {
|
|
|
5
5
|
return /*#__PURE__*/React.createElement(Alert, {
|
|
6
6
|
variant: "warning",
|
|
7
7
|
margin: "small"
|
|
8
|
-
}, t('
|
|
8
|
+
}, t('This Quiz appears to have been accessed from multiple devices or browsers.'), /*#__PURE__*/React.createElement("br", null), t('Review the activity log and take appropriate action.'));
|
|
9
9
|
};
|
|
@@ -19,7 +19,7 @@ export var checkIsBreach = function checkIsBreach(firstEventData, currentEventDa
|
|
|
19
19
|
checks.forEach(function (_ref) {
|
|
20
20
|
var key = _ref.key,
|
|
21
21
|
message = _ref.message;
|
|
22
|
-
if (currentEventData[key] !== firstEventData[key]) {
|
|
22
|
+
if (currentEventData[key] && currentEventData[key] !== firstEventData[key]) {
|
|
23
23
|
result.isBreach = true;
|
|
24
24
|
result[key] = message;
|
|
25
25
|
}
|
|
@@ -9,12 +9,16 @@ export var extractSessionData = function extractSessionData(sourceData) {
|
|
|
9
9
|
userPlatform: ''
|
|
10
10
|
};
|
|
11
11
|
var clientTimestamp = sourceData.getIn(['eventData', 'clientTimestamp']);
|
|
12
|
-
var
|
|
12
|
+
var userAgent = sourceData.getIn(['eventData', 'userAgent']);
|
|
13
|
+
var userPlatform = null;
|
|
14
|
+
if (userAgent) {
|
|
15
|
+
userPlatform = platform.parse(userAgent);
|
|
16
|
+
}
|
|
13
17
|
return {
|
|
14
18
|
ipAddress: sourceData.getIn(['eventData', 'ipAddress']),
|
|
15
19
|
browserSessionID: sourceData.getIn(['eventData', 'browserSessionId']),
|
|
16
20
|
eventDate: clientTimestamp ? formatDateTimeSeconds(clientTimestamp) : '',
|
|
17
|
-
browserString: "".concat(userPlatform.name, " ").concat(userPlatform.version),
|
|
18
|
-
userPlatform: userPlatform.os.toString()
|
|
21
|
+
browserString: userPlatform ? "".concat(userPlatform.name, " ").concat(userPlatform.version) : null,
|
|
22
|
+
userPlatform: userPlatform ? userPlatform.os.toString() : null
|
|
19
23
|
};
|
|
20
24
|
};
|
|
@@ -37,13 +37,13 @@ var EventDetails = exports.EventDetails = function EventDetails(_ref) {
|
|
|
37
37
|
id: "system-details-attribute"
|
|
38
38
|
}, (0, _formatMessage["default"])('Attribute')), /*#__PURE__*/_react["default"].createElement(_uiTable.Table.ColHeader, {
|
|
39
39
|
id: "system-details-value"
|
|
40
|
-
}, (0, _formatMessage["default"])('Value')))), /*#__PURE__*/_react["default"].createElement(_uiTable.Table.Body, null, /*#__PURE__*/_react["default"].createElement(_uiTable.Table.Row, null, /*#__PURE__*/_react["default"].createElement(_uiTable.Table.Cell, null, (0, _formatMessage["default"])('Client IP address')), /*#__PURE__*/_react["default"].createElement(_uiTable.Table.Cell, null, /*#__PURE__*/_react["default"].createElement(_uiText.Text, {
|
|
40
|
+
}, (0, _formatMessage["default"])('Value')))), /*#__PURE__*/_react["default"].createElement(_uiTable.Table.Body, null, currentEventData.ipAddress && /*#__PURE__*/_react["default"].createElement(_uiTable.Table.Row, null, /*#__PURE__*/_react["default"].createElement(_uiTable.Table.Cell, null, (0, _formatMessage["default"])('Client IP address')), /*#__PURE__*/_react["default"].createElement(_uiTable.Table.Cell, null, /*#__PURE__*/_react["default"].createElement(_uiText.Text, {
|
|
41
41
|
color: validationErrors.ipAddress ? 'danger' : 'primary'
|
|
42
42
|
}, currentEventData.ipAddress), validationErrors.ipAddress && renderTooltip(validationErrors.ipAddress))), /*#__PURE__*/_react["default"].createElement(_uiTable.Table.Row, null, /*#__PURE__*/_react["default"].createElement(_uiTable.Table.Cell, null, (0, _formatMessage["default"])('Browser session ID')), /*#__PURE__*/_react["default"].createElement(_uiTable.Table.Cell, null, /*#__PURE__*/_react["default"].createElement(_uiText.Text, {
|
|
43
43
|
color: validationErrors.browserSessionID ? 'danger' : 'primary'
|
|
44
|
-
}, currentEventData.browserSessionID), validationErrors.browserSessionID && renderTooltip(validationErrors.browserSessionID))), /*#__PURE__*/_react["default"].createElement(_uiTable.Table.Row, null, /*#__PURE__*/_react["default"].createElement(_uiTable.Table.Cell, null, (0, _formatMessage["default"])('Browser')), /*#__PURE__*/_react["default"].createElement(_uiTable.Table.Cell, null, /*#__PURE__*/_react["default"].createElement(_uiText.Text, {
|
|
44
|
+
}, currentEventData.browserSessionID), validationErrors.browserSessionID && renderTooltip(validationErrors.browserSessionID))), currentEventData.browserString && /*#__PURE__*/_react["default"].createElement(_uiTable.Table.Row, null, /*#__PURE__*/_react["default"].createElement(_uiTable.Table.Cell, null, (0, _formatMessage["default"])('Browser')), /*#__PURE__*/_react["default"].createElement(_uiTable.Table.Cell, null, /*#__PURE__*/_react["default"].createElement(_uiText.Text, {
|
|
45
45
|
color: validationErrors.browserString ? 'danger' : 'primary'
|
|
46
|
-
}, currentEventData.browserString),
|
|
46
|
+
}, currentEventData.browserString), renderTooltip(validationErrors.browserString))), currentEventData.userPlatform && /*#__PURE__*/_react["default"].createElement(_uiTable.Table.Row, null, /*#__PURE__*/_react["default"].createElement(_uiTable.Table.Cell, null, (0, _formatMessage["default"])('Operating System')), /*#__PURE__*/_react["default"].createElement(_uiTable.Table.Cell, null, /*#__PURE__*/_react["default"].createElement(_uiText.Text, {
|
|
47
47
|
color: validationErrors.userPlatform ? 'danger' : 'primary'
|
|
48
48
|
}, currentEventData.userPlatform), validationErrors.userPlatform && renderTooltip(validationErrors.userPlatform))), answerValue && /*#__PURE__*/_react["default"].createElement(_uiTable.Table.Row, null, /*#__PURE__*/_react["default"].createElement(_uiTable.Table.Cell, null, (0, _formatMessage["default"])('Answer value')), /*#__PURE__*/_react["default"].createElement(_uiTable.Table.Cell, null, answerValue)))));
|
|
49
49
|
};
|
|
@@ -12,5 +12,5 @@ var SessionBreachAlert = exports.SessionBreachAlert = function SessionBreachAler
|
|
|
12
12
|
return /*#__PURE__*/_react["default"].createElement(_uiAlerts.Alert, {
|
|
13
13
|
variant: "warning",
|
|
14
14
|
margin: "small"
|
|
15
|
-
}, (0, _formatMessage["default"])('
|
|
15
|
+
}, (0, _formatMessage["default"])('This Quiz appears to have been accessed from multiple devices or browsers.'), /*#__PURE__*/_react["default"].createElement("br", null), (0, _formatMessage["default"])('Review the activity log and take appropriate action.'));
|
|
16
16
|
};
|
|
@@ -26,7 +26,7 @@ var checkIsBreach = exports.checkIsBreach = function checkIsBreach(firstEventDat
|
|
|
26
26
|
checks.forEach(function (_ref) {
|
|
27
27
|
var key = _ref.key,
|
|
28
28
|
message = _ref.message;
|
|
29
|
-
if (currentEventData[key] !== firstEventData[key]) {
|
|
29
|
+
if (currentEventData[key] && currentEventData[key] !== firstEventData[key]) {
|
|
30
30
|
result.isBreach = true;
|
|
31
31
|
result[key] = message;
|
|
32
32
|
}
|
|
@@ -16,12 +16,16 @@ var extractSessionData = exports.extractSessionData = function extractSessionDat
|
|
|
16
16
|
userPlatform: ''
|
|
17
17
|
};
|
|
18
18
|
var clientTimestamp = sourceData.getIn(['eventData', 'clientTimestamp']);
|
|
19
|
-
var
|
|
19
|
+
var userAgent = sourceData.getIn(['eventData', 'userAgent']);
|
|
20
|
+
var userPlatform = null;
|
|
21
|
+
if (userAgent) {
|
|
22
|
+
userPlatform = _platform["default"].parse(userAgent);
|
|
23
|
+
}
|
|
20
24
|
return {
|
|
21
25
|
ipAddress: sourceData.getIn(['eventData', 'ipAddress']),
|
|
22
26
|
browserSessionID: sourceData.getIn(['eventData', 'browserSessionId']),
|
|
23
27
|
eventDate: clientTimestamp ? (0, _quizI18n.formatDateTimeSeconds)(clientTimestamp) : '',
|
|
24
|
-
browserString: "".concat(userPlatform.name, " ").concat(userPlatform.version),
|
|
25
|
-
userPlatform: userPlatform.os.toString()
|
|
28
|
+
browserString: userPlatform ? "".concat(userPlatform.name, " ").concat(userPlatform.version) : null,
|
|
29
|
+
userPlatform: userPlatform ? userPlatform.os.toString() : null
|
|
26
30
|
};
|
|
27
31
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/quiz-core",
|
|
3
|
-
"version": "21.2.
|
|
3
|
+
"version": "21.2.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "The Quiz React SDK by Instructure Inc.",
|
|
6
6
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
@@ -111,12 +111,12 @@
|
|
|
111
111
|
"store": "^1.3.20",
|
|
112
112
|
"striptags": "^2.0.0",
|
|
113
113
|
"uuid": "^3.2.1",
|
|
114
|
-
"@instructure/quiz-common": "21.2.
|
|
115
|
-
"@instructure/quiz-
|
|
116
|
-
"@instructure/quiz-
|
|
117
|
-
"@instructure/quiz-
|
|
118
|
-
"
|
|
119
|
-
"instructure-
|
|
114
|
+
"@instructure/quiz-common": "21.2.4",
|
|
115
|
+
"@instructure/quiz-interactions": "21.2.4",
|
|
116
|
+
"@instructure/quiz-number-input": "21.2.4",
|
|
117
|
+
"@instructure/quiz-rce": "21.2.4",
|
|
118
|
+
"instructure-validations": "21.2.4",
|
|
119
|
+
"@instructure/quiz-i18n": "21.2.4"
|
|
120
120
|
},
|
|
121
121
|
"devDependencies": {
|
|
122
122
|
"@instructure/ui-axe-check": "^9.11.1",
|
|
@@ -145,7 +145,7 @@
|
|
|
145
145
|
"sinon": "^6.1.3",
|
|
146
146
|
"sinon-chai": "^3.3.0",
|
|
147
147
|
"@instructure/quiz-scripts": "21.0.0",
|
|
148
|
-
"quiz-presets": "21.2.
|
|
148
|
+
"quiz-presets": "21.2.4"
|
|
149
149
|
},
|
|
150
150
|
"peerDependencies": {
|
|
151
151
|
"react": "^15 || ^16"
|