@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
|
@@ -1,410 +0,0 @@
|
|
|
1
|
-
/** @jsx jsx */ function _assert_this_initialized(self) {
|
|
2
|
-
if (self === void 0) {
|
|
3
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
4
|
-
}
|
|
5
|
-
return self;
|
|
6
|
-
}
|
|
7
|
-
function _call_super(_this, derived, args) {
|
|
8
|
-
derived = _get_prototype_of(derived);
|
|
9
|
-
return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
|
|
10
|
-
}
|
|
11
|
-
function _class_call_check(instance, Constructor) {
|
|
12
|
-
if (!(instance instanceof Constructor)) {
|
|
13
|
-
throw new TypeError("Cannot call a class as a function");
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
function _defineProperties(target, props) {
|
|
17
|
-
for(var i = 0; i < props.length; i++){
|
|
18
|
-
var descriptor = props[i];
|
|
19
|
-
descriptor.enumerable = descriptor.enumerable || false;
|
|
20
|
-
descriptor.configurable = true;
|
|
21
|
-
if ("value" in descriptor) descriptor.writable = true;
|
|
22
|
-
Object.defineProperty(target, descriptor.key, descriptor);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
function _create_class(Constructor, protoProps, staticProps) {
|
|
26
|
-
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
27
|
-
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
28
|
-
return Constructor;
|
|
29
|
-
}
|
|
30
|
-
function _define_property(obj, key, value) {
|
|
31
|
-
if (key in obj) {
|
|
32
|
-
Object.defineProperty(obj, key, {
|
|
33
|
-
value: value,
|
|
34
|
-
enumerable: true,
|
|
35
|
-
configurable: true,
|
|
36
|
-
writable: true
|
|
37
|
-
});
|
|
38
|
-
} else {
|
|
39
|
-
obj[key] = value;
|
|
40
|
-
}
|
|
41
|
-
return obj;
|
|
42
|
-
}
|
|
43
|
-
function _get_prototype_of(o) {
|
|
44
|
-
_get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
|
|
45
|
-
return o.__proto__ || Object.getPrototypeOf(o);
|
|
46
|
-
};
|
|
47
|
-
return _get_prototype_of(o);
|
|
48
|
-
}
|
|
49
|
-
function _inherits(subClass, superClass) {
|
|
50
|
-
if (typeof superClass !== "function" && superClass !== null) {
|
|
51
|
-
throw new TypeError("Super expression must either be null or a function");
|
|
52
|
-
}
|
|
53
|
-
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
54
|
-
constructor: {
|
|
55
|
-
value: subClass,
|
|
56
|
-
writable: true,
|
|
57
|
-
configurable: true
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
if (superClass) _set_prototype_of(subClass, superClass);
|
|
61
|
-
}
|
|
62
|
-
function _possible_constructor_return(self, call) {
|
|
63
|
-
if (call && (_type_of(call) === "object" || typeof call === "function")) {
|
|
64
|
-
return call;
|
|
65
|
-
}
|
|
66
|
-
return _assert_this_initialized(self);
|
|
67
|
-
}
|
|
68
|
-
function _set_prototype_of(o, p) {
|
|
69
|
-
_set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
|
|
70
|
-
o.__proto__ = p;
|
|
71
|
-
return o;
|
|
72
|
-
};
|
|
73
|
-
return _set_prototype_of(o, p);
|
|
74
|
-
}
|
|
75
|
-
function _type_of(obj) {
|
|
76
|
-
"@swc/helpers - typeof";
|
|
77
|
-
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
78
|
-
}
|
|
79
|
-
function _is_native_reflect_construct() {
|
|
80
|
-
try {
|
|
81
|
-
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
82
|
-
} catch (_) {}
|
|
83
|
-
return (_is_native_reflect_construct = function() {
|
|
84
|
-
return !!result;
|
|
85
|
-
})();
|
|
86
|
-
}
|
|
87
|
-
function _ts_decorate(decorators, target, key, desc) {
|
|
88
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
89
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
90
|
-
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
91
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
92
|
-
}
|
|
93
|
-
import { Component } from 'react';
|
|
94
|
-
import PropTypes from 'prop-types';
|
|
95
|
-
import ImmutablePropTypes from 'react-immutable-proptypes';
|
|
96
|
-
import { AccessibleContent, ScreenReaderContent } from '@instructure/ui-a11y-content';
|
|
97
|
-
import { Alert } from '@instructure/ui-alerts';
|
|
98
|
-
import { Text } from '@instructure/ui-text';
|
|
99
|
-
import { ProgressCircle } from '@instructure/ui-progress';
|
|
100
|
-
import { Heading } from '@instructure/ui-heading';
|
|
101
|
-
import { View } from '@instructure/ui-view';
|
|
102
|
-
import { jsx } from '@instructure/emotion';
|
|
103
|
-
import t from '@instructure/quiz-i18n/format-message';
|
|
104
|
-
import { scoreToLetterGrade } from '@instructure/grading-utils';
|
|
105
|
-
import { withI18nSupport, withStyleOverrides } from '@instructure/quiz-common';
|
|
106
|
-
import FormattedDuration from '../../../shared/FormattedDuration';
|
|
107
|
-
import { formatTime } from '../../../../util/formatTimespan';
|
|
108
|
-
import generateStyle from './styles';
|
|
109
|
-
import generateComponentTheme from './theme';
|
|
110
|
-
var unknownPercentageValue = 'UNKNOWN_PERCENTAGE';
|
|
111
|
-
var _withI18nSupport;
|
|
112
|
-
export var Info = /*#__PURE__*/ function(_superClass) {
|
|
113
|
-
"use strict";
|
|
114
|
-
_inherits(Info, _superClass);
|
|
115
|
-
function Info(props) {
|
|
116
|
-
_class_call_check(this, Info);
|
|
117
|
-
var _this;
|
|
118
|
-
_this = _call_super(this, Info, [
|
|
119
|
-
props
|
|
120
|
-
]);
|
|
121
|
-
_this.progressTextFormatter = _this.progressTextFormatter.bind(_this);
|
|
122
|
-
_this.progressDisplayFormatter = _this.progressDisplayFormatter.bind(_this);
|
|
123
|
-
return _this;
|
|
124
|
-
}
|
|
125
|
-
_create_class(Info, [
|
|
126
|
-
{
|
|
127
|
-
key: "points",
|
|
128
|
-
get: function get() {
|
|
129
|
-
return this.props.quizSessionResult.score;
|
|
130
|
-
}
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
key: "pointsPresent",
|
|
134
|
-
get: function get() {
|
|
135
|
-
return typeof this.points === 'number';
|
|
136
|
-
}
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
key: "pointsMissing",
|
|
140
|
-
get: function get() {
|
|
141
|
-
return !this.pointsPresent;
|
|
142
|
-
}
|
|
143
|
-
},
|
|
144
|
-
{
|
|
145
|
-
key: "pointsPossible",
|
|
146
|
-
get: function get() {
|
|
147
|
-
return this.props.quizSessionResult.pointsPossible;
|
|
148
|
-
}
|
|
149
|
-
},
|
|
150
|
-
{
|
|
151
|
-
key: "pointsPossiblePresent",
|
|
152
|
-
get: function get() {
|
|
153
|
-
return typeof this.pointsPossible === 'number';
|
|
154
|
-
}
|
|
155
|
-
},
|
|
156
|
-
{
|
|
157
|
-
key: "pointsPossibleMissing",
|
|
158
|
-
get: function get() {
|
|
159
|
-
return !this.pointsPossiblePresent;
|
|
160
|
-
}
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
key: "percentageVal",
|
|
164
|
-
get: function get() {
|
|
165
|
-
var ratio = this.props.quizSessionResult.percentage;
|
|
166
|
-
return isNaN(ratio) ? unknownPercentageValue : ratio;
|
|
167
|
-
}
|
|
168
|
-
},
|
|
169
|
-
{
|
|
170
|
-
key: "mainPointsText",
|
|
171
|
-
get: function get() {
|
|
172
|
-
if (this.pointsMissing && this.pointsPossibleMissing) {
|
|
173
|
-
return '--';
|
|
174
|
-
}
|
|
175
|
-
var valueToUse = this.pointsPresent ? this.points : this.pointsPossible;
|
|
176
|
-
return t.number(valueToUse);
|
|
177
|
-
}
|
|
178
|
-
},
|
|
179
|
-
{
|
|
180
|
-
key: "subPointsText",
|
|
181
|
-
get: function get() {
|
|
182
|
-
if (this.pointsPresent && this.pointsPossiblePresent) {
|
|
183
|
-
return t("Out of {\n points, plural,\n one {# point}\n other {# points}\n }", {
|
|
184
|
-
points: this.pointsPossible
|
|
185
|
-
});
|
|
186
|
-
}
|
|
187
|
-
if (this.pointsPresent) {
|
|
188
|
-
return t("Earned {points, plural,\n one {point}\n other {points}\n }", {
|
|
189
|
-
points: this.points
|
|
190
|
-
});
|
|
191
|
-
}
|
|
192
|
-
// We use "Points Possible" when only points is present or when nothing is present
|
|
193
|
-
return t("{points, plural,\n one {Point}\n other {Points}\n } possible", {
|
|
194
|
-
points: this.pointsPossible
|
|
195
|
-
});
|
|
196
|
-
}
|
|
197
|
-
},
|
|
198
|
-
{
|
|
199
|
-
key: "pointsText",
|
|
200
|
-
get: function get() {
|
|
201
|
-
if (this.pointsPresent && this.pointsPossiblePresent) {
|
|
202
|
-
return t("{points, number} out of {\n total, plural,\n one {# point}\n other {# points}\n }", {
|
|
203
|
-
points: this.points,
|
|
204
|
-
total: this.pointsPossible
|
|
205
|
-
});
|
|
206
|
-
}
|
|
207
|
-
if (this.pointsPresent) {
|
|
208
|
-
return t("Earned {points, plural,\n one {# point}\n other {# points}\n }", {
|
|
209
|
-
points: this.points
|
|
210
|
-
});
|
|
211
|
-
}
|
|
212
|
-
// We use "Points Possible" when only points is present or when nothing is present
|
|
213
|
-
if (this.pointsPossiblePresent) {
|
|
214
|
-
return t("{points, plural,\n one {# point}\n other {# points}\n } possible", {
|
|
215
|
-
points: this.pointsPossible
|
|
216
|
-
});
|
|
217
|
-
}
|
|
218
|
-
return t('Unknown Score');
|
|
219
|
-
}
|
|
220
|
-
},
|
|
221
|
-
{
|
|
222
|
-
// needed for inst-ui Progress
|
|
223
|
-
key: "progressTextFormatter",
|
|
224
|
-
value: function progressTextFormatter(param) {
|
|
225
|
-
var valueNow = param.valueNow;
|
|
226
|
-
var percentageUnknown = valueNow === unknownPercentageValue;
|
|
227
|
-
return percentageUnknown ? t('Unknown Score') : t('Your score was {percentage}.', {
|
|
228
|
-
percentage: this.formatPercentMax2FractionDigits(valueNow)
|
|
229
|
-
});
|
|
230
|
-
}
|
|
231
|
-
},
|
|
232
|
-
{
|
|
233
|
-
// needed for inst-ui Progress
|
|
234
|
-
key: "progressDisplayFormatter",
|
|
235
|
-
value: function progressDisplayFormatter(param) {
|
|
236
|
-
var valueNow = param.valueNow;
|
|
237
|
-
var valueToShow = valueNow === unknownPercentageValue ? t({
|
|
238
|
-
id: 'progress_display',
|
|
239
|
-
default: '?',
|
|
240
|
-
description: 'placeholder for an unknown percentage value'
|
|
241
|
-
}) : this.formatPercentMax2FractionDigits(valueNow);
|
|
242
|
-
return /*#__PURE__*/ jsx("div", {
|
|
243
|
-
css: this.props.styles.scorePercentage,
|
|
244
|
-
"data-automation": "sdk-quiz-score-percentage"
|
|
245
|
-
}, valueToShow);
|
|
246
|
-
}
|
|
247
|
-
},
|
|
248
|
-
{
|
|
249
|
-
key: "renderAlert",
|
|
250
|
-
value: function renderAlert() {
|
|
251
|
-
var _this_props = this.props, quizSessionResult = _this_props.quizSessionResult, sessionItemResults = _this_props.sessionItemResults;
|
|
252
|
-
var ungradedCount = sessionItemResults.reduce(function(count, sessionItemResult) {
|
|
253
|
-
return sessionItemResult.getIn([
|
|
254
|
-
'scoredData',
|
|
255
|
-
'gradeStatus'
|
|
256
|
-
]) === 'waiting' ? count + 1 : count;
|
|
257
|
-
}, 0);
|
|
258
|
-
var hasUngradedQuesitons = ungradedCount > 0;
|
|
259
|
-
var alerts = [];
|
|
260
|
-
if (quizSessionResult.isLoaded() && quizSessionResult.autogradingFailed()) {
|
|
261
|
-
var msg = t('There was a grading problem. Please inform your instructor.');
|
|
262
|
-
alerts.push(/*#__PURE__*/ jsx(Alert, {
|
|
263
|
-
key: "autograding_failed",
|
|
264
|
-
variant: "warning"
|
|
265
|
-
}, msg));
|
|
266
|
-
}
|
|
267
|
-
if (hasUngradedQuesitons && quizSessionResult.isLoaded()) {
|
|
268
|
-
var ungradedText = t("{\n count, plural,\n one {# question requires grading}\n other {# questions require grading}\n }", {
|
|
269
|
-
count: ungradedCount
|
|
270
|
-
});
|
|
271
|
-
alerts.push(/*#__PURE__*/ jsx(Alert, {
|
|
272
|
-
key: "manual_grading",
|
|
273
|
-
variant: "info"
|
|
274
|
-
}, ungradedText));
|
|
275
|
-
}
|
|
276
|
-
if (alerts.length) {
|
|
277
|
-
return /*#__PURE__*/ jsx("div", {
|
|
278
|
-
css: this.props.styles.alertWrapper
|
|
279
|
-
}, /*#__PURE__*/ jsx("div", {
|
|
280
|
-
css: this.props.styles.alertWidth,
|
|
281
|
-
"data-automation": "sdk-results-requires-grading"
|
|
282
|
-
}, alerts));
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
},
|
|
286
|
-
{
|
|
287
|
-
key: "renderLetterGrade",
|
|
288
|
-
value: function renderLetterGrade() {
|
|
289
|
-
var letterGrade = scoreToLetterGrade(this.percentageVal * 100, this.props.gradingScheme);
|
|
290
|
-
var gradeText = t('Grade for this attempt');
|
|
291
|
-
var alt = t('Grade for this attempt: { grade }', {
|
|
292
|
-
grade: letterGrade
|
|
293
|
-
});
|
|
294
|
-
return /*#__PURE__*/ jsx(AccessibleContent, {
|
|
295
|
-
alt: alt
|
|
296
|
-
}, /*#__PURE__*/ jsx(View, {
|
|
297
|
-
as: "div"
|
|
298
|
-
}, /*#__PURE__*/ jsx(Text, {
|
|
299
|
-
size: "xx-large",
|
|
300
|
-
weight: "bold",
|
|
301
|
-
color: "primary"
|
|
302
|
-
}, letterGrade)), /*#__PURE__*/ jsx(Text, {
|
|
303
|
-
color: "secondary"
|
|
304
|
-
}, gradeText));
|
|
305
|
-
}
|
|
306
|
-
},
|
|
307
|
-
{
|
|
308
|
-
key: "renderScoreStats",
|
|
309
|
-
value: function renderScoreStats() {
|
|
310
|
-
return /*#__PURE__*/ jsx("div", {
|
|
311
|
-
css: this.props.styles.scoreStats
|
|
312
|
-
}, this.renderProgress(), this.renderPointsDisplay());
|
|
313
|
-
}
|
|
314
|
-
},
|
|
315
|
-
{
|
|
316
|
-
key: "renderProgress",
|
|
317
|
-
value: function renderProgress() {
|
|
318
|
-
if (this.pointsMissing || this.pointsPossibleMissing) {
|
|
319
|
-
return null;
|
|
320
|
-
}
|
|
321
|
-
return /*#__PURE__*/ jsx("div", {
|
|
322
|
-
css: this.props.styles.score,
|
|
323
|
-
"data-automation": "sdk-info-score"
|
|
324
|
-
}, /*#__PURE__*/ jsx(ProgressCircle, {
|
|
325
|
-
shouldAnimateOnMount: true,
|
|
326
|
-
size: "large",
|
|
327
|
-
screenReaderLabel: t('Your Score'),
|
|
328
|
-
formatScreenReaderValue: this.progressTextFormatter,
|
|
329
|
-
renderValue: this.progressDisplayFormatter,
|
|
330
|
-
valueNow: this.percentageVal,
|
|
331
|
-
valueMax: 1
|
|
332
|
-
}));
|
|
333
|
-
}
|
|
334
|
-
},
|
|
335
|
-
{
|
|
336
|
-
key: "renderPointsDisplay",
|
|
337
|
-
value: function renderPointsDisplay() {
|
|
338
|
-
return /*#__PURE__*/ jsx("div", {
|
|
339
|
-
css: this.props.styles.infoWrapper
|
|
340
|
-
}, /*#__PURE__*/ jsx(AccessibleContent, {
|
|
341
|
-
alt: this.pointsText
|
|
342
|
-
}, /*#__PURE__*/ jsx(Text, {
|
|
343
|
-
as: "div",
|
|
344
|
-
color: "primary",
|
|
345
|
-
size: "xx-large",
|
|
346
|
-
weight: "bold"
|
|
347
|
-
}, this.mainPointsText), /*#__PURE__*/ jsx(Text, {
|
|
348
|
-
color: "secondary"
|
|
349
|
-
}, this.subPointsText)));
|
|
350
|
-
}
|
|
351
|
-
},
|
|
352
|
-
{
|
|
353
|
-
key: "renderTime",
|
|
354
|
-
value: function renderTime() {
|
|
355
|
-
var attemptText = t('Time for this attempt');
|
|
356
|
-
var alt = t('Time for this attempt: { time }', {
|
|
357
|
-
time: formatTime(this.props.quizSession.elapsedTime)
|
|
358
|
-
});
|
|
359
|
-
return /*#__PURE__*/ jsx(AccessibleContent, {
|
|
360
|
-
alt: alt
|
|
361
|
-
}, /*#__PURE__*/ jsx(View, {
|
|
362
|
-
as: "div"
|
|
363
|
-
}, /*#__PURE__*/ jsx(FormattedDuration, {
|
|
364
|
-
fontSize: "xx-large",
|
|
365
|
-
fontWeight: "bold",
|
|
366
|
-
seconds: this.props.quizSession.elapsedTime
|
|
367
|
-
})), /*#__PURE__*/ jsx(Text, {
|
|
368
|
-
color: "secondary"
|
|
369
|
-
}, attemptText));
|
|
370
|
-
}
|
|
371
|
-
},
|
|
372
|
-
{
|
|
373
|
-
key: "render",
|
|
374
|
-
value: function render() {
|
|
375
|
-
return /*#__PURE__*/ jsx("div", null, this.renderAlert(), /*#__PURE__*/ jsx("div", {
|
|
376
|
-
css: this.props.styles.wrapper
|
|
377
|
-
}, /*#__PURE__*/ jsx("div", {
|
|
378
|
-
css: this.props.styles.info,
|
|
379
|
-
className: "fs-mask"
|
|
380
|
-
}, /*#__PURE__*/ jsx(ScreenReaderContent, null, /*#__PURE__*/ jsx(Heading, {
|
|
381
|
-
level: "h2"
|
|
382
|
-
}, t('Assessment Statistics'))), this.props.restrictQuantitativeData ? this.renderLetterGrade() : this.renderScoreStats(), /*#__PURE__*/ jsx("div", {
|
|
383
|
-
css: this.props.styles.infoWrapper
|
|
384
|
-
}, this.renderTime()))));
|
|
385
|
-
}
|
|
386
|
-
}
|
|
387
|
-
]);
|
|
388
|
-
return Info;
|
|
389
|
-
}(_withI18nSupport = withI18nSupport(Component));
|
|
390
|
-
_define_property(Info, "displayName", 'QuizSessionResultInfo');
|
|
391
|
-
_define_property(Info, "componentId", "Quizzes".concat(Info.displayName));
|
|
392
|
-
_define_property(Info, "propTypes", {
|
|
393
|
-
gradingScheme: PropTypes.arrayOf(PropTypes.shape({
|
|
394
|
-
name: PropTypes.string,
|
|
395
|
-
value: PropTypes.number
|
|
396
|
-
})),
|
|
397
|
-
quizSession: ImmutablePropTypes.record.isRequired,
|
|
398
|
-
quizSessionResult: ImmutablePropTypes.record.isRequired,
|
|
399
|
-
restrictQuantitativeData: PropTypes.bool,
|
|
400
|
-
sessionItemResults: ImmutablePropTypes.list.isRequired,
|
|
401
|
-
styles: PropTypes.object
|
|
402
|
-
});
|
|
403
|
-
_define_property(Info, "defaultProps", {
|
|
404
|
-
gradingScheme: [],
|
|
405
|
-
restrictQuantitativeData: false
|
|
406
|
-
});
|
|
407
|
-
Info = _ts_decorate([
|
|
408
|
-
withStyleOverrides(generateStyle, generateComponentTheme)
|
|
409
|
-
], Info);
|
|
410
|
-
export default Info;
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
var generateStyle = function(componentTheme) {
|
|
2
|
-
return {
|
|
3
|
-
alertWrapper: {
|
|
4
|
-
display: 'flex',
|
|
5
|
-
flexDirection: 'row',
|
|
6
|
-
alignItems: 'center',
|
|
7
|
-
justifyContent: 'center',
|
|
8
|
-
marginTop: componentTheme.alertWrapperMargin
|
|
9
|
-
},
|
|
10
|
-
alertWidth: {
|
|
11
|
-
flexGrow: 1,
|
|
12
|
-
maxWidth: '33rem,'
|
|
13
|
-
},
|
|
14
|
-
wrapper: {
|
|
15
|
-
padding: 'none',
|
|
16
|
-
margin: 'none',
|
|
17
|
-
display: 'flex',
|
|
18
|
-
alignItems: 'center',
|
|
19
|
-
justifyContent: 'center'
|
|
20
|
-
},
|
|
21
|
-
info: {
|
|
22
|
-
alignSelf: 'center',
|
|
23
|
-
display: 'flex',
|
|
24
|
-
flexWrap: 'wrap',
|
|
25
|
-
alignItems: 'center',
|
|
26
|
-
justifyContent: 'center'
|
|
27
|
-
},
|
|
28
|
-
scoreStats: {
|
|
29
|
-
display: 'flex',
|
|
30
|
-
flexWrap: 'wrap',
|
|
31
|
-
alignItems: 'center',
|
|
32
|
-
justifyContent: 'flex-start',
|
|
33
|
-
flex: '1 1 auto'
|
|
34
|
-
},
|
|
35
|
-
score: {
|
|
36
|
-
display: 'flex',
|
|
37
|
-
alignItems: 'center',
|
|
38
|
-
flex: '1 1 auto',
|
|
39
|
-
margin: componentTheme.scoreMargin,
|
|
40
|
-
height: '150px',
|
|
41
|
-
width: '150px',
|
|
42
|
-
/*
|
|
43
|
-
progress modal sets a -1 z-index on its content
|
|
44
|
-
and this raises it above the app background
|
|
45
|
-
*/ zIndex: componentTheme.scoreZIndex
|
|
46
|
-
},
|
|
47
|
-
scorePercentage: {
|
|
48
|
-
fontSize: componentTheme.scorePercentageFontSize,
|
|
49
|
-
fontWeight: componentTheme.scorePercentageFontWeight
|
|
50
|
-
},
|
|
51
|
-
infoWrapper: {
|
|
52
|
-
flex: '1 1 auto',
|
|
53
|
-
margin: componentTheme.infoWrapperMargin,
|
|
54
|
-
paddingLeft: componentTheme.inforWrapperPadding
|
|
55
|
-
}
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
export default generateStyle;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
var generateComponentTheme = function(param) {
|
|
2
|
-
var spacing = param.spacing, typography = param.typography;
|
|
3
|
-
return {
|
|
4
|
-
alertWrapperMargin: spacing.xSmall,
|
|
5
|
-
scoreMargin: spacing.small,
|
|
6
|
-
scoreZIndex: '2222',
|
|
7
|
-
scorePercentageFontSize: typography.fontSizeLarge,
|
|
8
|
-
scorePercentageFontWeight: typography.fontWeightBold,
|
|
9
|
-
infoWrapperMargin: spacing.small,
|
|
10
|
-
inforWrapperPadding: spacing.small
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
export default generateComponentTheme;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
var generateStyle = function(componentTheme) {
|
|
2
|
-
return {
|
|
3
|
-
itemStem: {
|
|
4
|
-
whiteSpace: 'nowrap',
|
|
5
|
-
overflow: 'hidden',
|
|
6
|
-
textOverflow: 'ellipsis'
|
|
7
|
-
},
|
|
8
|
-
feedbackLabel: {
|
|
9
|
-
fontSize: componentTheme.feedbackLabelFontSize
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
export default generateStyle;
|