@pie-element/drawing-response 6.0.0 → 6.0.1-cr.1
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/configure/src/index.js +16 -4
- package/package.json +2 -2
- package/LICENSE.md +0 -5
- package/configure/lib/button.js +0 -61
- package/configure/lib/button.js.map +0 -1
- package/configure/lib/defaults.js +0 -56
- package/configure/lib/defaults.js.map +0 -1
- package/configure/lib/image-container.js +0 -364
- package/configure/lib/image-container.js.map +0 -1
- package/configure/lib/index.js +0 -143
- package/configure/lib/index.js.map +0 -1
- package/configure/lib/root.js +0 -256
- package/configure/lib/root.js.map +0 -1
- package/configure/node_modules/debug/CHANGELOG.md +0 -395
- package/configure/node_modules/debug/LICENSE +0 -19
- package/configure/node_modules/debug/README.md +0 -437
- package/configure/node_modules/debug/node.js +0 -1
- package/configure/node_modules/debug/package.json +0 -51
- package/configure/node_modules/debug/src/browser.js +0 -180
- package/configure/node_modules/debug/src/common.js +0 -249
- package/configure/node_modules/debug/src/index.js +0 -12
- package/configure/node_modules/debug/src/node.js +0 -177
- package/controller/lib/defaults.js +0 -16
- package/controller/lib/defaults.js.map +0 -1
- package/controller/lib/index.js +0 -84
- package/controller/lib/index.js.map +0 -1
package/controller/lib/index.js
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.createDefaultModel = void 0;
|
|
9
|
-
exports.model = model;
|
|
10
|
-
exports.normalize = void 0;
|
|
11
|
-
exports.outcome = outcome;
|
|
12
|
-
|
|
13
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
14
|
-
|
|
15
|
-
var _debug = _interopRequireDefault(require("debug"));
|
|
16
|
-
|
|
17
|
-
var _defaults = _interopRequireDefault(require("./defaults"));
|
|
18
|
-
|
|
19
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
20
|
-
|
|
21
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
22
|
-
|
|
23
|
-
var log = (0, _debug["default"])('pie-elements:drawing-response:controller');
|
|
24
|
-
|
|
25
|
-
var normalize = function normalize(question) {
|
|
26
|
-
return _objectSpread({
|
|
27
|
-
promptEnabled: true,
|
|
28
|
-
teacherInstructionsEnabled: true,
|
|
29
|
-
studentInstructionsEnabled: true,
|
|
30
|
-
backgroundImageEnabled: true
|
|
31
|
-
}, question);
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
exports.normalize = normalize;
|
|
35
|
-
|
|
36
|
-
function model(question, session, env) {
|
|
37
|
-
var normalizedQuestion = normalize(question);
|
|
38
|
-
var imageUrl = normalizedQuestion.imageUrl,
|
|
39
|
-
imageDimensions = normalizedQuestion.imageDimensions,
|
|
40
|
-
prompt = normalizedQuestion.prompt,
|
|
41
|
-
promptEnabled = normalizedQuestion.promptEnabled,
|
|
42
|
-
backgroundImageEnabled = normalizedQuestion.backgroundImageEnabled;
|
|
43
|
-
return new Promise(function (resolve) {
|
|
44
|
-
var out = {
|
|
45
|
-
disabled: env.mode !== 'gather',
|
|
46
|
-
mode: env.mode,
|
|
47
|
-
imageDimensions: imageDimensions,
|
|
48
|
-
imageUrl: imageUrl,
|
|
49
|
-
prompt: promptEnabled ? prompt : null,
|
|
50
|
-
backgroundImageEnabled: backgroundImageEnabled
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
if (env.role === 'instructor' && (env.mode === 'view' || env.mode === 'evaluate')) {
|
|
54
|
-
out.teacherInstructions = normalizedQuestion.teacherInstructionsEnabled ? normalizedQuestion.teacherInstructions : null;
|
|
55
|
-
} else {
|
|
56
|
-
out.teacherInstructions = null;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
resolve(out);
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
var createDefaultModel = function createDefaultModel() {
|
|
64
|
-
var model = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
65
|
-
return new Promise(function (resolve) {
|
|
66
|
-
resolve(_objectSpread(_objectSpread({}, _defaults["default"]), model));
|
|
67
|
-
});
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
exports.createDefaultModel = createDefaultModel;
|
|
71
|
-
|
|
72
|
-
function
|
|
73
|
-
/*config, session*/
|
|
74
|
-
outcome() {
|
|
75
|
-
return new Promise(function (resolve) {
|
|
76
|
-
log('outcome...');
|
|
77
|
-
resolve({
|
|
78
|
-
score: 0,
|
|
79
|
-
completed: 'n/a',
|
|
80
|
-
note: 'Requires manual scoring'
|
|
81
|
-
});
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.js"],"names":["log","normalize","question","promptEnabled","teacherInstructionsEnabled","studentInstructionsEnabled","backgroundImageEnabled","model","session","env","normalizedQuestion","imageUrl","imageDimensions","prompt","Promise","resolve","out","disabled","mode","role","teacherInstructions","createDefaultModel","defaults","outcome","score","completed","note"],"mappings":";;;;;;;;;;;;;;AAAA;;AACA;;;;;;AAEA,IAAMA,GAAG,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B,IAFJ;AAGD,KAJD,MAIO;AACLJ,MAAAA,GAAG,CAACI,mBAAJ,GAA0B,IAA1B;AACD;;AAEDL,IAAAA,OAAO,CAACC,GAAD,CAAP;AACD,GAnBM,CAAP;AAoBD;;AAEM,IAAMK,kBAAkB,GAAG,SAArBA,kBAAqB;AAAA,MAACd,KAAD,uEAAS,EAAT;AAAA,SAChC,IAAIO,OAAJ,CAAY,UAACC,OAAD,EAAa;AACvBA,IAAAA,OAAO,iCACFO,oBADE,GAEFf,KAFE,EAAP;AAID,GALD,CADgC;AAAA,CAA3B;;;;AAQA;AAAiB;AAARgB,OAAT,GAAsC;AAC3C,SAAO,IAAIT,OAAJ,CAAY,UAACC,OAAD,EAAa;AAC9Bf,IAAAA,GAAG,CAAC,YAAD,CAAH;AACAe,IAAAA,OAAO,CAAC;AACNS,MAAAA,KAAK,EAAE,CADD;AAENC,MAAAA,SAAS,EAAE,KAFL;AAGNC,MAAAA,IAAI,EAAE;AAHA,KAAD,CAAP;AAKD,GAPM,CAAP;AAQD","sourcesContent":["import debug from 'debug';\nimport defaults from './defaults';\n\nconst log = debug('pie-elements:drawing-response:controller');\n\nexport const normalize = (question) => ({\n promptEnabled: true,\n teacherInstructionsEnabled: true,\n studentInstructionsEnabled: true,\n backgroundImageEnabled: true,\n ...question,\n});\n\nexport function model(question, session, env) {\n const normalizedQuestion = normalize(question);\n const { imageUrl, imageDimensions, prompt, promptEnabled, backgroundImageEnabled } = normalizedQuestion;\n\n return new Promise((resolve) => {\n const out = {\n disabled: env.mode !== 'gather',\n mode: env.mode,\n imageDimensions,\n imageUrl,\n prompt: promptEnabled ? prompt : null,\n backgroundImageEnabled,\n };\n\n if (env.role === 'instructor' && (env.mode === 'view' || env.mode === 'evaluate')) {\n out.teacherInstructions = normalizedQuestion.teacherInstructionsEnabled\n ? normalizedQuestion.teacherInstructions\n : null;\n } else {\n out.teacherInstructions = null;\n }\n\n resolve(out);\n });\n}\n\nexport const createDefaultModel = (model = {}) =>\n new Promise((resolve) => {\n resolve({\n ...defaults,\n ...model,\n });\n });\n\nexport function outcome(/*config, session*/) {\n return new Promise((resolve) => {\n log('outcome...');\n resolve({\n score: 0,\n completed: 'n/a',\n note: 'Requires manual scoring',\n });\n });\n}\n"],"file":"index.js"}
|