@instructure/quiz-core 18.4.1-rc.4 → 18.4.1-rc.6

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.
@@ -106,7 +106,13 @@ export var SidebarItem = (_dec = themeable(theme, styles), _dec(_class = (_temp
106
106
  value: function renderButton() {
107
107
  var _this$props2 = this.props,
108
108
  displayPosition = _this$props2.displayPosition,
109
- itemId = _this$props2.itemId;
109
+ itemId = _this$props2.itemId,
110
+ isAnswered = _this$props2.isAnswered;
111
+ var screenReaderContent = !isAnswered && isAnswered !== null ? t('Navigate to question at position {displayPosition}, unanswered', {
112
+ displayPosition: displayPosition
113
+ }) : t('Navigate to question at position {displayPosition}', {
114
+ displayPosition: displayPosition
115
+ });
110
116
  return /*#__PURE__*/React.createElement(Link, {
111
117
  href: "#",
112
118
  size: "small",
@@ -117,9 +123,7 @@ export var SidebarItem = (_dec = themeable(theme, styles), _dec(_class = (_temp
117
123
  "data-automation-item-id": itemId,
118
124
  "data-automation": "sdk-sidebar-item-button"
119
125
  }, /*#__PURE__*/React.createElement(AccessibleContent, {
120
- alt: t('Navigate to question at position {displayPosition}', {
121
- displayPosition: displayPosition
122
- })
126
+ alt: screenReaderContent
123
127
  }, this.renderPosition()));
124
128
  }
125
129
  }, {
@@ -181,6 +185,7 @@ export var SidebarItem = (_dec = themeable(theme, styles), _dec(_class = (_temp
181
185
  itemBody: PropTypes.string,
182
186
  itemName: PropTypes.string.isRequired,
183
187
  inStimulus: PropTypes.bool,
188
+ isAnswered: PropTypes.bool,
184
189
  position: PropTypes.number.isRequired,
185
190
  pointsPossible: PropTypes.number.isRequired,
186
191
  preventScrollToItem: PropTypes.bool.isRequired,
@@ -193,6 +198,7 @@ export var SidebarItem = (_dec = themeable(theme, styles), _dec(_class = (_temp
193
198
  children: null,
194
199
  inStimulus: false,
195
200
  itemBody: '',
196
- quizEntry: null
201
+ quizEntry: null,
202
+ isAnswered: null
197
203
  }, _temp)) || _class);
198
204
  export default SidebarItem;
@@ -5,7 +5,6 @@ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
5
5
 
6
6
  var _dec, _class, _class2, _temp;
7
7
 
8
- import { Heading } from '@instructure/ui-heading';
9
8
  import React, { Component } from 'react';
10
9
  var styles = {
11
10
  componentId: 'eHqQt',
@@ -80,21 +79,11 @@ export var NewQuizAnalysis = (_dec = themeable(theme, styles), _dec(_class = (_t
80
79
  _this.renderContent = function () {
81
80
  var quizAnalysis = _this.props.quizAnalysis;
82
81
  var scores = quizAnalysis.scores,
83
- attempts = quizAnalysis.attempts,
84
- metadata = quizAnalysis.metadata;
82
+ attempts = quizAnalysis.attempts;
85
83
  var expanded = _this.state.expanded;
86
84
  return /*#__PURE__*/React.createElement(Card, {
87
85
  className: styles.cardWrapper
88
86
  }, /*#__PURE__*/React.createElement("div", {
89
- className: styles.heading
90
- }, /*#__PURE__*/React.createElement(Heading, {
91
- level: "h2",
92
- theme: {
93
- h2FontWeight: 700
94
- },
95
- margin: "0 x-large 0 0",
96
- color: "primary"
97
- }, t('Quiz summary:'), " ", metadata === null || metadata === void 0 ? void 0 : metadata.quiz_title)), /*#__PURE__*/React.createElement("div", {
98
87
  className: styles.metricGroup
99
88
  }, /*#__PURE__*/React.createElement("div", {
100
89
  className: styles.metricsWrapper
@@ -85,6 +85,27 @@ export var NewQuizAndItemAnalysisPresenter = /*#__PURE__*/function (_Component)
85
85
  }, getFailedToFetchReports())));
86
86
  };
87
87
 
88
+ _this.renderHeader = function () {
89
+ var _quizAnalysis$metadat;
90
+
91
+ var quizAnalysis = _this.props.quizAnalysis;
92
+ return /*#__PURE__*/React.createElement(Flex, {
93
+ alignItems: "center",
94
+ width: "auto",
95
+ margin: "auto",
96
+ direction: "column"
97
+ }, /*#__PURE__*/React.createElement(Flex.Item, {
98
+ overflowY: "hidden"
99
+ }, /*#__PURE__*/React.createElement(Heading, {
100
+ level: "h2",
101
+ theme: {
102
+ h2FontWeight: 700
103
+ },
104
+ margin: "0 x-large 0 0",
105
+ color: "primary"
106
+ }, quizAnalysis === null || quizAnalysis === void 0 ? void 0 : (_quizAnalysis$metadat = quizAnalysis.metadata) === null || _quizAnalysis$metadat === void 0 ? void 0 : _quizAnalysis$metadat.quiz_title)));
107
+ };
108
+
88
109
  _this.renderTop = function () {
89
110
  var _this$props = _this.props,
90
111
  analysisError = _this$props.analysisError,
@@ -92,19 +113,28 @@ export var NewQuizAndItemAnalysisPresenter = /*#__PURE__*/function (_Component)
92
113
  quizAnalysis = _this$props.quizAnalysis;
93
114
  var shouldShowError = analysisError && !generationInProgress;
94
115
  return /*#__PURE__*/React.createElement(Flex, {
95
- alignItems: "end",
96
- width: "82.5rem",
116
+ justifyItems: "space-between",
117
+ alignItems: "center",
118
+ wrap: "wrap",
119
+ width: "auto",
97
120
  margin: "auto",
98
- direction: "column"
121
+ direction: "row"
122
+ }, /*#__PURE__*/React.createElement(Flex.Item, null, _this.renderHeader()), /*#__PURE__*/React.createElement(Flex.Item, null, /*#__PURE__*/React.createElement(Flex, {
123
+ alignItems: "center",
124
+ width: "auto",
125
+ margin: "auto",
126
+ direction: "row"
99
127
  }, /*#__PURE__*/React.createElement(Flex.Item, {
128
+ margin: "small"
129
+ }, /*#__PURE__*/React.createElement(AnalysisUpdateDate, {
130
+ date: quizAnalysis === null || quizAnalysis === void 0 ? void 0 : quizAnalysis.created_timestamp
131
+ })), /*#__PURE__*/React.createElement(Flex.Item, {
100
132
  overflowY: "visible"
101
133
  }, _this.renderGenerationButton()), /*#__PURE__*/React.createElement(Flex.Item, null, shouldShowError && /*#__PURE__*/React.createElement(Text, {
102
134
  size: "x-small",
103
135
  weight: "bold",
104
136
  color: "danger"
105
- }, analysisError)), /*#__PURE__*/React.createElement(Flex.Item, null, /*#__PURE__*/React.createElement(AnalysisUpdateDate, {
106
- date: quizAnalysis === null || quizAnalysis === void 0 ? void 0 : quizAnalysis.created_timestamp
107
- })));
137
+ }, analysisError)))));
108
138
  };
109
139
 
110
140
  _this.renderTopOnFailedFetch = function () {
@@ -148,10 +178,7 @@ export var NewQuizAndItemAnalysisPresenter = /*#__PURE__*/function (_Component)
148
178
  _this.renderGenerationButton = function () {
149
179
  var generationInProgress = _this.props.generationInProgress;
150
180
  var buttonVariant = generationInProgress ? _this.renderOngoingGenerationButton() : _this.renderStartGenerationButton();
151
- return /*#__PURE__*/React.createElement(Flex.Item, {
152
- align: "end",
153
- padding: "xx-small"
154
- }, buttonVariant);
181
+ return /*#__PURE__*/React.createElement(React.Fragment, null, buttonVariant);
155
182
  };
156
183
 
157
184
  _this.renderBody = function () {
@@ -133,7 +133,13 @@ var SidebarItem = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _
133
133
  value: function renderButton() {
134
134
  var _this$props2 = this.props,
135
135
  displayPosition = _this$props2.displayPosition,
136
- itemId = _this$props2.itemId;
136
+ itemId = _this$props2.itemId,
137
+ isAnswered = _this$props2.isAnswered;
138
+ var screenReaderContent = !isAnswered && isAnswered !== null ? (0, _formatMessage.default)('Navigate to question at position {displayPosition}, unanswered', {
139
+ displayPosition: displayPosition
140
+ }) : (0, _formatMessage.default)('Navigate to question at position {displayPosition}', {
141
+ displayPosition: displayPosition
142
+ });
137
143
  return /*#__PURE__*/_react.default.createElement(_uiLink.Link, {
138
144
  href: "#",
139
145
  size: "small",
@@ -144,9 +150,7 @@ var SidebarItem = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _
144
150
  "data-automation-item-id": itemId,
145
151
  "data-automation": "sdk-sidebar-item-button"
146
152
  }, /*#__PURE__*/_react.default.createElement(_uiA11yContent.AccessibleContent, {
147
- alt: (0, _formatMessage.default)('Navigate to question at position {displayPosition}', {
148
- displayPosition: displayPosition
149
- })
153
+ alt: screenReaderContent
150
154
  }, this.renderPosition()));
151
155
  }
152
156
  }, {
@@ -207,6 +211,7 @@ var SidebarItem = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _
207
211
  itemBody: _propTypes.default.string,
208
212
  itemName: _propTypes.default.string.isRequired,
209
213
  inStimulus: _propTypes.default.bool,
214
+ isAnswered: _propTypes.default.bool,
210
215
  position: _propTypes.default.number.isRequired,
211
216
  pointsPossible: _propTypes.default.number.isRequired,
212
217
  preventScrollToItem: _propTypes.default.bool.isRequired,
@@ -219,7 +224,8 @@ var SidebarItem = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles), _
219
224
  children: null,
220
225
  inStimulus: false,
221
226
  itemBody: '',
222
- quizEntry: null
227
+ quizEntry: null,
228
+ isAnswered: null
223
229
  }, _temp)) || _class);
224
230
  exports.SidebarItem = SidebarItem;
225
231
  var _default = SidebarItem;
@@ -17,8 +17,6 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
17
17
 
18
18
  var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
19
19
 
20
- var _uiHeading = require("@instructure/ui-heading");
21
-
22
20
  var _react = _interopRequireWildcard(require("react"));
23
21
 
24
22
  var _formatMessage = _interopRequireDefault(require("@instructure/quiz-i18n/es/format-message"));
@@ -109,21 +107,11 @@ var NewQuizAnalysis = (_dec = (0, _uiThemeable.themeable)(_theme.default, styles
109
107
  _this.renderContent = function () {
110
108
  var quizAnalysis = _this.props.quizAnalysis;
111
109
  var scores = quizAnalysis.scores,
112
- attempts = quizAnalysis.attempts,
113
- metadata = quizAnalysis.metadata;
110
+ attempts = quizAnalysis.attempts;
114
111
  var expanded = _this.state.expanded;
115
112
  return /*#__PURE__*/_react.default.createElement(_index2.default, {
116
113
  className: styles.cardWrapper
117
114
  }, /*#__PURE__*/_react.default.createElement("div", {
118
- className: styles.heading
119
- }, /*#__PURE__*/_react.default.createElement(_uiHeading.Heading, {
120
- level: "h2",
121
- theme: {
122
- h2FontWeight: 700
123
- },
124
- margin: "0 x-large 0 0",
125
- color: "primary"
126
- }, (0, _formatMessage.default)('Quiz summary:'), " ", metadata === null || metadata === void 0 ? void 0 : metadata.quiz_title)), /*#__PURE__*/_react.default.createElement("div", {
127
115
  className: styles.metricGroup
128
116
  }, /*#__PURE__*/_react.default.createElement("div", {
129
117
  className: styles.metricsWrapper
@@ -116,6 +116,27 @@ var NewQuizAndItemAnalysisPresenter = /*#__PURE__*/function (_Component) {
116
116
  }, (0, _errorMessages.getFailedToFetchReports)())));
117
117
  };
118
118
 
119
+ _this.renderHeader = function () {
120
+ var _quizAnalysis$metadat;
121
+
122
+ var quizAnalysis = _this.props.quizAnalysis;
123
+ return /*#__PURE__*/_react.default.createElement(_uiFlex.Flex, {
124
+ alignItems: "center",
125
+ width: "auto",
126
+ margin: "auto",
127
+ direction: "column"
128
+ }, /*#__PURE__*/_react.default.createElement(_uiFlex.Flex.Item, {
129
+ overflowY: "hidden"
130
+ }, /*#__PURE__*/_react.default.createElement(_uiHeading.Heading, {
131
+ level: "h2",
132
+ theme: {
133
+ h2FontWeight: 700
134
+ },
135
+ margin: "0 x-large 0 0",
136
+ color: "primary"
137
+ }, quizAnalysis === null || quizAnalysis === void 0 ? void 0 : (_quizAnalysis$metadat = quizAnalysis.metadata) === null || _quizAnalysis$metadat === void 0 ? void 0 : _quizAnalysis$metadat.quiz_title)));
138
+ };
139
+
119
140
  _this.renderTop = function () {
120
141
  var _this$props = _this.props,
121
142
  analysisError = _this$props.analysisError,
@@ -123,19 +144,28 @@ var NewQuizAndItemAnalysisPresenter = /*#__PURE__*/function (_Component) {
123
144
  quizAnalysis = _this$props.quizAnalysis;
124
145
  var shouldShowError = analysisError && !generationInProgress;
125
146
  return /*#__PURE__*/_react.default.createElement(_uiFlex.Flex, {
126
- alignItems: "end",
127
- width: "82.5rem",
147
+ justifyItems: "space-between",
148
+ alignItems: "center",
149
+ wrap: "wrap",
150
+ width: "auto",
128
151
  margin: "auto",
129
- direction: "column"
152
+ direction: "row"
153
+ }, /*#__PURE__*/_react.default.createElement(_uiFlex.Flex.Item, null, _this.renderHeader()), /*#__PURE__*/_react.default.createElement(_uiFlex.Flex.Item, null, /*#__PURE__*/_react.default.createElement(_uiFlex.Flex, {
154
+ alignItems: "center",
155
+ width: "auto",
156
+ margin: "auto",
157
+ direction: "row"
130
158
  }, /*#__PURE__*/_react.default.createElement(_uiFlex.Flex.Item, {
159
+ margin: "small"
160
+ }, /*#__PURE__*/_react.default.createElement(_index3.AnalysisUpdateDate, {
161
+ date: quizAnalysis === null || quizAnalysis === void 0 ? void 0 : quizAnalysis.created_timestamp
162
+ })), /*#__PURE__*/_react.default.createElement(_uiFlex.Flex.Item, {
131
163
  overflowY: "visible"
132
164
  }, _this.renderGenerationButton()), /*#__PURE__*/_react.default.createElement(_uiFlex.Flex.Item, null, shouldShowError && /*#__PURE__*/_react.default.createElement(_uiText.Text, {
133
165
  size: "x-small",
134
166
  weight: "bold",
135
167
  color: "danger"
136
- }, analysisError)), /*#__PURE__*/_react.default.createElement(_uiFlex.Flex.Item, null, /*#__PURE__*/_react.default.createElement(_index3.AnalysisUpdateDate, {
137
- date: quizAnalysis === null || quizAnalysis === void 0 ? void 0 : quizAnalysis.created_timestamp
138
- })));
168
+ }, analysisError)))));
139
169
  };
140
170
 
141
171
  _this.renderTopOnFailedFetch = function () {
@@ -179,10 +209,7 @@ var NewQuizAndItemAnalysisPresenter = /*#__PURE__*/function (_Component) {
179
209
  _this.renderGenerationButton = function () {
180
210
  var generationInProgress = _this.props.generationInProgress;
181
211
  var buttonVariant = generationInProgress ? _this.renderOngoingGenerationButton() : _this.renderStartGenerationButton();
182
- return /*#__PURE__*/_react.default.createElement(_uiFlex.Flex.Item, {
183
- align: "end",
184
- padding: "xx-small"
185
- }, buttonVariant);
212
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, buttonVariant);
186
213
  };
187
214
 
188
215
  _this.renderBody = function () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/quiz-core",
3
- "version": "18.4.1-rc.4+1403d39fd",
3
+ "version": "18.4.1-rc.6+985c29e54",
4
4
  "license": "MIT",
5
5
  "description": "The Quiz React SDK by Instructure Inc.",
6
6
  "author": "Instructure, Inc. Engineering and Product Design",
@@ -43,11 +43,11 @@
43
43
  "dependencies": {
44
44
  "@instructure/grading-utils": "^1.0.0",
45
45
  "@instructure/outcomes-ui": "^2.1.9",
46
- "@instructure/quiz-common": "18.4.1-rc.4+1403d39fd",
47
- "@instructure/quiz-i18n": "18.4.1-rc.4+1403d39fd",
48
- "@instructure/quiz-interactions": "18.4.1-rc.4+1403d39fd",
49
- "@instructure/quiz-number-input": "18.4.1-rc.4+1403d39fd",
50
- "@instructure/quiz-rce": "18.4.1-rc.4+1403d39fd",
46
+ "@instructure/quiz-common": "18.4.1-rc.6+985c29e54",
47
+ "@instructure/quiz-i18n": "18.4.1-rc.6+985c29e54",
48
+ "@instructure/quiz-interactions": "18.4.1-rc.6+985c29e54",
49
+ "@instructure/quiz-number-input": "18.4.1-rc.6+985c29e54",
50
+ "@instructure/quiz-rce": "18.4.1-rc.6+985c29e54",
51
51
  "@instructure/ui-a11y-content": "^7.22.1",
52
52
  "@instructure/ui-alerts": "^7.22.1",
53
53
  "@instructure/ui-avatar": "^7.22.1",
@@ -108,7 +108,7 @@
108
108
  "eventemitter3": "^3.1.0",
109
109
  "humps": "^2.0.0",
110
110
  "immutable": "^3.8.1",
111
- "instructure-validations": "18.4.1-rc.4+1403d39fd",
111
+ "instructure-validations": "18.4.1-rc.6+985c29e54",
112
112
  "ipaddr.js": "^1.5.4",
113
113
  "isomorphic-fetch": "^2.2.0",
114
114
  "isuuid": "^0.1.0",
@@ -159,7 +159,7 @@
159
159
  "intl": "^1.2.4",
160
160
  "jquery": "^2.2.3",
161
161
  "most-subject": "^5.3.0",
162
- "quiz-presets": "18.4.1-rc.4+1403d39fd",
162
+ "quiz-presets": "18.4.1-rc.6+985c29e54",
163
163
  "react": "^16.8.6",
164
164
  "react-addons-test-utils": "^15.6.2",
165
165
  "react-dom": "^16.8.6",
@@ -175,5 +175,5 @@
175
175
  "publishConfig": {
176
176
  "access": "public"
177
177
  },
178
- "gitHead": "1403d39fdef30e950227a3b2fe64adf240af4586"
178
+ "gitHead": "985c29e543b0508cbd6c26cabd65c6ebd5d07ed9"
179
179
  }