@instructure/quiz-core 22.16.1 → 22.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. package/es/building/api/quizEntries.js +25 -5
  2. package/es/building/components/layout/header/BuildingButtons/index.js +1 -0
  3. package/es/building/components/layout/header/BuildingButtons/presenter.js +4 -0
  4. package/es/building/components/resources/ItemFeedbackModal/index.js +4 -1
  5. package/es/building/components/resources/ItemFeedbackModal/presenter.js +44 -41
  6. package/es/building/components/resources/quizEntry/QuizEntry/index.js +2 -1
  7. package/es/building/components/resources/quizEntry/QuizEntry/presenter.js +6 -2
  8. package/es/building/components/resources/quizEntry/QuizEntryEdit/Footer/index.js +5 -1
  9. package/es/building/components/resources/quizEntry/QuizEntryEdit/Footer/presenter.js +39 -3
  10. package/es/building/components/resources/quizEntry/QuizEntryEdit/index.js +1 -0
  11. package/es/building/components/resources/quizEntry/QuizEntryEdit/presenter.js +1 -0
  12. package/es/building/components/resources/quizEntry/QuizEntryShow/components/LeftHeader.js +151 -0
  13. package/es/building/components/resources/quizEntry/QuizEntryShow/index.js +5 -2
  14. package/es/building/components/resources/quizEntry/QuizEntryShow/presenter.js +27 -102
  15. package/es/building/components/resources/quizEntry/QuizEntryShow/styles.js +0 -12
  16. package/es/common/actions/modal.js +2 -1
  17. package/es/common/components/ConfirmationModal/index.js +1 -1
  18. package/es/common/components/ConfirmationModal/presenter.js +49 -169
  19. package/es/common/components/SDKApp/index.js +22 -23
  20. package/es/common/components/layout/sidebar/Sidebar/components/TotalPointsPossible.js +37 -0
  21. package/es/common/components/layout/sidebar/Sidebar/index.js +29 -57
  22. package/es/common/components/layout/sidebar/SidebarItem/index.js +5 -1
  23. package/es/common/components/layout/sidebar/SidebarItem/presenter.js +40 -11
  24. package/es/common/components/layout/sidebar/SidebarItem/styles.js +4 -1
  25. package/es/common/components/layout/sidebar/Stimulus/presenter.js +26 -1
  26. package/{lib/common/components/resources/quizSessionResult/Header → es/common/components/resources/QuizSessionResult/QuizSessionResultHeader}/index.js +15 -23
  27. package/es/common/components/resources/QuizSessionResult/QuizSessionResultInfo/ScoreDisplay/components/LetterGrade.js +36 -0
  28. package/es/common/components/resources/QuizSessionResult/QuizSessionResultInfo/ScoreDisplay/components/PointsDisplay.js +70 -0
  29. package/es/common/components/resources/QuizSessionResult/QuizSessionResultInfo/ScoreDisplay/components/Progress.js +57 -0
  30. package/es/common/components/resources/QuizSessionResult/QuizSessionResultInfo/ScoreDisplay/index.js +49 -0
  31. package/es/common/components/resources/QuizSessionResult/QuizSessionResultInfo/index.js +118 -0
  32. package/es/common/components/resources/item/ItemEdit/index.js +5 -3
  33. package/es/common/components/resources/item/ItemEdit/presenter.js +3 -2
  34. package/es/common/components/resources/item/ItemShow/index.js +2 -1
  35. package/es/common/components/resources/quiz/AddContent/Body/index.js +4 -2
  36. package/es/common/components/resources/quiz/AddContent/Body/presenter.js +25 -6
  37. package/es/common/components/resources/quiz/AddContent/Body/styles.js +7 -0
  38. package/es/common/components/resources/quiz/AddContent/Popover/presenter.js +1 -0
  39. package/es/common/components/resources/sessionItemResult/SessionItemResult/components/SessionItemResultHeader.js +122 -0
  40. package/es/common/components/resources/sessionItemResult/SessionItemResult/index.js +6 -2
  41. package/es/common/components/resources/sessionItemResult/SessionItemResult/presenter.js +80 -168
  42. package/es/common/components/resources/sessionItemResult/SessionItemResult/styles.js +0 -8
  43. package/es/common/components/resources/stimulus/Stimulus/index.js +4 -1
  44. package/es/common/components/resources/stimulus/Stimulus/presenter.js +2 -0
  45. package/es/common/components/resources/stimulus/StimulusEdit/presenter.js +3 -1
  46. package/es/common/middleware/appSyncMiddleware.js +19 -0
  47. package/es/common/records/Quiz.js +8 -1
  48. package/es/common/records/QuizEntry.js +8 -1
  49. package/es/common/records/SessionItem.js +2 -1
  50. package/es/common/records/SessionItemResult.js +24 -0
  51. package/es/common/util/interactionTypePropsHelper.js +4 -2
  52. package/es/common/util/isMissing.js +4 -0
  53. package/es/configureStore.js +3 -1
  54. package/es/index.js +4 -2
  55. package/es/moderating/components/resources/ModerateTable/presenter.js +14 -9
  56. package/es/moderating/components/resources/ModerateTableRow/presenter.js +68 -24
  57. package/es/moderating/components/resources/ModerateTableRow/styles.js +0 -4
  58. package/es/reduxStore.js +4 -0
  59. package/es/taking/api/taking.js +45 -10
  60. package/lib/building/api/quizEntries.js +25 -5
  61. package/lib/building/components/layout/header/BuildingButtons/index.js +1 -0
  62. package/lib/building/components/layout/header/BuildingButtons/presenter.js +4 -0
  63. package/lib/building/components/resources/ItemFeedbackModal/index.js +4 -1
  64. package/lib/building/components/resources/ItemFeedbackModal/presenter.js +44 -41
  65. package/lib/building/components/resources/quizEntry/QuizEntry/index.js +2 -1
  66. package/lib/building/components/resources/quizEntry/QuizEntry/presenter.js +6 -2
  67. package/lib/building/components/resources/quizEntry/QuizEntryEdit/Footer/index.js +5 -1
  68. package/lib/building/components/resources/quizEntry/QuizEntryEdit/Footer/presenter.js +39 -3
  69. package/lib/building/components/resources/quizEntry/QuizEntryEdit/index.js +1 -0
  70. package/lib/building/components/resources/quizEntry/QuizEntryEdit/presenter.js +1 -0
  71. package/lib/building/components/resources/quizEntry/QuizEntryShow/components/LeftHeader.js +151 -0
  72. package/lib/building/components/resources/quizEntry/QuizEntryShow/index.js +5 -2
  73. package/lib/building/components/resources/quizEntry/QuizEntryShow/presenter.js +27 -102
  74. package/lib/building/components/resources/quizEntry/QuizEntryShow/styles.js +0 -12
  75. package/lib/common/actions/modal.js +2 -1
  76. package/lib/common/components/ConfirmationModal/index.js +1 -1
  77. package/lib/common/components/ConfirmationModal/presenter.js +49 -169
  78. package/lib/common/components/SDKApp/index.js +22 -23
  79. package/lib/common/components/layout/sidebar/Sidebar/components/TotalPointsPossible.js +37 -0
  80. package/lib/common/components/layout/sidebar/Sidebar/index.js +29 -57
  81. package/lib/common/components/layout/sidebar/SidebarItem/index.js +5 -1
  82. package/lib/common/components/layout/sidebar/SidebarItem/presenter.js +40 -11
  83. package/lib/common/components/layout/sidebar/SidebarItem/styles.js +4 -1
  84. package/lib/common/components/layout/sidebar/Stimulus/presenter.js +26 -1
  85. package/{es/common/components/resources/quizSessionResult/Header → lib/common/components/resources/QuizSessionResult/QuizSessionResultHeader}/index.js +15 -23
  86. package/lib/common/components/resources/QuizSessionResult/QuizSessionResultInfo/ScoreDisplay/components/LetterGrade.js +36 -0
  87. package/lib/common/components/resources/QuizSessionResult/QuizSessionResultInfo/ScoreDisplay/components/PointsDisplay.js +70 -0
  88. package/lib/common/components/resources/QuizSessionResult/QuizSessionResultInfo/ScoreDisplay/components/Progress.js +57 -0
  89. package/lib/common/components/resources/QuizSessionResult/QuizSessionResultInfo/ScoreDisplay/index.js +49 -0
  90. package/lib/common/components/resources/QuizSessionResult/QuizSessionResultInfo/index.js +118 -0
  91. package/lib/common/components/resources/item/ItemEdit/index.js +5 -3
  92. package/lib/common/components/resources/item/ItemEdit/presenter.js +3 -2
  93. package/lib/common/components/resources/item/ItemShow/index.js +2 -1
  94. package/lib/common/components/resources/quiz/AddContent/Body/index.js +4 -2
  95. package/lib/common/components/resources/quiz/AddContent/Body/presenter.js +25 -6
  96. package/lib/common/components/resources/quiz/AddContent/Body/styles.js +7 -0
  97. package/lib/common/components/resources/quiz/AddContent/Popover/presenter.js +1 -0
  98. package/lib/common/components/resources/sessionItemResult/SessionItemResult/components/SessionItemResultHeader.js +122 -0
  99. package/lib/common/components/resources/sessionItemResult/SessionItemResult/index.js +6 -2
  100. package/lib/common/components/resources/sessionItemResult/SessionItemResult/presenter.js +80 -168
  101. package/lib/common/components/resources/sessionItemResult/SessionItemResult/styles.js +0 -8
  102. package/lib/common/components/resources/stimulus/Stimulus/index.js +4 -1
  103. package/lib/common/components/resources/stimulus/Stimulus/presenter.js +2 -0
  104. package/lib/common/components/resources/stimulus/StimulusEdit/presenter.js +3 -1
  105. package/lib/common/middleware/appSyncMiddleware.js +19 -0
  106. package/lib/common/records/Quiz.js +8 -1
  107. package/lib/common/records/QuizEntry.js +8 -1
  108. package/lib/common/records/SessionItem.js +2 -1
  109. package/lib/common/records/SessionItemResult.js +24 -0
  110. package/lib/common/util/interactionTypePropsHelper.js +4 -2
  111. package/lib/common/util/isMissing.js +4 -0
  112. package/lib/configureStore.js +3 -1
  113. package/lib/index.js +4 -2
  114. package/lib/moderating/components/resources/ModerateTable/presenter.js +14 -9
  115. package/lib/moderating/components/resources/ModerateTableRow/presenter.js +68 -24
  116. package/lib/moderating/components/resources/ModerateTableRow/styles.js +0 -4
  117. package/lib/reduxStore.js +4 -0
  118. package/lib/taking/api/taking.js +45 -10
  119. package/package.json +10 -10
  120. package/es/building/components/resources/ItemFeedbackModal/styles.js +0 -13
  121. package/es/building/components/resources/ItemFeedbackModal/theme.js +0 -7
  122. package/es/common/components/resources/quizSessionResult/Info/index.js +0 -410
  123. package/es/common/components/resources/quizSessionResult/Info/styles.js +0 -58
  124. package/es/common/components/resources/quizSessionResult/Info/theme.js +0 -13
  125. package/lib/building/components/resources/ItemFeedbackModal/styles.js +0 -13
  126. package/lib/building/components/resources/ItemFeedbackModal/theme.js +0 -7
  127. package/lib/common/components/resources/quizSessionResult/Info/index.js +0 -410
  128. package/lib/common/components/resources/quizSessionResult/Info/styles.js +0 -58
  129. package/lib/common/components/resources/quizSessionResult/Info/theme.js +0 -13
  130. /package/es/common/components/resources/{quizSessionResult/Header → QuizSessionResult/QuizSessionResultHeader}/styles.js +0 -0
  131. /package/es/common/components/resources/{quizSessionResult/Header → QuizSessionResult/QuizSessionResultHeader}/theme.js +0 -0
  132. /package/lib/common/components/resources/{quizSessionResult/Header → QuizSessionResult/QuizSessionResultHeader}/styles.js +0 -0
  133. /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;