@mathscan/math-exercise-engine 1.0.12 → 1.0.13

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/dist/style.css CHANGED
@@ -49,6 +49,8 @@
49
49
  --exercise-border: #ddd;
50
50
  --exercise-border-focus: var(--exercise-primary);
51
51
  --exercise-highlight-color: #aef59d;
52
+ --exercise-correct: #22c55e;
53
+ --exercise-incorrect: #ef4444;
52
54
 
53
55
  /* ========================================
54
56
  SPACING VARIABLES
@@ -181,7 +183,6 @@
181
183
  flex-wrap: wrap;
182
184
  align-items: center;
183
185
  justify-content: center;
184
- align-items: baseline;
185
186
  gap: var(--exercise-element-margin);
186
187
  padding-bottom: calc(var(--exercise-line-gap) * 0.5);
187
188
  }
@@ -371,6 +372,30 @@ mark {
371
372
  border-color: var(--exercise-border-focus);
372
373
  }
373
374
 
375
+ /* ========================================
376
+ VALIDATION STATUS
377
+ ======================================== */
378
+
379
+ .inline-input.widget--correct {
380
+ border-color: var(--exercise-correct, #22c55e);
381
+ box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
382
+ }
383
+
384
+ .inline-input.widget--incorrect {
385
+ border-color: var(--exercise-incorrect, #ef4444);
386
+ box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
387
+ }
388
+
389
+ .inline-input-chip.widget--correct {
390
+ border-color: var(--exercise-correct, #22c55e);
391
+ box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
392
+ }
393
+
394
+ .inline-input-chip.widget--incorrect {
395
+ border-color: var(--exercise-incorrect, #ef4444);
396
+ box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
397
+ }
398
+
374
399
  /**
375
400
  * Widget Styles
376
401
  *
@@ -479,6 +504,24 @@ button.drag-option {
479
504
  box-shadow: 0 2px 4px rgba(0, 122, 204, 0.2);
480
505
  }
481
506
 
507
+ /* ========================================
508
+ VALIDATION STATUS
509
+ ======================================== */
510
+
511
+ .radio-option.widget--correct {
512
+ background: var(--exercise-correct, #22c55e);
513
+ border-color: var(--exercise-correct, #22c55e);
514
+ color: white;
515
+ box-shadow: 0 2px 4px rgba(34, 197, 94, 0.25);
516
+ }
517
+
518
+ .radio-option.widget--incorrect {
519
+ background: var(--exercise-incorrect, #ef4444);
520
+ border-color: var(--exercise-incorrect, #ef4444);
521
+ color: white;
522
+ box-shadow: 0 2px 4px rgba(239, 68, 68, 0.25);
523
+ }
524
+
482
525
  /* ========================================
483
526
  NUMERIC KEYPAD
484
527
  ======================================== */
@@ -567,6 +610,64 @@ td.exercise-table-cell, th.exercise-table-cell {
567
610
  border: 2px solid #7c6cf2;
568
611
  }
569
612
 
613
+ /* ========================================
614
+ FRACTION WIDGET
615
+ ======================================== */
616
+
617
+ .fraction {
618
+ display: inline-flex;
619
+ flex-direction: column;
620
+ align-items: center;
621
+ vertical-align: -0.15em;
622
+ margin: 0 0.2em;
623
+ line-height: 1;
624
+ }
625
+
626
+ .fraction-numerator {
627
+ margin-bottom: 3px;
628
+ }
629
+
630
+ .fraction-numerator,
631
+ .fraction-denominator {
632
+ display: flex;
633
+ align-items: center;
634
+ justify-content: center;
635
+ min-width: 1.5em;
636
+ padding: 0.05em 0.1em;
637
+ line-height: 2.2;
638
+ }
639
+
640
+ .fraction-bar {
641
+ width: 100%;
642
+ min-width: 2em;
643
+ height: 3px;
644
+ background-color: var(--exercise-accent);
645
+ border-radius: 1px;
646
+ margin: 1px 0;
647
+ }
648
+
649
+ .fraction-fixed {
650
+ color: var(--exercise-text);
651
+ min-width: 1ch;
652
+ text-align: center;
653
+ }
654
+
655
+ .fraction-input {
656
+ width: 3.2em !important;
657
+ padding: 0.15em 0.2em;
658
+ font-size: 0.9em;
659
+ text-align: center;
660
+ }
661
+
662
+ .fraction-chip {
663
+ font-size: 0.9em;
664
+ padding: 0.1em 0.3em;
665
+ }
666
+
667
+ .fraction-slot-droppable {
668
+ display: inline-flex;
669
+ }
670
+
570
671
  /**
571
672
  * Number Line Styles
572
673
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mathscan/math-exercise-engine",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
4
4
  "description": "A DSL parser and validator for math exercises - transforms text-based exercise definitions into structured AST and JSON",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",