@instructure/quiz-core 17.49.1-rc.8 → 17.50.1-rc.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 +24 -0
- package/es/banks/api/banks.js +26 -2
- package/es/banks/components/Banks/presenter.js +3 -4
- package/es/banks/components/CreateBankModal/index.js +3 -1
- package/es/banks/components/CreateBankModal/presenter.js +48 -2
- package/es/common/actions/grading.js +6 -1
- package/es/common/components/ConfirmationModal/presenter.js +1 -1
- package/es/common/components/layout/sidebar/Sidebar/index.js +3 -1
- package/es/common/reducers/grading.js +4 -1
- package/es/index.js +1 -1
- package/es/moderating/components/resources/ModerateTableRow/presenter.js +11 -41
- package/lib/banks/api/banks.js +26 -2
- package/lib/banks/components/Banks/presenter.js +3 -4
- package/lib/banks/components/CreateBankModal/index.js +4 -1
- package/lib/banks/components/CreateBankModal/presenter.js +50 -2
- package/lib/common/actions/grading.js +7 -0
- package/lib/common/components/ConfirmationModal/presenter.js +1 -1
- package/lib/common/components/layout/sidebar/Sidebar/index.js +3 -1
- package/lib/common/reducers/grading.js +3 -0
- package/lib/index.js +7 -0
- package/lib/moderating/components/resources/ModerateTableRow/presenter.js +11 -43
- package/package.json +10 -10
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,30 @@
|
|
|
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
|
+
# [17.50.0](https://gerrit.instructure.com/quizzes-ui/compare/v17.49.0...v17.50.0) (2023-03-16)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **a11y:** add accessibility to moderate table ([f764223](https://gerrit.instructure.com/quizzes-ui/commits/f7642232ac0a572d4dc5265ed46f74e4f55ae4e9))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* **GBQ:** add grade by question banner ([b6cd887](https://gerrit.instructure.com/quizzes-ui/commits/b6cd887c3bb6c8d582d9a7ef59e27f9b6abc3955))
|
|
17
|
+
* **GBQ:** add hidden button to jump to sidebar from grading questions ([fd884fc](https://gerrit.instructure.com/quizzes-ui/commits/fd884fc589dcef38f3ba0ad20d615c4868fafa08))
|
|
18
|
+
* **GBQ:** add modal when active question not found ([9bd3bc8](https://gerrit.instructure.com/quizzes-ui/commits/9bd3bc8000129449c35fb05480a8955447f4a481))
|
|
19
|
+
* **GBQ:** set and scroll to active item ([209011c](https://gerrit.instructure.com/quizzes-ui/commits/209011c05b8c437e7e1809c61d268c8021930d4b))
|
|
20
|
+
* **gradeBQM:** add support for gradeByQuestionMode ([4edda95](https://gerrit.instructure.com/quizzes-ui/commits/4edda9558c107916281346c7a8f5de4c29352425))
|
|
21
|
+
* **Grading:** Add sidebar to grading page ([67a51dc](https://gerrit.instructure.com/quizzes-ui/commits/67a51dce3d75661bf30ed46ce38dd5151490589d))
|
|
22
|
+
* **RCE5:** Forward canvas tool id to Canvas-rce 5 ([64019c5](https://gerrit.instructure.com/quizzes-ui/commits/64019c505076e70430601ccbed94f7a94898ca21))
|
|
23
|
+
* **Reports:** Create skeleton for new item analysis report page ([0b7fea3](https://gerrit.instructure.com/quizzes-ui/commits/0b7fea3862df6b8e938238011f50617fd656e52f))
|
|
24
|
+
* **sharing:** Add share checkbox on bank create ([5175224](https://gerrit.instructure.com/quizzes-ui/commits/5175224bda8b6eba33d9d2e41a8d01f8723a0bd0))
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
6
30
|
# [17.49.0](https://gerrit.instructure.com/quizzes-ui/compare/v17.48.0...v17.49.0) (2023-02-22)
|
|
7
31
|
|
|
8
32
|
|
package/es/banks/api/banks.js
CHANGED
|
@@ -10,7 +10,7 @@ import { removeSharedBank, updateSharedBankPermission as updateSharedBankPermiss
|
|
|
10
10
|
import { clear, newActiveBankEntry, newActiveBank } from "../../common/actions/ui.js";
|
|
11
11
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
12
12
|
import { handleError } from "../../common/api/helpers.js";
|
|
13
|
-
import { BANKS_BANK_PAGINATION, BANKS_BANK_ENTRY_PAGINATION, DELETE_BANK_CALL, UPDATE_BANK_CALL, CAN_EDIT, REMOVED_ACCESS, SHARED_WITH_USER, SHARED_WITH_COURSE } from '@instructure/quiz-common';
|
|
13
|
+
import { BANKS_BANK_PAGINATION, BANKS_BANK_ENTRY_PAGINATION, DELETE_BANK_CALL, UPDATE_BANK_CALL, CAN_EDIT, READ_ONLY, REMOVED_ACCESS, SHARED_WITH_USER, SHARED_WITH_COURSE } from '@instructure/quiz-common';
|
|
14
14
|
var banksApiEndpoint = '/api/banks';
|
|
15
15
|
var DEFAULT_PAGE_SIZE = 100;
|
|
16
16
|
|
|
@@ -71,7 +71,7 @@ export var getBank = function getBank(bankId) {
|
|
|
71
71
|
});
|
|
72
72
|
};
|
|
73
73
|
};
|
|
74
|
-
export var createBank = function createBank(newBank) {
|
|
74
|
+
export var createBank = function createBank(newBank, shareWithCourseUuid) {
|
|
75
75
|
return function (dispatch, getState) {
|
|
76
76
|
var newBankData = JSON.stringify({
|
|
77
77
|
bank: {
|
|
@@ -84,10 +84,34 @@ export var createBank = function createBank(newBank) {
|
|
|
84
84
|
body: newBankData
|
|
85
85
|
}).then(function (bankData) {
|
|
86
86
|
dispatch([handleBankResponse(bankData), clear(BANKS_BANK_PAGINATION)]);
|
|
87
|
+
|
|
88
|
+
if (shareWithCourseUuid) {
|
|
89
|
+
simpleShareWithCourse(dispatch, bankData.id, shareWithCourseUuid);
|
|
90
|
+
}
|
|
91
|
+
|
|
87
92
|
return bankData;
|
|
88
93
|
});
|
|
89
94
|
};
|
|
95
|
+
}; // not an action creator
|
|
96
|
+
|
|
97
|
+
var simpleShareWithCourse = function simpleShareWithCourse(dispatch, bankId, courseUuid) {
|
|
98
|
+
var url = "".concat(banksApiEndpoint, "/").concat(bankId, "/shared_banks");
|
|
99
|
+
var shareBankData = JSON.stringify({
|
|
100
|
+
shared_bank: {
|
|
101
|
+
entity_id: courseUuid,
|
|
102
|
+
entityType: SHARED_WITH_COURSE,
|
|
103
|
+
bank_id: bankId,
|
|
104
|
+
permission: READ_ONLY
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
var fetcher = new Fetcher({
|
|
108
|
+
onError: handleError(dispatch, t('Failed to share bank.'))
|
|
109
|
+
});
|
|
110
|
+
return fetcher.post(url, {
|
|
111
|
+
body: shareBankData
|
|
112
|
+
});
|
|
90
113
|
};
|
|
114
|
+
|
|
91
115
|
export function getExistingBankAndEntries(bankId) {
|
|
92
116
|
return function (dispatch, getState) {
|
|
93
117
|
return dispatch([clear("".concat(BANKS_BANK_ENTRY_PAGINATION, ":").concat(bankId)), getBank(bankId)]);
|
|
@@ -44,9 +44,6 @@ var sortOrderIcons = {
|
|
|
44
44
|
ASC: IconArrowUpLine,
|
|
45
45
|
DESC: IconArrowDownLine
|
|
46
46
|
};
|
|
47
|
-
|
|
48
|
-
var _ref4 = /*#__PURE__*/React.createElement(CreateBankModal, null);
|
|
49
|
-
|
|
50
47
|
export var Banks = (_dec = themeable(theme, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
51
48
|
_inherits(Banks, _Component);
|
|
52
49
|
|
|
@@ -366,7 +363,9 @@ export var Banks = (_dec = themeable(theme, styles), _dec(_class = (_temp = _cla
|
|
|
366
363
|
getPage: this.getPage,
|
|
367
364
|
renderRecords: this.renderRecords,
|
|
368
365
|
stateKey: BANKS_BANK_PAGINATION
|
|
369
|
-
}),
|
|
366
|
+
}), /*#__PURE__*/React.createElement(CreateBankModal, {
|
|
367
|
+
itemBanksScope: this.props.scope
|
|
368
|
+
})));
|
|
370
369
|
}
|
|
371
370
|
}]);
|
|
372
371
|
|
|
@@ -10,6 +10,7 @@ import Bank from "../../../common/records/Bank.js";
|
|
|
10
10
|
import { showError, hideError } from "../../../common/actions/errorsShowing.js";
|
|
11
11
|
import { getModalTrigger } from "../../../common/util/modalHelpers.js";
|
|
12
12
|
import { screenreaderNotification } from "../../../common/actions/alerts.js";
|
|
13
|
+
import { featureOn } from "../../../common/util/featureCheck.js";
|
|
13
14
|
|
|
14
15
|
function mapStateToProps(state) {
|
|
15
16
|
var temporaryBank = new Bank(state.getIn(['modifications', 'banks', TEMPORARY_BANK_ID]));
|
|
@@ -21,7 +22,8 @@ function mapStateToProps(state) {
|
|
|
21
22
|
onCreateBank: state.getIn(['modal', 'options', 'onCreateBank']),
|
|
22
23
|
temporaryBank: temporaryBank,
|
|
23
24
|
errorKey: errorKey,
|
|
24
|
-
displayError: errorsMap.get(errorKey)
|
|
25
|
+
displayError: errorsMap.get(errorKey),
|
|
26
|
+
showShareBankOnCreate: featureOn('share_bank_on_create')
|
|
25
27
|
};
|
|
26
28
|
}
|
|
27
29
|
|
|
@@ -8,6 +8,8 @@ var _dec, _class, _class2, _temp;
|
|
|
8
8
|
import React, { Component } from 'react';
|
|
9
9
|
import PropTypes from 'prop-types';
|
|
10
10
|
import { Button, CloseButton } from '@instructure/ui-buttons';
|
|
11
|
+
import { Checkbox } from '@instructure/ui-checkbox';
|
|
12
|
+
import { View } from '@instructure/ui-view';
|
|
11
13
|
import { TextInput } from '@instructure/ui-text-input';
|
|
12
14
|
import { Heading } from '@instructure/ui-heading';
|
|
13
15
|
import { themeable } from '@instructure/ui-themeable';
|
|
@@ -39,12 +41,17 @@ export var CreateBankModal = (_dec = themeable(theme, styles), _dec(_class = (_t
|
|
|
39
41
|
}
|
|
40
42
|
|
|
41
43
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
44
|
+
_this.state = {
|
|
45
|
+
shareWithCourse: false
|
|
46
|
+
};
|
|
42
47
|
|
|
43
48
|
_this.continueAction = function () {
|
|
44
49
|
_this.props.showError(_this.props.errorKey);
|
|
45
50
|
|
|
46
51
|
if (_this.props.temporaryBank.isValid()) {
|
|
47
|
-
_this.
|
|
52
|
+
var courseUuid = _this.state.shareWithCourse ? _this.props.itemBanksScope.uuid : null;
|
|
53
|
+
|
|
54
|
+
_this.props.createBank(_this.props.temporaryBank, courseUuid);
|
|
48
55
|
|
|
49
56
|
_this.props.onCreateBank();
|
|
50
57
|
|
|
@@ -57,6 +64,10 @@ export var CreateBankModal = (_dec = themeable(theme, styles), _dec(_class = (_t
|
|
|
57
64
|
_this.closeAction = function () {
|
|
58
65
|
_this.props.hideError(_this.props.errorKey);
|
|
59
66
|
|
|
67
|
+
_this.setState({
|
|
68
|
+
shareWithCourse: false
|
|
69
|
+
});
|
|
70
|
+
|
|
60
71
|
_this.props.clearModifications('banks', _this.props.temporaryBank.id);
|
|
61
72
|
|
|
62
73
|
if (_this.props.modalTrigger) {
|
|
@@ -80,6 +91,12 @@ export var CreateBankModal = (_dec = themeable(theme, styles), _dec(_class = (_t
|
|
|
80
91
|
}
|
|
81
92
|
};
|
|
82
93
|
|
|
94
|
+
_this.toggleCheckbox = function (event) {
|
|
95
|
+
_this.setState({
|
|
96
|
+
shareWithCourse: event.target.checked
|
|
97
|
+
});
|
|
98
|
+
};
|
|
99
|
+
|
|
83
100
|
return _this;
|
|
84
101
|
}
|
|
85
102
|
|
|
@@ -117,6 +134,27 @@ export var CreateBankModal = (_dec = themeable(theme, styles), _dec(_class = (_t
|
|
|
117
134
|
type: "text",
|
|
118
135
|
placeholder: t('Enter a name...'),
|
|
119
136
|
"data-automation": "sdk-create-bank-name-textinput"
|
|
137
|
+
}), this.renderCheckbox());
|
|
138
|
+
}
|
|
139
|
+
}, {
|
|
140
|
+
key: "renderCheckbox",
|
|
141
|
+
value: function renderCheckbox() {
|
|
142
|
+
var hide = !this.props.showShareBankOnCreate || this.props.itemBanksScope.type !== 'course' || !this.props.itemBanksScope.title || !this.props.itemBanksScope.uuid;
|
|
143
|
+
|
|
144
|
+
if (hide) {
|
|
145
|
+
return null;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
var label = t('Share with { courseName }', {
|
|
149
|
+
courseName: this.props.itemBanksScope.title
|
|
150
|
+
});
|
|
151
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
152
|
+
margin: "medium 0 0 0",
|
|
153
|
+
as: "div"
|
|
154
|
+
}, /*#__PURE__*/React.createElement(Checkbox, {
|
|
155
|
+
label: label,
|
|
156
|
+
checked: this.state.shareWithCourse,
|
|
157
|
+
onChange: this.toggleCheckbox
|
|
120
158
|
}));
|
|
121
159
|
}
|
|
122
160
|
}, {
|
|
@@ -155,10 +193,18 @@ export var CreateBankModal = (_dec = themeable(theme, styles), _dec(_class = (_t
|
|
|
155
193
|
hideError: PropTypes.func.isRequired,
|
|
156
194
|
closeModal: PropTypes.func.isRequired,
|
|
157
195
|
screenreaderNotification: PropTypes.func.isRequired,
|
|
158
|
-
onCreateBank: PropTypes.func
|
|
196
|
+
onCreateBank: PropTypes.func,
|
|
197
|
+
showShareBankOnCreate: PropTypes.bool,
|
|
198
|
+
itemBanksScope: PropTypes.shape({
|
|
199
|
+
type: PropTypes.string,
|
|
200
|
+
uuid: PropTypes.string,
|
|
201
|
+
title: PropTypes.string
|
|
202
|
+
})
|
|
159
203
|
}, _class2.defaultProps = {
|
|
160
204
|
displayError: false,
|
|
161
205
|
modalTrigger: null,
|
|
206
|
+
showShareBankOnCreate: false,
|
|
207
|
+
itemBanksScope: {},
|
|
162
208
|
onCreateBank: function onCreateBank() {}
|
|
163
209
|
}, _temp)) || _class);
|
|
164
210
|
export default CreateBankModal;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GRADE_BY_QUESTION_ENABLED, GBQ_SET_ACTIVE_ITEM } from '@instructure/quiz-common';
|
|
1
|
+
import { DISMISS_GBQ_BANNER, GRADE_BY_QUESTION_ENABLED, GBQ_SET_ACTIVE_ITEM } from '@instructure/quiz-common';
|
|
2
2
|
export function setGradeByQuestionEnabled(enabled) {
|
|
3
3
|
return {
|
|
4
4
|
type: GRADE_BY_QUESTION_ENABLED,
|
|
@@ -10,4 +10,9 @@ export function setActiveItem(itemId) {
|
|
|
10
10
|
type: GBQ_SET_ACTIVE_ITEM,
|
|
11
11
|
payload: itemId
|
|
12
12
|
};
|
|
13
|
+
}
|
|
14
|
+
export function dismissGradeByQuestionBanner() {
|
|
15
|
+
return {
|
|
16
|
+
type: DISMISS_GBQ_BANNER
|
|
17
|
+
};
|
|
13
18
|
}
|
|
@@ -111,7 +111,7 @@ ConfirmationModal.propTypes = {
|
|
|
111
111
|
title: PropTypes.string,
|
|
112
112
|
text: PropTypes.string,
|
|
113
113
|
cancelText: PropTypes.string,
|
|
114
|
-
continueText: PropTypes.string,
|
|
114
|
+
continueText: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
|
115
115
|
continueVariant: PropTypes.string,
|
|
116
116
|
size: PropTypes.string,
|
|
117
117
|
shouldReturnFocus: PropTypes.bool,
|
|
@@ -313,7 +313,9 @@ export var Sidebar = (_dec = themeable(theme, styles), _dec(_class = (_temp = _c
|
|
|
313
313
|
value: function render() {
|
|
314
314
|
var sidebarClassList = classNames(styles.sidebar, _defineProperty({}, styles.sidebarIsOpen, this.props.sidebarOpen));
|
|
315
315
|
return /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement("div", {
|
|
316
|
-
className: styles.commonContainer
|
|
316
|
+
className: styles.commonContainer,
|
|
317
|
+
id: "sidebar-wrapper",
|
|
318
|
+
tabIndex: "-1"
|
|
317
319
|
}, /*#__PURE__*/React.createElement("div", {
|
|
318
320
|
className: sidebarClassList,
|
|
319
321
|
onTransitionEnd: this.handleTransitionEnd,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { fromJS } from 'immutable';
|
|
2
|
-
import { GRADE_BY_QUESTION_ENABLED, GBQ_SET_ACTIVE_ITEM } from '@instructure/quiz-common';
|
|
2
|
+
import { DISMISS_GBQ_BANNER, GRADE_BY_QUESTION_ENABLED, GBQ_SET_ACTIVE_ITEM } from '@instructure/quiz-common';
|
|
3
3
|
export default (function () {
|
|
4
4
|
var state = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : fromJS({});
|
|
5
5
|
var action = arguments.length > 1 ? arguments[1] : void 0;
|
|
@@ -11,6 +11,9 @@ export default (function () {
|
|
|
11
11
|
case GBQ_SET_ACTIVE_ITEM:
|
|
12
12
|
return state.set('activeItemId', action.payload);
|
|
13
13
|
|
|
14
|
+
case DISMISS_GBQ_BANNER:
|
|
15
|
+
return state.set('gradeByQuestionBannerDismissed', true);
|
|
16
|
+
|
|
14
17
|
default:
|
|
15
18
|
return state;
|
|
16
19
|
}
|
package/es/index.js
CHANGED
|
@@ -109,7 +109,7 @@ export { takingApiActions }; // Actions
|
|
|
109
109
|
|
|
110
110
|
export { addSuccess, addInfo, addError, screenreaderNotification, removeAlert } from "./common/actions/alerts.js";
|
|
111
111
|
export { openModal, closeModal } from "./common/actions/modal.js";
|
|
112
|
-
export { setGradeByQuestionEnabled, setActiveItem } from "./common/actions/grading.js";
|
|
112
|
+
export { setGradeByQuestionEnabled, setActiveItem, dismissGradeByQuestionBanner } from "./common/actions/grading.js";
|
|
113
113
|
export { setRegradingPayload, setScoreReconciliation, toggleRegradingEditMode } from "./common/actions/regrading.js";
|
|
114
114
|
export { showError, hideError, clearErrorsShowing } from "./common/actions/errorsShowing.js";
|
|
115
115
|
export { changeItemState, changeQuizEntryPoints, changeQuizEntryProperties, clearModifications, moveTemporaryQuizEntry, changeQuizOutcomeAlignmentSetGuid, changeFudgePoints, sessionItemResultsModification } from "./common/actions/modifications.js";
|
|
@@ -56,18 +56,6 @@ export var ModerateTableRow = (_dec = themeable(theme, styles), _dec(_class = (_
|
|
|
56
56
|
_this.moderateButton = node;
|
|
57
57
|
};
|
|
58
58
|
|
|
59
|
-
_this.generateAttemptSRMessage = function (attemptNumber) {
|
|
60
|
-
var studentName = "".concat(t('Student'), " ").concat(_this.props.rowData.name, ", ");
|
|
61
|
-
var message = t('Attempt { attemptNumber }', {
|
|
62
|
-
attemptNumber: attemptNumber
|
|
63
|
-
});
|
|
64
|
-
return " ".concat(studentName).concat(message, ", ");
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
_this.generateAttemptSRC = function (attemptNumber) {
|
|
68
|
-
return _this.props.rowData.name && attemptNumber ? /*#__PURE__*/React.createElement(ScreenReaderContent, null, _this.generateAttemptSRMessage(attemptNumber)) : null;
|
|
69
|
-
};
|
|
70
|
-
|
|
71
59
|
_this.onModerateButtonClick = function () {
|
|
72
60
|
_this.props.onModerateButtonClick(_this.props.rowData);
|
|
73
61
|
};
|
|
@@ -77,9 +65,6 @@ export var ModerateTableRow = (_dec = themeable(theme, styles), _dec(_class = (_
|
|
|
77
65
|
};
|
|
78
66
|
|
|
79
67
|
_this.generateAttemptLink = function (autogradefailed, message, quizSessionId, attemptNumber) {
|
|
80
|
-
var studentName = "".concat(t('Student'), " ").concat(_this.props.rowData.name, ", "); // A screenreader message is available if student has more than one attempt
|
|
81
|
-
|
|
82
|
-
var attemptSRMessage = attemptNumber > 1 && /*#__PURE__*/React.createElement(ScreenReaderContent, null, studentName);
|
|
83
68
|
var iconTitle = t('Autograde error on attempt { attemptNumber }.', {
|
|
84
69
|
attemptNumber: attemptNumber
|
|
85
70
|
});
|
|
@@ -90,9 +75,9 @@ export var ModerateTableRow = (_dec = themeable(theme, styles), _dec(_class = (_
|
|
|
90
75
|
title: iconTitle
|
|
91
76
|
}),
|
|
92
77
|
iconPlacement: "end"
|
|
93
|
-
},
|
|
78
|
+
}, message) : /*#__PURE__*/React.createElement(Link, {
|
|
94
79
|
onClick: _this.onResultsLinkClick(quizSessionId)
|
|
95
|
-
},
|
|
80
|
+
}, message);
|
|
96
81
|
return /*#__PURE__*/React.createElement("div", {
|
|
97
82
|
key: quizSessionId,
|
|
98
83
|
className: styles.tableDataItem
|
|
@@ -100,9 +85,6 @@ export var ModerateTableRow = (_dec = themeable(theme, styles), _dec(_class = (_
|
|
|
100
85
|
};
|
|
101
86
|
|
|
102
87
|
_this.generateAttemptText = function (autogradefailed, message, quizSessionId, attemptNumber) {
|
|
103
|
-
var studentName = "".concat(t('Student'), " ").concat(_this.props.rowData.name, ", "); // A screenreader message is available if student has more than one attempt
|
|
104
|
-
|
|
105
|
-
var attemptSRMessage = attemptNumber > 1 && /*#__PURE__*/React.createElement(ScreenReaderContent, null, studentName);
|
|
106
88
|
var iconTitle = t('Autograde error on attempt { attemptNumber }.', {
|
|
107
89
|
attemptNumber: attemptNumber
|
|
108
90
|
});
|
|
@@ -113,7 +95,7 @@ export var ModerateTableRow = (_dec = themeable(theme, styles), _dec(_class = (_
|
|
|
113
95
|
return /*#__PURE__*/React.createElement("div", {
|
|
114
96
|
key: quizSessionId,
|
|
115
97
|
className: styles.tableDataItem
|
|
116
|
-
},
|
|
98
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
117
99
|
margin: "0 x-small 0 0"
|
|
118
100
|
}, message), icon);
|
|
119
101
|
};
|
|
@@ -160,8 +142,6 @@ export var ModerateTableRow = (_dec = themeable(theme, styles), _dec(_class = (_
|
|
|
160
142
|
|
|
161
143
|
var message = t('No Score');
|
|
162
144
|
|
|
163
|
-
var attemptSRMessage = _this3.generateAttemptSRMessage(renderedScores.length + 1);
|
|
164
|
-
|
|
165
145
|
if (result.get('score') != null) {
|
|
166
146
|
var percentage = result.get('score') / result.get('pointsPossible');
|
|
167
147
|
message = _this3.formatPercentMax2FractionDigits(percentage);
|
|
@@ -181,7 +161,7 @@ export var ModerateTableRow = (_dec = themeable(theme, styles), _dec(_class = (_
|
|
|
181
161
|
renderedScores.push( /*#__PURE__*/React.createElement("div", {
|
|
182
162
|
key: result.get('id'),
|
|
183
163
|
className: styles.tableDataItem
|
|
184
|
-
},
|
|
164
|
+
}, message));
|
|
185
165
|
return renderedScores;
|
|
186
166
|
}, []);
|
|
187
167
|
}
|
|
@@ -220,23 +200,20 @@ export var ModerateTableRow = (_dec = themeable(theme, styles), _dec(_class = (_
|
|
|
220
200
|
|
|
221
201
|
return quizSessions.map(function (quizSession, idx) {
|
|
222
202
|
var quizSessionId = quizSession.get('id');
|
|
203
|
+
var hasAutogradeFailure = quizSession.findAuthoritativeResult().status === 'autograding_failed';
|
|
223
204
|
|
|
224
|
-
var message = _this4.attemptMessage(idx, maxAttempts);
|
|
225
|
-
|
|
226
|
-
var hasAutoGradeFailure = quizSession.findAuthoritativeResult().status === 'autograding_failed';
|
|
205
|
+
var message = _this4.attemptMessage(idx, maxAttempts, hasAutogradeFailure);
|
|
227
206
|
|
|
228
207
|
if (_this4.props.onResultsLinkClick && quizSession.graded()) {
|
|
229
|
-
return _this4.generateAttemptLink(
|
|
208
|
+
return _this4.generateAttemptLink(hasAutogradeFailure, message, quizSessionId, idx + 1);
|
|
230
209
|
} else {
|
|
231
|
-
return _this4.generateAttemptText(
|
|
210
|
+
return _this4.generateAttemptText(hasAutogradeFailure, message, quizSessionId, idx + 1);
|
|
232
211
|
}
|
|
233
212
|
});
|
|
234
213
|
}
|
|
235
214
|
}, {
|
|
236
215
|
key: "renderTimes",
|
|
237
216
|
value: function renderTimes(quizSessions) {
|
|
238
|
-
var _this5 = this;
|
|
239
|
-
|
|
240
217
|
if (!quizSessions.length) {
|
|
241
218
|
return /*#__PURE__*/React.createElement("div", {
|
|
242
219
|
className: styles.tableDataItem
|
|
@@ -250,8 +227,6 @@ export var ModerateTableRow = (_dec = themeable(theme, styles), _dec(_class = (_
|
|
|
250
227
|
seconds: quizSession.elapsedTime
|
|
251
228
|
});
|
|
252
229
|
|
|
253
|
-
var attemptSRMessage = _this5.generateAttemptSRC(idx + 1);
|
|
254
|
-
|
|
255
230
|
if (quizSession.inProgress() || quizSession.reopeningGraded()) {
|
|
256
231
|
var alt = t('In progress, time not available');
|
|
257
232
|
message = /*#__PURE__*/React.createElement(AccessibleContent, {
|
|
@@ -262,14 +237,12 @@ export var ModerateTableRow = (_dec = themeable(theme, styles), _dec(_class = (_
|
|
|
262
237
|
return /*#__PURE__*/React.createElement("div", {
|
|
263
238
|
key: quizSession.get('id'),
|
|
264
239
|
className: styles.tableDataItem
|
|
265
|
-
},
|
|
240
|
+
}, message);
|
|
266
241
|
});
|
|
267
242
|
}
|
|
268
243
|
}, {
|
|
269
244
|
key: "renderLogLinks",
|
|
270
245
|
value: function renderLogLinks(quizSessions) {
|
|
271
|
-
var _this6 = this;
|
|
272
|
-
|
|
273
246
|
if (!quizSessions.length) {
|
|
274
247
|
return /*#__PURE__*/React.createElement("div", {
|
|
275
248
|
className: styles.tableDataItem
|
|
@@ -281,11 +254,8 @@ export var ModerateTableRow = (_dec = themeable(theme, styles), _dec(_class = (_
|
|
|
281
254
|
var _this$props = this.props,
|
|
282
255
|
onModerateLogClick = _this$props.onModerateLogClick,
|
|
283
256
|
id = _this$props.rowData.id;
|
|
284
|
-
return quizSessions.map(function (quizSession
|
|
257
|
+
return quizSessions.map(function (quizSession) {
|
|
285
258
|
var quizSessionId = quizSession.get('id');
|
|
286
|
-
|
|
287
|
-
var attemptSRMessage = _this6.generateAttemptSRC(idx + 1);
|
|
288
|
-
|
|
289
259
|
var message = quizSession.inProgress() || quizSession.reopeningGraded() ? t('In Progress') : t('View Log');
|
|
290
260
|
|
|
291
261
|
function onClick(event) {
|
|
@@ -301,7 +271,7 @@ export var ModerateTableRow = (_dec = themeable(theme, styles), _dec(_class = (_
|
|
|
301
271
|
className: styles.tableDataItem
|
|
302
272
|
}, /*#__PURE__*/React.createElement(Link, {
|
|
303
273
|
onClick: onClick
|
|
304
|
-
},
|
|
274
|
+
}, message));
|
|
305
275
|
});
|
|
306
276
|
}
|
|
307
277
|
}, {
|
package/lib/banks/api/banks.js
CHANGED
|
@@ -103,7 +103,7 @@ var getBank = function getBank(bankId) {
|
|
|
103
103
|
|
|
104
104
|
exports.getBank = getBank;
|
|
105
105
|
|
|
106
|
-
var createBank = function createBank(newBank) {
|
|
106
|
+
var createBank = function createBank(newBank, shareWithCourseUuid) {
|
|
107
107
|
return function (dispatch, getState) {
|
|
108
108
|
var newBankData = JSON.stringify({
|
|
109
109
|
bank: {
|
|
@@ -116,13 +116,37 @@ var createBank = function createBank(newBank) {
|
|
|
116
116
|
body: newBankData
|
|
117
117
|
}).then(function (bankData) {
|
|
118
118
|
dispatch([(0, _callHandlers.handleBankResponse)(bankData), (0, _ui.clear)(_quizCommon.BANKS_BANK_PAGINATION)]);
|
|
119
|
+
|
|
120
|
+
if (shareWithCourseUuid) {
|
|
121
|
+
simpleShareWithCourse(dispatch, bankData.id, shareWithCourseUuid);
|
|
122
|
+
}
|
|
123
|
+
|
|
119
124
|
return bankData;
|
|
120
125
|
});
|
|
121
126
|
};
|
|
122
|
-
};
|
|
127
|
+
}; // not an action creator
|
|
128
|
+
|
|
123
129
|
|
|
124
130
|
exports.createBank = createBank;
|
|
125
131
|
|
|
132
|
+
var simpleShareWithCourse = function simpleShareWithCourse(dispatch, bankId, courseUuid) {
|
|
133
|
+
var url = "".concat(banksApiEndpoint, "/").concat(bankId, "/shared_banks");
|
|
134
|
+
var shareBankData = JSON.stringify({
|
|
135
|
+
shared_bank: {
|
|
136
|
+
entity_id: courseUuid,
|
|
137
|
+
entityType: _quizCommon.SHARED_WITH_COURSE,
|
|
138
|
+
bank_id: bankId,
|
|
139
|
+
permission: _quizCommon.READ_ONLY
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
var fetcher = new _Fetcher.default({
|
|
143
|
+
onError: (0, _helpers.handleError)(dispatch, (0, _formatMessage.default)('Failed to share bank.'))
|
|
144
|
+
});
|
|
145
|
+
return fetcher.post(url, {
|
|
146
|
+
body: shareBankData
|
|
147
|
+
});
|
|
148
|
+
};
|
|
149
|
+
|
|
126
150
|
function getExistingBankAndEntries(bankId) {
|
|
127
151
|
return function (dispatch, getState) {
|
|
128
152
|
return dispatch([(0, _ui.clear)("".concat(_quizCommon.BANKS_BANK_ENTRY_PAGINATION, ":").concat(bankId)), getBank(bankId)]);
|
|
@@ -81,9 +81,6 @@ var sortOrderIcons = {
|
|
|
81
81
|
ASC: _uiIcons.IconArrowUpLine,
|
|
82
82
|
DESC: _uiIcons.IconArrowDownLine
|
|
83
83
|
};
|
|
84
|
-
|
|
85
|
-
var _ref4 = /*#__PURE__*/_react.default.createElement(_index4.default, null);
|
|
86
|
-
|
|
87
84
|
var Banks = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
88
85
|
(0, _inherits2.default)(Banks, _Component);
|
|
89
86
|
|
|
@@ -405,7 +402,9 @@ var Banks = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(_c
|
|
|
405
402
|
getPage: this.getPage,
|
|
406
403
|
renderRecords: this.renderRecords,
|
|
407
404
|
stateKey: _quizCommon.BANKS_BANK_PAGINATION
|
|
408
|
-
}),
|
|
405
|
+
}), /*#__PURE__*/_react.default.createElement(_index4.default, {
|
|
406
|
+
itemBanksScope: this.props.scope
|
|
407
|
+
})));
|
|
409
408
|
}
|
|
410
409
|
}]);
|
|
411
410
|
Banks.displayName = "Banks";
|
|
@@ -33,6 +33,8 @@ var _modalHelpers = require("../../../common/util/modalHelpers.js");
|
|
|
33
33
|
|
|
34
34
|
var _alerts = require("../../../common/actions/alerts.js");
|
|
35
35
|
|
|
36
|
+
var _featureCheck = require("../../../common/util/featureCheck.js");
|
|
37
|
+
|
|
36
38
|
function mapStateToProps(state) {
|
|
37
39
|
var temporaryBank = new _Bank.default(state.getIn(['modifications', 'banks', _quizCommon.TEMPORARY_BANK_ID]));
|
|
38
40
|
var errorsMap = state.get('errorsShowing', (0, _immutable.Map)());
|
|
@@ -43,7 +45,8 @@ function mapStateToProps(state) {
|
|
|
43
45
|
onCreateBank: state.getIn(['modal', 'options', 'onCreateBank']),
|
|
44
46
|
temporaryBank: temporaryBank,
|
|
45
47
|
errorKey: errorKey,
|
|
46
|
-
displayError: errorsMap.get(errorKey)
|
|
48
|
+
displayError: errorsMap.get(errorKey),
|
|
49
|
+
showShareBankOnCreate: (0, _featureCheck.featureOn)('share_bank_on_create')
|
|
47
50
|
};
|
|
48
51
|
}
|
|
49
52
|
|
|
@@ -23,6 +23,10 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
23
23
|
|
|
24
24
|
var _uiButtons = require("@instructure/ui-buttons");
|
|
25
25
|
|
|
26
|
+
var _uiCheckbox = require("@instructure/ui-checkbox");
|
|
27
|
+
|
|
28
|
+
var _uiView = require("@instructure/ui-view");
|
|
29
|
+
|
|
26
30
|
var _uiTextInput = require("@instructure/ui-text-input");
|
|
27
31
|
|
|
28
32
|
var _uiHeading = require("@instructure/ui-heading");
|
|
@@ -64,12 +68,17 @@ var CreateBankModal = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles
|
|
|
64
68
|
}
|
|
65
69
|
|
|
66
70
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
71
|
+
_this.state = {
|
|
72
|
+
shareWithCourse: false
|
|
73
|
+
};
|
|
67
74
|
|
|
68
75
|
_this.continueAction = function () {
|
|
69
76
|
_this.props.showError(_this.props.errorKey);
|
|
70
77
|
|
|
71
78
|
if (_this.props.temporaryBank.isValid()) {
|
|
72
|
-
_this.
|
|
79
|
+
var courseUuid = _this.state.shareWithCourse ? _this.props.itemBanksScope.uuid : null;
|
|
80
|
+
|
|
81
|
+
_this.props.createBank(_this.props.temporaryBank, courseUuid);
|
|
73
82
|
|
|
74
83
|
_this.props.onCreateBank();
|
|
75
84
|
|
|
@@ -82,6 +91,10 @@ var CreateBankModal = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles
|
|
|
82
91
|
_this.closeAction = function () {
|
|
83
92
|
_this.props.hideError(_this.props.errorKey);
|
|
84
93
|
|
|
94
|
+
_this.setState({
|
|
95
|
+
shareWithCourse: false
|
|
96
|
+
});
|
|
97
|
+
|
|
85
98
|
_this.props.clearModifications('banks', _this.props.temporaryBank.id);
|
|
86
99
|
|
|
87
100
|
if (_this.props.modalTrigger) {
|
|
@@ -105,6 +118,12 @@ var CreateBankModal = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles
|
|
|
105
118
|
}
|
|
106
119
|
};
|
|
107
120
|
|
|
121
|
+
_this.toggleCheckbox = function (event) {
|
|
122
|
+
_this.setState({
|
|
123
|
+
shareWithCourse: event.target.checked
|
|
124
|
+
});
|
|
125
|
+
};
|
|
126
|
+
|
|
108
127
|
return _this;
|
|
109
128
|
}
|
|
110
129
|
|
|
@@ -142,6 +161,27 @@ var CreateBankModal = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles
|
|
|
142
161
|
type: "text",
|
|
143
162
|
placeholder: (0, _formatMessage.default)('Enter a name...'),
|
|
144
163
|
"data-automation": "sdk-create-bank-name-textinput"
|
|
164
|
+
}), this.renderCheckbox());
|
|
165
|
+
}
|
|
166
|
+
}, {
|
|
167
|
+
key: "renderCheckbox",
|
|
168
|
+
value: function renderCheckbox() {
|
|
169
|
+
var hide = !this.props.showShareBankOnCreate || this.props.itemBanksScope.type !== 'course' || !this.props.itemBanksScope.title || !this.props.itemBanksScope.uuid;
|
|
170
|
+
|
|
171
|
+
if (hide) {
|
|
172
|
+
return null;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
var label = (0, _formatMessage.default)('Share with { courseName }', {
|
|
176
|
+
courseName: this.props.itemBanksScope.title
|
|
177
|
+
});
|
|
178
|
+
return /*#__PURE__*/_react.default.createElement(_uiView.View, {
|
|
179
|
+
margin: "medium 0 0 0",
|
|
180
|
+
as: "div"
|
|
181
|
+
}, /*#__PURE__*/_react.default.createElement(_uiCheckbox.Checkbox, {
|
|
182
|
+
label: label,
|
|
183
|
+
checked: this.state.shareWithCourse,
|
|
184
|
+
onChange: this.toggleCheckbox
|
|
145
185
|
}));
|
|
146
186
|
}
|
|
147
187
|
}, {
|
|
@@ -179,10 +219,18 @@ var CreateBankModal = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles
|
|
|
179
219
|
hideError: _propTypes.default.func.isRequired,
|
|
180
220
|
closeModal: _propTypes.default.func.isRequired,
|
|
181
221
|
screenreaderNotification: _propTypes.default.func.isRequired,
|
|
182
|
-
onCreateBank: _propTypes.default.func
|
|
222
|
+
onCreateBank: _propTypes.default.func,
|
|
223
|
+
showShareBankOnCreate: _propTypes.default.bool,
|
|
224
|
+
itemBanksScope: _propTypes.default.shape({
|
|
225
|
+
type: _propTypes.default.string,
|
|
226
|
+
uuid: _propTypes.default.string,
|
|
227
|
+
title: _propTypes.default.string
|
|
228
|
+
})
|
|
183
229
|
}, _class2.defaultProps = {
|
|
184
230
|
displayError: false,
|
|
185
231
|
modalTrigger: null,
|
|
232
|
+
showShareBankOnCreate: false,
|
|
233
|
+
itemBanksScope: {},
|
|
186
234
|
onCreateBank: function onCreateBank() {}
|
|
187
235
|
}, _temp)) || _class);
|
|
188
236
|
exports.CreateBankModal = CreateBankModal;
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.setGradeByQuestionEnabled = setGradeByQuestionEnabled;
|
|
7
7
|
exports.setActiveItem = setActiveItem;
|
|
8
|
+
exports.dismissGradeByQuestionBanner = dismissGradeByQuestionBanner;
|
|
8
9
|
|
|
9
10
|
var _quizCommon = require("@instructure/quiz-common");
|
|
10
11
|
|
|
@@ -20,4 +21,10 @@ function setActiveItem(itemId) {
|
|
|
20
21
|
type: _quizCommon.GBQ_SET_ACTIVE_ITEM,
|
|
21
22
|
payload: itemId
|
|
22
23
|
};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function dismissGradeByQuestionBanner() {
|
|
27
|
+
return {
|
|
28
|
+
type: _quizCommon.DISMISS_GBQ_BANNER
|
|
29
|
+
};
|
|
23
30
|
}
|
|
@@ -134,7 +134,7 @@ ConfirmationModal.propTypes = {
|
|
|
134
134
|
title: _propTypes.default.string,
|
|
135
135
|
text: _propTypes.default.string,
|
|
136
136
|
cancelText: _propTypes.default.string,
|
|
137
|
-
continueText: _propTypes.default.string,
|
|
137
|
+
continueText: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.node]),
|
|
138
138
|
continueVariant: _propTypes.default.string,
|
|
139
139
|
size: _propTypes.default.string,
|
|
140
140
|
shouldReturnFocus: _propTypes.default.bool,
|
|
@@ -348,7 +348,9 @@ var Sidebar = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _dec(
|
|
|
348
348
|
value: function render() {
|
|
349
349
|
var sidebarClassList = (0, _classnames.default)(styles.sidebar, (0, _defineProperty2.default)({}, styles.sidebarIsOpen, this.props.sidebarOpen));
|
|
350
350
|
return /*#__PURE__*/_react.default.createElement(_uiView.View, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
351
|
-
className: styles.commonContainer
|
|
351
|
+
className: styles.commonContainer,
|
|
352
|
+
id: "sidebar-wrapper",
|
|
353
|
+
tabIndex: "-1"
|
|
352
354
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
353
355
|
className: sidebarClassList,
|
|
354
356
|
onTransitionEnd: this.handleTransitionEnd,
|
|
@@ -20,6 +20,9 @@ var _default = function _default() {
|
|
|
20
20
|
case _quizCommon.GBQ_SET_ACTIVE_ITEM:
|
|
21
21
|
return state.set('activeItemId', action.payload);
|
|
22
22
|
|
|
23
|
+
case _quizCommon.DISMISS_GBQ_BANNER:
|
|
24
|
+
return state.set('gradeByQuestionBannerDismissed', true);
|
|
25
|
+
|
|
23
26
|
default:
|
|
24
27
|
return state;
|
|
25
28
|
}
|
package/lib/index.js
CHANGED
|
@@ -150,6 +150,7 @@ var _exportNames = {
|
|
|
150
150
|
modalActions: true,
|
|
151
151
|
setGradeByQuestionEnabled: true,
|
|
152
152
|
setActiveItem: true,
|
|
153
|
+
dismissGradeByQuestionBanner: true,
|
|
153
154
|
setRegradingPayload: true,
|
|
154
155
|
setScoreReconciliation: true,
|
|
155
156
|
toggleRegradingEditMode: true,
|
|
@@ -1052,6 +1053,12 @@ Object.defineProperty(exports, "setActiveItem", {
|
|
|
1052
1053
|
return _grading.setActiveItem;
|
|
1053
1054
|
}
|
|
1054
1055
|
});
|
|
1056
|
+
Object.defineProperty(exports, "dismissGradeByQuestionBanner", {
|
|
1057
|
+
enumerable: true,
|
|
1058
|
+
get: function get() {
|
|
1059
|
+
return _grading.dismissGradeByQuestionBanner;
|
|
1060
|
+
}
|
|
1061
|
+
});
|
|
1055
1062
|
Object.defineProperty(exports, "setRegradingPayload", {
|
|
1056
1063
|
enumerable: true,
|
|
1057
1064
|
get: function get() {
|
|
@@ -87,18 +87,6 @@ var ModerateTableRow = (_dec = (0, _uiThemeable.themeable)(_theme.default, style
|
|
|
87
87
|
_this.moderateButton = node;
|
|
88
88
|
};
|
|
89
89
|
|
|
90
|
-
_this.generateAttemptSRMessage = function (attemptNumber) {
|
|
91
|
-
var studentName = "".concat((0, _formatMessage.default)('Student'), " ").concat(_this.props.rowData.name, ", ");
|
|
92
|
-
var message = (0, _formatMessage.default)('Attempt { attemptNumber }', {
|
|
93
|
-
attemptNumber: attemptNumber
|
|
94
|
-
});
|
|
95
|
-
return " ".concat(studentName).concat(message, ", ");
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
_this.generateAttemptSRC = function (attemptNumber) {
|
|
99
|
-
return _this.props.rowData.name && attemptNumber ? /*#__PURE__*/_react.default.createElement(_uiA11yContent.ScreenReaderContent, null, _this.generateAttemptSRMessage(attemptNumber)) : null;
|
|
100
|
-
};
|
|
101
|
-
|
|
102
90
|
_this.onModerateButtonClick = function () {
|
|
103
91
|
_this.props.onModerateButtonClick(_this.props.rowData);
|
|
104
92
|
};
|
|
@@ -108,10 +96,6 @@ var ModerateTableRow = (_dec = (0, _uiThemeable.themeable)(_theme.default, style
|
|
|
108
96
|
};
|
|
109
97
|
|
|
110
98
|
_this.generateAttemptLink = function (autogradefailed, message, quizSessionId, attemptNumber) {
|
|
111
|
-
var studentName = "".concat((0, _formatMessage.default)('Student'), " ").concat(_this.props.rowData.name, ", "); // A screenreader message is available if student has more than one attempt
|
|
112
|
-
|
|
113
|
-
var attemptSRMessage = attemptNumber > 1 && /*#__PURE__*/_react.default.createElement(_uiA11yContent.ScreenReaderContent, null, studentName);
|
|
114
|
-
|
|
115
99
|
var iconTitle = (0, _formatMessage.default)('Autograde error on attempt { attemptNumber }.', {
|
|
116
100
|
attemptNumber: attemptNumber
|
|
117
101
|
});
|
|
@@ -122,9 +106,9 @@ var ModerateTableRow = (_dec = (0, _uiThemeable.themeable)(_theme.default, style
|
|
|
122
106
|
title: iconTitle
|
|
123
107
|
}),
|
|
124
108
|
iconPlacement: "end"
|
|
125
|
-
},
|
|
109
|
+
}, message) : /*#__PURE__*/_react.default.createElement(_uiLink.Link, {
|
|
126
110
|
onClick: _this.onResultsLinkClick(quizSessionId)
|
|
127
|
-
},
|
|
111
|
+
}, message);
|
|
128
112
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
129
113
|
key: quizSessionId,
|
|
130
114
|
className: styles.tableDataItem
|
|
@@ -132,10 +116,6 @@ var ModerateTableRow = (_dec = (0, _uiThemeable.themeable)(_theme.default, style
|
|
|
132
116
|
};
|
|
133
117
|
|
|
134
118
|
_this.generateAttemptText = function (autogradefailed, message, quizSessionId, attemptNumber) {
|
|
135
|
-
var studentName = "".concat((0, _formatMessage.default)('Student'), " ").concat(_this.props.rowData.name, ", "); // A screenreader message is available if student has more than one attempt
|
|
136
|
-
|
|
137
|
-
var attemptSRMessage = attemptNumber > 1 && /*#__PURE__*/_react.default.createElement(_uiA11yContent.ScreenReaderContent, null, studentName);
|
|
138
|
-
|
|
139
119
|
var iconTitle = (0, _formatMessage.default)('Autograde error on attempt { attemptNumber }.', {
|
|
140
120
|
attemptNumber: attemptNumber
|
|
141
121
|
});
|
|
@@ -146,7 +126,7 @@ var ModerateTableRow = (_dec = (0, _uiThemeable.themeable)(_theme.default, style
|
|
|
146
126
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
147
127
|
key: quizSessionId,
|
|
148
128
|
className: styles.tableDataItem
|
|
149
|
-
},
|
|
129
|
+
}, /*#__PURE__*/_react.default.createElement(_uiView.View, {
|
|
150
130
|
margin: "0 x-small 0 0"
|
|
151
131
|
}, message), icon);
|
|
152
132
|
};
|
|
@@ -194,8 +174,6 @@ var ModerateTableRow = (_dec = (0, _uiThemeable.themeable)(_theme.default, style
|
|
|
194
174
|
|
|
195
175
|
var message = (0, _formatMessage.default)('No Score');
|
|
196
176
|
|
|
197
|
-
var attemptSRMessage = _this3.generateAttemptSRMessage(renderedScores.length + 1);
|
|
198
|
-
|
|
199
177
|
if (result.get('score') != null) {
|
|
200
178
|
var percentage = result.get('score') / result.get('pointsPossible');
|
|
201
179
|
message = _this3.formatPercentMax2FractionDigits(percentage);
|
|
@@ -215,7 +193,7 @@ var ModerateTableRow = (_dec = (0, _uiThemeable.themeable)(_theme.default, style
|
|
|
215
193
|
renderedScores.push( /*#__PURE__*/_react.default.createElement("div", {
|
|
216
194
|
key: result.get('id'),
|
|
217
195
|
className: styles.tableDataItem
|
|
218
|
-
},
|
|
196
|
+
}, message));
|
|
219
197
|
return renderedScores;
|
|
220
198
|
}, []);
|
|
221
199
|
}
|
|
@@ -254,23 +232,20 @@ var ModerateTableRow = (_dec = (0, _uiThemeable.themeable)(_theme.default, style
|
|
|
254
232
|
|
|
255
233
|
return quizSessions.map(function (quizSession, idx) {
|
|
256
234
|
var quizSessionId = quizSession.get('id');
|
|
235
|
+
var hasAutogradeFailure = quizSession.findAuthoritativeResult().status === 'autograding_failed';
|
|
257
236
|
|
|
258
|
-
var message = _this4.attemptMessage(idx, maxAttempts);
|
|
259
|
-
|
|
260
|
-
var hasAutoGradeFailure = quizSession.findAuthoritativeResult().status === 'autograding_failed';
|
|
237
|
+
var message = _this4.attemptMessage(idx, maxAttempts, hasAutogradeFailure);
|
|
261
238
|
|
|
262
239
|
if (_this4.props.onResultsLinkClick && quizSession.graded()) {
|
|
263
|
-
return _this4.generateAttemptLink(
|
|
240
|
+
return _this4.generateAttemptLink(hasAutogradeFailure, message, quizSessionId, idx + 1);
|
|
264
241
|
} else {
|
|
265
|
-
return _this4.generateAttemptText(
|
|
242
|
+
return _this4.generateAttemptText(hasAutogradeFailure, message, quizSessionId, idx + 1);
|
|
266
243
|
}
|
|
267
244
|
});
|
|
268
245
|
}
|
|
269
246
|
}, {
|
|
270
247
|
key: "renderTimes",
|
|
271
248
|
value: function renderTimes(quizSessions) {
|
|
272
|
-
var _this5 = this;
|
|
273
|
-
|
|
274
249
|
if (!quizSessions.length) {
|
|
275
250
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
276
251
|
className: styles.tableDataItem
|
|
@@ -284,8 +259,6 @@ var ModerateTableRow = (_dec = (0, _uiThemeable.themeable)(_theme.default, style
|
|
|
284
259
|
seconds: quizSession.elapsedTime
|
|
285
260
|
});
|
|
286
261
|
|
|
287
|
-
var attemptSRMessage = _this5.generateAttemptSRC(idx + 1);
|
|
288
|
-
|
|
289
262
|
if (quizSession.inProgress() || quizSession.reopeningGraded()) {
|
|
290
263
|
var alt = (0, _formatMessage.default)('In progress, time not available');
|
|
291
264
|
message = /*#__PURE__*/_react.default.createElement(_uiA11yContent.AccessibleContent, {
|
|
@@ -296,14 +269,12 @@ var ModerateTableRow = (_dec = (0, _uiThemeable.themeable)(_theme.default, style
|
|
|
296
269
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
297
270
|
key: quizSession.get('id'),
|
|
298
271
|
className: styles.tableDataItem
|
|
299
|
-
},
|
|
272
|
+
}, message);
|
|
300
273
|
});
|
|
301
274
|
}
|
|
302
275
|
}, {
|
|
303
276
|
key: "renderLogLinks",
|
|
304
277
|
value: function renderLogLinks(quizSessions) {
|
|
305
|
-
var _this6 = this;
|
|
306
|
-
|
|
307
278
|
if (!quizSessions.length) {
|
|
308
279
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
309
280
|
className: styles.tableDataItem
|
|
@@ -315,11 +286,8 @@ var ModerateTableRow = (_dec = (0, _uiThemeable.themeable)(_theme.default, style
|
|
|
315
286
|
var _this$props = this.props,
|
|
316
287
|
onModerateLogClick = _this$props.onModerateLogClick,
|
|
317
288
|
id = _this$props.rowData.id;
|
|
318
|
-
return quizSessions.map(function (quizSession
|
|
289
|
+
return quizSessions.map(function (quizSession) {
|
|
319
290
|
var quizSessionId = quizSession.get('id');
|
|
320
|
-
|
|
321
|
-
var attemptSRMessage = _this6.generateAttemptSRC(idx + 1);
|
|
322
|
-
|
|
323
291
|
var message = quizSession.inProgress() || quizSession.reopeningGraded() ? (0, _formatMessage.default)('In Progress') : (0, _formatMessage.default)('View Log');
|
|
324
292
|
|
|
325
293
|
function onClick(event) {
|
|
@@ -335,7 +303,7 @@ var ModerateTableRow = (_dec = (0, _uiThemeable.themeable)(_theme.default, style
|
|
|
335
303
|
className: styles.tableDataItem
|
|
336
304
|
}, /*#__PURE__*/_react.default.createElement(_uiLink.Link, {
|
|
337
305
|
onClick: onClick
|
|
338
|
-
},
|
|
306
|
+
}, message));
|
|
339
307
|
});
|
|
340
308
|
}
|
|
341
309
|
}, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/quiz-core",
|
|
3
|
-
"version": "17.
|
|
3
|
+
"version": "17.50.1-rc.0+044c6711c",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "The Quiz React SDK by Instructure Inc.",
|
|
6
6
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
@@ -41,11 +41,11 @@
|
|
|
41
41
|
],
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@instructure/outcomes-ui": "^2.1.2",
|
|
44
|
-
"@instructure/quiz-common": "17.
|
|
45
|
-
"@instructure/quiz-i18n": "17.
|
|
46
|
-
"@instructure/quiz-interactions": "17.
|
|
47
|
-
"@instructure/quiz-number-input": "17.
|
|
48
|
-
"@instructure/quiz-rce": "17.
|
|
44
|
+
"@instructure/quiz-common": "17.50.1-rc.0+044c6711c",
|
|
45
|
+
"@instructure/quiz-i18n": "17.50.1-rc.0+044c6711c",
|
|
46
|
+
"@instructure/quiz-interactions": "17.50.1-rc.0+044c6711c",
|
|
47
|
+
"@instructure/quiz-number-input": "17.50.1-rc.0+044c6711c",
|
|
48
|
+
"@instructure/quiz-rce": "17.50.1-rc.0+044c6711c",
|
|
49
49
|
"@instructure/ui-a11y-content": "^7.20.0",
|
|
50
50
|
"@instructure/ui-alerts": "^7.20.0",
|
|
51
51
|
"@instructure/ui-avatar": "^7.20.0",
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
"eventemitter3": "^3.1.0",
|
|
107
107
|
"humps": "^2.0.0",
|
|
108
108
|
"immutable": "^3.8.1",
|
|
109
|
-
"instructure-validations": "17.
|
|
109
|
+
"instructure-validations": "17.50.1-rc.0+044c6711c",
|
|
110
110
|
"ipaddr.js": "^1.5.4",
|
|
111
111
|
"isomorphic-fetch": "^2.2.0",
|
|
112
112
|
"isuuid": "^0.1.0",
|
|
@@ -137,7 +137,7 @@
|
|
|
137
137
|
"uuid": "^3.2.1"
|
|
138
138
|
},
|
|
139
139
|
"devDependencies": {
|
|
140
|
-
"@instructure/quiz-scripts": "17.
|
|
140
|
+
"@instructure/quiz-scripts": "17.50.0",
|
|
141
141
|
"@instructure/ui-axe-check": "^7.20.0",
|
|
142
142
|
"@instructure/ui-babel-preset": "^7.20.0",
|
|
143
143
|
"@instructure/ui-karma-config": "^7.20.0",
|
|
@@ -156,7 +156,7 @@
|
|
|
156
156
|
"intl": "^1.2.4",
|
|
157
157
|
"jquery": "^2.2.3",
|
|
158
158
|
"most-subject": "^5.3.0",
|
|
159
|
-
"quiz-presets": "17.
|
|
159
|
+
"quiz-presets": "17.50.1-rc.0+044c6711c",
|
|
160
160
|
"react": "^16.8.6",
|
|
161
161
|
"react-addons-test-utils": "^15.6.2",
|
|
162
162
|
"react-dom": "^16.8.6",
|
|
@@ -172,5 +172,5 @@
|
|
|
172
172
|
"publishConfig": {
|
|
173
173
|
"access": "public"
|
|
174
174
|
},
|
|
175
|
-
"gitHead": "
|
|
175
|
+
"gitHead": "044c6711cb29aae360c3d99dfc6785afa789443c"
|
|
176
176
|
}
|