@instructure/quiz-core 22.16.0 → 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/banks/components/BankEntry/presenter.js +1 -1
- package/es/banks/components/SharingModal/presenter.js +1 -1
- 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/ApiFeatureFlagInitializer/index.js +1 -1
- package/es/common/components/ConfirmationModal/index.js +1 -1
- package/es/common/components/ConfirmationModal/presenter.js +49 -169
- package/es/common/components/RceConfigProvider/presenter.js +1 -1
- package/es/common/components/SDKApp/index.js +38 -39
- 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/components/shared/PaginatedCollection/presenter.js +1 -1
- package/es/common/components/shared/PrintTrigger/presenter.js +1 -1
- package/es/common/components/shared/spinner/Spinner.js +15 -16
- 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 +6 -4
- package/es/moderating/components/resources/ModerateTable/presenter.js +15 -10
- 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/reporting/components/itemAnalysis/ItemAnalysisRow/presenter.js +1 -1
- package/es/reporting/components/quizAnalysis/QuizAnalysisOverview.js +1 -1
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/ReportCard/presenter.js +1 -1
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/presenter.js +4 -4
- package/es/reporting/components/resources/QuizAndItemAnalysis/presenter.js +1 -1
- package/es/reporting/components/resources/StudentAnalysis/ReportCard/presenter.js +1 -1
- package/es/taking/api/taking.js +45 -10
- package/lib/banks/components/BankEntry/presenter.js +1 -1
- package/lib/banks/components/SharingModal/presenter.js +1 -1
- 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/ApiFeatureFlagInitializer/index.js +1 -1
- package/lib/common/components/ConfirmationModal/index.js +1 -1
- package/lib/common/components/ConfirmationModal/presenter.js +49 -169
- package/lib/common/components/RceConfigProvider/presenter.js +1 -1
- package/lib/common/components/SDKApp/index.js +38 -39
- 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/components/shared/PaginatedCollection/presenter.js +1 -1
- package/lib/common/components/shared/PrintTrigger/presenter.js +1 -1
- package/lib/common/components/shared/spinner/Spinner.js +15 -16
- 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 +6 -4
- package/lib/moderating/components/resources/ModerateTable/presenter.js +15 -10
- 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/reporting/components/itemAnalysis/ItemAnalysisRow/presenter.js +1 -1
- package/lib/reporting/components/quizAnalysis/QuizAnalysisOverview.js +1 -1
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/ReportCard/presenter.js +1 -1
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/presenter.js +4 -4
- package/lib/reporting/components/resources/QuizAndItemAnalysis/presenter.js +1 -1
- package/lib/reporting/components/resources/StudentAnalysis/ReportCard/presenter.js +1 -1
- 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
package/es/configureStore.js
CHANGED
|
@@ -35,6 +35,7 @@ import crossDomainMessagingMiddleware from './common/middleware/crossDomainMessa
|
|
|
35
35
|
import eventLoggerMiddlewareCreator from './common/middleware/eventLoggerMiddleware';
|
|
36
36
|
import { createQuizTimerWebSocketMiddleware } from './common/middleware/quizTimerWebSocketMiddleware';
|
|
37
37
|
import { createSharedBanksMiddleware } from './common/middleware/sharedBanksMiddleware';
|
|
38
|
+
import { createAppSyncMiddleware } from './common/middleware/appSyncMiddleware';
|
|
38
39
|
// reducers
|
|
39
40
|
import alerts from './common/reducers/alerts';
|
|
40
41
|
import banks from './common/reducers/banks';
|
|
@@ -99,7 +100,8 @@ export function configureStore(param) {
|
|
|
99
100
|
getMiddleware(eventLoggerMiddlewareCreator(), middlewareOverrides.kinesisMiddleware),
|
|
100
101
|
getMiddleware(thunkMiddleware, middlewareOverrides.thunkMiddleware),
|
|
101
102
|
getMiddleware(createQuizTimerWebSocketMiddleware(), middlewareOverrides.websocketMiddleware),
|
|
102
|
-
getMiddleware(createSharedBanksMiddleware(), middlewareOverrides.sharedBanksMiddleware)
|
|
103
|
+
getMiddleware(createSharedBanksMiddleware(), middlewareOverrides.sharedBanksMiddleware),
|
|
104
|
+
getMiddleware(createAppSyncMiddleware(), middlewareOverrides.appSyncMiddleware)
|
|
103
105
|
];
|
|
104
106
|
var devMiddleware = [
|
|
105
107
|
getMiddleware(loggerMiddleware, middlewareOverrides.logger)
|
package/es/index.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* These exports are for other packages to use.
|
|
6
6
|
* We should look into configuring an import/no-restricted-paths eslint rule to prevent this.
|
|
7
7
|
*/ // Components
|
|
8
|
-
export {
|
|
8
|
+
export { SDKApp } from './common/components/SDKApp';
|
|
9
9
|
export { TimingAlerts } from './common/components/TimingAlerts';
|
|
10
10
|
export { ModerateTable } from './moderating/components/resources/ModerateTable';
|
|
11
11
|
export { Calculator } from './common/components/layout/header/Calculator/index';
|
|
@@ -27,7 +27,7 @@ export { ExtraTimeSettings } from './moderating/components/resources/Accommodati
|
|
|
27
27
|
export { ReduceAnswerChoicesSettings } from './moderating/components/resources/AccommodationsModal/ReduceAnswerChoicesSettings';
|
|
28
28
|
export { PreviewFrame } from './common/components/PreviewFrame';
|
|
29
29
|
export { SDKHeaderCalculator } from './common/components/SDKHeaderCalculator';
|
|
30
|
-
export {
|
|
30
|
+
export { Spinner } from './common/components/shared/spinner/Spinner';
|
|
31
31
|
export { PrintTrigger } from './common/components/shared/PrintTrigger';
|
|
32
32
|
export { IfFeature } from './common/components/shared/IfFeature';
|
|
33
33
|
export { UndecoratedQuizEntryEdit } from './building/components/resources/quizEntry/QuizEntryEdit/presenter';
|
|
@@ -69,8 +69,8 @@ export { QuizInstructions } from './building/components/resources/quiz/instructi
|
|
|
69
69
|
export { QuizTitle } from './building/components/resources/quiz/title/Title';
|
|
70
70
|
export { QuizEntryShow } from './building/components/resources/quizEntry/QuizEntryShow';
|
|
71
71
|
export { StimulusShow } from './common/components/resources/stimulus/StimulusShow';
|
|
72
|
-
export { QuizSessionResultHeader } from './common/components/resources/
|
|
73
|
-
export {
|
|
72
|
+
export { QuizSessionResultHeader } from './common/components/resources/QuizSessionResult/QuizSessionResultHeader';
|
|
73
|
+
export { QuizSessionResultInfo } from './common/components/resources/QuizSessionResult/QuizSessionResultInfo';
|
|
74
74
|
export { SessionItemResultsList } from './common/components/resources/sessionItemResult/SessionItemResultsList';
|
|
75
75
|
export { TimeUnitsInput } from './common/components/shared/TimeUnitsInput';
|
|
76
76
|
export { QuizEntry as QuizEntryView } from './building/components/resources/quizEntry/QuizEntry';
|
|
@@ -83,6 +83,8 @@ export { MaskedTextInput } from './common/components/MaskedTextInput';
|
|
|
83
83
|
export { AccessCodeTextInput } from './common/components/AccessCodeTextInput';
|
|
84
84
|
export { LocalStoreService } from './common/util/localStoreService';
|
|
85
85
|
export { default as Alerts } from './common/components/alerts/index';
|
|
86
|
+
export { InteractionTypeName, PointsPossible, RequiredIndicator } from './building/components/resources/quizEntry/QuizEntryShow/components/LeftHeader';
|
|
87
|
+
export { default as ConfirmationModal } from './common/components/ConfirmationModal';
|
|
86
88
|
// Utilities
|
|
87
89
|
export { environment as config } from './config';
|
|
88
90
|
export { Fetcher } from './common/util/Fetcher';
|
|
@@ -130,7 +130,7 @@ import ModerateTableRow from '../ModerateTableRow';
|
|
|
130
130
|
import IfFeature from '../../../../common/components/shared/IfFeature';
|
|
131
131
|
import OutstandingQuizzesModal from '../OutstandingQuizzesModal';
|
|
132
132
|
import ModerateTray from '../../sidebar/ModerateTray';
|
|
133
|
-
import Spinner from '../../../../common/components/shared/spinner/Spinner';
|
|
133
|
+
import { Spinner } from '../../../../common/components/shared/spinner/Spinner';
|
|
134
134
|
import generateStyle from './styles';
|
|
135
135
|
import generateComponentTheme from './theme';
|
|
136
136
|
import ResetQuiz from '../../sidebar/ResetQuiz';
|
|
@@ -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;
|
|
@@ -101,7 +101,7 @@ import { jsx } from '@instructure/emotion';
|
|
|
101
101
|
import { RichContentRenderer } from '@instructure/quiz-rce';
|
|
102
102
|
import Card from '../../../../common/components/shared/Card';
|
|
103
103
|
import ExpandButton from '../../../../common/components/shared/ExpandButton';
|
|
104
|
-
import Spinner from '../../../../common/components/shared/spinner/Spinner';
|
|
104
|
+
import { Spinner } from '../../../../common/components/shared/spinner/Spinner';
|
|
105
105
|
import AnswerFrequencySummary from '../AnswerFrequencySummary';
|
|
106
106
|
import QuintileDistribution from '../../charts/QuintileDistribution';
|
|
107
107
|
import Legend from '../../charts/Legend';
|
|
@@ -100,7 +100,7 @@ import { jsx } from '@instructure/emotion';
|
|
|
100
100
|
import FormattedDuration from '../../../common/components/shared/FormattedDuration';
|
|
101
101
|
import t from '@instructure/quiz-i18n/format-message';
|
|
102
102
|
import Card from '../../../common/components/shared/Card';
|
|
103
|
-
import Spinner from '../../../common/components/shared/spinner/Spinner';
|
|
103
|
+
import { Spinner } from '../../../common/components/shared/spinner/Spinner';
|
|
104
104
|
import CentileDistribution from '../charts/CentileDistribution';
|
|
105
105
|
import MetricsListItem from '../MetricsListItem';
|
|
106
106
|
import generateStyle from './styles';
|
|
@@ -101,7 +101,7 @@ import Card from '../../../../../common/components/shared/Card';
|
|
|
101
101
|
import generateStyle from './styles';
|
|
102
102
|
import generateComponentTheme from './theme';
|
|
103
103
|
import AnalysisMetric from '../AnalysisMetric';
|
|
104
|
-
import Spinner from '../../../../../common/components/shared/spinner/Spinner';
|
|
104
|
+
import { Spinner } from '../../../../../common/components/shared/spinner/Spinner';
|
|
105
105
|
import { AnalysisUpdateDate } from '../../common/AnalysisUpdateDate';
|
|
106
106
|
import { itemAnalysisPropType, quizAnalysisPropType } from '../../common/propTypes';
|
|
107
107
|
import { csvFormat } from '../exportFormats';
|
|
@@ -98,8 +98,8 @@ import t from '@instructure/quiz-i18n/format-message';
|
|
|
98
98
|
import { AnalysisUpdateDate } from '../common/AnalysisUpdateDate';
|
|
99
99
|
import { itemAnalysisPropType, quizAnalysisPropType } from '../common/propTypes';
|
|
100
100
|
import PropTypes from 'prop-types';
|
|
101
|
-
import {
|
|
102
|
-
import { Spinner } from '@instructure/ui-spinner';
|
|
101
|
+
import { Spinner } from '../../../../common/components/shared/spinner/Spinner';
|
|
102
|
+
import { Spinner as InstUISpinner } from '@instructure/ui-spinner';
|
|
103
103
|
import { Button } from '@instructure/ui-buttons';
|
|
104
104
|
import { Text } from '@instructure/ui-text';
|
|
105
105
|
import { getFailedToFetchReports } from '../common/errorMessages';
|
|
@@ -137,7 +137,7 @@ export var NewQuizAndItemAnalysisPresenter = /*#__PURE__*/ function(Component) {
|
|
|
137
137
|
padding: "medium",
|
|
138
138
|
justifyItems: "center",
|
|
139
139
|
alignItems: "center"
|
|
140
|
-
}, /*#__PURE__*/ jsx(
|
|
140
|
+
}, /*#__PURE__*/ jsx(InstUISpinner, {
|
|
141
141
|
renderTitle: t('Loading item analyses data')
|
|
142
142
|
}));
|
|
143
143
|
}), _define_property(_this, "renderBodyOnFailedFetch", function() {
|
|
@@ -255,7 +255,7 @@ export var NewQuizAndItemAnalysisPresenter = /*#__PURE__*/ function(Component) {
|
|
|
255
255
|
color: "primary-inverse",
|
|
256
256
|
interaction: "disabled",
|
|
257
257
|
margin: "auto"
|
|
258
|
-
}, /*#__PURE__*/ jsx(
|
|
258
|
+
}, /*#__PURE__*/ jsx(Spinner, {
|
|
259
259
|
size: "x-small",
|
|
260
260
|
color: "brand",
|
|
261
261
|
minHeight: "0",
|
|
@@ -97,7 +97,7 @@ import { Heading } from '@instructure/ui-heading';
|
|
|
97
97
|
import { jsx } from '@instructure/emotion';
|
|
98
98
|
import t from '@instructure/quiz-i18n/format-message';
|
|
99
99
|
import { withI18nSupport, withStyleOverrides } from '@instructure/quiz-common';
|
|
100
|
-
import Spinner from '../../../../common/components/shared/spinner/Spinner';
|
|
100
|
+
import { Spinner } from '../../../../common/components/shared/spinner/Spinner';
|
|
101
101
|
import Card from '../../../../common/components/shared/Card';
|
|
102
102
|
import FormattedDuration from '../../../../common/components/shared/FormattedDuration';
|
|
103
103
|
import ItemAnalysisRow from '../../../../reporting/components/itemAnalysis/ItemAnalysisRow';
|
|
@@ -99,7 +99,7 @@ import Card from '../../../../../common/components/shared/Card';
|
|
|
99
99
|
import { generateStyle } from './styles';
|
|
100
100
|
import { generateComponentTheme } from './theme';
|
|
101
101
|
import { ExportButton } from '../../common/ExportButton';
|
|
102
|
-
import Spinner from '../../../../../common/components/shared/spinner/Spinner';
|
|
102
|
+
import { Spinner } from '../../../../../common/components/shared/spinner/Spinner';
|
|
103
103
|
import { Flex, STUDENT_ANALYSES, withStyleOverrides } from '@instructure/quiz-common';
|
|
104
104
|
import { AnalysisUpdateDate } from '../../common/AnalysisUpdateDate';
|
|
105
105
|
export var StudentAnalysisReportCardPresenter = /*#__PURE__*/ function(Component) {
|
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
|
|
@@ -234,7 +234,7 @@ import ItemEdit from '../../../common/components/resources/item/ItemEdit';
|
|
|
234
234
|
import ItemFeedbackModal from '../../../building/components/resources/ItemFeedbackModal';
|
|
235
235
|
import ItemShow from '../../../common/components/resources/item/ItemShow';
|
|
236
236
|
import Page from '../../../common/components/layout/Page';
|
|
237
|
-
import Spinner from '../../../common/components/shared/spinner/Spinner';
|
|
237
|
+
import { Spinner } from '../../../common/components/shared/spinner/Spinner';
|
|
238
238
|
import StimulusEditInfo from '../../../common/components/resources/stimulus/StimulusEditInfo';
|
|
239
239
|
import StimulusShowInfo from '../../../common/components/resources/stimulus/StimulusShowInfo';
|
|
240
240
|
import TagSuggestSelect from '../../../common/components/shared/TagSuggestSelect';
|
|
@@ -228,7 +228,7 @@ import CustomPropTypes from '../../../common/util/CustomPropTypes';
|
|
|
228
228
|
import ShareList from './ShareList';
|
|
229
229
|
import AsyncSearch from '../AsyncSearch';
|
|
230
230
|
import RootAccountSharing from './RootAccountSharing';
|
|
231
|
-
import Spinner from '../../../common/components/shared/spinner/Spinner';
|
|
231
|
+
import { Spinner } from '../../../common/components/shared/spinner/Spinner';
|
|
232
232
|
import generateStyle from './styles';
|
|
233
233
|
import generateComponentTheme from './theme';
|
|
234
234
|
import t from '@instructure/quiz-i18n/format-message';
|
|
@@ -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,
|