@pie-element/explicit-constructed-response 9.2.2-next.0 → 9.2.2-next.11

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.
@@ -4234,13 +4234,8 @@ const enabled = (config, env, defaultValue) => {
4234
4234
  return typeof defaultValue === 'boolean' ? defaultValue : true;
4235
4235
  };
4236
4236
 
4237
- var partialScoring = /*#__PURE__*/Object.freeze({
4238
- __proto__: null,
4239
- enabled: enabled
4240
- });
4241
-
4242
- const lg = n => console[n].bind(console, 'controller-utils:');
4243
-
4237
+ // eslint-disable-next-line no-console
4238
+ const lg = (n) => console[n].bind(console, 'controller-utils:');
4244
4239
  lg('debug');
4245
4240
  lg('log');
4246
4241
  lg('warn');
@@ -4875,7 +4870,7 @@ function _objectSpread$4(target) { for (var i = 1; i < arguments.length; i++) {
4875
4870
  function _createSuper$2(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$2(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
4876
4871
  function _isNativeReflectConstruct$2() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
4877
4872
  var checkedLoadedFor = {};
4878
- var Translator = function (_EventEmitter) {
4873
+ var Translator$1 = function (_EventEmitter) {
4879
4874
  _inherits(Translator, _EventEmitter);
4880
4875
  var _super = _createSuper$2(Translator);
4881
4876
  function Translator(services) {
@@ -6484,7 +6479,7 @@ var I18n = function (_EventEmitter) {
6484
6479
  s.i18nFormat = createClassOnDemand(this.modules.i18nFormat);
6485
6480
  if (s.i18nFormat.init) s.i18nFormat.init(this);
6486
6481
  }
6487
- this.translator = new Translator(this.services, this.options);
6482
+ this.translator = new Translator$1(this.services, this.options);
6488
6483
  this.translator.on('*', function (event) {
6489
6484
  for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
6490
6485
  args[_key2 - 1] = arguments[_key2];
@@ -6844,7 +6839,7 @@ var I18n = function (_EventEmitter) {
6844
6839
  clone.services.utils = {
6845
6840
  hasLoadedNamespace: clone.hasLoadedNamespace.bind(clone)
6846
6841
  };
6847
- clone.translator = new Translator(clone.services, clone.options);
6842
+ clone.translator = new Translator$1(clone.services, clone.options);
6848
6843
  clone.translator.on('*', function (event) {
6849
6844
  for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
6850
6845
  args[_key4 - 1] = arguments[_key4];
@@ -6895,41 +6890,26 @@ instance.hasLoadedNamespace;
6895
6890
  instance.loadNamespaces;
6896
6891
  instance.loadLanguages;
6897
6892
 
6898
- function _extends() {
6899
- _extends = Object.assign || function (target) {
6900
- for (var i = 1; i < arguments.length; i++) {
6901
- var source = arguments[i];
6902
-
6903
- for (var key in source) {
6904
- if (Object.prototype.hasOwnProperty.call(source, key)) {
6905
- target[key] = source[key];
6906
- }
6907
- }
6908
- }
6909
-
6910
- return target;
6911
- };
6912
-
6913
- return _extends.apply(this, arguments);
6914
- }
6915
-
6916
6893
  var en = {
6917
6894
  translation: {
6918
6895
  categorize: {
6919
- limitMaxChoicesPerCategory: "You've reached the limit of {{maxChoicesPerCategory}} responses per area. To add another response, one must first be removed.",
6920
- maxChoicesPerCategoryRestriction: 'To change this value to {{maxChoicesPerCategory}}, each category must have {{maxChoicesPerCategory}} or fewer answer choice[s].'
6896
+ limitMaxChoicesPerCategory:
6897
+ "You've reached the limit of {{maxChoicesPerCategory}} responses per area. To add another response, one must first be removed.",
6898
+ maxChoicesPerCategoryRestriction:
6899
+ 'To change this value to {{maxChoicesPerCategory}}, each category must have {{maxChoicesPerCategory}} or fewer answer choice[s].',
6921
6900
  },
6922
6901
  ebsr: {
6923
- part: 'Part {{index}}'
6902
+ part: 'Part {{index}}',
6924
6903
  },
6925
6904
  numberLine: {
6926
6905
  addElementLimit_one: 'You can only add {{count}} element',
6927
6906
  addElementLimit_other: 'You can only add {{count}} elements',
6928
- clearAll: 'Clear all'
6907
+ clearAll: 'Clear all',
6929
6908
  },
6930
6909
  imageClozeAssociation: {
6931
- reachedLimit_one: 'You’ve reached the limit of {{count}} response per area. To add another response, one must first be removed.',
6932
- reachedLimit_other: 'Full'
6910
+ reachedLimit_one:
6911
+ 'You’ve reached the limit of {{count}} response per area. To add another response, one must first be removed.',
6912
+ reachedLimit_other: 'Full',
6933
6913
  },
6934
6914
  drawingResponse: {
6935
6915
  fillColor: 'Fill color',
@@ -6945,7 +6925,7 @@ var en = {
6945
6925
  green: 'Green',
6946
6926
  white: 'White',
6947
6927
  black: 'Black',
6948
- onDoubleClick: 'Double click to edit this text. Press Enter to submit.'
6928
+ onDoubleClick: 'Double click to edit this text. Press Enter to submit.',
6949
6929
  },
6950
6930
  charting: {
6951
6931
  addCategory: 'Add category',
@@ -6957,8 +6937,8 @@ var en = {
6957
6937
  keyLegend: {
6958
6938
  incorrectAnswer: 'Student incorrect answer',
6959
6939
  correctAnswer: 'Student correct answer',
6960
- correctKeyAnswer: 'Answer key correct'
6961
- }
6940
+ correctKeyAnswer: 'Answer key correct',
6941
+ },
6962
6942
  },
6963
6943
  graphing: {
6964
6944
  point: 'Point',
@@ -6974,24 +6954,25 @@ var en = {
6974
6954
  vector: 'Vector',
6975
6955
  label: 'Label',
6976
6956
  redo: 'Redo',
6977
- reset: 'Reset'
6957
+ reset: 'Reset',
6978
6958
  },
6979
6959
  mathInline: {
6980
- primaryCorrectWithAlternates: 'Note: The answer shown above is the primary correct answer specified by the author for this item, but other answers may also be recognized as correct.'
6960
+ primaryCorrectWithAlternates:
6961
+ 'Note: The answer shown above is the primary correct answer specified by the author for this item, but other answers may also be recognized as correct.',
6981
6962
  },
6982
6963
  multipleChoice: {
6983
6964
  minSelections: 'Select at least {{minSelections}}.',
6984
6965
  maxSelections_one: 'Only {{maxSelections}} answer is allowed.',
6985
6966
  maxSelections_other: 'Only {{maxSelections}} answers are allowed.',
6986
6967
  minmaxSelections_equal: 'Select {{minSelections}}.',
6987
- minmaxSelections_range: 'Select between {{minSelections}} and {{maxSelections}}.'
6968
+ minmaxSelections_range: 'Select between {{minSelections}} and {{maxSelections}}.',
6988
6969
  },
6989
6970
  selectText: {
6990
6971
  correctAnswerSelected: 'Correct',
6991
6972
  correctAnswerNotSelected: 'Correct Answer Not Selected',
6992
6973
  incorrectSelection: 'Incorrect Selection',
6993
- key: 'Key'
6994
- }
6974
+ key: 'Key',
6975
+ },
6995
6976
  },
6996
6977
  common: {
6997
6978
  undo: 'Undo',
@@ -7000,31 +6981,35 @@ var en = {
7000
6981
  incorrect: 'Incorrect',
7001
6982
  showCorrectAnswer: 'Show correct answer',
7002
6983
  hideCorrectAnswer: 'Hide correct answer',
7003
- commonCorrectAnswerWithAlternates: 'Note: The answer shown above is the most common correct answer for this item. One or more additional correct answers are also defined, and will also be recognized as correct.',
6984
+ commonCorrectAnswerWithAlternates:
6985
+ 'Note: The answer shown above is the most common correct answer for this item. One or more additional correct answers are also defined, and will also be recognized as correct.',
7004
6986
  warning: 'Warning',
7005
6987
  showNote: 'Show Note',
7006
6988
  hideNote: 'Hide Note',
7007
- cancel: 'Cancel'
7008
- }
6989
+ cancel: 'Cancel',
6990
+ },
7009
6991
  };
7010
6992
 
7011
6993
  var es = {
7012
6994
  translation: {
7013
6995
  categorize: {
7014
- limitMaxChoicesPerCategory: 'Has alcanzado el límite de {{maxChoicesPerCategory}} respuestas por área. Para agregar otra respuesta, primero se debe eliminar una respuesta.',
7015
- maxChoicesPerCategoryRestriction: 'Para cambiar este valor a {{maxChoicesPerCategory}}, cada categoría debe tener {{maxChoicesPerCategory}} o menos opciones de respuesta'
6996
+ limitMaxChoicesPerCategory:
6997
+ 'Has alcanzado el límite de {{maxChoicesPerCategory}} respuestas por área. Para agregar otra respuesta, primero se debe eliminar una respuesta.',
6998
+ maxChoicesPerCategoryRestriction:
6999
+ 'Para cambiar este valor a {{maxChoicesPerCategory}}, cada categoría debe tener {{maxChoicesPerCategory}} o menos opciones de respuesta',
7016
7000
  },
7017
7001
  ebsr: {
7018
- part: 'Parte {{index}}'
7002
+ part: 'Parte {{index}}',
7019
7003
  },
7020
7004
  numberLine: {
7021
7005
  addElementLimit_one: 'Solo puedes agregar {{count}} elemento',
7022
7006
  addElementLimit_other: 'Solo puedes agregar {{count}} elementos',
7023
- clearAll: 'Borrar todo'
7007
+ clearAll: 'Borrar todo',
7024
7008
  },
7025
7009
  imageClozeAssociation: {
7026
- reachedLimit_one: 'Has alcanzado el límite de {{count}} respuesta por área. Para agregar otra respuesta, primero se debe eliminar una respuesta.',
7027
- reachedLimit_other: 'Lleno'
7010
+ reachedLimit_one:
7011
+ 'Has alcanzado el límite de {{count}} respuesta por área. Para agregar otra respuesta, primero se debe eliminar una respuesta.',
7012
+ reachedLimit_other: 'Lleno',
7028
7013
  },
7029
7014
  drawingResponse: {
7030
7015
  fillColor: 'Color de relleno',
@@ -7040,7 +7025,7 @@ var es = {
7040
7025
  green: 'Verde',
7041
7026
  white: 'Blanco',
7042
7027
  black: 'Negro',
7043
- onDoubleClick: 'Haz doble clic para revisar este texto. Presiona el botón de ingreso para enviar'
7028
+ onDoubleClick: 'Haz doble clic para revisar este texto. Presiona el botón de ingreso para enviar',
7044
7029
  },
7045
7030
  charting: {
7046
7031
  addCategory: 'Añadir categoría',
@@ -7052,8 +7037,8 @@ var es = {
7052
7037
  keyLegend: {
7053
7038
  incorrectAnswer: 'Respuesta incorrecta del estudiante',
7054
7039
  correctAnswer: 'Respuesta correcta del estudiante',
7055
- correctKeyAnswer: 'Clave de respuesta correcta'
7056
- }
7040
+ correctKeyAnswer: 'Clave de respuesta correcta',
7041
+ },
7057
7042
  },
7058
7043
  graphing: {
7059
7044
  point: 'Punto',
@@ -7069,24 +7054,25 @@ var es = {
7069
7054
  vector: 'Vector',
7070
7055
  label: 'Etiqueta',
7071
7056
  redo: 'Rehacer',
7072
- reset: 'Reiniciar'
7057
+ reset: 'Reiniciar',
7073
7058
  },
7074
7059
  mathInline: {
7075
- primaryCorrectWithAlternates: 'Nota: La respuesta que se muestra arriba es la respuesta correcta principal especificada por el autor para esta pregunta, pero también se pueden reconocer otras respuestas como correctas.'
7060
+ primaryCorrectWithAlternates:
7061
+ 'Nota: La respuesta que se muestra arriba es la respuesta correcta principal especificada por el autor para esta pregunta, pero también se pueden reconocer otras respuestas como correctas.',
7076
7062
  },
7077
7063
  multipleChoice: {
7078
7064
  minSelections: 'Seleccione al menos {{minSelections}}.',
7079
7065
  maxSelections_one: 'Sólo se permite {{maxSelections}} respuesta.',
7080
7066
  maxSelections_other: 'Sólo se permiten {{maxSelections}} respuestas.',
7081
7067
  minmaxSelections_equal: 'Seleccione {{minSelections}}.',
7082
- minmaxSelections_range: 'Seleccione entre {{minSelections}} y {{maxSelections}}.'
7068
+ minmaxSelections_range: 'Seleccione entre {{minSelections}} y {{maxSelections}}.',
7083
7069
  },
7084
7070
  selectText: {
7085
7071
  correctAnswerSelected: 'Respuesta Correcta',
7086
7072
  correctAnswerNotSelected: 'Respuesta Correcta No Seleccionada',
7087
7073
  incorrectSelection: 'Selección Incorrecta',
7088
- key: 'Clave'
7089
- }
7074
+ key: 'Clave',
7075
+ },
7090
7076
  },
7091
7077
  common: {
7092
7078
  undo: 'Deshacer',
@@ -7095,12 +7081,13 @@ var es = {
7095
7081
  incorrect: 'Incorrect',
7096
7082
  showCorrectAnswer: 'Mostrar respuesta correcta',
7097
7083
  hideCorrectAnswer: 'Ocultar respuesta correcta',
7098
- commonCorrectAnswerWithAlternates: 'Nota: La respuesta que se muestra arriba es la respuesta correcta más común para esta pregunta. También se definen una o más respuestas correctas adicionales, y también se reconocerán como correctas.',
7084
+ commonCorrectAnswerWithAlternates:
7085
+ 'Nota: La respuesta que se muestra arriba es la respuesta correcta más común para esta pregunta. También se definen una o más respuestas correctas adicionales, y también se reconocerán como correctas.',
7099
7086
  warning: 'Advertencia',
7100
7087
  showNote: 'Mostrar Nota',
7101
7088
  hideNote: 'Ocultar Nota',
7102
- cancel: 'Cancelar'
7103
- }
7089
+ cancel: 'Cancelar',
7090
+ },
7104
7091
  };
7105
7092
 
7106
7093
  instance.init({
@@ -7109,15 +7096,15 @@ instance.init({
7109
7096
  debug: true,
7110
7097
  resources: {
7111
7098
  en: en,
7112
- es: es
7113
- }
7099
+ es: es,
7100
+ },
7114
7101
  });
7115
- var index = {
7116
- translator: _extends({}, instance, {
7102
+
7103
+ var Translator = {
7104
+ translator: {
7105
+ ...instance,
7117
7106
  t: (key, options) => {
7118
- const {
7119
- lng
7120
- } = options;
7107
+ const { lng } = options;
7121
7108
 
7122
7109
  switch (lng) {
7123
7110
  // these keys don't work with plurals, don't know why, so I added a workaround to convert them to the correct lng
@@ -7125,7 +7112,6 @@ var index = {
7125
7112
  case 'en-US':
7126
7113
  options.lng = 'en';
7127
7114
  break;
7128
-
7129
7115
  case 'es_ES':
7130
7116
  case 'es-ES':
7131
7117
  case 'es_MX':
@@ -7133,19 +7119,13 @@ var index = {
7133
7119
  options.lng = 'es';
7134
7120
  break;
7135
7121
  }
7136
-
7137
- return instance.t(key, _extends({
7138
- lng
7139
- }, options));
7140
- }
7141
- }),
7142
- languageOptions: [{
7143
- value: 'en_US',
7144
- label: 'English (US)'
7145
- }, {
7146
- value: 'es_ES',
7147
- label: 'Spanish'
7148
- }]
7122
+ return instance.t(key, { lng, ...options });
7123
+ },
7124
+ },
7125
+ languageOptions: [
7126
+ { value: 'en_US', label: 'English (US)' },
7127
+ { value: 'es_ES', label: 'Spanish' },
7128
+ ],
7149
7129
  };
7150
7130
 
7151
7131
  var defaults = {
@@ -7165,7 +7145,7 @@ var defaults = {
7165
7145
  toolbarEditorPosition: 'bottom',
7166
7146
  };
7167
7147
 
7168
- const { translator } = index;
7148
+ const { translator } = Translator;
7169
7149
 
7170
7150
  const prepareChoice = (mode, defaultFeedback) => (choice) => {
7171
7151
  const out = {
@@ -7384,7 +7364,7 @@ const getScore = (config, session) => {
7384
7364
  */
7385
7365
  function outcome(model, session, env = {}) {
7386
7366
  return new Promise((resolve) => {
7387
- const partialScoringEnabled = partialScoring.enabled(model, env);
7367
+ const partialScoringEnabled = enabled(model, env);
7388
7368
  const score = getScore(model, session);
7389
7369
 
7390
7370
  resolve({ score: partialScoringEnabled ? score : score === 1 ? 1 : 0, empty: isEmpty_1(session) });