@instructure/quiz-core 20.11.3-rc.2 → 20.11.3-rc.21
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/presenter.js +12 -6
- package/es/banks/components/HeaderMenu/presenter.js +40 -1
- package/es/banks/components/HeaderMenu/styles.js +3 -0
- package/es/banks/components/NavWrapper/presenter.js +6 -1
- package/es/banks/components/SharingModal/presenter.js +1 -1
- package/es/building/components/resources/quizEntry/QuizEntry/index.js +2 -1
- package/es/building/components/resources/quizEntry/QuizEntry/presenter.js +23 -29
- package/es/building/components/resources/quizEntry/QuizEntry/quizEntryPresenterWrapper.js +39 -0
- package/es/building/components/resources/quizEntry/QuizEntry/styles.js +23 -0
- package/es/building/components/resources/quizEntry/QuizEntry/theme.js +4 -2
- package/es/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankEdit/presenter.js +35 -43
- package/es/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankEdit/styles.js +30 -0
- package/es/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankEdit/theme.js +4 -2
- package/es/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankShow/index.js +25 -31
- package/es/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankShow/styles.js +19 -0
- package/es/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankShow/theme.js +4 -2
- package/es/building/components/resources/quizEntry/QuizEntryEdit/Footer/presenter.js +27 -33
- package/es/building/components/resources/quizEntry/QuizEntryEdit/Footer/styles.js +28 -0
- package/es/building/components/resources/quizEntry/QuizEntryEdit/Footer/theme.js +4 -2
- package/es/building/components/resources/quizEntry/QuizEntryEdit/Header/index.js +32 -37
- package/es/building/components/resources/quizEntry/QuizEntryEdit/Header/styles.js +49 -0
- package/es/building/components/resources/quizEntry/QuizEntryEdit/Header/theme.js +4 -2
- package/es/building/components/resources/quizEntry/QuizEntryEdit/presenter.js +23 -23
- package/es/building/components/resources/quizEntry/QuizEntryEdit/styles.js +21 -0
- package/es/building/components/resources/quizEntry/QuizEntryEdit/theme.js +4 -2
- package/es/building/components/resources/quizEntry/QuizEntryShow/presenter.js +36 -50
- package/es/building/components/resources/quizEntry/QuizEntryShow/styles.js +84 -0
- package/es/building/components/resources/quizEntry/QuizEntryShow/theme.js +4 -2
- package/es/common/components/layout/navbar/SecondaryNavBarButton/index.js +1 -1
- package/es/common/components/layout/navbar/index.js +135 -38
- package/es/common/components/layout/navbar/styles.js +8 -0
- package/es/common/components/layout/navbar/theme.js +10 -0
- package/es/common/components/resources/stimulus/Stimulus/presenter.js +40 -50
- package/es/common/components/resources/stimulus/Stimulus/styles.js +58 -0
- package/es/common/components/resources/stimulus/Stimulus/theme.js +4 -2
- package/es/common/components/resources/stimulus/StimulusEdit/presenter.js +37 -46
- package/es/common/components/resources/stimulus/StimulusEdit/styles.js +46 -0
- package/es/common/components/resources/stimulus/StimulusEdit/theme.js +4 -2
- package/es/common/components/shared/overlayEmotion/index.js +1 -1
- package/es/common/components/shared/return_button/ReturnButton.js +4 -1
- package/es/moderating/components/resources/ModerateTable/presenter.js +44 -46
- package/es/moderating/components/resources/ModerateTable/styles.js +23 -0
- package/es/moderating/components/resources/ModerateTable/theme.js +4 -2
- package/es/moderating/components/resources/ModerateTableRow/presenter.js +63 -68
- package/es/moderating/components/resources/ModerateTableRow/styles.js +25 -0
- package/es/moderating/components/resources/ModerateTableRow/theme.js +4 -2
- package/es/reporting/components/quizAnalysis/QuizAnalysisOverview.js +34 -41
- package/es/reporting/components/quizAnalysis/styles.js +27 -0
- package/es/reporting/components/quizAnalysis/theme.js +4 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/ChoiceTypeTableRow/presenter.js +43 -43
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/ChoiceTypeTableRow/styles.js +41 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/ChoiceTypeTableRow/theme.js +6 -3
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/presenter.js +20 -26
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/styles.js +19 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/theme.js +4 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/MatchingTypeTable/presenter.js +45 -47
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/MatchingTypeTable/styles.js +52 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/MatchingTypeTable/theme.js +4 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/ChoiceTypeWithInfo/presenter.js +2 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/presenter.js +2 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/RichFillBlankType/ChoiceGroupTypeTable/presenter.js +2 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsPartsContainer/presenter.js +32 -26
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsPartsContainer/styles.js +14 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsPartsContainer/theme.js +4 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AggregationTable/presenter.js +38 -53
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AggregationTable/styles.js +141 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AggregationTable/theme.js +10 -7
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ChoiceTypeTable/presenter.js +80 -61
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ChoiceTypeTable/styles.js +93 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ChoiceTypeTable/theme.js +8 -5
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/MetricPopover/presenter.js +31 -26
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/MetricPopover/styles.js +15 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/MetricPopover/theme.js +4 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/presenter.js +80 -79
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/styles.js +75 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/theme.js +4 -2
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/presenter.js +47 -49
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/styles.js +14 -0
- package/es/reporting/components/resources/NewQuizAndItemAnalysis/theme.js +4 -2
- package/lib/banks/components/Bank/presenter.js +10 -5
- package/lib/banks/components/HeaderMenu/presenter.js +42 -1
- package/lib/banks/components/HeaderMenu/styles.js +3 -0
- package/lib/banks/components/NavWrapper/presenter.js +6 -1
- package/lib/banks/components/SharingModal/presenter.js +1 -1
- package/lib/building/components/resources/quizEntry/QuizEntry/index.js +3 -1
- package/lib/building/components/resources/quizEntry/QuizEntry/presenter.js +22 -30
- package/lib/building/components/resources/quizEntry/QuizEntry/quizEntryPresenterWrapper.js +51 -0
- package/lib/building/components/resources/quizEntry/QuizEntry/styles.js +33 -0
- package/lib/building/components/resources/quizEntry/QuizEntry/theme.js +6 -3
- package/lib/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankEdit/presenter.js +34 -45
- package/lib/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankEdit/styles.js +38 -0
- package/lib/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankEdit/theme.js +6 -3
- package/lib/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankShow/index.js +24 -33
- package/lib/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankShow/styles.js +27 -0
- package/lib/building/components/resources/quizEntry/QuizEntryBank/QuizEntryBankShow/theme.js +6 -3
- package/lib/building/components/resources/quizEntry/QuizEntryEdit/Footer/presenter.js +26 -35
- package/lib/building/components/resources/quizEntry/QuizEntryEdit/Footer/styles.js +38 -0
- package/lib/building/components/resources/quizEntry/QuizEntryEdit/Footer/theme.js +6 -3
- package/lib/building/components/resources/quizEntry/QuizEntryEdit/Header/index.js +30 -38
- package/lib/building/components/resources/quizEntry/QuizEntryEdit/Header/styles.js +57 -0
- package/lib/building/components/resources/quizEntry/QuizEntryEdit/Header/theme.js +6 -3
- package/lib/building/components/resources/quizEntry/QuizEntryEdit/presenter.js +20 -22
- package/lib/building/components/resources/quizEntry/QuizEntryEdit/styles.js +29 -0
- package/lib/building/components/resources/quizEntry/QuizEntryEdit/theme.js +6 -3
- package/lib/building/components/resources/quizEntry/QuizEntryShow/presenter.js +36 -53
- package/lib/building/components/resources/quizEntry/QuizEntryShow/styles.js +95 -0
- package/lib/building/components/resources/quizEntry/QuizEntryShow/theme.js +6 -3
- package/lib/common/components/layout/navbar/SecondaryNavBarButton/index.js +1 -1
- package/lib/common/components/layout/navbar/index.js +130 -39
- package/lib/common/components/layout/navbar/styles.js +16 -0
- package/lib/common/components/layout/navbar/theme.js +18 -0
- package/lib/common/components/resources/stimulus/Stimulus/presenter.js +38 -52
- package/lib/common/components/resources/stimulus/Stimulus/styles.js +70 -0
- package/lib/common/components/resources/stimulus/Stimulus/theme.js +6 -3
- package/lib/common/components/resources/stimulus/StimulusEdit/presenter.js +36 -47
- package/lib/common/components/resources/stimulus/StimulusEdit/styles.js +54 -0
- package/lib/common/components/resources/stimulus/StimulusEdit/theme.js +6 -3
- package/lib/common/components/shared/overlayEmotion/index.js +1 -1
- package/lib/common/components/shared/return_button/ReturnButton.js +4 -1
- package/lib/moderating/components/resources/ModerateTable/presenter.js +43 -50
- package/lib/moderating/components/resources/ModerateTable/styles.js +33 -0
- package/lib/moderating/components/resources/ModerateTable/theme.js +6 -3
- package/lib/moderating/components/resources/ModerateTableRow/presenter.js +61 -70
- package/lib/moderating/components/resources/ModerateTableRow/styles.js +33 -0
- package/lib/moderating/components/resources/ModerateTableRow/theme.js +6 -3
- package/lib/reporting/components/quizAnalysis/QuizAnalysisOverview.js +33 -43
- package/lib/reporting/components/quizAnalysis/styles.js +37 -0
- package/lib/reporting/components/quizAnalysis/theme.js +6 -3
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/ChoiceTypeTableRow/presenter.js +42 -47
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/ChoiceTypeTableRow/styles.js +51 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/ChoiceTypeTableRow/theme.js +8 -4
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/presenter.js +19 -28
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/styles.js +27 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/LegacyChoiceType/theme.js +6 -3
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/MatchingTypeTable/presenter.js +45 -52
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/MatchingTypeTable/styles.js +62 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/MatchingType/MatchingTypeTable/theme.js +6 -3
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/ChoiceTypeWithInfo/presenter.js +2 -2
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/NumericType/presenter.js +2 -2
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/RichFillBlankType/ChoiceGroupTypeTable/presenter.js +2 -2
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsPartsContainer/presenter.js +28 -26
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsPartsContainer/styles.js +24 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AfsPartsContainer/theme.js +6 -3
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AggregationTable/presenter.js +37 -55
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AggregationTable/styles.js +149 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/AggregationTable/theme.js +12 -8
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ChoiceTypeTable/presenter.js +81 -65
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ChoiceTypeTable/styles.js +103 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/AnswerFrequencySummary/shared/ChoiceTypeTable/theme.js +10 -6
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/MetricPopover/presenter.js +30 -28
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/MetricPopover/styles.js +23 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/MetricPopover/theme.js +6 -3
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/presenter.js +82 -84
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/styles.js +85 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/NewItemAnalysis/theme.js +6 -3
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/presenter.js +43 -48
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/styles.js +22 -0
- package/lib/reporting/components/resources/NewQuizAndItemAnalysis/theme.js +6 -3
- package/package.json +9 -9
- package/es/common/components/layout/navbar/presenter.js +0 -114
- package/lib/common/components/layout/navbar/presenter.js +0 -136
|
@@ -5,29 +5,22 @@ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
|
5
5
|
|
|
6
6
|
var _dec, _class, _class2, _temp;
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
/** @jsx jsx */
|
|
9
|
+
import { Component } from 'react';
|
|
9
10
|
import PropTypes from 'prop-types';
|
|
10
11
|
import { View } from '@instructure/ui-view';
|
|
11
12
|
import { Alert } from '@instructure/ui-alerts';
|
|
12
13
|
import { Text } from '@instructure/ui-text';
|
|
13
|
-
import {
|
|
14
|
+
import { withStyle, jsx } from '@instructure/emotion';
|
|
14
15
|
import Bank from "../../../../../../common/records/Bank.js";
|
|
15
16
|
import QuizEntry from "../../../../../../common/records/QuizEntry.js";
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
template: function template(theme) {
|
|
19
|
-
return "\n\n.BXWam_cLXE{background-color:".concat(theme.quizEntryBankBackgroundColor || 'inherit', ";border:").concat(theme.quizEntryBankBorderSize || 'inherit', " dashed ").concat(theme.quizEntryBankBorderColor || 'inherit', ";cursor:pointer;margin-top:").concat(theme.quizEntryBankTopMargin || 'inherit', ";padding:").concat(theme.quizEntryBankPadding || 'inherit', "}\n\n.BXWam_dpNC,[dir=ltr] .BXWam_dpNC,[dir=rtl] .BXWam_dpNC{text-align:left}\n\n.BXWam_ekHz{margin-bottom:").concat(theme.alertWrapperMargin || 'inherit', "}");
|
|
20
|
-
},
|
|
21
|
-
'quizEntryBank': 'BXWam_cLXE',
|
|
22
|
-
'quizEntryBankText': 'BXWam_dpNC',
|
|
23
|
-
'alertWrapper': 'BXWam_ekHz'
|
|
24
|
-
};
|
|
25
|
-
import theme from "./theme.js";
|
|
17
|
+
import generateStyle from "./styles.js";
|
|
18
|
+
import generateComponentTheme from "./theme.js";
|
|
26
19
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
27
20
|
|
|
28
|
-
var _ref =
|
|
21
|
+
var _ref = jsx("br", null);
|
|
29
22
|
|
|
30
|
-
export var QuizEntryBank = (_dec =
|
|
23
|
+
export var QuizEntryBank = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
31
24
|
_inherits(QuizEntryBank, _Component);
|
|
32
25
|
|
|
33
26
|
var _super = _createSuper(QuizEntryBank);
|
|
@@ -41,24 +34,24 @@ export var QuizEntryBank = (_dec = themeable(theme, styles), _dec(_class = (_tem
|
|
|
41
34
|
_createClass(QuizEntryBank, [{
|
|
42
35
|
key: "renderSampleError",
|
|
43
36
|
value: function renderSampleError() {
|
|
44
|
-
return
|
|
45
|
-
|
|
46
|
-
},
|
|
37
|
+
return jsx("div", {
|
|
38
|
+
css: this.props.styles.alertWrapper
|
|
39
|
+
}, jsx(Alert, {
|
|
47
40
|
variant: "error"
|
|
48
|
-
},
|
|
41
|
+
}, jsx(Text, {
|
|
49
42
|
color: "primary"
|
|
50
|
-
},
|
|
43
|
+
}, jsx("b", null, t('Max number of bank questions exceeded! ')), t("{ number, plural,\n one {This bank contains 1 question.}\n other {This bank contains # questions.}\n } ", {
|
|
51
44
|
number: this.props.entry.itemEntryCount
|
|
52
45
|
}))));
|
|
53
46
|
}
|
|
54
47
|
}, {
|
|
55
48
|
key: "renderDeletedError",
|
|
56
49
|
value: function renderDeletedError() {
|
|
57
|
-
return
|
|
58
|
-
|
|
59
|
-
},
|
|
50
|
+
return jsx("div", {
|
|
51
|
+
css: this.props.styles.alertWrapper
|
|
52
|
+
}, jsx(Alert, {
|
|
60
53
|
variant: "error"
|
|
61
|
-
},
|
|
54
|
+
}, jsx(Text, {
|
|
62
55
|
color: "primary"
|
|
63
56
|
}, t('Item bank no longer exists!'))));
|
|
64
57
|
}
|
|
@@ -82,22 +75,22 @@ export var QuizEntryBank = (_dec = themeable(theme, styles), _dec(_class = (_tem
|
|
|
82
75
|
value: function renderContent() {
|
|
83
76
|
var sampleNum = this.props.quizEntry.sampleNum;
|
|
84
77
|
if (!sampleNum) sampleNum = 0;
|
|
85
|
-
return
|
|
86
|
-
|
|
87
|
-
},
|
|
78
|
+
return jsx("div", {
|
|
79
|
+
css: this.props.styles.quizEntryBankText
|
|
80
|
+
}, jsx(Text, {
|
|
88
81
|
color: "primary"
|
|
89
82
|
}, t("{ number, plural,\n =0 { All questions pulled from bank: }\n one {# question pulled randomly from bank: }\n other {# questions pulled randomly from bank: }\n } ", {
|
|
90
83
|
number: sampleNum
|
|
91
|
-
}),
|
|
84
|
+
}), jsx("b", null, this.props.entry.title), _ref, t("{ number, plural,\n one {# point per question }\n other {# points per question }\n }", {
|
|
92
85
|
number: this.props.quizEntry.pointsPossible
|
|
93
86
|
})));
|
|
94
87
|
}
|
|
95
88
|
}, {
|
|
96
89
|
key: "render",
|
|
97
90
|
value: function render() {
|
|
98
|
-
return
|
|
99
|
-
|
|
100
|
-
},
|
|
91
|
+
return jsx("div", {
|
|
92
|
+
css: this.props.styles.quizEntryBank
|
|
93
|
+
}, jsx(View, {
|
|
101
94
|
size: "medium",
|
|
102
95
|
textAlign: "center",
|
|
103
96
|
margin: "0 auto",
|
|
@@ -110,6 +103,7 @@ export var QuizEntryBank = (_dec = themeable(theme, styles), _dec(_class = (_tem
|
|
|
110
103
|
return QuizEntryBank;
|
|
111
104
|
}(Component), _class2.propTypes = {
|
|
112
105
|
entry: PropTypes.instanceOf(Bank).isRequired,
|
|
113
|
-
quizEntry: PropTypes.instanceOf(QuizEntry).isRequired
|
|
106
|
+
quizEntry: PropTypes.instanceOf(QuizEntry).isRequired,
|
|
107
|
+
styles: PropTypes.object
|
|
114
108
|
}, _temp)) || _class);
|
|
115
109
|
export default QuizEntryBank;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
var generateStyle = function generateStyle(componentTheme) {
|
|
2
|
+
return {
|
|
3
|
+
quizEntryBank: {
|
|
4
|
+
backgroundColor: componentTheme.quizEntryBankBackgroundColor,
|
|
5
|
+
border: "".concat(componentTheme.quizEntryBankBorderSize, " dashed ").concat(componentTheme.quizEntryBankBorderColor),
|
|
6
|
+
cursor: 'pointer',
|
|
7
|
+
padding: componentTheme.quizEntryBankPadding,
|
|
8
|
+
marginTop: componentTheme.quizEntryBankTopMargin
|
|
9
|
+
},
|
|
10
|
+
quizEntryBankText: {
|
|
11
|
+
textAlign: 'left'
|
|
12
|
+
},
|
|
13
|
+
alertWrapper: {
|
|
14
|
+
marginBottom: componentTheme.alertWrapperMargin
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export default generateStyle;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
2
2
|
var spacing = _ref.spacing,
|
|
3
3
|
colors = _ref.colors,
|
|
4
4
|
typography = _ref.typography,
|
|
@@ -10,4 +10,6 @@ export default function generator(_ref) {
|
|
|
10
10
|
quizEntryBankTopMargin: spacing.small,
|
|
11
11
|
alertWrapperMargin: spacing.small
|
|
12
12
|
};
|
|
13
|
-
}
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export default generateComponentTheme;
|
|
@@ -6,7 +6,8 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
|
6
6
|
|
|
7
7
|
var _dec, _class, _class2, _temp;
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
/** @jsx jsx */
|
|
10
|
+
import { Component } from 'react';
|
|
10
11
|
import PropTypes from 'prop-types';
|
|
11
12
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
12
13
|
import { View } from '@instructure/ui-view';
|
|
@@ -15,23 +16,14 @@ import { ScreenReaderContent } from '@instructure/ui-a11y-content';
|
|
|
15
16
|
import { Text } from '@instructure/ui-text';
|
|
16
17
|
import NumberInput from '@instructure/quiz-number-input';
|
|
17
18
|
import { IconButton } from '@instructure/ui-buttons';
|
|
18
|
-
import {
|
|
19
|
+
import { withStyle, jsx } from '@instructure/emotion';
|
|
19
20
|
import { IconDiscussionLine, IconDiscussionSolid } from '@instructure/ui-icons';
|
|
20
21
|
import { interactionPoints } from '@instructure/quiz-interactions';
|
|
21
22
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
22
23
|
import EntrySave from "../../../../../../common/components/resources/entry/EntrySave/index.js";
|
|
23
24
|
import { ITEM_FEEDBACK_MODAL, ITEM_FEEDBACK_MODAL_ITEM, ITEM_FEEDBACK_MODAL_FEEDBACK } from '@instructure/quiz-common';
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
template: function template(theme) {
|
|
27
|
-
return "\n\n.kXHyM_bVuu{align-items:center;display:inline-flex;flex-wrap:nowrap}\n\n.kXHyM_fsXS,.kXHyM_djwg{align-items:center;display:flex}\n\n.kXHyM_fsXS{margin-left:".concat(theme.feedbackSectionLeftMargin || 'inherit', "}\n\n.kXHyM_duRV{display:inline-flex;font-size:").concat(theme.pointsInputFontSize || 'inherit', ";width:6.1rem}");
|
|
28
|
-
},
|
|
29
|
-
'leftFooter': 'kXHyM_bVuu',
|
|
30
|
-
'feedbackSection': 'kXHyM_fsXS',
|
|
31
|
-
'pointsSection': 'kXHyM_djwg',
|
|
32
|
-
'pointsInput': 'kXHyM_duRV'
|
|
33
|
-
};
|
|
34
|
-
import theme from "./theme.js";
|
|
25
|
+
import generateStyle from "./styles.js";
|
|
26
|
+
import generateComponentTheme from "./theme.js";
|
|
35
27
|
|
|
36
28
|
function pointsAsFloat(pointsString) {
|
|
37
29
|
return parseFloat(pointsString) || 0;
|
|
@@ -48,7 +40,7 @@ function countDecimals(normalizedPointsString) {
|
|
|
48
40
|
return decimals ? decimals.length : 0;
|
|
49
41
|
}
|
|
50
42
|
|
|
51
|
-
export var QuizEntryEditFooter = (_dec =
|
|
43
|
+
export var QuizEntryEditFooter = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
52
44
|
_inherits(QuizEntryEditFooter, _Component);
|
|
53
45
|
|
|
54
46
|
var _super = _createSuper(QuizEntryEditFooter);
|
|
@@ -162,10 +154,11 @@ export var QuizEntryEditFooter = (_dec = themeable(theme, styles), _dec(_class =
|
|
|
162
154
|
text = t('Edit Question Level Feedback');
|
|
163
155
|
}
|
|
164
156
|
|
|
165
|
-
return
|
|
166
|
-
className:
|
|
157
|
+
return jsx("div", {
|
|
158
|
+
className: "feedbackSection",
|
|
159
|
+
css: this.props.styles.feedbackSection,
|
|
167
160
|
"data-automation": "sdk-quiz-entry-edit-footer-feedback-section"
|
|
168
|
-
},
|
|
161
|
+
}, jsx(IconButton, {
|
|
169
162
|
onClick: this.openFeedbackModal,
|
|
170
163
|
withBackground: false,
|
|
171
164
|
withBorder: false,
|
|
@@ -179,28 +172,28 @@ export var QuizEntryEditFooter = (_dec = themeable(theme, styles), _dec(_class =
|
|
|
179
172
|
}, {
|
|
180
173
|
key: "renderPointsSection",
|
|
181
174
|
value: function renderPointsSection() {
|
|
182
|
-
return
|
|
183
|
-
|
|
184
|
-
},
|
|
185
|
-
|
|
186
|
-
},
|
|
187
|
-
renderLabel:
|
|
175
|
+
return jsx("div", {
|
|
176
|
+
css: this.props.styles.pointsSection
|
|
177
|
+
}, jsx("span", {
|
|
178
|
+
css: this.props.styles.pointsInput
|
|
179
|
+
}, jsx(NumberInput, {
|
|
180
|
+
renderLabel: jsx(ScreenReaderContent, null, t('Points Possible Input')),
|
|
188
181
|
onChange: this.handlePointsChange,
|
|
189
182
|
onBlur: this.handlePointsBlur,
|
|
190
183
|
value: this.state.points,
|
|
191
184
|
disabled: this.pointsDisabled(),
|
|
192
185
|
"data-automation": "sdk-points-possible-numberinput"
|
|
193
|
-
})),
|
|
186
|
+
})), jsx(View, {
|
|
194
187
|
margin: "none none none x-small"
|
|
195
|
-
},
|
|
188
|
+
}, jsx(Text, {
|
|
196
189
|
size: "small"
|
|
197
190
|
}, t('Points'))));
|
|
198
191
|
}
|
|
199
192
|
}, {
|
|
200
193
|
key: "renderLeftFooter",
|
|
201
194
|
value: function renderLeftFooter() {
|
|
202
|
-
return
|
|
203
|
-
|
|
195
|
+
return jsx("div", {
|
|
196
|
+
css: this.props.styles.leftFooter
|
|
204
197
|
}, this.renderPointsSection(), this.renderFeedbackSection());
|
|
205
198
|
}
|
|
206
199
|
}, {
|
|
@@ -210,7 +203,7 @@ export var QuizEntryEditFooter = (_dec = themeable(theme, styles), _dec(_class =
|
|
|
210
203
|
return this.props.alternativeRightFooter();
|
|
211
204
|
}
|
|
212
205
|
|
|
213
|
-
return
|
|
206
|
+
return jsx(EntrySave, {
|
|
214
207
|
clearChanges: this.props.clearChanges,
|
|
215
208
|
disableSubmit: this.props.disableSubmit,
|
|
216
209
|
displayPosition: this.props.displayPosition,
|
|
@@ -224,17 +217,17 @@ export var QuizEntryEditFooter = (_dec = themeable(theme, styles), _dec(_class =
|
|
|
224
217
|
}, {
|
|
225
218
|
key: "render",
|
|
226
219
|
value: function render() {
|
|
227
|
-
return
|
|
220
|
+
return jsx(View, {
|
|
228
221
|
as: "div",
|
|
229
222
|
background: "secondary",
|
|
230
223
|
padding: "xx-small none"
|
|
231
|
-
},
|
|
224
|
+
}, jsx(Flex, {
|
|
232
225
|
wrap: "wrap",
|
|
233
226
|
justifyItems: "space-between",
|
|
234
227
|
alignItems: "center"
|
|
235
|
-
},
|
|
228
|
+
}, jsx(Flex.Item, {
|
|
236
229
|
padding: "xx-small small"
|
|
237
|
-
}, this.renderLeftFooter()),
|
|
230
|
+
}, this.renderLeftFooter()), jsx(Flex.Item, {
|
|
238
231
|
padding: "xx-small small"
|
|
239
232
|
}, this.renderRightFooter())));
|
|
240
233
|
}
|
|
@@ -260,7 +253,8 @@ export var QuizEntryEditFooter = (_dec = themeable(theme, styles), _dec(_class =
|
|
|
260
253
|
workingEntry: ImmutablePropTypes.record.isRequired,
|
|
261
254
|
// This prop is flagged as unused, but it is actually used
|
|
262
255
|
// eslint-disable-next-line react/no-unused-prop-types
|
|
263
|
-
workingQuizEntry: ImmutablePropTypes.record.isRequired
|
|
256
|
+
workingQuizEntry: ImmutablePropTypes.record.isRequired,
|
|
257
|
+
styles: PropTypes.object
|
|
264
258
|
}, _class2.defaultProps = {
|
|
265
259
|
alternativeRightFooter: null,
|
|
266
260
|
disableSubmit: false,
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
|
|
3
|
+
var generateStyle = function generateStyle(componentTheme) {
|
|
4
|
+
var sectionStyle = {
|
|
5
|
+
display: 'flex',
|
|
6
|
+
alignItems: 'center'
|
|
7
|
+
};
|
|
8
|
+
return {
|
|
9
|
+
leftFooter: {
|
|
10
|
+
display: 'inline-flex',
|
|
11
|
+
flexWrap: 'nowrap',
|
|
12
|
+
alignItems: 'center'
|
|
13
|
+
},
|
|
14
|
+
pointsSection: sectionStyle,
|
|
15
|
+
feedbackSection: _objectSpread(_objectSpread({}, sectionStyle), {}, {
|
|
16
|
+
marginLeft: componentTheme.feedbackSectionLeftMarg
|
|
17
|
+
}),
|
|
18
|
+
pointsInput: {
|
|
19
|
+
width: '6.1rem',
|
|
20
|
+
|
|
21
|
+
/* wide enough to fit 3 decimal places (i.e. 8.888) */
|
|
22
|
+
fontSize: componentTheme.pointsInputFontSize,
|
|
23
|
+
display: 'inline-flex'
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export default generateStyle;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
2
2
|
var spacing = _ref.spacing,
|
|
3
3
|
colors = _ref.colors,
|
|
4
4
|
typography = _ref.typography,
|
|
@@ -7,4 +7,6 @@ export default function generator(_ref) {
|
|
|
7
7
|
feedbackSectionLeftMargin: spacing.xSmall,
|
|
8
8
|
pointsInputFontSize: typography.fontSizeMedium
|
|
9
9
|
};
|
|
10
|
-
}
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export default generateComponentTheme;
|
|
@@ -7,14 +7,15 @@ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
|
7
7
|
|
|
8
8
|
var _dec, _class, _class2, _temp;
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
/** @jsx jsx */
|
|
11
|
+
import { Component } from 'react';
|
|
11
12
|
import PropTypes from 'prop-types';
|
|
12
13
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
13
14
|
import partial from 'lodash/partial';
|
|
14
15
|
import { ScreenReaderContent } from '@instructure/ui-a11y-content';
|
|
15
16
|
import { CondensedButton } from '@instructure/ui-buttons';
|
|
16
17
|
import { TextInput } from '@instructure/ui-text-input';
|
|
17
|
-
import {
|
|
18
|
+
import { withStyle, jsx, Global } from '@instructure/emotion';
|
|
18
19
|
import { FillBlankInteractionType } from '@instructure/quiz-interactions';
|
|
19
20
|
import { IconBankLine } from '@instructure/ui-icons';
|
|
20
21
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
@@ -23,23 +24,12 @@ import PositionBox from "../../../../../../common/components/resources/positionB
|
|
|
23
24
|
import Item from "../../../../../../common/records/Item.js";
|
|
24
25
|
import ActionButtons from "../../../ActionButtons/index.js";
|
|
25
26
|
import { DELETED_QUIZ_ENTRY, API_INPUT_VALIDATION_ERROR, BUILD_TRAY_OPEN } from '@instructure/quiz-common';
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
'leftHeader': 'cCKjK_cKlw',
|
|
33
|
-
'interactionType': 'cCKjK_ecuB',
|
|
34
|
-
'dividingLine': 'cCKjK_epFc',
|
|
35
|
-
'titleHolder': 'cCKjK_dFsQ',
|
|
36
|
-
'titleInput': 'cCKjK_eGPC'
|
|
37
|
-
};
|
|
38
|
-
import theme from "./theme.js";
|
|
39
|
-
|
|
40
|
-
var _ref2 = /*#__PURE__*/React.createElement(IconBankLine, null);
|
|
41
|
-
|
|
42
|
-
var QuizEntryHeader = (_dec = themeable(theme, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
27
|
+
import generateStyle from "./styles.js";
|
|
28
|
+
import generateComponentTheme from "./theme.js";
|
|
29
|
+
|
|
30
|
+
var _ref2 = jsx(IconBankLine, null);
|
|
31
|
+
|
|
32
|
+
var QuizEntryHeader = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
43
33
|
_inherits(QuizEntryHeader, _Component);
|
|
44
34
|
|
|
45
35
|
var _super = _createSuper(QuizEntryHeader);
|
|
@@ -239,7 +229,7 @@ var QuizEntryHeader = (_dec = themeable(theme, styles), _dec(_class = (_temp = _
|
|
|
239
229
|
key: "renderName",
|
|
240
230
|
value: function renderName() {
|
|
241
231
|
if (this.props.quizEntry.isBank && this.props.newActiveBank) {
|
|
242
|
-
return
|
|
232
|
+
return jsx(CondensedButton, {
|
|
243
233
|
size: "small",
|
|
244
234
|
margin: "0 0 0 x-small",
|
|
245
235
|
onClick: this.handleBankClick,
|
|
@@ -247,8 +237,8 @@ var QuizEntryHeader = (_dec = themeable(theme, styles), _dec(_class = (_temp = _
|
|
|
247
237
|
}, this.props.name);
|
|
248
238
|
}
|
|
249
239
|
|
|
250
|
-
return
|
|
251
|
-
|
|
240
|
+
return jsx("div", {
|
|
241
|
+
css: this.props.styles.interactionType,
|
|
252
242
|
"data-automation": "sdk-quiz-entry-interaction-type"
|
|
253
243
|
}, this.props.name);
|
|
254
244
|
}
|
|
@@ -268,13 +258,13 @@ var QuizEntryHeader = (_dec = themeable(theme, styles), _dec(_class = (_temp = _
|
|
|
268
258
|
questionNumber: displayPosition,
|
|
269
259
|
interactionType: entry.getInteractionType().name
|
|
270
260
|
});
|
|
271
|
-
return
|
|
272
|
-
|
|
273
|
-
},
|
|
274
|
-
|
|
275
|
-
},
|
|
261
|
+
return jsx("div", {
|
|
262
|
+
css: this.props.styles.titleHolder
|
|
263
|
+
}, jsx("span", {
|
|
264
|
+
css: this.props.styles.titleInput
|
|
265
|
+
}, jsx(TextInput, {
|
|
276
266
|
ref: this.storeTitleRef,
|
|
277
|
-
renderLabel:
|
|
267
|
+
renderLabel: jsx(ScreenReaderContent, null, titleLabelText),
|
|
278
268
|
type: "text",
|
|
279
269
|
placeholder: t('Question Title'),
|
|
280
270
|
onChange: this.handleTitleChange,
|
|
@@ -290,14 +280,15 @@ var QuizEntryHeader = (_dec = themeable(theme, styles), _dec(_class = (_temp = _
|
|
|
290
280
|
position: this.props.displayPosition
|
|
291
281
|
});
|
|
292
282
|
var position = this.props.disabledForRegrade ? this.props.displayPosition : this.props.quizEntry.positionToDisplay(this.props.displayPosition);
|
|
293
|
-
return
|
|
294
|
-
className:
|
|
295
|
-
|
|
283
|
+
return jsx("div", {
|
|
284
|
+
className: "leftHeader",
|
|
285
|
+
css: this.props.styles.leftHeader
|
|
286
|
+
}, jsx(PositionBox, {
|
|
296
287
|
position: position,
|
|
297
288
|
headingText: positionText,
|
|
298
289
|
"data-automation": "sdk-quiz-entry-positionbox"
|
|
299
|
-
}), this.renderBankedContent(), this.renderName(),
|
|
300
|
-
|
|
290
|
+
}), this.renderBankedContent(), this.renderName(), jsx("div", {
|
|
291
|
+
css: this.props.styles.dividingLine
|
|
301
292
|
}), this.renderTitleHolder());
|
|
302
293
|
}
|
|
303
294
|
}, {
|
|
@@ -316,9 +307,12 @@ var QuizEntryHeader = (_dec = themeable(theme, styles), _dec(_class = (_temp = _
|
|
|
316
307
|
shouldDisableDeleteButton: this.props.disabledForRegrade,
|
|
317
308
|
shouldRenderEdit: false
|
|
318
309
|
};
|
|
319
|
-
return
|
|
320
|
-
className:
|
|
321
|
-
|
|
310
|
+
return jsx("div", {
|
|
311
|
+
className: "header",
|
|
312
|
+
css: this.props.styles.header
|
|
313
|
+
}, jsx(Global, {
|
|
314
|
+
styles: this.props.styles.globalStyles
|
|
315
|
+
}), this.renderLeftHeader(), jsx(ActionButtons, actionButtonProps));
|
|
322
316
|
}
|
|
323
317
|
}]);
|
|
324
318
|
|
|
@@ -360,7 +354,8 @@ var QuizEntryHeader = (_dec = themeable(theme, styles), _dec(_class = (_temp = _
|
|
|
360
354
|
successfulSubmit: PropTypes.func.isRequired,
|
|
361
355
|
withConfirm: PropTypes.func.isRequired,
|
|
362
356
|
workingEntry: ImmutablePropTypes.record.isRequired,
|
|
363
|
-
workingQuizEntry: ImmutablePropTypes.record.isRequired
|
|
357
|
+
workingQuizEntry: ImmutablePropTypes.record.isRequired,
|
|
358
|
+
styles: PropTypes.object
|
|
364
359
|
}, _class2.defaultProps = {
|
|
365
360
|
disabledForRegrade: false,
|
|
366
361
|
initialFocusId: null,
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
var generateStyle = function generateStyle(componentTheme) {
|
|
2
|
+
return {
|
|
3
|
+
/* Hide left header when the RCE editor is in fullscreen mode */
|
|
4
|
+
globalStyles: {
|
|
5
|
+
'body.tox-fullscreen .leftHeader': {
|
|
6
|
+
display: 'none'
|
|
7
|
+
}
|
|
8
|
+
},
|
|
9
|
+
header: {
|
|
10
|
+
backgroundColor: componentTheme.headerBackgroundColor,
|
|
11
|
+
color: componentTheme.headerColor,
|
|
12
|
+
padding: componentTheme.headerPadding,
|
|
13
|
+
display: 'flex',
|
|
14
|
+
justifyContent: 'space-between',
|
|
15
|
+
verticalAlign: 'middle',
|
|
16
|
+
alignItems: 'center'
|
|
17
|
+
},
|
|
18
|
+
leftHeader: {
|
|
19
|
+
flex: '8 0 0',
|
|
20
|
+
display: 'inline-flex',
|
|
21
|
+
flexWrap: 'nowrap',
|
|
22
|
+
alignItems: 'center',
|
|
23
|
+
|
|
24
|
+
/* fix for ie11 */
|
|
25
|
+
width: '100%'
|
|
26
|
+
},
|
|
27
|
+
interactionType: {
|
|
28
|
+
fontSize: componentTheme.interactionTypeFontSize,
|
|
29
|
+
marginLeft: componentTheme.interactionTypeLeftMargin,
|
|
30
|
+
marginRight: componentTheme.interactionTypeRightMargin
|
|
31
|
+
},
|
|
32
|
+
dividingLine: {
|
|
33
|
+
width: '0',
|
|
34
|
+
borderLeft: componentTheme.dividingLineLeftBorder
|
|
35
|
+
},
|
|
36
|
+
titleHolder: {
|
|
37
|
+
display: 'flex',
|
|
38
|
+
flex: '1 1 auto'
|
|
39
|
+
},
|
|
40
|
+
titleInput: {
|
|
41
|
+
flex: '1 1 auto',
|
|
42
|
+
fontSize: componentTheme.titleInputFontSize,
|
|
43
|
+
whiteSpace: 'nowrap',
|
|
44
|
+
textOverflow: 'ellipsis'
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export default generateStyle;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
var generateComponentTheme = function generateComponentTheme(_ref) {
|
|
2
2
|
var spacing = _ref.spacing,
|
|
3
3
|
colors = _ref.colors,
|
|
4
4
|
typography = _ref.typography;
|
|
@@ -11,4 +11,6 @@ export default function generator(_ref) {
|
|
|
11
11
|
interactionTypeRightMargin: spacing.xSmall,
|
|
12
12
|
titleInputFontSize: typography.fontSizeMedium
|
|
13
13
|
};
|
|
14
|
-
}
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export default generateComponentTheme;
|
|
@@ -7,32 +7,29 @@ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
|
7
7
|
|
|
8
8
|
var _dec, _class, _class2, _temp;
|
|
9
9
|
|
|
10
|
+
/* eslint-disable no-unused-vars */
|
|
11
|
+
|
|
12
|
+
/** @jsx jsx */
|
|
10
13
|
import React, { Component } from 'react';
|
|
11
14
|
import PropTypes from 'prop-types';
|
|
12
15
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
13
16
|
import { DragSource } from 'react-dnd';
|
|
14
17
|
import pick from 'lodash/pick';
|
|
15
18
|
import first from 'lodash/first';
|
|
16
|
-
import {
|
|
19
|
+
import { withStyle, jsx, Global } from '@instructure/emotion';
|
|
17
20
|
import t from '@instructure/quiz-i18n/es/format-message';
|
|
18
21
|
import CustomPropTypes from "../../../../../common/util/CustomPropTypes.js";
|
|
19
22
|
import elementsForSelectors from "../../../../../common/util/ElementsForSelectors.js";
|
|
20
23
|
import AddToBankModal from "../../../../../banks/components/AddToBankModal/index.js";
|
|
21
24
|
import DragAndDropZone from "../../../../../common/components/shared/drag_and_drop/DragAndDropZone/index.js";
|
|
22
|
-
import
|
|
25
|
+
import wrapWithOutsideClickEmotion from "../../../../../common/components/shared/functionality/componentWithOutsideClickEmotion.js";
|
|
23
26
|
import QuizEntryEditHeader from "./Header/index.js";
|
|
24
27
|
import QuizEntryEditFooter from "./Footer/index.js";
|
|
25
28
|
import { SHOULD_CLONE_ITEM, TEMPORARY_ITEM_ID, DELETED_QUIZ_ENTRY, API_INPUT_VALIDATION_ERROR, CLEAR_ALL_INPUT_VALIDATION_ERRORS, PARENT_TYPE_ADDING_TO_BANK } from '@instructure/quiz-common';
|
|
26
29
|
import { ItemTypes, dragSource, collectDrag } from "../../../../../common/components/shared/drag_and_drop/dragAndDropUtils.js";
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
return "\n\n.bZuQH_qRLg{font-size:".concat(theme.quizEntryEditFontSize || 'inherit', ";margin:").concat(theme.quizEntryEditMargin || 'inherit', " 0;position:relative;transform:translateZ(0);z-index:3333}\n\nbody.tox-fullscreen .bZuQH_qRLg{transform:none;z-index:6666}");
|
|
31
|
-
},
|
|
32
|
-
'quizEntryEdit': 'bZuQH_qRLg'
|
|
33
|
-
};
|
|
34
|
-
import theme from "./theme.js";
|
|
35
|
-
var QuizEntryEdit = (_dec = themeable(theme, styles), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
30
|
+
import generateStyle from "./styles.js";
|
|
31
|
+
import generateComponentTheme from "./theme.js";
|
|
32
|
+
var QuizEntryEdit = (_dec = withStyle(generateStyle, generateComponentTheme), _dec(_class = (_temp = _class2 = /*#__PURE__*/function (_Component) {
|
|
36
33
|
_inherits(QuizEntryEdit, _Component);
|
|
37
34
|
|
|
38
35
|
var _super = _createSuper(QuizEntryEdit);
|
|
@@ -323,9 +320,9 @@ var QuizEntryEdit = (_dec = themeable(theme, styles), _dec(_class = (_temp = _cl
|
|
|
323
320
|
draggingOver: draggingOver,
|
|
324
321
|
draggingAboveHalf: draggingAboveHalf
|
|
325
322
|
};
|
|
326
|
-
return
|
|
323
|
+
return jsx("div", null, jsx(DragAndDropZone, Object.assign({}, propsForDnDZone, {
|
|
327
324
|
location: "above"
|
|
328
|
-
})), connectDragPreview(_this.renderForm()),
|
|
325
|
+
})), connectDragPreview(_this.renderForm()), jsx(DragAndDropZone, Object.assign({}, propsForDnDZone, {
|
|
329
326
|
location: "below"
|
|
330
327
|
})));
|
|
331
328
|
};
|
|
@@ -374,7 +371,7 @@ var QuizEntryEdit = (_dec = themeable(theme, styles), _dec(_class = (_temp = _cl
|
|
|
374
371
|
var isItemOrBankEntry = this.props.quizEntry.isItem || this.props.quizEntry.isBankEntry;
|
|
375
372
|
if (!(isItemOrBankEntry || this.props.disabledForRegrade)) return;
|
|
376
373
|
var footerProps = pick(this.props, ['alternativeRightFooter', 'changeQuizEntryPoints', 'clearTemporaryItem', 'displayPosition', 'entry', 'guid', 'initialFocusId', 'openModal', 'quizEntry', 'setUi', 'shouldClone', 'workingQuizEntry']);
|
|
377
|
-
return
|
|
374
|
+
return jsx(QuizEntryEditFooter, Object.assign({
|
|
378
375
|
clearChanges: this.clearChanges,
|
|
379
376
|
isValid: this.isValid(),
|
|
380
377
|
successfulSubmit: this.successfulSubmit,
|
|
@@ -385,7 +382,7 @@ var QuizEntryEdit = (_dec = themeable(theme, styles), _dec(_class = (_temp = _cl
|
|
|
385
382
|
key: "renderAddToBankModal",
|
|
386
383
|
value: function renderAddToBankModal() {
|
|
387
384
|
if (!this.props.quizEntry.isItem) return;
|
|
388
|
-
return
|
|
385
|
+
return jsx(AddToBankModal, {
|
|
389
386
|
label: t('Add to an Item Bank'),
|
|
390
387
|
onContinue: this.handleAddToBankContinue,
|
|
391
388
|
onAdd: this.handleAddToBank,
|
|
@@ -400,7 +397,7 @@ var QuizEntryEdit = (_dec = themeable(theme, styles), _dec(_class = (_temp = _cl
|
|
|
400
397
|
key: "renderHeader",
|
|
401
398
|
value: function renderHeader() {
|
|
402
399
|
var headerProps = pick(this.props, ['changeItemTitle', 'clearModifications', 'clearTemporaryItem', 'connectDragSource', 'createTempItem', 'disabledForRegrade', 'displayPosition', 'entry', 'guid', 'hideError', 'initialFocusId', 'name', 'newActiveBank', 'quizEntries', 'quizEntry', 'quizId', 'removeQuizEntry', 'richFITBEnabled', 'richFITBInteractionID', 'screenreaderNotification', 'setUi', 'shouldClone', 'showError', 'withConfirm', 'workingEntry', 'workingQuizEntry']);
|
|
403
|
-
return
|
|
400
|
+
return jsx(QuizEntryEditHeader, Object.assign({
|
|
404
401
|
isValid: this.isValid(),
|
|
405
402
|
successfulSubmit: this.successfulSubmit,
|
|
406
403
|
disableSubmit: this.shouldDisableSubmit()
|
|
@@ -409,17 +406,19 @@ var QuizEntryEdit = (_dec = themeable(theme, styles), _dec(_class = (_temp = _cl
|
|
|
409
406
|
}, {
|
|
410
407
|
key: "renderForm",
|
|
411
408
|
value: function renderForm() {
|
|
412
|
-
return
|
|
413
|
-
|
|
409
|
+
return jsx("div", null, jsx("div", {
|
|
410
|
+
css: this.props.styles.quizEntryEdit,
|
|
414
411
|
"data-automation": "sdk-quiz-entry-edit-div"
|
|
415
|
-
},
|
|
412
|
+
}, jsx("div", {
|
|
416
413
|
role: "form"
|
|
417
|
-
}, this.renderHeader(), this.props.children, this.renderFooter()), this.renderAddToBankModal());
|
|
414
|
+
}, this.renderHeader(), this.props.children, this.renderFooter()), this.renderAddToBankModal()));
|
|
418
415
|
}
|
|
419
416
|
}, {
|
|
420
417
|
key: "render",
|
|
421
418
|
value: function render() {
|
|
422
|
-
return
|
|
419
|
+
return jsx(React.Fragment, null, jsx(Global, {
|
|
420
|
+
styles: this.props.styles.globalStyles
|
|
421
|
+
}), this.props.disabledForRegrade ? this.renderForm() : this.renderDraggable());
|
|
423
422
|
}
|
|
424
423
|
}]);
|
|
425
424
|
|
|
@@ -493,7 +492,8 @@ var QuizEntryEdit = (_dec = themeable(theme, styles), _dec(_class = (_temp = _cl
|
|
|
493
492
|
// from connected component
|
|
494
493
|
withConfirm: PropTypes.func.isRequired,
|
|
495
494
|
workingEntry: ImmutablePropTypes.record.isRequired,
|
|
496
|
-
workingQuizEntry: ImmutablePropTypes.record.isRequired
|
|
495
|
+
workingQuizEntry: ImmutablePropTypes.record.isRequired,
|
|
496
|
+
styles: PropTypes.object
|
|
497
497
|
}, _class2.defaultProps = {
|
|
498
498
|
alternativeRightFooter: null,
|
|
499
499
|
children: null,
|
|
@@ -510,5 +510,5 @@ var QuizEntryEdit = (_dec = themeable(theme, styles), _dec(_class = (_temp = _cl
|
|
|
510
510
|
shouldClone: false
|
|
511
511
|
}, _temp)) || _class);
|
|
512
512
|
export var UndecoratedQuizEntryEdit = QuizEntryEdit;
|
|
513
|
-
export var QuizEntryEditRaw =
|
|
513
|
+
export var QuizEntryEditRaw = wrapWithOutsideClickEmotion(QuizEntryEdit);
|
|
514
514
|
export default DragSource(ItemTypes.QUIZ_ENTRY, dragSource, collectDrag)(QuizEntryEditRaw);
|