@webwriter/quiz 1.1.1 → 1.1.2

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.
@@ -5893,7 +5893,6 @@ var WebwriterChoice = class extends (_a2 = LitElementWw, _mode_dec = [n5({ type:
5893
5893
  this.items.forEach((item) => {
5894
5894
  itemActive = itemActive || item.active;
5895
5895
  });
5896
- console.log(itemActive);
5897
5896
  if (!itemActive) {
5898
5897
  this.items.forEach((item) => {
5899
5898
  item.valid = void 0;
@@ -5902,7 +5901,6 @@ var WebwriterChoice = class extends (_a2 = LitElementWw, _mode_dec = [n5({ type:
5902
5901
  });
5903
5902
  return;
5904
5903
  }
5905
- console.warn("h");
5906
5904
  if (!this.solution) {
5907
5905
  this.items.forEach((item) => item.valid = true);
5908
5906
  return;
@@ -5910,7 +5908,6 @@ var WebwriterChoice = class extends (_a2 = LitElementWw, _mode_dec = [n5({ type:
5910
5908
  this.items.forEach(
5911
5909
  (item) => {
5912
5910
  item.valid = (this.solution ?? []).includes(item.id);
5913
- console.log(this.solution, item.active, item.valid);
5914
5911
  if (item.active != item.valid && !this.showSolution) {
5915
5912
  this.items.forEach((item2) => {
5916
5913
  item2.showSolution = false;
@@ -3393,7 +3393,6 @@ var WebwriterOrderItem = class extends (_a2 = LitElementWw, _showSolution_dec =
3393
3393
  }
3394
3394
  async updated(_changedProperties) {
3395
3395
  if (_changedProperties.has("layout") && this.layout === "list") {
3396
- console.log("switched to list");
3397
3396
  this.syncSize(true);
3398
3397
  this.observer?.disconnect();
3399
3398
  this.requestUpdate();
@@ -4593,7 +4593,7 @@ var WebwriterOrder = class extends (_a2 = LitElementWw, _layout_dec = [n5({ type
4593
4593
  super(...arguments);
4594
4594
  __runInitializers(_init2, 5, this);
4595
4595
  __publicField(this, "localize", generated_default);
4596
- __privateAdd(this, _showSolution, __runInitializers(_init2, 8, this, true)), __runInitializers(_init2, 11, this);
4596
+ __privateAdd(this, _showSolution, __runInitializers(_init2, 8, this, false)), __runInitializers(_init2, 11, this);
4597
4597
  __publicField(this, "observer");
4598
4598
  __publicField(this, "orderSheet", new CSSStyleSheet());
4599
4599
  __publicField(this, "clearDropPreviews", () => {
@@ -4701,11 +4701,9 @@ var WebwriterOrder = class extends (_a2 = LitElementWw, _layout_dec = [n5({ type
4701
4701
  }
4702
4702
  }
4703
4703
  reportSolution() {
4704
- console.log(this.solution, this.items);
4705
4704
  this.solution.forEach((id, i7) => this.querySelector(`#${id}`).validOrder = i7);
4706
4705
  if (!this.showSolution) {
4707
4706
  this.items.forEach((item) => {
4708
- console.log(item.validOrder, this.solution.indexOf(item.id));
4709
4707
  if (this.items.indexOf(item) != this.solution.indexOf(item.id)) {
4710
4708
  this.items.forEach((i7) => {
4711
4709
  i7.showSolution = false;
@@ -7972,7 +7972,6 @@ var WebwriterQuiz = class extends (_a2 = LitElementWw, _randomOrder_dec = [n5({
7972
7972
  __publicField(this, "localize", generated_default);
7973
7973
  __privateAdd(this, _randomOrder, __runInitializers(_init2, 8, this, false)), __runInitializers(_init2, 11, this);
7974
7974
  __publicField(this, "handleReset", () => {
7975
- console.warn(this.tasks);
7976
7975
  this.tasks.forEach((task) => task.handleReset());
7977
7976
  this.requestUpdate();
7978
7977
  this.submitted = false;
@@ -8230,7 +8230,6 @@ var WebwriterTask = class extends (_a2 = LitElementWw, _hints_dec = [o7({ slot:
8230
8230
  }
8231
8231
  });
8232
8232
  __publicField(this, "handleHintKeydown", (e11) => {
8233
- console.log(document.getSelection().anchorOffset === 0, this.hints.includes(document.getSelection().anchorNode.parentElement));
8234
8233
  if (e11.key === "Backspace" && document.getSelection().anchorOffset === 0 && this.hints.includes(document.getSelection().anchorNode.parentElement)) {
8235
8234
  this.hintOpen = false;
8236
8235
  this.hint = false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webwriter/quiz",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "Add interactive tasks (multiple choice, order, free text, highlighting, or speech input). Make a quiz out of multiple tasks.",
5
5
  "keywords": [
6
6
  "webwriter-widget",
@@ -93,19 +93,16 @@ export class WebwriterChoice extends LitElementWw {
93
93
 
94
94
  let itemActive: boolean = false
95
95
  this.items.forEach(item => {itemActive = itemActive || item.active})
96
- console.log(itemActive)
97
96
  if(!itemActive){
98
97
  this.items.forEach(item => {item.valid = undefined; item.active = false; item.style.pointerEvents = "auto"})
99
98
  return
100
99
  }
101
- console.warn("h")
102
100
  if(!this.solution) {
103
101
  this.items.forEach(item => item.valid = true)
104
102
  return
105
103
  }
106
104
  this.items.forEach(item => {
107
105
  item.valid = (this.solution ?? []).includes(item.id)
108
- console.log(this.solution, item.active, item.valid)
109
106
  if(item.active != item.valid && !this.showSolution){
110
107
  this.items.forEach(item => {
111
108
  item.showSolution = false
@@ -367,7 +367,7 @@ export class WebwriterOrderItem extends LitElementWw {
367
367
 
368
368
  protected async updated(_changedProperties: PropertyValues) {
369
369
  if(_changedProperties.has("layout") && this.layout === "list") {
370
- console.log("switched to list")
370
+ // console.log("switched to list")
371
371
  this.syncSize(true)
372
372
  this.observer?.disconnect()
373
373
  this.requestUpdate()
@@ -142,7 +142,7 @@ export class WebwriterOrder extends LitElementWw {
142
142
  type: Boolean,
143
143
  label: {"en": "show Solution", "de": "Lösung anzeigen"},
144
144
  })
145
- accessor showSolution = true
145
+ accessor showSolution = false
146
146
 
147
147
  observer: MutationObserver
148
148
 
@@ -272,11 +272,9 @@ export class WebwriterOrder extends LitElementWw {
272
272
 
273
273
 
274
274
  reportSolution() {
275
- console.log(this.solution, this.items)
276
275
  this.solution.forEach((id, i) => (this.querySelector(`#${id}`) as any).validOrder = i)
277
276
  if(!this.showSolution){
278
277
  this.items.forEach(item => {
279
- console.log(item.validOrder, this.solution.indexOf(item.id))
280
278
  if(this.items.indexOf(item) != this.solution.indexOf(item.id)){
281
279
  this.items.forEach(i => {
282
280
  i.showSolution = false
@@ -214,7 +214,6 @@ export class WebwriterQuiz extends LitElementWw {
214
214
  }
215
215
 
216
216
  handleReset = () => {
217
- console.warn(this.tasks)
218
217
  this.tasks.forEach(task => task.handleReset())
219
218
  this.requestUpdate()
220
219
  this.submitted = false
@@ -460,7 +460,7 @@ export class WebwriterTask extends LitElementWw {
460
460
  }
461
461
 
462
462
  handleHintKeydown = (e: KeyboardEvent) => {
463
- console.log(document.getSelection().anchorOffset === 0, this.hints.includes(document.getSelection().anchorNode.parentElement))
463
+ // console.log(document.getSelection().anchorOffset === 0, this.hints.includes(document.getSelection().anchorNode.parentElement))
464
464
  if(e.key === "Backspace" && document.getSelection().anchorOffset === 0 && this.hints.includes(document.getSelection().anchorNode.parentElement)) {
465
465
  this.hintOpen = false
466
466
  this.hint = false