@instructure/quiz-core 20.14.1-rc.6 → 20.14.1-rc.7
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/building/api/quizzes.js +6 -1
- package/es/common/actions/modifications.js +11 -0
- package/es/common/actions/taking.js +8 -6
- package/es/common/records/Quiz.js +1 -0
- package/es/common/records/QuizSession.js +1 -0
- package/es/index.js +1 -1
- package/lib/building/api/quizzes.js +7 -0
- package/lib/common/actions/modifications.js +13 -0
- package/lib/common/actions/taking.js +8 -6
- package/lib/common/records/Quiz.js +1 -0
- package/lib/common/records/QuizSession.js +1 -0
- package/lib/index.js +7 -0
- package/package.json +9 -9
|
@@ -3,7 +3,7 @@ import { noop } from 'lodash';
|
|
|
3
3
|
import { DO_NOTHING, NEW_QUIZ_ID, QUIZ_SAVE_CALL, PARENT_TYPE_BANK, PARENT_TYPE_QUIZ, PARENT_TYPE_QUIZ_SESSION } from '@instructure/quiz-common';
|
|
4
4
|
import Fetcher from "../../common/util/Fetcher.js";
|
|
5
5
|
import { getQTIInfo } from "./qtiImports.js";
|
|
6
|
-
import { changeQuizAllowBacktracking, changeQuizAllowClearMCSelection, changeQuizHasTimeLimit, changeQuizOneAtATimeType, changeQuizShuffleQuestions, changeQuizShuffleAnswers, changeQuizRequireStudentAccessCode, changeQuizStudentAccessCode, changeSessionTimeLimitInSeconds, changeQuizFilterIpAddress, changeQuizIpFilters, changeQuizCalculatorType, changeResultsFeedback, changeResultsFeedbackEnabled } from "../../common/actions/modifications.js";
|
|
6
|
+
import { changeQuizAllowBacktracking, changeQuizAllowClearMCSelection, changeQuizChoiceElimination, changeQuizHasTimeLimit, changeQuizOneAtATimeType, changeQuizShuffleQuestions, changeQuizShuffleAnswers, changeQuizRequireStudentAccessCode, changeQuizStudentAccessCode, changeSessionTimeLimitInSeconds, changeQuizFilterIpAddress, changeQuizIpFilters, changeQuizCalculatorType, changeResultsFeedback, changeResultsFeedbackEnabled } from "../../common/actions/modifications.js";
|
|
7
7
|
import { handleQuizResponse } from "../../common/api/callHandlers.js";
|
|
8
8
|
import { getUploadUrl, sendFileToS3 } from "../../common/api/fileUpload.js";
|
|
9
9
|
import { interactionTypeFetch } from "../../common/api/interactionTypes.js";
|
|
@@ -165,6 +165,11 @@ export function setAllowClearMCSelection(quizId, value, completeCb) {
|
|
|
165
165
|
allow_clear_mc_selection: Boolean(value)
|
|
166
166
|
}, changeQuizAllowClearMCSelection(quizId, value), completeCb);
|
|
167
167
|
}
|
|
168
|
+
export function setChoiceElimination(quizId, value, completeCb) {
|
|
169
|
+
return setQuizProperty(quizId, {
|
|
170
|
+
choice_elimination: Boolean(value)
|
|
171
|
+
}, changeQuizChoiceElimination(quizId, value), completeCb);
|
|
172
|
+
}
|
|
168
173
|
export function setQuizShuffleQuestions(quizId, value, completeCb) {
|
|
169
174
|
return setQuizProperty(quizId, {
|
|
170
175
|
shuffle_questions: Boolean(value)
|
|
@@ -49,6 +49,17 @@ export function changeQuizAllowClearMCSelection(quizId, value) {
|
|
|
49
49
|
}
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
|
+
export function changeQuizChoiceElimination(quizId, value) {
|
|
53
|
+
return {
|
|
54
|
+
type: QUIZ_MODIFICATION,
|
|
55
|
+
payload: {
|
|
56
|
+
id: quizId,
|
|
57
|
+
modifications: {
|
|
58
|
+
choiceElimination: Boolean(value)
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
}
|
|
52
63
|
export function changeQuizShuffleQuestions(quizId, value) {
|
|
53
64
|
return {
|
|
54
65
|
type: QUIZ_MODIFICATION,
|
|
@@ -60,29 +60,31 @@ export var updateTimerInfo = function updateTimerInfo(timerData) {
|
|
|
60
60
|
}
|
|
61
61
|
};
|
|
62
62
|
};
|
|
63
|
-
export var previewResponse = function previewResponse(sessionItem, value) {
|
|
64
|
-
var invalid = arguments.length >
|
|
63
|
+
export var previewResponse = function previewResponse(sessionItem, value, properties) {
|
|
64
|
+
var invalid = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false;
|
|
65
65
|
return {
|
|
66
66
|
type: PREVIEW_RESPONSE,
|
|
67
67
|
payload: {
|
|
68
68
|
position: sessionItem.position,
|
|
69
69
|
itemId: sessionItem.getItem().id,
|
|
70
70
|
userResponse: {
|
|
71
|
-
value: value
|
|
71
|
+
value: value,
|
|
72
|
+
properties: properties
|
|
72
73
|
},
|
|
73
74
|
invalid: invalid
|
|
74
75
|
}
|
|
75
76
|
};
|
|
76
77
|
};
|
|
77
|
-
export var editResponse = function editResponse(sessionItem, value) {
|
|
78
|
-
var invalid = arguments.length >
|
|
78
|
+
export var editResponse = function editResponse(sessionItem, value, properties) {
|
|
79
|
+
var invalid = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false;
|
|
79
80
|
return {
|
|
80
81
|
type: RESPONSE,
|
|
81
82
|
payload: {
|
|
82
83
|
position: sessionItem.position,
|
|
83
84
|
itemId: sessionItem.getItem().id,
|
|
84
85
|
userResponse: {
|
|
85
|
-
value: value
|
|
86
|
+
value: value,
|
|
87
|
+
properties: properties
|
|
86
88
|
},
|
|
87
89
|
invalid: invalid
|
|
88
90
|
}
|
package/es/index.js
CHANGED
|
@@ -98,7 +98,7 @@ export { ensureRCEContentIsLoaded } from "./common/util/rceChecker.js"; // APIs
|
|
|
98
98
|
export { createQuizEntryRegrade } from "./grading/api/quizEntryRegrades.js";
|
|
99
99
|
export { getQuizEntry } from "./building/api/quizEntries.js";
|
|
100
100
|
export { getItem } from "./building/api/items.js";
|
|
101
|
-
export { interactionFileUpload, setOneAtATimeType, quizBuildingSession, saveQuizChange, setBacktracking, setCalculatorType, setAllowClearMCSelection, setFilterIpAddress, setIpFiltersApi, setIpFiltersUi, setQuizShuffleAnswers, setQuizShuffleQuestions, setRequireStudentAccessCode, setStudentAccessCodeApi, setStudentAccessCodeUi, setQuizHasTimeLimit, setSessionTimeLimitInSecondsUi, setSessionTimeLimitInSecondsApi, setResultsFeedback, setResultsFeedbackEnabled } from "./building/api/quizzes.js";
|
|
101
|
+
export { interactionFileUpload, setOneAtATimeType, quizBuildingSession, saveQuizChange, setBacktracking, setCalculatorType, setAllowClearMCSelection, setChoiceElimination, setFilterIpAddress, setIpFiltersApi, setIpFiltersUi, setQuizShuffleAnswers, setQuizShuffleQuestions, setRequireStudentAccessCode, setStudentAccessCodeApi, setStudentAccessCodeUi, setQuizHasTimeLimit, setSessionTimeLimitInSecondsUi, setSessionTimeLimitInSecondsApi, setResultsFeedback, setResultsFeedbackEnabled } from "./building/api/quizzes.js";
|
|
102
102
|
export { getExistingQuiz } from "./common/api/quizzes.js";
|
|
103
103
|
export { confirmSessionStartPage, submitStudentAccessCode, nextQuestion, submitQuiz } from "./taking/api/taking.js";
|
|
104
104
|
export { pinSessionItem } from "./common/api/quizSessions.js";
|
|
@@ -11,6 +11,7 @@ exports.startNewQuiz = startNewQuiz;
|
|
|
11
11
|
exports.getExistingQuizAndItemsForBuilding = getExistingQuizAndItemsForBuilding;
|
|
12
12
|
exports.interactionFileUpload = interactionFileUpload;
|
|
13
13
|
exports.setAllowClearMCSelection = setAllowClearMCSelection;
|
|
14
|
+
exports.setChoiceElimination = setChoiceElimination;
|
|
14
15
|
exports.setQuizShuffleQuestions = setQuizShuffleQuestions;
|
|
15
16
|
exports.setQuizShuffleAnswers = setQuizShuffleAnswers;
|
|
16
17
|
exports.setRequireStudentAccessCode = setRequireStudentAccessCode;
|
|
@@ -210,6 +211,12 @@ function setAllowClearMCSelection(quizId, value, completeCb) {
|
|
|
210
211
|
}, (0, _modifications.changeQuizAllowClearMCSelection)(quizId, value), completeCb);
|
|
211
212
|
}
|
|
212
213
|
|
|
214
|
+
function setChoiceElimination(quizId, value, completeCb) {
|
|
215
|
+
return setQuizProperty(quizId, {
|
|
216
|
+
choice_elimination: Boolean(value)
|
|
217
|
+
}, (0, _modifications.changeQuizChoiceElimination)(quizId, value), completeCb);
|
|
218
|
+
}
|
|
219
|
+
|
|
213
220
|
function setQuizShuffleQuestions(quizId, value, completeCb) {
|
|
214
221
|
return setQuizProperty(quizId, {
|
|
215
222
|
shuffle_questions: Boolean(value)
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.changeQuizTitle = changeQuizTitle;
|
|
7
7
|
exports.changeQuizInstructions = changeQuizInstructions;
|
|
8
8
|
exports.changeQuizAllowClearMCSelection = changeQuizAllowClearMCSelection;
|
|
9
|
+
exports.changeQuizChoiceElimination = changeQuizChoiceElimination;
|
|
9
10
|
exports.changeQuizShuffleQuestions = changeQuizShuffleQuestions;
|
|
10
11
|
exports.changeQuizShuffleAnswers = changeQuizShuffleAnswers;
|
|
11
12
|
exports.changeQuizRequireStudentAccessCode = changeQuizRequireStudentAccessCode;
|
|
@@ -99,6 +100,18 @@ function changeQuizAllowClearMCSelection(quizId, value) {
|
|
|
99
100
|
};
|
|
100
101
|
}
|
|
101
102
|
|
|
103
|
+
function changeQuizChoiceElimination(quizId, value) {
|
|
104
|
+
return {
|
|
105
|
+
type: _quizCommon.QUIZ_MODIFICATION,
|
|
106
|
+
payload: {
|
|
107
|
+
id: quizId,
|
|
108
|
+
modifications: {
|
|
109
|
+
choiceElimination: Boolean(value)
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
|
|
102
115
|
function changeQuizShuffleQuestions(quizId, value) {
|
|
103
116
|
return {
|
|
104
117
|
type: _quizCommon.QUIZ_MODIFICATION,
|
|
@@ -93,15 +93,16 @@ var updateTimerInfo = function updateTimerInfo(timerData) {
|
|
|
93
93
|
|
|
94
94
|
exports.updateTimerInfo = updateTimerInfo;
|
|
95
95
|
|
|
96
|
-
var previewResponse = function previewResponse(sessionItem, value) {
|
|
97
|
-
var invalid = arguments.length >
|
|
96
|
+
var previewResponse = function previewResponse(sessionItem, value, properties) {
|
|
97
|
+
var invalid = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false;
|
|
98
98
|
return {
|
|
99
99
|
type: _quizCommon.PREVIEW_RESPONSE,
|
|
100
100
|
payload: {
|
|
101
101
|
position: sessionItem.position,
|
|
102
102
|
itemId: sessionItem.getItem().id,
|
|
103
103
|
userResponse: {
|
|
104
|
-
value: value
|
|
104
|
+
value: value,
|
|
105
|
+
properties: properties
|
|
105
106
|
},
|
|
106
107
|
invalid: invalid
|
|
107
108
|
}
|
|
@@ -110,15 +111,16 @@ var previewResponse = function previewResponse(sessionItem, value) {
|
|
|
110
111
|
|
|
111
112
|
exports.previewResponse = previewResponse;
|
|
112
113
|
|
|
113
|
-
var editResponse = function editResponse(sessionItem, value) {
|
|
114
|
-
var invalid = arguments.length >
|
|
114
|
+
var editResponse = function editResponse(sessionItem, value, properties) {
|
|
115
|
+
var invalid = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : false;
|
|
115
116
|
return {
|
|
116
117
|
type: _quizCommon.RESPONSE,
|
|
117
118
|
payload: {
|
|
118
119
|
position: sessionItem.position,
|
|
119
120
|
itemId: sessionItem.getItem().id,
|
|
120
121
|
userResponse: {
|
|
121
|
-
value: value
|
|
122
|
+
value: value,
|
|
123
|
+
properties: properties
|
|
122
124
|
},
|
|
123
125
|
invalid: invalid
|
|
124
126
|
}
|
package/lib/index.js
CHANGED
|
@@ -117,6 +117,7 @@ var _exportNames = {
|
|
|
117
117
|
setBacktracking: true,
|
|
118
118
|
setCalculatorType: true,
|
|
119
119
|
setAllowClearMCSelection: true,
|
|
120
|
+
setChoiceElimination: true,
|
|
120
121
|
setFilterIpAddress: true,
|
|
121
122
|
setIpFiltersApi: true,
|
|
122
123
|
setIpFiltersUi: true,
|
|
@@ -870,6 +871,12 @@ Object.defineProperty(exports, "setAllowClearMCSelection", {
|
|
|
870
871
|
return _quizzes.setAllowClearMCSelection;
|
|
871
872
|
}
|
|
872
873
|
});
|
|
874
|
+
Object.defineProperty(exports, "setChoiceElimination", {
|
|
875
|
+
enumerable: true,
|
|
876
|
+
get: function get() {
|
|
877
|
+
return _quizzes.setChoiceElimination;
|
|
878
|
+
}
|
|
879
|
+
});
|
|
873
880
|
Object.defineProperty(exports, "setFilterIpAddress", {
|
|
874
881
|
enumerable: true,
|
|
875
882
|
get: function get() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/quiz-core",
|
|
3
|
-
"version": "20.14.1-rc.
|
|
3
|
+
"version": "20.14.1-rc.7+b3ea95075",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "The Quiz React SDK by Instructure Inc.",
|
|
6
6
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
@@ -44,11 +44,11 @@
|
|
|
44
44
|
"@instructure/emotion": "^8.51.0",
|
|
45
45
|
"@instructure/grading-utils": "^1.0.0",
|
|
46
46
|
"@instructure/outcomes-ui": "^3.2.2",
|
|
47
|
-
"@instructure/quiz-common": "20.14.1-rc.
|
|
48
|
-
"@instructure/quiz-i18n": "20.14.1-rc.
|
|
49
|
-
"@instructure/quiz-interactions": "20.14.1-rc.
|
|
50
|
-
"@instructure/quiz-number-input": "20.14.1-rc.
|
|
51
|
-
"@instructure/quiz-rce": "20.14.1-rc.
|
|
47
|
+
"@instructure/quiz-common": "20.14.1-rc.7+b3ea95075",
|
|
48
|
+
"@instructure/quiz-i18n": "20.14.1-rc.7+b3ea95075",
|
|
49
|
+
"@instructure/quiz-interactions": "20.14.1-rc.7+b3ea95075",
|
|
50
|
+
"@instructure/quiz-number-input": "20.14.1-rc.7+b3ea95075",
|
|
51
|
+
"@instructure/quiz-rce": "20.14.1-rc.7+b3ea95075",
|
|
52
52
|
"@instructure/ui-a11y-content": "^8.51.0",
|
|
53
53
|
"@instructure/ui-alerts": "^8.51.0",
|
|
54
54
|
"@instructure/ui-avatar": "^8.51.0",
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
"file-saver": "~2.0.5",
|
|
112
112
|
"humps": "^2.0.0",
|
|
113
113
|
"immutable": "^3.8.1",
|
|
114
|
-
"instructure-validations": "20.14.1-rc.
|
|
114
|
+
"instructure-validations": "20.14.1-rc.7+b3ea95075",
|
|
115
115
|
"ipaddr.js": "^1.5.4",
|
|
116
116
|
"isomorphic-fetch": "^2.2.0",
|
|
117
117
|
"isuuid": "^0.1.0",
|
|
@@ -163,7 +163,7 @@
|
|
|
163
163
|
"jquery": "^2.2.3",
|
|
164
164
|
"karma-junit-reporter": "^2.0.1",
|
|
165
165
|
"most-subject": "^5.3.0",
|
|
166
|
-
"quiz-presets": "20.14.1-rc.
|
|
166
|
+
"quiz-presets": "20.14.1-rc.7+b3ea95075",
|
|
167
167
|
"react": "^16.8.6",
|
|
168
168
|
"react-addons-test-utils": "^15.6.2",
|
|
169
169
|
"react-dom": "^16.8.6",
|
|
@@ -179,5 +179,5 @@
|
|
|
179
179
|
"publishConfig": {
|
|
180
180
|
"access": "public"
|
|
181
181
|
},
|
|
182
|
-
"gitHead": "
|
|
182
|
+
"gitHead": "b3ea95075a09af4cd8e7393883070634d6ab7467"
|
|
183
183
|
}
|