@instructure/quiz-core 22.16.1 → 22.17.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/es/building/api/quizEntries.js +25 -5
- package/es/building/components/layout/header/BuildingButtons/index.js +1 -0
- package/es/building/components/layout/header/BuildingButtons/presenter.js +4 -0
- package/es/building/components/resources/ItemFeedbackModal/index.js +4 -1
- package/es/building/components/resources/ItemFeedbackModal/presenter.js +44 -41
- package/es/building/components/resources/quizEntry/QuizEntry/index.js +2 -1
- package/es/building/components/resources/quizEntry/QuizEntry/presenter.js +6 -2
- package/es/building/components/resources/quizEntry/QuizEntryEdit/Footer/index.js +5 -1
- package/es/building/components/resources/quizEntry/QuizEntryEdit/Footer/presenter.js +39 -3
- package/es/building/components/resources/quizEntry/QuizEntryEdit/index.js +1 -0
- package/es/building/components/resources/quizEntry/QuizEntryEdit/presenter.js +1 -0
- package/es/building/components/resources/quizEntry/QuizEntryShow/components/LeftHeader.js +151 -0
- package/es/building/components/resources/quizEntry/QuizEntryShow/index.js +5 -2
- package/es/building/components/resources/quizEntry/QuizEntryShow/presenter.js +27 -102
- package/es/building/components/resources/quizEntry/QuizEntryShow/styles.js +0 -12
- package/es/common/actions/modal.js +2 -1
- package/es/common/components/ConfirmationModal/index.js +1 -1
- package/es/common/components/ConfirmationModal/presenter.js +49 -169
- package/es/common/components/SDKApp/index.js +22 -23
- package/es/common/components/layout/sidebar/Sidebar/components/TotalPointsPossible.js +37 -0
- package/es/common/components/layout/sidebar/Sidebar/index.js +29 -57
- package/es/common/components/layout/sidebar/SidebarItem/index.js +5 -1
- package/es/common/components/layout/sidebar/SidebarItem/presenter.js +40 -11
- package/es/common/components/layout/sidebar/SidebarItem/styles.js +4 -1
- package/es/common/components/layout/sidebar/Stimulus/presenter.js +26 -1
- package/{lib/common/components/resources/quizSessionResult/Header → es/common/components/resources/QuizSessionResult/QuizSessionResultHeader}/index.js +15 -23
- package/es/common/components/resources/QuizSessionResult/QuizSessionResultInfo/ScoreDisplay/components/LetterGrade.js +36 -0
- package/es/common/components/resources/QuizSessionResult/QuizSessionResultInfo/ScoreDisplay/components/PointsDisplay.js +70 -0
- package/es/common/components/resources/QuizSessionResult/QuizSessionResultInfo/ScoreDisplay/components/Progress.js +57 -0
- package/es/common/components/resources/QuizSessionResult/QuizSessionResultInfo/ScoreDisplay/index.js +49 -0
- package/es/common/components/resources/QuizSessionResult/QuizSessionResultInfo/index.js +118 -0
- package/es/common/components/resources/item/ItemEdit/index.js +5 -3
- package/es/common/components/resources/item/ItemEdit/presenter.js +3 -2
- package/es/common/components/resources/item/ItemShow/index.js +2 -1
- package/es/common/components/resources/quiz/AddContent/Body/index.js +4 -2
- package/es/common/components/resources/quiz/AddContent/Body/presenter.js +25 -6
- package/es/common/components/resources/quiz/AddContent/Body/styles.js +7 -0
- package/es/common/components/resources/quiz/AddContent/Popover/presenter.js +1 -0
- package/es/common/components/resources/sessionItemResult/SessionItemResult/components/SessionItemResultHeader.js +122 -0
- package/es/common/components/resources/sessionItemResult/SessionItemResult/index.js +6 -2
- package/es/common/components/resources/sessionItemResult/SessionItemResult/presenter.js +80 -168
- package/es/common/components/resources/sessionItemResult/SessionItemResult/styles.js +0 -8
- package/es/common/components/resources/stimulus/Stimulus/index.js +4 -1
- package/es/common/components/resources/stimulus/Stimulus/presenter.js +2 -0
- package/es/common/components/resources/stimulus/StimulusEdit/presenter.js +3 -1
- package/es/common/middleware/appSyncMiddleware.js +19 -0
- package/es/common/records/Quiz.js +8 -1
- package/es/common/records/QuizEntry.js +8 -1
- package/es/common/records/SessionItem.js +2 -1
- package/es/common/records/SessionItemResult.js +24 -0
- package/es/common/util/interactionTypePropsHelper.js +4 -2
- package/es/common/util/isMissing.js +4 -0
- package/es/configureStore.js +3 -1
- package/es/index.js +4 -2
- package/es/moderating/components/resources/ModerateTable/presenter.js +14 -9
- package/es/moderating/components/resources/ModerateTableRow/presenter.js +68 -24
- package/es/moderating/components/resources/ModerateTableRow/styles.js +0 -4
- package/es/reduxStore.js +4 -0
- package/es/taking/api/taking.js +45 -10
- package/lib/building/api/quizEntries.js +25 -5
- package/lib/building/components/layout/header/BuildingButtons/index.js +1 -0
- package/lib/building/components/layout/header/BuildingButtons/presenter.js +4 -0
- package/lib/building/components/resources/ItemFeedbackModal/index.js +4 -1
- package/lib/building/components/resources/ItemFeedbackModal/presenter.js +44 -41
- package/lib/building/components/resources/quizEntry/QuizEntry/index.js +2 -1
- package/lib/building/components/resources/quizEntry/QuizEntry/presenter.js +6 -2
- package/lib/building/components/resources/quizEntry/QuizEntryEdit/Footer/index.js +5 -1
- package/lib/building/components/resources/quizEntry/QuizEntryEdit/Footer/presenter.js +39 -3
- package/lib/building/components/resources/quizEntry/QuizEntryEdit/index.js +1 -0
- package/lib/building/components/resources/quizEntry/QuizEntryEdit/presenter.js +1 -0
- package/lib/building/components/resources/quizEntry/QuizEntryShow/components/LeftHeader.js +151 -0
- package/lib/building/components/resources/quizEntry/QuizEntryShow/index.js +5 -2
- package/lib/building/components/resources/quizEntry/QuizEntryShow/presenter.js +27 -102
- package/lib/building/components/resources/quizEntry/QuizEntryShow/styles.js +0 -12
- package/lib/common/actions/modal.js +2 -1
- package/lib/common/components/ConfirmationModal/index.js +1 -1
- package/lib/common/components/ConfirmationModal/presenter.js +49 -169
- package/lib/common/components/SDKApp/index.js +22 -23
- package/lib/common/components/layout/sidebar/Sidebar/components/TotalPointsPossible.js +37 -0
- package/lib/common/components/layout/sidebar/Sidebar/index.js +29 -57
- package/lib/common/components/layout/sidebar/SidebarItem/index.js +5 -1
- package/lib/common/components/layout/sidebar/SidebarItem/presenter.js +40 -11
- package/lib/common/components/layout/sidebar/SidebarItem/styles.js +4 -1
- package/lib/common/components/layout/sidebar/Stimulus/presenter.js +26 -1
- package/{es/common/components/resources/quizSessionResult/Header → lib/common/components/resources/QuizSessionResult/QuizSessionResultHeader}/index.js +15 -23
- package/lib/common/components/resources/QuizSessionResult/QuizSessionResultInfo/ScoreDisplay/components/LetterGrade.js +36 -0
- package/lib/common/components/resources/QuizSessionResult/QuizSessionResultInfo/ScoreDisplay/components/PointsDisplay.js +70 -0
- package/lib/common/components/resources/QuizSessionResult/QuizSessionResultInfo/ScoreDisplay/components/Progress.js +57 -0
- package/lib/common/components/resources/QuizSessionResult/QuizSessionResultInfo/ScoreDisplay/index.js +49 -0
- package/lib/common/components/resources/QuizSessionResult/QuizSessionResultInfo/index.js +118 -0
- package/lib/common/components/resources/item/ItemEdit/index.js +5 -3
- package/lib/common/components/resources/item/ItemEdit/presenter.js +3 -2
- package/lib/common/components/resources/item/ItemShow/index.js +2 -1
- package/lib/common/components/resources/quiz/AddContent/Body/index.js +4 -2
- package/lib/common/components/resources/quiz/AddContent/Body/presenter.js +25 -6
- package/lib/common/components/resources/quiz/AddContent/Body/styles.js +7 -0
- package/lib/common/components/resources/quiz/AddContent/Popover/presenter.js +1 -0
- package/lib/common/components/resources/sessionItemResult/SessionItemResult/components/SessionItemResultHeader.js +122 -0
- package/lib/common/components/resources/sessionItemResult/SessionItemResult/index.js +6 -2
- package/lib/common/components/resources/sessionItemResult/SessionItemResult/presenter.js +80 -168
- package/lib/common/components/resources/sessionItemResult/SessionItemResult/styles.js +0 -8
- package/lib/common/components/resources/stimulus/Stimulus/index.js +4 -1
- package/lib/common/components/resources/stimulus/Stimulus/presenter.js +2 -0
- package/lib/common/components/resources/stimulus/StimulusEdit/presenter.js +3 -1
- package/lib/common/middleware/appSyncMiddleware.js +19 -0
- package/lib/common/records/Quiz.js +8 -1
- package/lib/common/records/QuizEntry.js +8 -1
- package/lib/common/records/SessionItem.js +2 -1
- package/lib/common/records/SessionItemResult.js +24 -0
- package/lib/common/util/interactionTypePropsHelper.js +4 -2
- package/lib/common/util/isMissing.js +4 -0
- package/lib/configureStore.js +3 -1
- package/lib/index.js +4 -2
- package/lib/moderating/components/resources/ModerateTable/presenter.js +14 -9
- package/lib/moderating/components/resources/ModerateTableRow/presenter.js +68 -24
- package/lib/moderating/components/resources/ModerateTableRow/styles.js +0 -4
- package/lib/reduxStore.js +4 -0
- package/lib/taking/api/taking.js +45 -10
- package/package.json +10 -10
- package/es/building/components/resources/ItemFeedbackModal/styles.js +0 -13
- package/es/building/components/resources/ItemFeedbackModal/theme.js +0 -7
- package/es/common/components/resources/quizSessionResult/Info/index.js +0 -410
- package/es/common/components/resources/quizSessionResult/Info/styles.js +0 -58
- package/es/common/components/resources/quizSessionResult/Info/theme.js +0 -13
- package/lib/building/components/resources/ItemFeedbackModal/styles.js +0 -13
- package/lib/building/components/resources/ItemFeedbackModal/theme.js +0 -7
- package/lib/common/components/resources/quizSessionResult/Info/index.js +0 -410
- package/lib/common/components/resources/quizSessionResult/Info/styles.js +0 -58
- package/lib/common/components/resources/quizSessionResult/Info/theme.js +0 -13
- /package/es/common/components/resources/{quizSessionResult/Header → QuizSessionResult/QuizSessionResultHeader}/styles.js +0 -0
- /package/es/common/components/resources/{quizSessionResult/Header → QuizSessionResult/QuizSessionResultHeader}/theme.js +0 -0
- /package/lib/common/components/resources/{quizSessionResult/Header → QuizSessionResult/QuizSessionResultHeader}/styles.js +0 -0
- /package/lib/common/components/resources/{quizSessionResult/Header → QuizSessionResult/QuizSessionResultHeader}/theme.js +0 -0
|
@@ -254,7 +254,7 @@ export var ModerateTable = /*#__PURE__*/ function(Component) {
|
|
|
254
254
|
sessionTimeLimitInSeconds: sessionTimeLimitInSeconds
|
|
255
255
|
});
|
|
256
256
|
}
|
|
257
|
-
if (prevProps.tableData
|
|
257
|
+
if (prevProps.tableData !== this.props.tableData) {
|
|
258
258
|
this.setState({
|
|
259
259
|
selectedStudent: null
|
|
260
260
|
});
|
|
@@ -297,7 +297,9 @@ export var ModerateTable = /*#__PURE__*/ function(Component) {
|
|
|
297
297
|
rowData: rowData,
|
|
298
298
|
shouldRenderModerateButton: shouldRenderModerateButton,
|
|
299
299
|
focusTarget: _this.state.selectedStudent,
|
|
300
|
-
displayScoreAsPercentage: _this.state.displayScoreAsPercentage
|
|
300
|
+
displayScoreAsPercentage: _this.state.displayScoreAsPercentage,
|
|
301
|
+
isAnonymousParticipantsEnabled: _this.props.isAnonymousParticipantsEnabled,
|
|
302
|
+
isGraded: _this.props.isGraded
|
|
301
303
|
});
|
|
302
304
|
});
|
|
303
305
|
}
|
|
@@ -382,26 +384,27 @@ export var ModerateTable = /*#__PURE__*/ function(Component) {
|
|
|
382
384
|
key: "renderTable",
|
|
383
385
|
value: function renderTable() {
|
|
384
386
|
var outstandingAttemptsCount = this.countOutstandingAttempts();
|
|
387
|
+
var _this_props = this.props, anonymousGrading = _this_props.anonymousGrading, isAnonymousParticipantsEnabled = _this_props.isAnonymousParticipantsEnabled, isGraded = _this_props.isGraded, onAccommodationsClick = _this_props.onAccommodationsClick, shouldRenderModerateButton = _this_props.shouldRenderModerateButton;
|
|
385
388
|
return /*#__PURE__*/ jsx("div", {
|
|
386
389
|
className: "fs-mask"
|
|
387
390
|
}, outstandingAttemptsCount ? this.renderAlertContent(outstandingAttemptsCount) : null, /*#__PURE__*/ jsx(Table, {
|
|
388
391
|
caption: t('Moderation Table')
|
|
389
392
|
}, /*#__PURE__*/ jsx(Table.Head, null, /*#__PURE__*/ jsx(Table.Row, null, /*#__PURE__*/ jsx(Table.ColHeader, {
|
|
390
393
|
id: "moderation-table-student"
|
|
391
|
-
}, t('Student')), !
|
|
394
|
+
}, t('Student')), !anonymousGrading && /*#__PURE__*/ jsx(Table.ColHeader, {
|
|
392
395
|
id: "moderation-table-attempts"
|
|
393
|
-
}, t('Attempts')), !
|
|
396
|
+
}, t('Attempts')), !anonymousGrading && isGraded && /*#__PURE__*/ jsx(Table.ColHeader, {
|
|
394
397
|
id: "moderation-table-score"
|
|
395
|
-
}, t('Score'), this.renderScoreToggle()), !
|
|
398
|
+
}, t('Score'), this.renderScoreToggle()), !anonymousGrading && /*#__PURE__*/ jsx(Table.ColHeader, {
|
|
396
399
|
id: "moderation-table-time"
|
|
397
|
-
}, t('Time')), !
|
|
400
|
+
}, t('Time')), !anonymousGrading && !isAnonymousParticipantsEnabled && /*#__PURE__*/ jsx(Table.ColHeader, {
|
|
398
401
|
id: "moderation-table-log"
|
|
399
|
-
}, t('Log')),
|
|
402
|
+
}, t('Log')), onAccommodationsClick && !anonymousGrading && !isAnonymousParticipantsEnabled && /*#__PURE__*/ jsx(Table.ColHeader, {
|
|
400
403
|
id: "moderation-table-accommodations"
|
|
401
404
|
}, t({
|
|
402
405
|
default: 'Accommodations',
|
|
403
406
|
description: 'Support for students with who need extra time or attempts.'
|
|
404
|
-
})),
|
|
407
|
+
})), shouldRenderModerateButton && !isAnonymousParticipantsEnabled && /*#__PURE__*/ jsx(Table.ColHeader, {
|
|
405
408
|
id: "moderation-table-moderate"
|
|
406
409
|
}, /*#__PURE__*/ jsx(ScreenReaderContent, null, t('Moderate'))))), /*#__PURE__*/ jsx(Table.Body, null, this.renderTableRows())));
|
|
407
410
|
}
|
|
@@ -489,7 +492,9 @@ _define_property(ModerateTable, "propTypes", {
|
|
|
489
492
|
addSuccess: PropTypes.func.isRequired,
|
|
490
493
|
styles: PropTypes.object,
|
|
491
494
|
makeStyles: PropTypes.func,
|
|
492
|
-
atteqApplyChangesToCurrentQuizAttemptsEnabled: PropTypes.bool.isRequired
|
|
495
|
+
atteqApplyChangesToCurrentQuizAttemptsEnabled: PropTypes.bool.isRequired,
|
|
496
|
+
isAnonymousParticipantsEnabled: PropTypes.bool.isRequired,
|
|
497
|
+
isGraded: PropTypes.bool.isRequired
|
|
493
498
|
});
|
|
494
499
|
_define_property(ModerateTable, "defaultProps", {
|
|
495
500
|
anonymousGrading: false,
|
|
@@ -74,6 +74,30 @@ function _object_spread(target) {
|
|
|
74
74
|
}
|
|
75
75
|
return target;
|
|
76
76
|
}
|
|
77
|
+
function ownKeys(object, enumerableOnly) {
|
|
78
|
+
var keys = Object.keys(object);
|
|
79
|
+
if (Object.getOwnPropertySymbols) {
|
|
80
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
81
|
+
if (enumerableOnly) {
|
|
82
|
+
symbols = symbols.filter(function(sym) {
|
|
83
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
keys.push.apply(keys, symbols);
|
|
87
|
+
}
|
|
88
|
+
return keys;
|
|
89
|
+
}
|
|
90
|
+
function _object_spread_props(target, source) {
|
|
91
|
+
source = source != null ? source : {};
|
|
92
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
93
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
94
|
+
} else {
|
|
95
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
96
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
return target;
|
|
100
|
+
}
|
|
77
101
|
function _possible_constructor_return(self, call) {
|
|
78
102
|
if (call && (_type_of(call) === "object" || typeof call === "function")) {
|
|
79
103
|
return call;
|
|
@@ -105,7 +129,7 @@ function _ts_decorate(decorators, target, key, desc) {
|
|
|
105
129
|
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
106
130
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
107
131
|
}
|
|
108
|
-
import React, { Component } from 'react';
|
|
132
|
+
import React, { Component, useCallback } from 'react';
|
|
109
133
|
import PropTypes from 'prop-types';
|
|
110
134
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
111
135
|
import { AccessibleContent, PresentationContent } from '@instructure/ui-a11y-content';
|
|
@@ -115,16 +139,37 @@ import { Link } from '@instructure/ui-link';
|
|
|
115
139
|
import { Avatar } from '@instructure/ui-avatar';
|
|
116
140
|
import { View } from '@instructure/ui-view';
|
|
117
141
|
import { Table } from '@instructure/ui-table';
|
|
118
|
-
import { IconEditLine, IconWarningLine, IconWarningSolid } from '@instructure/ui-icons';
|
|
142
|
+
import { IconEditLine, IconWarningLine, IconWarningSolid, IconUserLine } from '@instructure/ui-icons';
|
|
119
143
|
import { IconButton } from '@instructure/ui-buttons';
|
|
120
144
|
import { jsx } from '@instructure/emotion';
|
|
121
145
|
import t from '@instructure/quiz-i18n/format-message';
|
|
122
|
-
import { withI18nSupport, withStyleOverrides } from '@instructure/quiz-common';
|
|
146
|
+
import { Flex, withI18nSupport, withStyleOverrides } from '@instructure/quiz-common';
|
|
123
147
|
import FormattedDuration from '../../../../common/components/shared/FormattedDuration';
|
|
124
148
|
import generateStyle from './styles';
|
|
125
149
|
import generateComponentTheme from './theme';
|
|
126
150
|
import { Tooltip } from '@instructure/ui-tooltip';
|
|
127
151
|
var DASHES = '---';
|
|
152
|
+
function ParticipantAvatar(param) {
|
|
153
|
+
var avatarUrl = param.avatarUrl, name = param.name, isAnonymousParticipantsEnabled = param.isAnonymousParticipantsEnabled;
|
|
154
|
+
var avatarProps = useCallback(function() {
|
|
155
|
+
if (isAnonymousParticipantsEnabled) {
|
|
156
|
+
return {
|
|
157
|
+
renderIcon: /*#__PURE__*/ jsx(IconUserLine, null)
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
return {
|
|
161
|
+
name: name,
|
|
162
|
+
src: avatarUrl
|
|
163
|
+
};
|
|
164
|
+
}, [
|
|
165
|
+
isAnonymousParticipantsEnabled,
|
|
166
|
+
name,
|
|
167
|
+
avatarUrl
|
|
168
|
+
]);
|
|
169
|
+
return /*#__PURE__*/ jsx(PresentationContent, null, /*#__PURE__*/ jsx(Avatar, _object_spread_props(_object_spread({}, avatarProps()), {
|
|
170
|
+
size: "small"
|
|
171
|
+
})));
|
|
172
|
+
}
|
|
128
173
|
var _withI18nSupport;
|
|
129
174
|
export var ModerateTableRow = /*#__PURE__*/ function(_superClass) {
|
|
130
175
|
"use strict";
|
|
@@ -191,7 +236,10 @@ export var ModerateTableRow = /*#__PURE__*/ function(_superClass) {
|
|
|
191
236
|
value: function onResultsLinkClick(quizSessionId) {
|
|
192
237
|
var _this = this;
|
|
193
238
|
return function() {
|
|
194
|
-
_this.props.onResultsLinkClick(
|
|
239
|
+
_this.props.onResultsLinkClick({
|
|
240
|
+
quizSessionId: quizSessionId,
|
|
241
|
+
participantId: _this.props.rowData.id
|
|
242
|
+
});
|
|
195
243
|
};
|
|
196
244
|
}
|
|
197
245
|
},
|
|
@@ -408,30 +456,24 @@ export var ModerateTableRow = /*#__PURE__*/ function(_superClass) {
|
|
|
408
456
|
}
|
|
409
457
|
},
|
|
410
458
|
{
|
|
411
|
-
key: "
|
|
412
|
-
value: function
|
|
413
|
-
|
|
459
|
+
key: "render",
|
|
460
|
+
value: function render() {
|
|
461
|
+
var quizSessions = this.props.quizSessions.toArray();
|
|
462
|
+
var _this_props = this.props, _this_props_rowData = _this_props.rowData, name = _this_props_rowData.name, avatarUrl = _this_props_rowData.avatar, maxAttempts = _this_props_rowData.maxAttempts, accommodations = _this_props_rowData.accommodations, isAnonymousParticipantsEnabled = _this_props.isAnonymousParticipantsEnabled, isGraded = _this_props.isGraded;
|
|
463
|
+
var avatarName = this.props.styles.avatarName;
|
|
464
|
+
return /*#__PURE__*/ jsx(Table.Row, null, /*#__PURE__*/ jsx(Table.RowHeader, null, /*#__PURE__*/ jsx(Flex, {
|
|
465
|
+
alignItems: "center"
|
|
466
|
+
}, /*#__PURE__*/ jsx(ParticipantAvatar, {
|
|
467
|
+
name: name,
|
|
468
|
+
avatarUrl: avatarUrl,
|
|
469
|
+
isAnonymousParticipantsEnabled: isAnonymousParticipantsEnabled
|
|
470
|
+
}), /*#__PURE__*/ jsx(Link, {
|
|
414
471
|
onClick: this.onAccommodationsClick,
|
|
415
472
|
screenReaderLabel: t('Edit course accommodations'),
|
|
416
473
|
"data-automation": "sdk-moderate-accommodations-edit",
|
|
417
474
|
margin: "0 small",
|
|
418
475
|
css: avatarName
|
|
419
|
-
}, name);
|
|
420
|
-
}
|
|
421
|
-
},
|
|
422
|
-
{
|
|
423
|
-
key: "render",
|
|
424
|
-
value: function render() {
|
|
425
|
-
var quizSessions = this.props.quizSessions.toArray();
|
|
426
|
-
var _this_props = this.props, _this_props_rowData = _this_props.rowData, name = _this_props_rowData.name, avatarUrl = _this_props_rowData.avatar, maxAttempts = _this_props_rowData.maxAttempts, accommodations = _this_props_rowData.accommodations;
|
|
427
|
-
var _this_props_styles = this.props.styles, avatarRow = _this_props_styles.avatarRow, avatarName = _this_props_styles.avatarName;
|
|
428
|
-
return /*#__PURE__*/ jsx(Table.Row, null, /*#__PURE__*/ jsx(Table.RowHeader, null, /*#__PURE__*/ jsx("span", {
|
|
429
|
-
css: avatarRow
|
|
430
|
-
}, /*#__PURE__*/ jsx(PresentationContent, null, /*#__PURE__*/ jsx(Avatar, {
|
|
431
|
-
name: name,
|
|
432
|
-
src: avatarUrl,
|
|
433
|
-
size: "small"
|
|
434
|
-
})), this.renderName(name, avatarName))), !this.props.anonymousGrading && /*#__PURE__*/ jsx(Table.Cell, null, this.renderAttempts(quizSessions, maxAttempts)), !this.props.anonymousGrading && /*#__PURE__*/ jsx(Table.Cell, null, this.renderScores(quizSessions)), !this.props.anonymousGrading && /*#__PURE__*/ jsx(Table.Cell, null, this.renderTimes(quizSessions)), !this.props.anonymousGrading && /*#__PURE__*/ jsx(Table.Cell, null, this.renderLogLinks(quizSessions)), !this.props.anonymousGrading && this.renderAccommodations(accommodations), this.renderModerate());
|
|
476
|
+
}, name))), !this.props.anonymousGrading && /*#__PURE__*/ jsx(Table.Cell, null, this.renderAttempts(quizSessions, maxAttempts)), !this.props.anonymousGrading && isGraded && /*#__PURE__*/ jsx(Table.Cell, null, this.renderScores(quizSessions)), !this.props.anonymousGrading && /*#__PURE__*/ jsx(Table.Cell, null, this.renderTimes(quizSessions)), !this.props.anonymousGrading && !isAnonymousParticipantsEnabled && /*#__PURE__*/ jsx(Table.Cell, null, this.renderLogLinks(quizSessions)), !this.props.anonymousGrading && !isAnonymousParticipantsEnabled && this.renderAccommodations(accommodations), !isAnonymousParticipantsEnabled && this.renderModerate());
|
|
435
477
|
}
|
|
436
478
|
}
|
|
437
479
|
]);
|
|
@@ -464,7 +506,9 @@ _define_property(ModerateTableRow, "propTypes", {
|
|
|
464
506
|
}).isRequired,
|
|
465
507
|
shouldRenderModerateButton: PropTypes.bool,
|
|
466
508
|
focusTarget: PropTypes.string,
|
|
467
|
-
styles: PropTypes.object
|
|
509
|
+
styles: PropTypes.object,
|
|
510
|
+
isAnonymousParticipantsEnabled: PropTypes.bool.isRequired,
|
|
511
|
+
isGraded: PropTypes.bool.isRequired
|
|
468
512
|
});
|
|
469
513
|
_define_property(ModerateTableRow, "defaultProps", {
|
|
470
514
|
displayScoreAsPercentage: true,
|
package/es/reduxStore.js
CHANGED
|
@@ -26,4 +26,8 @@ store.getAppState = function() {
|
|
|
26
26
|
var opts = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
27
27
|
return store.useFakeState || opts.useFakeState ? store.fakeState : store.getState();
|
|
28
28
|
};
|
|
29
|
+
export var appDispatch = null;
|
|
30
|
+
export function setAppDispatch(dispatchToSet) {
|
|
31
|
+
appDispatch = dispatchToSet;
|
|
32
|
+
}
|
|
29
33
|
export default store;
|
package/es/taking/api/taking.js
CHANGED
|
@@ -142,6 +142,7 @@ import { getSessionItems, handleQuizSessionFetch } from '../../common/actions/qu
|
|
|
142
142
|
import { handleSessionItemsResponse, handleResumeDataResponse, handleQuizSessionResponse } from '../../common/api/callHandlers';
|
|
143
143
|
import * as modalActions from '../../common/actions/modal';
|
|
144
144
|
import { backtrackingNextQuestion, sessionStartOrResumeEvent, setCurrentSessionItemPosition, submitQuizSessionEvent, updateQuizSubmitFlag, updateQuizSessionStatusOnPageLoad, updateTimerInfo } from '../../common/actions/taking';
|
|
145
|
+
import { getActiveQuiz } from '../../common/selectors/quizzes';
|
|
145
146
|
import { getClientIpAddress } from '../../common/util/getClientIpAddress';
|
|
146
147
|
var getQuizSessionConfig = function(quizSession) {
|
|
147
148
|
// these should be handled by existing functions
|
|
@@ -291,10 +292,16 @@ export function onQuizSessionReadyForTaking(quizSession) {
|
|
|
291
292
|
// ====================================
|
|
292
293
|
// show submit confirmation modal
|
|
293
294
|
// ====================================
|
|
294
|
-
export var messageForSubmitModal = function(positions) {
|
|
295
|
+
export var messageForSubmitModal = function(positions, isSurvey) {
|
|
295
296
|
if (!positions || positions.length === 0) {
|
|
296
297
|
return t('Upon submission you will not be able to change your answers. Are you ready to submit?');
|
|
297
298
|
}
|
|
299
|
+
if (isSurvey) {
|
|
300
|
+
return messageForSurveySubmitModal(positions);
|
|
301
|
+
}
|
|
302
|
+
return messageForQuizSubmitModal(positions);
|
|
303
|
+
};
|
|
304
|
+
var messageForQuizSubmitModal = function(positions) {
|
|
298
305
|
if (positions.length >= 10) {
|
|
299
306
|
return featureOn('invalid_input_warning') ? t('Multiple questions have either not been answered or have invalid answers. Upon submission you will not be able to change your answers. Are you ready to submit?') : t('Multiple questions have not been answered. Upon submission you will not be able to change your answers. Are you ready to submit?');
|
|
300
307
|
}
|
|
@@ -307,6 +314,19 @@ export var messageForSubmitModal = function(positions) {
|
|
|
307
314
|
}));
|
|
308
315
|
})), /*#__PURE__*/ React.createElement("p", null, t('Upon submission you will not be able to change your answers. Are you ready to submit?')));
|
|
309
316
|
};
|
|
317
|
+
var messageForSurveySubmitModal = function(positions) {
|
|
318
|
+
if (positions.length >= 10) {
|
|
319
|
+
return t('Please complete all the required questions to submit.');
|
|
320
|
+
}
|
|
321
|
+
var message = t('You need to answer the following questions before you can submit this survey:');
|
|
322
|
+
return /*#__PURE__*/ React.createElement("div", null, /*#__PURE__*/ React.createElement("p", null, message), /*#__PURE__*/ React.createElement("ul", null, positions.map(function(position) {
|
|
323
|
+
return /*#__PURE__*/ React.createElement("li", {
|
|
324
|
+
key: position
|
|
325
|
+
}, t('Question { position, number }', {
|
|
326
|
+
position: position
|
|
327
|
+
}));
|
|
328
|
+
})), /*#__PURE__*/ React.createElement("p", null, t('Please complete all the required questions to submit.')));
|
|
329
|
+
};
|
|
310
330
|
var __getResponseForSessionItem = function(sessionItem, responses) {
|
|
311
331
|
var resp = responses.find(function(r) {
|
|
312
332
|
return r.get('position') === sessionItem.get('position');
|
|
@@ -316,13 +336,18 @@ var __getResponseForSessionItem = function(sessionItem, responses) {
|
|
|
316
336
|
}
|
|
317
337
|
return resp && resp.get('userResponse').toJS();
|
|
318
338
|
};
|
|
319
|
-
var __remainingQuestionPositions = function(sessionItems, responses) {
|
|
339
|
+
var __remainingQuestionPositions = function(sessionItems, responses, isSurvey) {
|
|
320
340
|
return sessionItems.toList().sortBy(function(si) {
|
|
321
341
|
return si.get('position');
|
|
322
342
|
}).filterNot(function(si) {
|
|
323
343
|
var item = si.get('item');
|
|
324
344
|
var interactionType = item.get('interactionType');
|
|
325
345
|
return typeof interactionType === 'undefined' || interactionType === 'no-interaction';
|
|
346
|
+
}).filter(function(si) {
|
|
347
|
+
if (isSurvey) {
|
|
348
|
+
return si.get('required');
|
|
349
|
+
}
|
|
350
|
+
return true;
|
|
326
351
|
}).filterNot(function(si) {
|
|
327
352
|
var item = new Item(si.get('item'));
|
|
328
353
|
var itemUserResponse = __getResponseForSessionItem(si, responses);
|
|
@@ -334,16 +359,20 @@ var __remainingQuestionPositions = function(sessionItems, responses) {
|
|
|
334
359
|
export function showSubmitConfirmModal(quizSessionId) {
|
|
335
360
|
var onSubmitQuizSession = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : noop;
|
|
336
361
|
return function(dispatch, getState) {
|
|
337
|
-
var
|
|
338
|
-
var
|
|
339
|
-
var
|
|
362
|
+
var state = getState();
|
|
363
|
+
var quiz = getActiveQuiz(state);
|
|
364
|
+
var isSurvey = quiz.isSurvey();
|
|
365
|
+
var needResponse = getQuestionsNeedingAResponse(state, quizSessionId, isSurvey);
|
|
366
|
+
var title = titleForSubmitModal(needResponse, isSurvey);
|
|
367
|
+
var message = messageForSubmitModal(needResponse, isSurvey);
|
|
340
368
|
var modalAction = modalActions.withConfirm(function() {
|
|
341
369
|
return dispatch(postQuizSession(quizSessionId, onSubmitQuizSession));
|
|
342
370
|
}, {
|
|
343
371
|
title: title,
|
|
344
372
|
text: message,
|
|
345
373
|
continueText: t('Submit'),
|
|
346
|
-
cancelText: t('Cancel')
|
|
374
|
+
cancelText: t('Cancel'),
|
|
375
|
+
submitButtonDisabled: isSurvey && needResponse.length > 0
|
|
347
376
|
});
|
|
348
377
|
return dispatch(modalAction);
|
|
349
378
|
};
|
|
@@ -355,8 +384,14 @@ export function closeSubmitConfirmModal(quizSessionId) {
|
|
|
355
384
|
return dispatch(modalActions.closeModal(title));
|
|
356
385
|
};
|
|
357
386
|
}
|
|
358
|
-
function titleForSubmitModal(needResponse) {
|
|
359
|
-
|
|
387
|
+
function titleForSubmitModal(needResponse, isSurvey) {
|
|
388
|
+
if (needResponse.length === 0) {
|
|
389
|
+
return t('Confirm Submission');
|
|
390
|
+
}
|
|
391
|
+
if (isSurvey) {
|
|
392
|
+
return t('Required Questions!');
|
|
393
|
+
}
|
|
394
|
+
return t('Unanswered Questions!');
|
|
360
395
|
}
|
|
361
396
|
// ==============================================
|
|
362
397
|
// check for unanswered questions or override
|
|
@@ -388,7 +423,7 @@ export function updateTime(timeInSeconds, timerRunning) {
|
|
|
388
423
|
}));
|
|
389
424
|
};
|
|
390
425
|
}
|
|
391
|
-
function getQuestionsNeedingAResponse(state, quizSessionId) {
|
|
426
|
+
function getQuestionsNeedingAResponse(state, quizSessionId, isSurvey) {
|
|
392
427
|
var responses = state.getIn([
|
|
393
428
|
'taking',
|
|
394
429
|
'responses'
|
|
@@ -396,7 +431,7 @@ function getQuestionsNeedingAResponse(state, quizSessionId) {
|
|
|
396
431
|
var sessionItems = state.get('sessionItems', Map()).filter(function(record) {
|
|
397
432
|
return record.get('quizSessionId') === quizSessionId;
|
|
398
433
|
});
|
|
399
|
-
return __remainingQuestionPositions(sessionItems, responses);
|
|
434
|
+
return __remainingQuestionPositions(sessionItems, responses, isSurvey);
|
|
400
435
|
}
|
|
401
436
|
// ====================================
|
|
402
437
|
// submit the data for the quiz
|
|
@@ -305,14 +305,11 @@ export var createItemAndQuizEntry = queue.wrapActionCreator(function(quizId, ite
|
|
|
305
305
|
export function createQuizEntry(quizId, entryId, entryType, entryProperties) {
|
|
306
306
|
var requireFocus = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : true;
|
|
307
307
|
var url = "/api/quizzes/".concat(quizId, "/quiz_entries");
|
|
308
|
-
var
|
|
308
|
+
var body = buildCreateQuizEntryBody(_object_spread({
|
|
309
309
|
quizId: quizId,
|
|
310
310
|
entryType: entryType,
|
|
311
311
|
entryId: entryId
|
|
312
|
-
}, entryProperties);
|
|
313
|
-
var body = JSON.stringify({
|
|
314
|
-
quiz_entry: quizEntryParams
|
|
315
|
-
});
|
|
312
|
+
}, entryProperties));
|
|
316
313
|
return function(dispatch, getState) {
|
|
317
314
|
var fetcher = new Fetcher({
|
|
318
315
|
callType: CREATE_QUIZ_ENTRY_CALL,
|
|
@@ -334,6 +331,29 @@ export function createQuizEntry(quizId, entryId, entryType, entryProperties) {
|
|
|
334
331
|
});
|
|
335
332
|
};
|
|
336
333
|
}
|
|
334
|
+
var propertiesKeys = [
|
|
335
|
+
'required'
|
|
336
|
+
];
|
|
337
|
+
function buildCreateQuizEntryBody(entryProps) {
|
|
338
|
+
var _Object_keys_reduce = Object.keys(entryProps).reduce(function(acc, key) {
|
|
339
|
+
if (propertiesKeys.includes(key)) {
|
|
340
|
+
// eslint-disable-next-line no-param-reassign
|
|
341
|
+
acc.properties[key] = entryProps[key];
|
|
342
|
+
} else {
|
|
343
|
+
// eslint-disable-next-line no-param-reassign
|
|
344
|
+
acc.params[key] = entryProps[key];
|
|
345
|
+
}
|
|
346
|
+
return acc;
|
|
347
|
+
}, {
|
|
348
|
+
properties: {},
|
|
349
|
+
params: {}
|
|
350
|
+
}), properties = _Object_keys_reduce.properties, params = _Object_keys_reduce.params;
|
|
351
|
+
return JSON.stringify({
|
|
352
|
+
quiz_entry: _object_spread({
|
|
353
|
+
properties: properties
|
|
354
|
+
}, params)
|
|
355
|
+
});
|
|
356
|
+
}
|
|
337
357
|
export function createBulkQuizEntries(items, param) {
|
|
338
358
|
var quizId = param.quizId, startPosition = param.startPosition, _param_pointsPossible = param.pointsPossible, pointsPossible = _param_pointsPossible === void 0 ? [] : _param_pointsPossible, _param_requireFocus = param.requireFocus, requireFocus = _param_requireFocus === void 0 ? true : _param_requireFocus;
|
|
339
359
|
var url = "/api/quizzes/".concat(quizId, "/quiz_entries/bulk");
|
|
@@ -269,6 +269,7 @@ export var BuildingButtons = /*#__PURE__*/ function(Component) {
|
|
|
269
269
|
return /*#__PURE__*/ jsx(Drilldown.Option, {
|
|
270
270
|
id: key,
|
|
271
271
|
key: key,
|
|
272
|
+
disabled: this.props.isSurvey,
|
|
272
273
|
onOptionClick: onClick,
|
|
273
274
|
"data-automation": menuItemDataAutomation
|
|
274
275
|
}, /*#__PURE__*/ jsx(IconBankLine, {
|
|
@@ -280,6 +281,7 @@ export var BuildingButtons = /*#__PURE__*/ function(Component) {
|
|
|
280
281
|
}
|
|
281
282
|
return /*#__PURE__*/ jsx(Menu.Item, {
|
|
282
283
|
key: key,
|
|
284
|
+
disabled: this.props.isSurvey,
|
|
283
285
|
onSelect: onClick,
|
|
284
286
|
"data-automation": menuItemDataAutomation
|
|
285
287
|
}, /*#__PURE__*/ jsx(IconBankLine, {
|
|
@@ -435,6 +437,7 @@ _define_property(BuildingButtons, "propTypes", {
|
|
|
435
437
|
enableItemBanking: PropTypes.bool,
|
|
436
438
|
hasQuestions: PropTypes.bool.isRequired,
|
|
437
439
|
isEditing: PropTypes.bool.isRequired,
|
|
440
|
+
isSurvey: PropTypes.bool,
|
|
438
441
|
navigateToBanks: PropTypes.func.isRequired,
|
|
439
442
|
navigateToPreviewPrint: PropTypes.func.isRequired,
|
|
440
443
|
openBanksTray: PropTypes.func.isRequired,
|
|
@@ -458,6 +461,7 @@ _define_property(BuildingButtons, "defaultProps", {
|
|
|
458
461
|
contentExportEnabled: false,
|
|
459
462
|
contentExport: null,
|
|
460
463
|
enableItemBanking: true,
|
|
464
|
+
isSurvey: false,
|
|
461
465
|
quizSaving: false,
|
|
462
466
|
speedgraderLink: null,
|
|
463
467
|
contextUuid: null,
|
|
@@ -8,6 +8,7 @@ import { set } from '../../../../common/actions/ui';
|
|
|
8
8
|
import { getModalTrigger } from '../../../../common/util/modalHelpers';
|
|
9
9
|
import { generateImportModalId } from '../../../../common/components/ImportModal';
|
|
10
10
|
import { ITEM_FEEDBACK_MODAL, ITEM_FEEDBACK_MODAL_ITEM, ITEM_FEEDBACK_MODAL_FEEDBACK } from '@instructure/quiz-common';
|
|
11
|
+
import { getActiveQuiz } from '../../../../common/selectors/quizzes';
|
|
11
12
|
function mapStateToProps(state, props) {
|
|
12
13
|
var nestedModals = [
|
|
13
14
|
'correct',
|
|
@@ -19,6 +20,7 @@ function mapStateToProps(state, props) {
|
|
|
19
20
|
'isOpen'
|
|
20
21
|
]);
|
|
21
22
|
var importModalOpen = nestedModals.includes(openModal);
|
|
23
|
+
var quiz = getActiveQuiz(state);
|
|
22
24
|
return {
|
|
23
25
|
importModalOpen: importModalOpen,
|
|
24
26
|
modalOpen: openModal === ITEM_FEEDBACK_MODAL,
|
|
@@ -30,7 +32,8 @@ function mapStateToProps(state, props) {
|
|
|
30
32
|
'ui',
|
|
31
33
|
ITEM_FEEDBACK_MODAL_FEEDBACK
|
|
32
34
|
]) || Map(),
|
|
33
|
-
modalTrigger: getModalTrigger(state)
|
|
35
|
+
modalTrigger: getModalTrigger(state),
|
|
36
|
+
isSurvey: quiz.isSurvey()
|
|
34
37
|
};
|
|
35
38
|
}
|
|
36
39
|
var mapDispatchToProps = {
|
|
@@ -84,23 +84,27 @@ function _is_native_reflect_construct() {
|
|
|
84
84
|
return !!result;
|
|
85
85
|
})();
|
|
86
86
|
}
|
|
87
|
-
|
|
88
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
89
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
90
|
-
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
91
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
92
|
-
}
|
|
93
|
-
import { Component } from 'react';
|
|
87
|
+
import React, { Component } from 'react';
|
|
94
88
|
import PropTypes from 'prop-types';
|
|
95
89
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
96
90
|
import { Button, CloseButton } from '@instructure/ui-buttons';
|
|
91
|
+
import { View } from '@instructure/ui-view';
|
|
97
92
|
import { Heading } from '@instructure/ui-heading';
|
|
98
93
|
import { jsx } from '@instructure/emotion';
|
|
99
94
|
import { RichContentRenderer, RichContentInput, RCE_THREE_LINES_HEIGHT } from '@instructure/quiz-rce';
|
|
100
95
|
import t from '@instructure/quiz-i18n/format-message';
|
|
101
|
-
import { Modal, ModalHeader, ModalBody, ModalFooter, ITEM_FEEDBACK_MODAL_FEEDBACK, XSMALL_SIDE_MARGIN
|
|
102
|
-
|
|
103
|
-
|
|
96
|
+
import { Modal, ModalHeader, ModalBody, ModalFooter, ITEM_FEEDBACK_MODAL_FEEDBACK, XSMALL_SIDE_MARGIN } from '@instructure/quiz-common';
|
|
97
|
+
function FeedbackInput(param) {
|
|
98
|
+
var textAreaId = param.textAreaId, label = param.label, content = param.content, onChange = param.onChange;
|
|
99
|
+
return /*#__PURE__*/ jsx(RichContentInput, {
|
|
100
|
+
textareaId: textAreaId,
|
|
101
|
+
label: label,
|
|
102
|
+
plainTextLabel: label,
|
|
103
|
+
defaultContent: content,
|
|
104
|
+
onChange: onChange,
|
|
105
|
+
height: RCE_THREE_LINES_HEIGHT
|
|
106
|
+
});
|
|
107
|
+
}
|
|
104
108
|
export var ItemFeedbackModal = /*#__PURE__*/ function(Component) {
|
|
105
109
|
"use strict";
|
|
106
110
|
_inherits(ItemFeedbackModal, Component);
|
|
@@ -145,35 +149,12 @@ export var ItemFeedbackModal = /*#__PURE__*/ function(Component) {
|
|
|
145
149
|
}, t('Done'));
|
|
146
150
|
}
|
|
147
151
|
},
|
|
148
|
-
{
|
|
149
|
-
key: "renderRichContentInput",
|
|
150
|
-
value: function renderRichContentInput(key, label) {
|
|
151
|
-
return /*#__PURE__*/ jsx("div", null, /*#__PURE__*/ jsx("br", null), /*#__PURE__*/ jsx("label", {
|
|
152
|
-
css: this.props.styles.feedbackLabel,
|
|
153
|
-
htmlFor: key
|
|
154
|
-
}, label), /*#__PURE__*/ jsx(RichContentInput, {
|
|
155
|
-
label: "",
|
|
156
|
-
textareaId: key,
|
|
157
|
-
defaultContent: this.props.feedback.get(key),
|
|
158
|
-
onChange: this.onFeedbackWrapper(key),
|
|
159
|
-
height: RCE_THREE_LINES_HEIGHT
|
|
160
|
-
}));
|
|
161
|
-
}
|
|
162
|
-
},
|
|
163
|
-
{
|
|
164
|
-
key: "renderContent",
|
|
165
|
-
value: function renderContent() {
|
|
166
|
-
return /*#__PURE__*/ jsx("div", null, /*#__PURE__*/ jsx(RichContentRenderer, {
|
|
167
|
-
customStyles: this.props.styles.itemStem,
|
|
168
|
-
content: this.props.item.itemBody
|
|
169
|
-
}), this.renderRichContentInput('correct', t('For a correct answer')), this.renderRichContentInput('incorrect', t('For an incorrect answer')), this.renderRichContentInput('neutral', t('Provide general feedback (regardless of answer)')));
|
|
170
|
-
}
|
|
171
|
-
},
|
|
172
152
|
{
|
|
173
153
|
key: "render",
|
|
174
154
|
value: function render() {
|
|
175
|
-
|
|
176
|
-
|
|
155
|
+
var _this_props = this.props, modalOpen = _this_props.modalOpen, importModalOpen = _this_props.importModalOpen, feedback = _this_props.feedback, item = _this_props.item, isSurvey = _this_props.isSurvey;
|
|
156
|
+
return /*#__PURE__*/ jsx(Modal, {
|
|
157
|
+
open: modalOpen || importModalOpen,
|
|
177
158
|
onClose: this.closeAction,
|
|
178
159
|
size: "large",
|
|
179
160
|
label: t('Student Feedback'),
|
|
@@ -187,7 +168,32 @@ export var ItemFeedbackModal = /*#__PURE__*/ function(Component) {
|
|
|
187
168
|
placement: "end",
|
|
188
169
|
offset: "medium",
|
|
189
170
|
screenReaderLabel: t('Close')
|
|
190
|
-
})), /*#__PURE__*/ jsx(ModalBody, null,
|
|
171
|
+
})), /*#__PURE__*/ jsx(ModalBody, null, /*#__PURE__*/ jsx(View, {
|
|
172
|
+
as: "div",
|
|
173
|
+
margin: "0 0 medium 0"
|
|
174
|
+
}, /*#__PURE__*/ jsx(RichContentRenderer, {
|
|
175
|
+
customStyles: {
|
|
176
|
+
whiteSpace: 'nowrap',
|
|
177
|
+
overflow: 'hidden',
|
|
178
|
+
textOverflow: 'ellipsis'
|
|
179
|
+
},
|
|
180
|
+
content: item.itemBody
|
|
181
|
+
})), !isSurvey && /*#__PURE__*/ jsx(React.Fragment, null, /*#__PURE__*/ jsx(FeedbackInput, {
|
|
182
|
+
textAreaId: "correct",
|
|
183
|
+
label: t('For a correct answer'),
|
|
184
|
+
content: feedback.get('correct'),
|
|
185
|
+
onChange: this.onFeedbackWrapper('correct')
|
|
186
|
+
}), /*#__PURE__*/ jsx(FeedbackInput, {
|
|
187
|
+
textAreaId: "incorrect",
|
|
188
|
+
label: t('For an incorrect answer'),
|
|
189
|
+
content: feedback.get('incorrect'),
|
|
190
|
+
onChange: this.onFeedbackWrapper('incorrect')
|
|
191
|
+
})), /*#__PURE__*/ jsx(FeedbackInput, {
|
|
192
|
+
textAreaId: "neutral",
|
|
193
|
+
label: t('Provide general feedback (regardless of answer)'),
|
|
194
|
+
content: feedback.get('neutral'),
|
|
195
|
+
onChange: this.onFeedbackWrapper('neutral')
|
|
196
|
+
})), /*#__PURE__*/ jsx(ModalFooter, null, this.cancelButton(), this.doneButton()));
|
|
191
197
|
}
|
|
192
198
|
}
|
|
193
199
|
]);
|
|
@@ -204,12 +210,9 @@ _define_property(ItemFeedbackModal, "propTypes", {
|
|
|
204
210
|
modalOpen: PropTypes.bool.isRequired,
|
|
205
211
|
setUi: PropTypes.func.isRequired,
|
|
206
212
|
modalTrigger: PropTypes.instanceOf(Component),
|
|
207
|
-
|
|
213
|
+
isSurvey: PropTypes.bool.isRequired
|
|
208
214
|
});
|
|
209
215
|
_define_property(ItemFeedbackModal, "defaultProps", {
|
|
210
216
|
modalTrigger: null
|
|
211
217
|
});
|
|
212
|
-
ItemFeedbackModal = _ts_decorate([
|
|
213
|
-
withStyleOverrides(generateStyle, generateComponentTheme)
|
|
214
|
-
], ItemFeedbackModal);
|
|
215
218
|
export default ItemFeedbackModal;
|
|
@@ -58,7 +58,8 @@ export var mapStateToProps = function(state, props) {
|
|
|
58
58
|
tagAssociations: tagAssociations,
|
|
59
59
|
useBankTags: useBankTags,
|
|
60
60
|
workingEntry: entry.getWorkingInstance(),
|
|
61
|
-
workingQuizEntry: props.quizEntry.getWorkingInstance()
|
|
61
|
+
workingQuizEntry: props.quizEntry.getWorkingInstance(),
|
|
62
|
+
isSurvey: activeQuiz.isSurvey()
|
|
62
63
|
};
|
|
63
64
|
};
|
|
64
65
|
var dispatchToProps = {
|
|
@@ -265,7 +265,8 @@ export var QuizEntry = /*#__PURE__*/ function(Component) {
|
|
|
265
265
|
key: "additionalEditOptions",
|
|
266
266
|
value: function additionalEditOptions(item) {
|
|
267
267
|
var options = [];
|
|
268
|
-
|
|
268
|
+
// Don't show item banking options for surveys (both graded and ungraded)
|
|
269
|
+
if (this.props.quizEntry.entryType === 'Item' && !this.props.isSurvey) {
|
|
269
270
|
options.push({
|
|
270
271
|
key: 'banks',
|
|
271
272
|
title: t('Item Banking'),
|
|
@@ -293,7 +294,8 @@ export var QuizEntry = /*#__PURE__*/ function(Component) {
|
|
|
293
294
|
initialFocusId: this.props.initialFocusId,
|
|
294
295
|
validationErrorsFromApi: this.props.validationErrorsFromApi,
|
|
295
296
|
clearValidationErrorsFromApi: this.props.clearValidationErrorsFromApi,
|
|
296
|
-
separatorConfig: this.props.separatorConfig
|
|
297
|
+
separatorConfig: this.props.separatorConfig,
|
|
298
|
+
isSurvey: this.props.isSurvey
|
|
297
299
|
};
|
|
298
300
|
}
|
|
299
301
|
},
|
|
@@ -538,6 +540,7 @@ _define_property(QuizEntry, "propTypes", {
|
|
|
538
540
|
decimalSeparator: PropTypes.string,
|
|
539
541
|
thousandSeparator: PropTypes.string
|
|
540
542
|
}),
|
|
543
|
+
isSurvey: PropTypes.bool,
|
|
541
544
|
styles: PropTypes.object
|
|
542
545
|
});
|
|
543
546
|
_define_property(QuizEntry, "defaultProps", {
|
|
@@ -548,6 +551,7 @@ _define_property(QuizEntry, "defaultProps", {
|
|
|
548
551
|
initialFocusId: null,
|
|
549
552
|
isContentLockedByBlueprint: false,
|
|
550
553
|
isEditing: false,
|
|
554
|
+
isSurvey: false,
|
|
551
555
|
partialDeepScoringEnabled: false,
|
|
552
556
|
partialScoringEnabled: false,
|
|
553
557
|
scrollKey: void 0,
|