Skip to content

Commit

Permalink
chore: [NSA-506] Add new symbols to Math Entry interaction for NSA / …
Browse files Browse the repository at this point in the history
…Next Gen (#384)

* New symbols

Added additional symbols to the MatheEntryInteraction (%, °, |,  ≈)

* feat: updating portable files

* feat: migration creation and versioning for creator

* feat: review's fixes and clearing redundancy

* feat: dependencies version rollback

---------

Signed-off-by: Kiril Hatalski <KirylHatalski@users.noreply.github.com>
Co-authored-by: NŠA development <nsa.github@gmail.com>
  • Loading branch information
KirylHatalski and nsa-developer authored Oct 13, 2023
1 parent c6361a8 commit afd2acc
Show file tree
Hide file tree
Showing 10 changed files with 101 additions and 19 deletions.
41 changes: 41 additions & 0 deletions migrations/Version202310111248461465_qtiItemPci.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

declare(strict_types=1);

namespace oat\qtiItemPci\migrations;

use Doctrine\DBAL\Schema\Schema;
use oat\tao\scripts\tools\migrations\AbstractMigration;
use Doctrine\Migrations\Exception\IrreversibleMigration;
use oat\qtiItemPci\scripts\install\RegisterPciMathEntry;

/**
* Auto-generated Migration: Please modify to your needs!
*
* phpcs:disable Squiz.Classes.ValidClassName
*/
final class Version202310111248461465_qtiItemPci extends AbstractMigration
{
public function getDescription(): string
{
return 'Update the Math Entry PCI with new math symbols';
}

public function up(Schema $schema): void
{
$this->addReport(
$this->propagate(
new RegisterPciMathEntry()
)(
['2.6.0']
)
);
}

public function down(Schema $schema): void
{
throw new IrreversibleMigration(
'In order to undo this migration, please revert the client-side changes and run ' . RegisterPciMathEntry::class
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,20 @@
&#x2192; {{__ "right arrow"}}
</label>
</div>
<div>
<label class="panel">
<input name="tool_degree" type="checkbox" {{#if tool_degree}}checked="checked"{{/if}}/>
<span class="icon-checkbox"></span>
° {{__ "Degree symbol"}}
</label>
</div>
<div>
<label class="panel">
<input name="tool_percent" type="checkbox" {{#if tool_percent}}checked="checked"{{/if}}/>
<span class="icon-checkbox"></span>
% {{__ "Percent"}}
</label>
</div>

<hr />
<h3>{{__ "Geometry"}}</h3>
Expand All @@ -176,13 +190,6 @@
&ang; {{__ "angle"}}
</label>
</div>
<div>
<label class="panel">
<input name="tool_integral" type="checkbox" {{#if tool_integral}}checked="checked"{{/if}}/>
<span class="icon-checkbox"></span>
{{__ "Indefinite integral"}}
</label>
</div>
<div>
<label class="panel">
<input name="tool_triangle" type="checkbox" {{#if tool_triangle}}checked="checked"{{/if}}/>
Expand Down Expand Up @@ -211,6 +218,13 @@
&#8869; {{__ "is perpendicular to"}}
</label>
</div>
<div>
<label class="panel">
<input name="tool_vline" type="checkbox" {{#if tool_vline}}checked="checked"{{/if}}/>
<span class="icon-checkbox"></span>
| {{__ "Vertical line, divide"}}
</label>
</div>

<hr />
<h3>{{__ "Trigonometry"}}</h3>
Expand All @@ -224,16 +238,16 @@
</div>
<div>
<label class="panel">
<input name="tool_cos" type="checkbox" {{#if tool_cos}}checked="checked"{{/if}}/>
<input name="tool_sin" type="checkbox" {{#if tool_sin}}checked="checked"{{/if}}/>
<span class="icon-checkbox"></span>
{{__ "cosinus"}}
{{__ "sinus"}}
</label>
</div>
<div>
<label class="panel">
<input name="tool_sin" type="checkbox" {{#if tool_sin}}checked="checked"{{/if}}/>
<input name="tool_cos" type="checkbox" {{#if tool_cos}}checked="checked"{{/if}}/>
<span class="icon-checkbox"></span>
{{__ "sinus"}}
{{__ "cosinus"}}
</label>
</div>
<div>
Expand Down Expand Up @@ -274,6 +288,13 @@
{{__ ""}} {{__ "greater than or equal"}}
</label>
</div>
<div>
<label class="panel">
<input name="tool_approx" type="checkbox" {{#if tool_approx}}checked="checked"{{/if}}/>
<span class="icon-checkbox"></span>
{{__ ""}} {{__ "Approximately"}}
</label>
</div>

<hr />
<h3>{{__ "Operands"}}</h3>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@ define([
tool_subset: toBoolean(interaction.prop('tool_subset'), true),
tool_superset: toBoolean(interaction.prop('tool_superset'), true),
tool_contains: toBoolean(interaction.prop('tool_contains'), true),
tool_approx: toBoolean(interaction.prop('tool_approx'), true),
tool_vline: toBoolean(interaction.prop('tool_vline'), true),
tool_degree: toBoolean(interaction.prop('tool_degree'), true),
tool_percent: toBoolean(interaction.prop('tool_percent'), true),
tool_matrix_2row: toBoolean(interaction.prop('tool_matrix_2row'), true),
tool_matrix_2row_2col: toBoolean(interaction.prop('tool_matrix_2row_2col'), true),
allowNewLine: toBoolean(interaction.prop('allowNewLine'), false),
Expand Down Expand Up @@ -231,6 +235,10 @@ define([
tool_subset: configChangeCallBack,
tool_superset: configChangeCallBack,
tool_contains: configChangeCallBack,
tool_approx: configChangeCallBack,
tool_vline: configChangeCallBack,
tool_degree: configChangeCallBack,
tool_percent: configChangeCallBack,
tool_matrix_2row: configChangeCallBack,
tool_matrix_2row_2col: configChangeCallBack,

Expand Down
4 changes: 4 additions & 0 deletions views/js/pciCreator/ims/mathEntryInteraction/imsPciCreator.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ define([
tool_subset: 'true',
tool_superset: 'true',
tool_contains: 'true',
tool_approx: 'true',
tool_vline: 'true',
tool_degree: 'true',
tool_percent: 'true',
allowNewLine: 'false',
enableAutoWrap: 'false'
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"label": "Math entry",
"short": "Math entry",
"description": "Allow test taker to type math formulas",
"version": "2.5.2",
"version": "2.6.0",
"author": "Christophe Noël",
"email": "christophe@taotesting.com",
"tags": [
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,10 @@ define([
subset: toBoolean(config.tool_subset, true),
superset: toBoolean(config.tool_superset, true),
contains: toBoolean(config.tool_contains, true),
approx: toBoolean(config.tool_approx, true),
vline: toBoolean(config.tool_vline, true),
degree: toBoolean(config.tool_degree, true),
percent: toBoolean(config.tool_percent, true),
matrix_2row: toBoolean(config.tool_matrix_2row, true),
matrix_2row_2col: toBoolean(config.tool_matrix_2row_2col, true),
},
Expand Down Expand Up @@ -838,6 +842,10 @@ define([
subset: {label: '&#x2282;', latex: '\\subset', fn: 'cmd', desc: 'Subset'},
superset: {label: '&#x2283;', latex: '\\supset', fn: 'cmd', desc: 'Superset'},
contains: {label: '&#x220B;', latex: '\\ni', fn: 'cmd', desc: 'Contains as member'},
approx: {label: '≈', latex: '\\approx', fn: 'cmd', desc: 'Approximately'},
vline: {label:'|', latex: '\\mid', fn: 'cmd', desc: 'Vertical line, divide'},
degree: {label: '°', latex: '°', fn: 'write', desc: 'Degree symbol'},
percent: {label: '%', latex: '\%', fn: 'write', desc: 'Percent'},
matrix_2row: {
label: '<svg height="0.8em" width="0.8em" viewBox="0 0 50 111" xmlns="http://www.w3.org/2000/svg" style="pointer-events: none;">' +
'<rect id="svg_1" height="50" width="50" y="0" x="0" stroke="#fff" fill="#7f7f7f"/>' +
Expand All @@ -863,11 +871,11 @@ define([
{id: 'functions', tools: ['sqrt', 'frac', 'exp', 'subscript', 'log', 'ln', 'limit', 'sum', 'nthroot']},
{
id: 'symbols',
tools: ['e', 'infinity', 'lparen', 'rparen', 'lbrace', 'rbrace', 'lbrack', 'rbrack', 'integral', 'colon', 'to']
tools: ['e', 'infinity', 'lparen', 'rparen', 'lbrace', 'rbrace', 'lbrack', 'rbrack', 'integral', 'colon', 'to', 'degree', 'percent']
},
{id: 'geometry', tools: ['angle', 'triangle', 'similar', 'paral', 'perp']},
{id: 'geometry', tools: ['angle', 'triangle', 'similar', 'paral', 'perp', 'vline']},
{id: 'trigo', tools: ['pi', 'sin', 'cos','tan']},
{id: 'comparison', tools: ['lower', 'greater', 'lte', 'gte']},
{id: 'comparison', tools: ['lower', 'greater', 'lte', 'gte', 'approx']},
{
id: 'operands',
tools: ['equal', 'plus', 'minus', 'times', 'timesdot', 'divide', 'plusminus', 'inmem', 'ninmem', 'union', 'intersec', 'congruent', 'subset', 'superset', 'contains']
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

0 comments on commit afd2acc

Please sign in to comment.