@instructure/quiz-core 21.0.1-rc.0 → 21.0.1-rc.11
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/Bank/theme.js +1 -1
- package/es/banks/components/BankEntry/presenter.js +2 -2
- package/es/banks/components/BankEntry/theme.js +5 -5
- package/es/banks/components/BankEntryRow/styles.js +1 -0
- package/es/banks/components/BankEntryRow/theme.js +4 -4
- package/es/banks/components/Banks/theme.js +2 -2
- package/es/banks/components/BanksList/presenter.js +1 -1
- package/es/banks/components/BanksList/theme.js +4 -4
- package/es/banks/components/NavWrapper/theme.js +3 -3
- package/es/banks/components/SharingModal/presenter.js +2 -2
- package/es/banks/components/SharingModal/theme.js +1 -1
- package/es/building/components/layout/header/BuildingButtons/theme.js +1 -1
- package/es/building/components/resources/ActionButtons/theme.js +1 -1
- package/es/building/components/resources/AddToBankOptions/theme.js +2 -2
- package/es/building/components/resources/quiz/instructions/Instructions/theme.js +1 -1
- package/es/building/components/resources/quiz/title/Edit/theme.js +1 -1
- package/es/building/components/resources/quiz/title/Title/theme.js +3 -3
- package/es/building/components/resources/quizEntry/QuizEntry/theme.js +1 -1
- package/es/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankEdit/theme.js +3 -3
- package/es/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankShow/theme.js +2 -2
- package/es/building/components/resources/quizEntry/QuizEntryEdit/Footer/presenter.js +2 -2
- package/es/building/components/resources/quizEntry/QuizEntryEdit/Header/theme.js +2 -2
- package/es/building/components/resources/quizEntry/QuizEntryEdit/presenter.js +2 -2
- package/es/building/components/resources/quizEntry/QuizEntryShow/theme.js +5 -5
- package/es/common/actions/taking.js +3 -2
- package/es/common/components/ImportModal/ImportFileSelector/theme.js +4 -4
- package/es/common/components/PrintFontSizeModal/presenter.js +2 -2
- package/es/common/components/PrintFontSizeModal/theme.js +1 -1
- package/es/common/components/SDKApp/index.js +4 -4
- package/es/common/components/layout/header/HeaderMenuButton/theme.js +1 -1
- package/es/common/components/layout/header/Timer/theme.js +3 -3
- package/es/common/components/layout/navbar/theme.js +1 -1
- package/es/common/components/layout/sidebar/PositionSummary/theme.js +2 -2
- package/es/common/components/layout/sidebar/Sidebar/theme.js +10 -10
- package/es/common/components/layout/sidebar/SidebarItem/theme.js +5 -5
- package/es/common/components/layout/sidebar/Stimulus/Collection/theme.js +1 -1
- package/es/common/components/layout/sidebar/Stimulus/Summary/theme.js +2 -2
- package/es/common/components/layout/sidebar/Stimulus/theme.js +4 -4
- package/es/common/components/resources/WarningWrapper/theme.js +1 -1
- package/es/common/components/resources/entry/EntrySave/presenter.js +2 -2
- package/es/common/components/resources/positionBox/theme.js +2 -2
- package/es/common/components/resources/quiz/AddContent/Body/theme.js +1 -1
- package/es/common/components/resources/quiz/AddContent/Button/theme.js +4 -4
- package/es/common/components/resources/quiz/AddContent/Popover/theme.js +1 -1
- package/es/common/components/resources/sessionItemResult/ResultStimulus/theme.js +4 -4
- package/es/common/components/resources/sessionItemResult/SessionItemResult/theme.js +4 -4
- package/es/common/components/resources/sessionItemResult/SessionItemResultsList/theme.js +1 -1
- package/es/common/components/resources/stimulus/Stimulus/theme.js +1 -1
- package/es/common/components/resources/stimulus/StimulusEdit/theme.js +1 -1
- package/es/common/components/resources/stimulus/StimulusEditInfo/index.js +5 -1
- package/es/common/components/resources/stimulus/StimulusEditInfo/presenter.js +15 -2
- package/es/common/components/resources/stimulus/StimulusEditInfo/theme.js +1 -1
- package/es/common/components/resources/stimulus/StimulusShow/index.js +1 -1
- package/es/common/components/shared/Card/CardContent/theme.js +2 -2
- package/es/common/components/shared/Card/CardWrapper/theme.js +1 -1
- package/es/common/components/shared/InteractionTypes/theme.js +1 -1
- package/es/common/components/shared/PaginatedCollection/presenter.js +2 -2
- package/es/common/components/shared/PaginatedCollection/theme.js +1 -1
- package/es/common/components/shared/TimeUnitsInput/index.js +2 -2
- package/es/common/components/shared/drag_and_drop/DragAndDropZone/theme.js +5 -5
- package/es/common/components/shared/errors/theme.js +1 -1
- package/es/common/components/shared/file_selector/theme.js +2 -2
- package/es/common/components/shared/functionality/makeEditable.js +2 -2
- package/es/common/components/shared/overlay/theme.js +1 -1
- package/es/common/reducers/taking.js +5 -1
- package/es/common/selectors/taking.js +3 -0
- package/es/common/util/getClientIpAddress.js +35 -0
- package/es/common/util/serializeEvent.js +4 -2
- package/es/index.js +2 -3
- package/es/moderating/components/events/Event.js +27 -10
- package/es/moderating/components/events/ResponseEvent.js +24 -7
- package/es/moderating/components/events/SessionStartEvent.js +16 -15
- package/es/moderating/components/events/SessionSubmitEvent.js +42 -0
- package/es/moderating/components/events/theme.js +1 -1
- package/es/moderating/components/resources/AccommodationsModal/ExtraTimeMultiplier/index.js +2 -2
- package/es/moderating/components/resources/EventDetails.js +43 -0
- package/es/moderating/components/resources/ModerateTable/theme.js +1 -1
- package/es/moderating/components/resources/SessionBreachAlert.js +10 -0
- package/es/moderating/components/resources/util/checkIsBreach.js +28 -0
- package/es/moderating/components/resources/util/extractSessionData.js +20 -0
- package/es/reporting/components/charts/Distribution/theme.js +2 -2
- package/es/reporting/components/charts/Legend/theme.js +2 -2
- package/es/reporting/components/itemAnalysis/AnswerFrequencySummary/theme.js +8 -8
- package/es/reporting/components/itemAnalysis/ItemAnalysisRow/theme.js +4 -4
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/ChoiceTypeTableRow/theme.js +1 -1
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AggregationTable/theme.js +5 -5
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ChoiceTypeTable/theme.js +2 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/BlankIcon/theme.js +1 -1
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/theme.js +1 -1
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/ReportCard/theme.js +1 -1
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/charts/ScoreDistribution/theme.js +2 -2
- package/es/reporting/components/resources/QuizAndItemAnalysis/presenter.js +2 -2
- package/es/reporting/components/resources/QuizAndItemAnalysis/theme.js +1 -1
- package/es/reporting/components/resources/StudentAnalysis/ReportCard/theme.js +1 -1
- package/es/reporting/components/resources/common/propTypes.js +14 -0
- package/es/taking/api/taking.js +26 -3
- package/lib/banks/components/Bank/theme.js +1 -1
- package/lib/banks/components/BankEntry/presenter.js +2 -2
- package/lib/banks/components/BankEntry/theme.js +5 -5
- package/lib/banks/components/BankEntryRow/styles.js +1 -0
- package/lib/banks/components/BankEntryRow/theme.js +4 -4
- package/lib/banks/components/Banks/theme.js +2 -2
- package/lib/banks/components/BanksList/presenter.js +1 -1
- package/lib/banks/components/BanksList/theme.js +4 -4
- package/lib/banks/components/NavWrapper/theme.js +3 -3
- package/lib/banks/components/SharingModal/presenter.js +2 -2
- package/lib/banks/components/SharingModal/theme.js +1 -1
- package/lib/building/components/layout/header/BuildingButtons/theme.js +1 -1
- package/lib/building/components/resources/ActionButtons/theme.js +1 -1
- package/lib/building/components/resources/AddToBankOptions/theme.js +2 -2
- package/lib/building/components/resources/quiz/instructions/Instructions/theme.js +1 -1
- package/lib/building/components/resources/quiz/title/Edit/theme.js +1 -1
- package/lib/building/components/resources/quiz/title/Title/theme.js +3 -3
- package/lib/building/components/resources/quizEntry/QuizEntry/theme.js +1 -1
- package/lib/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankEdit/theme.js +3 -3
- package/lib/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankShow/theme.js +2 -2
- package/lib/building/components/resources/quizEntry/QuizEntryEdit/Footer/presenter.js +2 -2
- package/lib/building/components/resources/quizEntry/QuizEntryEdit/Header/theme.js +2 -2
- package/lib/building/components/resources/quizEntry/QuizEntryEdit/presenter.js +2 -2
- package/lib/building/components/resources/quizEntry/QuizEntryShow/theme.js +5 -5
- package/lib/common/actions/taking.js +3 -2
- package/lib/common/components/ImportModal/ImportFileSelector/theme.js +4 -4
- package/lib/common/components/PrintFontSizeModal/presenter.js +2 -2
- package/lib/common/components/PrintFontSizeModal/theme.js +1 -1
- package/lib/common/components/SDKApp/index.js +4 -4
- package/lib/common/components/layout/header/HeaderMenuButton/theme.js +1 -1
- package/lib/common/components/layout/header/Timer/theme.js +3 -3
- package/lib/common/components/layout/navbar/theme.js +1 -1
- package/lib/common/components/layout/sidebar/PositionSummary/theme.js +2 -2
- package/lib/common/components/layout/sidebar/Sidebar/theme.js +10 -10
- package/lib/common/components/layout/sidebar/SidebarItem/theme.js +5 -5
- package/lib/common/components/layout/sidebar/Stimulus/Collection/theme.js +1 -1
- package/lib/common/components/layout/sidebar/Stimulus/Summary/theme.js +2 -2
- package/lib/common/components/layout/sidebar/Stimulus/theme.js +4 -4
- package/lib/common/components/resources/WarningWrapper/theme.js +1 -1
- package/lib/common/components/resources/entry/EntrySave/presenter.js +2 -2
- package/lib/common/components/resources/positionBox/theme.js +2 -2
- package/lib/common/components/resources/quiz/AddContent/Body/theme.js +1 -1
- package/lib/common/components/resources/quiz/AddContent/Button/theme.js +4 -4
- package/lib/common/components/resources/quiz/AddContent/Popover/theme.js +1 -1
- package/lib/common/components/resources/sessionItemResult/ResultStimulus/theme.js +4 -4
- package/lib/common/components/resources/sessionItemResult/SessionItemResult/theme.js +4 -4
- package/lib/common/components/resources/sessionItemResult/SessionItemResultsList/theme.js +1 -1
- package/lib/common/components/resources/stimulus/Stimulus/theme.js +1 -1
- package/lib/common/components/resources/stimulus/StimulusEdit/theme.js +1 -1
- package/lib/common/components/resources/stimulus/StimulusEditInfo/index.js +5 -1
- package/lib/common/components/resources/stimulus/StimulusEditInfo/presenter.js +15 -2
- package/lib/common/components/resources/stimulus/StimulusEditInfo/theme.js +1 -1
- package/lib/common/components/resources/stimulus/StimulusShow/index.js +1 -1
- package/lib/common/components/shared/Card/CardContent/theme.js +2 -2
- package/lib/common/components/shared/Card/CardWrapper/theme.js +1 -1
- package/lib/common/components/shared/InteractionTypes/theme.js +1 -1
- package/lib/common/components/shared/PaginatedCollection/presenter.js +2 -2
- package/lib/common/components/shared/PaginatedCollection/theme.js +1 -1
- package/lib/common/components/shared/TimeUnitsInput/index.js +2 -2
- package/lib/common/components/shared/drag_and_drop/DragAndDropZone/theme.js +5 -5
- package/lib/common/components/shared/errors/theme.js +1 -1
- package/lib/common/components/shared/file_selector/theme.js +2 -2
- package/lib/common/components/shared/functionality/makeEditable.js +2 -2
- package/lib/common/components/shared/overlay/theme.js +1 -1
- package/lib/common/reducers/taking.js +5 -1
- package/lib/common/selectors/taking.js +5 -1
- package/lib/common/util/getClientIpAddress.js +43 -0
- package/lib/common/util/serializeEvent.js +3 -1
- package/lib/index.js +15 -0
- package/lib/moderating/components/events/Event.js +26 -9
- package/lib/moderating/components/events/ResponseEvent.js +25 -7
- package/lib/moderating/components/events/SessionStartEvent.js +16 -15
- package/lib/moderating/components/events/SessionSubmitEvent.js +52 -0
- package/lib/moderating/components/events/theme.js +1 -1
- package/lib/moderating/components/resources/AccommodationsModal/ExtraTimeMultiplier/index.js +2 -2
- package/lib/moderating/components/resources/EventDetails.js +51 -0
- package/lib/moderating/components/resources/ModerateTable/theme.js +1 -1
- package/lib/moderating/components/resources/SessionBreachAlert.js +18 -0
- package/lib/moderating/components/resources/util/checkIsBreach.js +36 -0
- package/lib/moderating/components/resources/util/extractSessionData.js +28 -0
- package/lib/reporting/components/charts/Distribution/theme.js +2 -2
- package/lib/reporting/components/charts/Legend/theme.js +2 -2
- package/lib/reporting/components/itemAnalysis/AnswerFrequencySummary/theme.js +8 -8
- package/lib/reporting/components/itemAnalysis/ItemAnalysisRow/theme.js +4 -4
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/ChoiceTypeTableRow/theme.js +1 -1
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AggregationTable/theme.js +5 -5
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ChoiceTypeTable/theme.js +2 -2
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/BlankIcon/theme.js +1 -1
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/theme.js +1 -1
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/ReportCard/theme.js +1 -1
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/charts/ScoreDistribution/theme.js +2 -2
- package/lib/reporting/components/resources/QuizAndItemAnalysis/presenter.js +2 -2
- package/lib/reporting/components/resources/QuizAndItemAnalysis/theme.js +1 -1
- package/lib/reporting/components/resources/StudentAnalysis/ReportCard/theme.js +1 -1
- package/lib/reporting/components/resources/common/propTypes.js +18 -2
- package/lib/taking/api/taking.js +26 -3
- package/package.json +55 -55
|
@@ -8,7 +8,7 @@ var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
|
8
8
|
phoneBreakPoint: "max-width: ".concat(breakpoints.medium),
|
|
9
9
|
popoverContentMargin: spacing.medium,
|
|
10
10
|
popoverHeaderBoxBorderWidth: borders.widthSmall,
|
|
11
|
-
popoverHeaderBoxBorderColor: colors.
|
|
11
|
+
popoverHeaderBoxBorderColor: colors.tiara
|
|
12
12
|
};
|
|
13
13
|
};
|
|
14
14
|
export default generateComponentTheme;
|
|
@@ -8,16 +8,16 @@ var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
|
8
8
|
attachQuestionButtonHolderZIndex: '2222',
|
|
9
9
|
newItemButtonMargin: spacing.xSmall,
|
|
10
10
|
newItemButtonPadding: spacing.xSmall,
|
|
11
|
-
newItemButtonBackgroundColor: colors.
|
|
11
|
+
newItemButtonBackgroundColor: colors.brand,
|
|
12
12
|
newItemButtonBorderRadius: spacing.large,
|
|
13
|
-
newItemButtonColor: colors.
|
|
14
|
-
newItemButtonFocusOutline: "2px solid ".concat(colors.
|
|
13
|
+
newItemButtonColor: colors.white,
|
|
14
|
+
newItemButtonFocusOutline: "2px solid ".concat(colors.brand),
|
|
15
15
|
newItemButtonFocusOutlineOffset: spacing.xxxSmall,
|
|
16
16
|
newItemButtonFontSize: typography.fontSizeMedium,
|
|
17
17
|
newItemButtonFontWeight: typography.fontWeightBold,
|
|
18
18
|
newItemButtonZIndex: '4444',
|
|
19
19
|
newItemButtonBoxShadow: '2px 2px 3px #ddd',
|
|
20
|
-
newItemButtonEditingBackgroundColor: colors.
|
|
20
|
+
newItemButtonEditingBackgroundColor: colors.crimson,
|
|
21
21
|
newItemButtonHolderZIndex: '2222',
|
|
22
22
|
newItemButtonTransition: "background-color ".concat(transitions.duration, " linear, transform ").concat(transitions.duration, " ease")
|
|
23
23
|
};
|
|
@@ -3,7 +3,7 @@ var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
|
3
3
|
borders = _ref.borders;
|
|
4
4
|
return {
|
|
5
5
|
borderLineBorderWidth: borders.widthMedium,
|
|
6
|
-
borderLineBorderColor: colors.
|
|
6
|
+
borderLineBorderColor: colors.porcelain
|
|
7
7
|
};
|
|
8
8
|
};
|
|
9
9
|
export default generateComponentTheme;
|
|
@@ -6,16 +6,16 @@ var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
|
6
6
|
breakpoints = _ref.breakpoints;
|
|
7
7
|
return {
|
|
8
8
|
rootBorderWidth: borders.widthSmall,
|
|
9
|
-
rootBorderColor: colors.
|
|
9
|
+
rootBorderColor: colors.porcelain,
|
|
10
10
|
instructionsPaddingTopBottom: spacing.medium,
|
|
11
11
|
instructionsPaddingLeftRight: spacing.large,
|
|
12
12
|
instructionsBorderWidth: borders.widthSmall,
|
|
13
|
-
instructionsBorderColor: colors.
|
|
13
|
+
instructionsBorderColor: colors.porcelain,
|
|
14
14
|
instructionsHeaderPadding: spacing.xSmall,
|
|
15
15
|
instructionsHeaderFontWeight: typography.fontWeightBold,
|
|
16
16
|
infoPaddingTopBottom: spacing.small,
|
|
17
17
|
infoPaddingLeftRight: spacing.medium,
|
|
18
|
-
infoBackgroundColor: colors.
|
|
18
|
+
infoBackgroundColor: colors.porcelain,
|
|
19
19
|
headerPaddingTop: spacing.xSmall,
|
|
20
20
|
headerPaddingBottom: spacing.small,
|
|
21
21
|
titleFontSize: typography.fontSizeMedium,
|
|
@@ -26,7 +26,7 @@ var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
|
26
26
|
phoneInstructionsPaddingLeftRight: spacing.small,
|
|
27
27
|
phoneInfoPadding: spacing.small,
|
|
28
28
|
phoneConnectingLinesBorderWidth: borders.widthSmall,
|
|
29
|
-
phoneConnectingLinesBorderColor: colors.
|
|
29
|
+
phoneConnectingLinesBorderColor: colors.tiara,
|
|
30
30
|
phoneConnectingLinesMargin: spacing.small
|
|
31
31
|
};
|
|
32
32
|
};
|
|
@@ -6,9 +6,9 @@ var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
|
6
6
|
return {
|
|
7
7
|
sessionItemResultPadding: spacing.small,
|
|
8
8
|
topBorderWidth: borders.widthSmall,
|
|
9
|
-
topBorderColor: colors.
|
|
9
|
+
topBorderColor: colors.tiara,
|
|
10
10
|
resultMargin: spacing.small,
|
|
11
|
-
pointsColor: colors.
|
|
11
|
+
pointsColor: colors.ash,
|
|
12
12
|
pointFontSize: typography.fontSizeXSmall,
|
|
13
13
|
questionFontSize: typography.fontSizeMedium,
|
|
14
14
|
itemFeedbackWrapperMargin: spacing.small,
|
|
@@ -17,9 +17,9 @@ var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
|
17
17
|
itemFeedbackWrapperFontSize: typography.fontSizeSmall,
|
|
18
18
|
itemFeedbackWrapperBorderStyle: borders.borderStyle,
|
|
19
19
|
itemFeedbackWrapperBorderWidth: borders.widthSmall,
|
|
20
|
-
itemFeedbackWrapperBorderColor: colors.
|
|
20
|
+
itemFeedbackWrapperBorderColor: colors.tiara,
|
|
21
21
|
itemFeedbackWrapperStyle: borders.style,
|
|
22
|
-
itemFeedbackLabelColor: colors.
|
|
22
|
+
itemFeedbackLabelColor: colors.oxford,
|
|
23
23
|
itemFeedbackLabelFontSize: typography.fontSizeXSmall,
|
|
24
24
|
itemFeedbackMargin: spacing.xxSmall,
|
|
25
25
|
itemFeedbackTextSize: typography.fontSizeMedium,
|
|
@@ -8,7 +8,7 @@ var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
|
8
8
|
sessionItemResultsListHeaderWrapperMarginLeftRight: spacing.large,
|
|
9
9
|
sessionItemResultsListHeaderFontSize: typography.fontSizeXLarge,
|
|
10
10
|
sessionItemResultsListMargin: spacing.xSmall,
|
|
11
|
-
sessionItemResultsListBorderColor: colors.
|
|
11
|
+
sessionItemResultsListBorderColor: colors.tiara,
|
|
12
12
|
sessionItemResultsListBorderWidth: borders.widthSmall
|
|
13
13
|
};
|
|
14
14
|
};
|
|
@@ -6,7 +6,7 @@ var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
|
6
6
|
return {
|
|
7
7
|
leftPanelPadding: spacing.xxSmall,
|
|
8
8
|
leftPanelBorderWidth: borders.widthSmall,
|
|
9
|
-
leftPanelBorderColor: colors.
|
|
9
|
+
leftPanelBorderColor: colors.tiara,
|
|
10
10
|
rightPanelPadding: spacing.xSmall,
|
|
11
11
|
dragAndDropHandleZIndex: '3333',
|
|
12
12
|
dragAndDropHandleFontSize: typography.fontSizeMedium,
|
|
@@ -9,7 +9,7 @@ var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
|
9
9
|
optionPadding: spacing.small,
|
|
10
10
|
stimulusContentPadding: spacing.small,
|
|
11
11
|
stimulusContentPaddingBottom: spacing.small,
|
|
12
|
-
stimulusButtonsColor: colors.
|
|
12
|
+
stimulusButtonsColor: colors.oxford,
|
|
13
13
|
stimulusButtonsZIndex: '3333'
|
|
14
14
|
};
|
|
15
15
|
};
|
|
@@ -2,12 +2,16 @@ import { bindActionCreators } from 'redux';
|
|
|
2
2
|
import { connect } from "../../../../react-redux.js";
|
|
3
3
|
import * as modificationActions from "../../../../actions/modifications.js";
|
|
4
4
|
import { featureOn } from "../../../../../common/util/featureCheck.js";
|
|
5
|
+
import { getActiveQuizId, getQuizById } from "../../../../../common/selectors/quizzes.js";
|
|
5
6
|
import StimulusEditInfo from "./presenter.js";
|
|
6
7
|
function mapStateToProps(state, props) {
|
|
8
|
+
var quizId = getActiveQuizId(state);
|
|
9
|
+
var quiz = getQuizById(state, quizId);
|
|
7
10
|
return {
|
|
8
11
|
workingStimulus: props.stimulus.getWorkingInstance(),
|
|
9
12
|
errorsShowing: state.getIn(['errorsShowing', props.guid], props.errorsShowing || false),
|
|
10
|
-
stimulusOrientationEnabled: featureOn('customizable_stimulus_orientation')
|
|
13
|
+
stimulusOrientationEnabled: featureOn('customizable_stimulus_orientation'),
|
|
14
|
+
shuffleQuestionsEnabled: quiz.shuffleQuestions
|
|
11
15
|
};
|
|
12
16
|
}
|
|
13
17
|
function mapDispatchToProps(dispatch) {
|
|
@@ -18,6 +18,7 @@ import { SimpleSelect, TextInput, TOP, withStyleOverrides, FormFieldGroup, FormF
|
|
|
18
18
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
19
19
|
import generateStyle from "./styles.js";
|
|
20
20
|
import generateComponentTheme from "./theme.js";
|
|
21
|
+
import { Alert } from '@instructure/ui-alerts';
|
|
21
22
|
var _ref3 = jsx(IconUpdownLine, {
|
|
22
23
|
rotate: "90"
|
|
23
24
|
});
|
|
@@ -96,6 +97,16 @@ export var StimulusEditInfo = (_dec = withStyleOverrides(generateStyle, generate
|
|
|
96
97
|
value: "top"
|
|
97
98
|
}, t('Questions below'))));
|
|
98
99
|
}
|
|
100
|
+
}, {
|
|
101
|
+
key: "renderPassageAlert",
|
|
102
|
+
value: function renderPassageAlert(stimulus) {
|
|
103
|
+
if (!stimulus.passage || !this.props.shuffleQuestionsEnabled) {
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
return jsx(Alert, {
|
|
107
|
+
variant: "warning"
|
|
108
|
+
}, t('The passage sections may not appear in their original order due to the shuffle setting.'));
|
|
109
|
+
}
|
|
99
110
|
}, {
|
|
100
111
|
key: "renderInstructions",
|
|
101
112
|
value: function renderInstructions(stimulus) {
|
|
@@ -146,7 +157,7 @@ export var StimulusEditInfo = (_dec = withStyleOverrides(generateStyle, generate
|
|
|
146
157
|
}, jsx(Heading, {
|
|
147
158
|
level: "h3",
|
|
148
159
|
as: "h2"
|
|
149
|
-
}, this.headerText(stimulus)), jsx("div", {
|
|
160
|
+
}, this.headerText(stimulus)), this.renderPassageAlert(stimulus), jsx("div", {
|
|
150
161
|
css: this.props.styles.section
|
|
151
162
|
}, jsx(TextInput, {
|
|
152
163
|
messages: this.inputErrors('title'),
|
|
@@ -184,9 +195,11 @@ export var StimulusEditInfo = (_dec = withStyleOverrides(generateStyle, generate
|
|
|
184
195
|
modifyStimulus: PropTypes.func.isRequired,
|
|
185
196
|
setTitleRef: PropTypes.func,
|
|
186
197
|
stimulusOrientationEnabled: PropTypes.bool.isRequired,
|
|
187
|
-
styles: PropTypes.object
|
|
198
|
+
styles: PropTypes.object,
|
|
199
|
+
shuffleQuestionsEnabled: PropTypes.bool
|
|
188
200
|
}, _StimulusEditInfo.defaultProps = {
|
|
189
201
|
isBankedContent: false,
|
|
202
|
+
shuffleQuestionsEnabled: false,
|
|
190
203
|
setTitleRef: function setTitleRef() {}
|
|
191
204
|
}, _StimulusEditInfo)) || _class);
|
|
192
205
|
export default StimulusEditInfo;
|
|
@@ -4,7 +4,7 @@ var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
|
4
4
|
colors = _ref.colors;
|
|
5
5
|
return {
|
|
6
6
|
sectionPadding: spacing.small,
|
|
7
|
-
optionalLabelColor: colors.
|
|
7
|
+
optionalLabelColor: colors.ash,
|
|
8
8
|
optionalLabelFontSize: typography.fontSizeXSmall,
|
|
9
9
|
urlLabelMargin: spacing.xSmall
|
|
10
10
|
};
|
|
@@ -11,13 +11,13 @@ import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
|
11
11
|
import { IconBankLine } from '@instructure/ui-icons';
|
|
12
12
|
import { jsx } from '@instructure/emotion';
|
|
13
13
|
import { Text } from '@instructure/ui-text';
|
|
14
|
+
import { Flex, withStyleOverrides } from '@instructure/quiz-common';
|
|
14
15
|
import StimulusShowInfo from "../StimulusShowInfo/index.js";
|
|
15
16
|
import ActionButtons from "../../../../../building/components/resources/ActionButtons/index.js";
|
|
16
17
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
17
18
|
import generateStyle from "./styles.js";
|
|
18
19
|
import generateComponentTheme from "./theme.js";
|
|
19
20
|
import Overlay from "../../../shared/overlay/index.js";
|
|
20
|
-
import { Flex, withStyleOverrides } from '@instructure/quiz-common';
|
|
21
21
|
var _ref = jsx(IconBankLine, null);
|
|
22
22
|
export var StimulusShow = (_dec = withStyleOverrides(generateStyle, generateComponentTheme), _dec(_class = (_StimulusShow = /*#__PURE__*/function (_Component) {
|
|
23
23
|
_inherits(StimulusShow, _Component);
|
|
@@ -6,13 +6,13 @@ var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
|
6
6
|
transitions = _ref.transitions;
|
|
7
7
|
return {
|
|
8
8
|
contentTransitionDuration: transitions.duration,
|
|
9
|
-
contentBackgroundColor: colors.
|
|
9
|
+
contentBackgroundColor: colors.white,
|
|
10
10
|
contentMaxWidth: '79.5rem',
|
|
11
11
|
contentMargin: spacing.medium,
|
|
12
12
|
phoneBreakPoint: "max-width: ".concat(breakpoints.medium),
|
|
13
13
|
phoneContentMargin: spacing.xSmall,
|
|
14
14
|
contentBoxShadow: shadows.depth1,
|
|
15
|
-
contentBorderColor: colors.
|
|
15
|
+
contentBorderColor: colors.tiara,
|
|
16
16
|
contentBorderRadius: '4px'
|
|
17
17
|
};
|
|
18
18
|
};
|
|
@@ -3,7 +3,7 @@ var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
|
3
3
|
breakpoints = _ref.breakpoints,
|
|
4
4
|
transitions = _ref.transitions;
|
|
5
5
|
return {
|
|
6
|
-
wrapperPadding: spacing.
|
|
6
|
+
wrapperPadding: spacing.mediumSmall,
|
|
7
7
|
wrapperTransitionDuration: transitions.duration,
|
|
8
8
|
phoneBreakPoint: "max-width: ".concat(breakpoints.medium),
|
|
9
9
|
phoneWrapperPadding: spacing.medium
|
|
@@ -4,7 +4,7 @@ var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
|
4
4
|
spacing = _ref.spacing;
|
|
5
5
|
return {
|
|
6
6
|
stimulusDividerBorderWidth: borders.widthSmall,
|
|
7
|
-
stimulusDividerBorderColor: colors.
|
|
7
|
+
stimulusDividerBorderColor: colors.ash,
|
|
8
8
|
stimulusDividerMarginTop: spacing.xSmall,
|
|
9
9
|
stimulusDividerMarginBottom: spacing.small
|
|
10
10
|
};
|
|
@@ -54,8 +54,8 @@ export var PaginatedCollection = (_dec = withStyleOverrides(generateStyle, gener
|
|
|
54
54
|
this.getPage(this.props.stateKey, this.props.currentPage, this.props.params);
|
|
55
55
|
}
|
|
56
56
|
}, {
|
|
57
|
-
key: "
|
|
58
|
-
value: function
|
|
57
|
+
key: "UNSAFE_componentWillReceiveProps",
|
|
58
|
+
value: function UNSAFE_componentWillReceiveProps(_ref) {
|
|
59
59
|
var merge = _ref.merge,
|
|
60
60
|
params = _ref.params,
|
|
61
61
|
set = _ref.set,
|
|
@@ -5,7 +5,7 @@ var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
|
5
5
|
return {
|
|
6
6
|
emptyPadding: spacing.small,
|
|
7
7
|
emptyFontSize: typography.fontSizeLarge,
|
|
8
|
-
emptyColor: colors.
|
|
8
|
+
emptyColor: colors.ash
|
|
9
9
|
};
|
|
10
10
|
};
|
|
11
11
|
export default generateComponentTheme;
|
|
@@ -179,8 +179,8 @@ export var TimeUnitsInput = /*#__PURE__*/function (_Component) {
|
|
|
179
179
|
return _this;
|
|
180
180
|
}
|
|
181
181
|
_createClass(TimeUnitsInput, [{
|
|
182
|
-
key: "
|
|
183
|
-
value: function
|
|
182
|
+
key: "UNSAFE_componentWillMount",
|
|
183
|
+
value: function UNSAFE_componentWillMount() {
|
|
184
184
|
var _breakdownSeconds5 = breakdownSeconds(this.props.timeInSeconds, this.props.includeDays),
|
|
185
185
|
days = _breakdownSeconds5.days,
|
|
186
186
|
hours = _breakdownSeconds5.hours,
|
|
@@ -4,16 +4,16 @@ var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
|
4
4
|
borders = _ref.borders;
|
|
5
5
|
return {
|
|
6
6
|
DnDZoneBorderWidth: borders.widthSmall,
|
|
7
|
-
DnDZoneBorderColor: colors.
|
|
8
|
-
DnDZoneBackgroundColor: colors.
|
|
7
|
+
DnDZoneBorderColor: colors.tiara,
|
|
8
|
+
DnDZoneBackgroundColor: colors.porcelain,
|
|
9
9
|
DnDZonePadding: spacing.medium,
|
|
10
10
|
// sidebar:
|
|
11
11
|
sidebarDnDZoneBorderWidth: borders.widthSmall,
|
|
12
|
-
sidebarDnDZoneBorderColor: colors.
|
|
13
|
-
sidebarDnDZoneBackgroundColor: colors.
|
|
12
|
+
sidebarDnDZoneBorderColor: colors.oxford,
|
|
13
|
+
sidebarDnDZoneBackgroundColor: colors.porcelain,
|
|
14
14
|
sidebarDnDZonePadding: spacing.small,
|
|
15
15
|
sidebarDnDZoneMargin: spacing.xSmall,
|
|
16
|
-
sidebarDnDZoneColor: colors.
|
|
16
|
+
sidebarDnDZoneColor: colors.licorice
|
|
17
17
|
};
|
|
18
18
|
};
|
|
19
19
|
export default generateComponentTheme;
|
|
@@ -4,7 +4,7 @@ var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
|
4
4
|
return {
|
|
5
5
|
errorFontFamily: typography.fontFamily,
|
|
6
6
|
errorFontSize: typography.fontSizeSmall,
|
|
7
|
-
errorColor: colors.
|
|
7
|
+
errorColor: colors.crimson
|
|
8
8
|
};
|
|
9
9
|
};
|
|
10
10
|
export default generateComponentTheme;
|
|
@@ -3,9 +3,9 @@ var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
|
3
3
|
spacing = _ref.spacing,
|
|
4
4
|
borders = _ref.borders;
|
|
5
5
|
return {
|
|
6
|
-
dropzoneBackgroundColor: colors.
|
|
6
|
+
dropzoneBackgroundColor: colors.porcelain,
|
|
7
7
|
dropzoneBorderWidth: borders.widthSmall,
|
|
8
|
-
dropzoneBorderColor: colors.
|
|
8
|
+
dropzoneBorderColor: colors.ash,
|
|
9
9
|
dropzonePadding: spacing.medium
|
|
10
10
|
};
|
|
11
11
|
};
|
|
@@ -55,8 +55,8 @@ var giveEditProps = function giveEditProps(ComposedComponent) {
|
|
|
55
55
|
return _this;
|
|
56
56
|
}
|
|
57
57
|
_createClass(_Class, [{
|
|
58
|
-
key: "
|
|
59
|
-
value: function
|
|
58
|
+
key: "UNSAFE_componentWillMount",
|
|
59
|
+
value: function UNSAFE_componentWillMount() {
|
|
60
60
|
this._uniqId = uniqueId("".concat(ComposedComponent.displayName, "_"));
|
|
61
61
|
}
|
|
62
62
|
}, {
|
|
@@ -67,7 +67,11 @@ var loadResponses = function loadResponses(state, payload) {
|
|
|
67
67
|
return payload.reduce(modifyResponse, state);
|
|
68
68
|
};
|
|
69
69
|
var markSessionStartedIdentifier = function markSessionStartedIdentifier(state, payload) {
|
|
70
|
-
|
|
70
|
+
var needsUpdate = state.get('browserSessionId') !== payload.browserSessionId || state.get('ipAddress') !== payload.ipAddress;
|
|
71
|
+
return needsUpdate ? state.merge({
|
|
72
|
+
browserSessionId: payload.browserSessionId,
|
|
73
|
+
ipAddress: payload.ipAddress
|
|
74
|
+
}) : state;
|
|
71
75
|
};
|
|
72
76
|
var updateQuizSubmitFlag = function updateQuizSubmitFlag(state, payload) {
|
|
73
77
|
return state.set('submitFlag', payload.value);
|
|
@@ -7,6 +7,9 @@ export var getCurrentSessionItemPosition = function getCurrentSessionItemPositio
|
|
|
7
7
|
export var getBrowserSessionId = function getBrowserSessionId(state) {
|
|
8
8
|
return state.getIn([path, 'browserSessionId']);
|
|
9
9
|
};
|
|
10
|
+
export var getIpAddress = function getIpAddress(state) {
|
|
11
|
+
return state.getIn([path, 'ipAddress']);
|
|
12
|
+
};
|
|
10
13
|
export var getTimerData = function getTimerData(state) {
|
|
11
14
|
return state.getIn([path, 'timerData'], Map());
|
|
12
15
|
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
2
|
+
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
3
|
+
import Fetcher from "./Fetcher.js";
|
|
4
|
+
export var getClientIpAddress = /*#__PURE__*/function () {
|
|
5
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(quizSessionId) {
|
|
6
|
+
var url, fetcher, _yield$fetcher$get, ip;
|
|
7
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
8
|
+
while (1) {
|
|
9
|
+
switch (_context.prev = _context.next) {
|
|
10
|
+
case 0:
|
|
11
|
+
_context.prev = 0;
|
|
12
|
+
url = "/api/quiz_sessions/".concat(quizSessionId, "/get_ip_address");
|
|
13
|
+
fetcher = new Fetcher();
|
|
14
|
+
_context.next = 5;
|
|
15
|
+
return fetcher.get(url);
|
|
16
|
+
case 5:
|
|
17
|
+
_yield$fetcher$get = _context.sent;
|
|
18
|
+
ip = _yield$fetcher$get.ip;
|
|
19
|
+
return _context.abrupt("return", ip);
|
|
20
|
+
case 10:
|
|
21
|
+
_context.prev = 10;
|
|
22
|
+
_context.t0 = _context["catch"](0);
|
|
23
|
+
console.error(_context.t0);
|
|
24
|
+
return _context.abrupt("return", null);
|
|
25
|
+
case 14:
|
|
26
|
+
case "end":
|
|
27
|
+
return _context.stop();
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}, _callee, null, [[0, 10]]);
|
|
31
|
+
}));
|
|
32
|
+
return function getClientIpAddress(_x) {
|
|
33
|
+
return _ref.apply(this, arguments);
|
|
34
|
+
};
|
|
35
|
+
}();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { QUIZ_SUBMISSION_EVENT, RESPONSE, SESSION_STARTED_OR_RESUMED_EVENT, RCE_EVENT, PAGE_BLURRED_EVENT, PAGE_FOCUSED_EVENT } from '@instructure/quiz-common';
|
|
2
|
-
import { getBrowserSessionId } from "../selectors/taking.js";
|
|
2
|
+
import { getBrowserSessionId, getIpAddress } from "../selectors/taking.js";
|
|
3
3
|
import { getActiveQuizSession } from "../selectors/quizSessions.js";
|
|
4
4
|
var whitelist = [QUIZ_SUBMISSION_EVENT, RESPONSE, SESSION_STARTED_OR_RESUMED_EVENT, RCE_EVENT, PAGE_BLURRED_EVENT, PAGE_FOCUSED_EVENT];
|
|
5
5
|
export function serializeEvent(action, store) {
|
|
@@ -10,8 +10,10 @@ export function serializeEvent(action, store) {
|
|
|
10
10
|
var state = store.getState();
|
|
11
11
|
var quizSession = getActiveQuizSession(state);
|
|
12
12
|
var defaultEventData = {
|
|
13
|
+
userAgent: navigator.userAgent,
|
|
13
14
|
browserSessionId: getBrowserSessionId(state),
|
|
14
|
-
clientTimestamp: new Date()
|
|
15
|
+
clientTimestamp: new Date(),
|
|
16
|
+
ipAddress: getIpAddress(state)
|
|
15
17
|
};
|
|
16
18
|
var authoritativeData = {
|
|
17
19
|
accountUuid: quizSession.accountUuid,
|
package/es/index.js
CHANGED
|
@@ -107,8 +107,7 @@ export { sessionStore } from "./common/util/sessionStore.js";
|
|
|
107
107
|
export { printWithCss, ensureImagesLoaded } from "./common/util/printUtils.js";
|
|
108
108
|
export { ensureRCEContentIsLoaded } from "./common/util/rceChecker.js";
|
|
109
109
|
export { applyComponentStyleOverride, withStyleOverrides, getThemeByKey, setThemeByKey, getActiveTheme, setActiveTheme } from '@instructure/quiz-common';
|
|
110
|
-
|
|
111
|
-
// APIs
|
|
110
|
+
export { getClientIpAddress } from "./common/util/getClientIpAddress.js"; // APIs
|
|
112
111
|
export { createQuizEntryRegrade } from "./grading/api/quizEntryRegrades.js";
|
|
113
112
|
export { getQuizEntry } from "./building/api/quizEntries.js";
|
|
114
113
|
export { getItem } from "./building/api/items.js";
|
|
@@ -146,7 +145,7 @@ import * as takingActionCreators from "./common/actions/taking.js";
|
|
|
146
145
|
export { takingActionCreators };
|
|
147
146
|
|
|
148
147
|
// Selectors
|
|
149
|
-
export { getQuizById, getActiveQuizId, getQuizEntryById, isActiveQuizWorkingInstanceOneQuestionAtATime, getActiveQuiz } from "./common/selectors/quizzes.js";
|
|
148
|
+
export { getQuizById, getActiveQuizId, getQuizEntryById, getQuizEntriesByQuizId, isActiveQuizWorkingInstanceOneQuestionAtATime, getActiveQuiz } from "./common/selectors/quizzes.js";
|
|
150
149
|
export { getItemById } from "./common/selectors/items.js";
|
|
151
150
|
export { fileUploading } from "./common/selectors/calls.js";
|
|
152
151
|
export { isTimeUp, getTimerData, getResponseDataByPosition } from "./common/selectors/taking.js";
|
|
@@ -6,14 +6,17 @@ var _Event;
|
|
|
6
6
|
import React, { Component } from 'react';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
9
|
-
import { RESPONSE, SESSION_STARTED_OR_RESUMED_EVENT, RCE_EVENT, PAGE_BLURRED_EVENT, PAGE_FOCUSED_EVENT } from '@instructure/quiz-common';
|
|
9
|
+
import { RESPONSE, SESSION_STARTED_OR_RESUMED_EVENT, RCE_EVENT, PAGE_BLURRED_EVENT, PAGE_FOCUSED_EVENT, QUIZ_SUBMISSION_EVENT } from '@instructure/quiz-common';
|
|
10
10
|
import { Table } from '@instructure/ui-table';
|
|
11
11
|
import ElapsedTime from "../resources/ElapsedTime.js";
|
|
12
12
|
import ResponseEvent from "./ResponseEvent.js";
|
|
13
13
|
import SessionStartEvent from "./SessionStartEvent.js";
|
|
14
|
+
import { SessionSubmitEvent } from "./SessionSubmitEvent.js";
|
|
14
15
|
import RCEEvent from "./RCEEvent.js";
|
|
15
16
|
import PageBlurredEvent from "./PageBlurredEvent.js";
|
|
16
17
|
import PageFocusedEvent from "./PageFocusedEvent.js";
|
|
18
|
+
import { extractSessionData } from "../resources/util/extractSessionData.js";
|
|
19
|
+
import { checkIsBreach } from "../resources/util/checkIsBreach.js";
|
|
17
20
|
var _ref = /*#__PURE__*/React.createElement(PageBlurredEvent, null);
|
|
18
21
|
var _ref2 = /*#__PURE__*/React.createElement(PageFocusedEvent, null);
|
|
19
22
|
export var Event = /*#__PURE__*/function (_Component) {
|
|
@@ -25,26 +28,34 @@ export var Event = /*#__PURE__*/function (_Component) {
|
|
|
25
28
|
}
|
|
26
29
|
_createClass(Event, [{
|
|
27
30
|
key: "renderResponseEvent",
|
|
28
|
-
value: function renderResponseEvent(event) {
|
|
31
|
+
value: function renderResponseEvent(event, validationErrors, currentEventData) {
|
|
29
32
|
var item = event.getItem();
|
|
30
33
|
if (!item) {
|
|
31
34
|
return null;
|
|
32
35
|
} else {
|
|
33
36
|
return /*#__PURE__*/React.createElement(ResponseEvent, {
|
|
34
37
|
event: event,
|
|
35
|
-
item: item
|
|
38
|
+
item: item,
|
|
39
|
+
validationErrors: validationErrors,
|
|
40
|
+
currentEventData: currentEventData
|
|
36
41
|
});
|
|
37
42
|
}
|
|
38
43
|
}
|
|
39
44
|
}, {
|
|
40
45
|
key: "renderPayload",
|
|
41
|
-
value: function renderPayload(event) {
|
|
46
|
+
value: function renderPayload(event, validationErrors, currentEventData) {
|
|
42
47
|
switch (event.eventType) {
|
|
43
48
|
case RESPONSE:
|
|
44
|
-
return this.renderResponseEvent(event);
|
|
49
|
+
return this.renderResponseEvent(event, validationErrors, currentEventData);
|
|
45
50
|
case SESSION_STARTED_OR_RESUMED_EVENT:
|
|
46
51
|
return /*#__PURE__*/React.createElement(SessionStartEvent, {
|
|
47
|
-
|
|
52
|
+
validationErrors: validationErrors,
|
|
53
|
+
currentEventData: currentEventData
|
|
54
|
+
});
|
|
55
|
+
case QUIZ_SUBMISSION_EVENT:
|
|
56
|
+
return /*#__PURE__*/React.createElement(SessionSubmitEvent, {
|
|
57
|
+
validationErrors: validationErrors,
|
|
58
|
+
currentEventData: currentEventData
|
|
48
59
|
});
|
|
49
60
|
case RCE_EVENT:
|
|
50
61
|
return /*#__PURE__*/React.createElement(RCEEvent, {
|
|
@@ -64,8 +75,12 @@ export var Event = /*#__PURE__*/function (_Component) {
|
|
|
64
75
|
value: function render() {
|
|
65
76
|
var _this$props = this.props,
|
|
66
77
|
event = _this$props.event,
|
|
67
|
-
startTime = _this$props.startTime
|
|
68
|
-
|
|
78
|
+
startTime = _this$props.startTime,
|
|
79
|
+
firstEvent = _this$props.firstEvent;
|
|
80
|
+
var currentEventData = extractSessionData(event);
|
|
81
|
+
var firstEventData = extractSessionData(firstEvent);
|
|
82
|
+
var validationErrors = checkIsBreach(firstEventData, currentEventData);
|
|
83
|
+
var payloadNode = this.renderPayload(event, validationErrors, currentEventData);
|
|
69
84
|
if (!payloadNode) return null;
|
|
70
85
|
return /*#__PURE__*/React.createElement(Table.Row, null, /*#__PURE__*/React.createElement(Table.Cell, null, /*#__PURE__*/React.createElement(ElapsedTime, {
|
|
71
86
|
eventTime: event.createdDate(),
|
|
@@ -82,10 +97,12 @@ Event.displayName = 'Row';
|
|
|
82
97
|
Event.componentId = "Quizzes".concat(_Event.displayName);
|
|
83
98
|
Event.propTypes = {
|
|
84
99
|
event: ImmutablePropTypes.record,
|
|
85
|
-
startTime: PropTypes.instanceOf(Date)
|
|
100
|
+
startTime: PropTypes.instanceOf(Date),
|
|
101
|
+
firstEvent: ImmutablePropTypes.record
|
|
86
102
|
};
|
|
87
103
|
Event.defaultProps = {
|
|
88
104
|
event: void 0,
|
|
89
|
-
startTime: void 0
|
|
105
|
+
startTime: void 0,
|
|
106
|
+
firstEvent: void 0
|
|
90
107
|
};
|
|
91
108
|
export default Event;
|
|
@@ -4,7 +4,7 @@ import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
|
4
4
|
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
5
5
|
var _dec, _class, _ResponseEvent;
|
|
6
6
|
/** @jsx jsx */
|
|
7
|
-
import { Component } from 'react';
|
|
7
|
+
import React, { Component } from 'react';
|
|
8
8
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
9
9
|
import PropTypes from 'prop-types';
|
|
10
10
|
import { IconImageSolid } from '@instructure/ui-icons';
|
|
@@ -14,9 +14,11 @@ import { ToggleDetails } from '@instructure/ui-toggle-details';
|
|
|
14
14
|
import { jsx } from '@instructure/emotion';
|
|
15
15
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
16
16
|
import { extractTextFromHtml } from '@instructure/quiz-interactions';
|
|
17
|
+
import { EventDetails } from "../resources/EventDetails.js";
|
|
17
18
|
import generateStyle from "./styles.js";
|
|
18
19
|
import generateComponentTheme from "./theme.js";
|
|
19
20
|
import { withStyleOverrides } from '@instructure/quiz-common';
|
|
21
|
+
import { sessionValidationErrorsPropType, eventDataPropType } from "../../../reporting/components/resources/common/propTypes.js";
|
|
20
22
|
var imgRegex = /<img.*?src=['"](.+)['"]/g;
|
|
21
23
|
export var ResponseEvent = (_dec = withStyleOverrides(generateStyle, generateComponentTheme), _dec(_class = (_ResponseEvent = /*#__PURE__*/function (_Component) {
|
|
22
24
|
_inherits(ResponseEvent, _Component);
|
|
@@ -44,13 +46,16 @@ export var ResponseEvent = (_dec = withStyleOverrides(generateStyle, generateCom
|
|
|
44
46
|
}, {
|
|
45
47
|
key: "renderTextSummary",
|
|
46
48
|
value: function renderTextSummary() {
|
|
49
|
+
var isBreach = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
|
|
47
50
|
var strippedItemBody = extractTextFromHtml(this.itemBody);
|
|
48
51
|
return jsx("span", null, this.hasMedia() && jsx(IconImageSolid, {
|
|
49
52
|
css: this.props.styles.answerMediaIcon
|
|
50
|
-
}),
|
|
53
|
+
}), jsx(Text, {
|
|
54
|
+
color: isBreach ? 'danger' : 'primary'
|
|
55
|
+
}, t('Answered question {position}: {question}', {
|
|
51
56
|
position: this.props.event.getIn(['eventData', 'position']),
|
|
52
57
|
question: strippedItemBody
|
|
53
|
-
}));
|
|
58
|
+
})));
|
|
54
59
|
}
|
|
55
60
|
}, {
|
|
56
61
|
key: "renderMedia",
|
|
@@ -78,16 +83,26 @@ export var ResponseEvent = (_dec = withStyleOverrides(generateStyle, generateCom
|
|
|
78
83
|
}, {
|
|
79
84
|
key: "render",
|
|
80
85
|
value: function render() {
|
|
86
|
+
var _this$props = this.props,
|
|
87
|
+
validationErrors = _this$props.validationErrors,
|
|
88
|
+
currentEventData = _this$props.currentEventData;
|
|
81
89
|
var responseText = this.getReadableResponseText();
|
|
82
90
|
if (responseText) {
|
|
83
91
|
// If this returns falsey, then we know to just display the stem
|
|
84
92
|
return jsx(ToggleDetails, {
|
|
85
|
-
summary: this.renderTextSummary()
|
|
86
|
-
}, this.renderMedia(),
|
|
93
|
+
summary: this.renderTextSummary(validationErrors.isBreach)
|
|
94
|
+
}, this.renderMedia(), jsx(EventDetails, {
|
|
95
|
+
currentEventData: currentEventData,
|
|
96
|
+
validationErrors: validationErrors,
|
|
97
|
+
answerValue: responseText
|
|
98
|
+
}));
|
|
87
99
|
} else {
|
|
88
100
|
return jsx(Text, {
|
|
89
101
|
size: "small"
|
|
90
|
-
}, this.renderTextSummary(),
|
|
102
|
+
}, this.renderTextSummary(validationErrors.isBreach), jsx(EventDetails, {
|
|
103
|
+
currentEventData: currentEventData,
|
|
104
|
+
validationErrors: validationErrors
|
|
105
|
+
}), this.renderMedia());
|
|
91
106
|
}
|
|
92
107
|
}
|
|
93
108
|
}, {
|
|
@@ -101,6 +116,8 @@ export var ResponseEvent = (_dec = withStyleOverrides(generateStyle, generateCom
|
|
|
101
116
|
}(Component), _ResponseEvent.displayName = 'ResponseEvent', _ResponseEvent.componentId = "Quizzes".concat(_ResponseEvent.displayName), _ResponseEvent.propTypes = {
|
|
102
117
|
event: ImmutablePropTypes.record.isRequired,
|
|
103
118
|
item: ImmutablePropTypes.record.isRequired,
|
|
104
|
-
styles: PropTypes.object
|
|
119
|
+
styles: PropTypes.object,
|
|
120
|
+
validationErrors: sessionValidationErrorsPropType,
|
|
121
|
+
currentEventData: eventDataPropType
|
|
105
122
|
}, _ResponseEvent)) || _class);
|
|
106
123
|
export default ResponseEvent;
|