@instructure/quiz-core 21.0.1-rc.37 → 21.0.1-rc.38
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 +9 -9
|
@@ -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.0.1-rc.
|
|
3
|
+
"version": "21.0.1-rc.38+4573d7554",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "The Quiz React SDK by Instructure Inc.",
|
|
6
6
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
@@ -46,11 +46,11 @@
|
|
|
46
46
|
"@instructure/emotion": "10.14.0",
|
|
47
47
|
"@instructure/grading-utils": "^1.0.0",
|
|
48
48
|
"@instructure/outcomes-ui": "3.2.3",
|
|
49
|
-
"@instructure/quiz-common": "21.0.1-rc.
|
|
50
|
-
"@instructure/quiz-i18n": "21.0.1-rc.
|
|
51
|
-
"@instructure/quiz-interactions": "21.0.1-rc.
|
|
52
|
-
"@instructure/quiz-number-input": "21.0.1-rc.
|
|
53
|
-
"@instructure/quiz-rce": "21.0.1-rc.
|
|
49
|
+
"@instructure/quiz-common": "21.0.1-rc.38+4573d7554",
|
|
50
|
+
"@instructure/quiz-i18n": "21.0.1-rc.38+4573d7554",
|
|
51
|
+
"@instructure/quiz-interactions": "21.0.1-rc.38+4573d7554",
|
|
52
|
+
"@instructure/quiz-number-input": "21.0.1-rc.38+4573d7554",
|
|
53
|
+
"@instructure/quiz-rce": "21.0.1-rc.38+4573d7554",
|
|
54
54
|
"@instructure/ui-a11y-content": "10.14.0",
|
|
55
55
|
"@instructure/ui-alerts": "10.14.0",
|
|
56
56
|
"@instructure/ui-avatar": "10.14.0",
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
"file-saver": "~2.0.5",
|
|
110
110
|
"humps": "^2.0.0",
|
|
111
111
|
"immutable": "^3.8.1",
|
|
112
|
-
"instructure-validations": "21.0.1-rc.
|
|
112
|
+
"instructure-validations": "21.0.1-rc.38+4573d7554",
|
|
113
113
|
"ipaddr.js": "^1.5.4",
|
|
114
114
|
"isomorphic-fetch": "^2.2.0",
|
|
115
115
|
"isuuid": "^0.1.0",
|
|
@@ -158,7 +158,7 @@
|
|
|
158
158
|
"jquery": "^2.2.3",
|
|
159
159
|
"karma-junit-reporter": "^2.0.1",
|
|
160
160
|
"most-subject": "^5.3.0",
|
|
161
|
-
"quiz-presets": "21.0.1-rc.
|
|
161
|
+
"quiz-presets": "21.0.1-rc.38+4573d7554",
|
|
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": "
|
|
177
|
+
"gitHead": "4573d755470fb79c39364d2f7cc595a7c5fd2d4c"
|
|
178
178
|
}
|