Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/TR-4494/add new symbols in Math PCI #319

Merged
merged 6 commits into from
Sep 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions migrations/Version202209071113251465_qtiItemPci.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?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!
*/
final class Version202209071113251465_qtiItemPci extends AbstractMigration
{

public function getDescription(): string
{
return 'Register new version of Math Entry PCI with new symbols and functions';
}

public function up(Schema $schema): void
{
$this->addReport(
$this->propagate(
new RegisterPciMathEntry()
)(
['2.1.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 @@ -85,7 +85,27 @@
{{__ "ln"}}
</label>
</div>

<div>
<label class="panel">
<input name="tool_limit" type="checkbox" {{#if tool_limit}}checked="checked"{{/if}}/>
<span class="icon-checkbox"></span>
{{__ "limit"}}
</label>
</div>
<div>
<label class="panel">
<input name="tool_sum" type="checkbox" {{#if tool_sum}}checked="checked"{{/if}}/>
<span class="icon-checkbox"></span>
{{__ "sum"}}
</label>
</div>
<div>
<label class="panel">
<input name="tool_nthroot" type="checkbox" {{#if tool_nthroot}}checked="checked"{{/if}}/>
<span class="icon-checkbox"></span>
{{__ "n-root"}}
</label>
</div>
<hr />
<h3>{{__ "Symbols"}}</h3>

Expand Down Expand Up @@ -131,6 +151,20 @@
&#x222b; {{__ "Indefinite integral"}}
</label>
</div>
<div>
<label class="panel">
<input name="tool_colon" type="checkbox" {{#if tool_colon}}checked="checked"{{/if}}/>
<span class="icon-checkbox"></span>
: {{__ "colon"}}
</label>
</div>
<div>
<label class="panel">
<input name="tool_to" type="checkbox" {{#if tool_to}}checked="checked"{{/if}}/>
<span class="icon-checkbox"></span>
&#x2192; {{__ "right arrow"}}
</label>
</div>

<hr />
<h3>{{__ "Geometry"}}</h3>
Expand Down Expand Up @@ -202,7 +236,13 @@
{{__ "sinus"}}
</label>
</div>

<div>
<label class="panel">
<input name="tool_tan" type="checkbox" {{#if tool_tan}}checked="checked"{{/if}}/>
<span class="icon-checkbox"></span>
{{__ "tangent"}}
</label>
</div>
<hr />
<h3>{{__ "Comparison"}}</h3>

Expand Down Expand Up @@ -315,7 +355,34 @@
{{__ "set intersection"}}
</label>
</div>

<div>
<label class="panel">
<input name="tool_congruent" type="checkbox" {{#if tool_congruent}}checked="checked"{{/if}}/>
<span class="icon-checkbox"></span>
&#x2245; {{__ "congruent"}}
</label>
</div>
<div>
<label class="panel">
<input name="tool_subset" type="checkbox" {{#if tool_subset}}checked="checked"{{/if}}/>
<span class="icon-checkbox"></span>
&#x2282; {{__ "subset"}}
</label>
</div>
<div>
<label class="panel">
<input name="tool_superset" type="checkbox" {{#if tool_superset}}checked="checked"{{/if}}/>
<span class="icon-checkbox"></span>
&#x2283; {{__ "superset of"}}
</label>
</div>
<div>
<label class="panel">
<input name="tool_contains" type="checkbox" {{#if tool_contains}}checked="checked"{{/if}}/>
<span class="icon-checkbox"></span>
&#x220B; {{__ "contains as member"}}
</label>
</div>
<hr />

<h3 class="txt-error"><strong><span class="icon-warning"></span> {{__ "Experimental only"}}</strong></h3>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,16 @@ define([
tool_exp: toBoolean(interaction.prop('tool_exp'), true),
tool_log: toBoolean(interaction.prop('tool_log'), true),
tool_ln: toBoolean(interaction.prop('tool_ln'), true),
tool_limit: toBoolean(interaction.prop('tool_limit'), true),
tool_sum: toBoolean(interaction.prop('tool_sum'), true),
tool_nthroot: toBoolean(interaction.prop('tool_nthroot'), true),
tool_e: toBoolean(interaction.prop('tool_e'), true),
tool_infinity: toBoolean(interaction.prop('tool_infinity'),true),
squarebkts: toBoolean(interaction.prop('tool_rbrack'), true) && toBoolean(interaction.prop('tool_lbrack'), true),
tool_pi: toBoolean(interaction.prop('tool_pi'), true),
tool_cos: toBoolean(interaction.prop('tool_cos'), true),
tool_sin: toBoolean(interaction.prop('tool_sin'), true),
tool_tan: toBoolean(interaction.prop('tan'), true),
tool_lte: toBoolean(interaction.prop('tool_lte'), true),
tool_gte: toBoolean(interaction.prop('tool_gte'), true),
tool_times: toBoolean(interaction.prop('tool_times'), true),
Expand All @@ -140,6 +144,12 @@ define([
tool_ninmem: toBoolean(interaction.prop('tool_ninmem'), true),
tool_union: toBoolean(interaction.prop('tool_union'), true),
tool_intersec: toBoolean(interaction.prop('tool_intersec'),true),
tool_colon: toBoolean(interaction.prop('tool_colon'), true),
tool_to: toBoolean(interaction.prop('tool_to'), true),
tool_congruent: toBoolean(interaction.prop('tool_congruent'), true),
tool_subset: toBoolean(interaction.prop('tool_subset'), true),
tool_superset: toBoolean(interaction.prop('tool_superset'), true),
tool_contains: toBoolean(interaction.prop('tool_contains'), true),
allowNewLine: toBoolean(interaction.prop('allowNewLine'), false),
enableAutoWrap: toBoolean(interaction.prop('enableAutoWrap'), false)
}));
Expand Down Expand Up @@ -180,11 +190,15 @@ define([
tool_exp: configChangeCallBack,
tool_log: configChangeCallBack,
tool_ln: configChangeCallBack,
tool_limit: configChangeCallBack,
tool_sum: configChangeCallBack,
tool_nthroot: configChangeCallBack,
tool_e: configChangeCallBack,
tool_infinity: configChangeCallBack,
tool_pi: configChangeCallBack,
tool_cos: configChangeCallBack,
tool_sin: configChangeCallBack,
tool_tan: configChangeCallBack,
tool_lte: configChangeCallBack,
tool_gte: configChangeCallBack,
tool_times: configChangeCallBack,
Expand All @@ -207,6 +221,12 @@ define([
tool_ninmem: configChangeCallBack,
tool_union: configChangeCallBack,
tool_intersec: configChangeCallBack,
tool_colon: configChangeCallBack,
tool_to: configChangeCallBack,
tool_congruent: configChangeCallBack,
tool_subset: configChangeCallBack,
tool_superset: configChangeCallBack,
tool_contains: configChangeCallBack,

squarebkts: function squarebktsChangeCallBack(i, value) {
i.prop('tool_lbrack', value);
Expand Down
10 changes: 10 additions & 0 deletions views/js/pciCreator/ims/mathEntryInteraction/imsPciCreator.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,17 @@ define([
tool_exp: 'true',
tool_log: 'true',
tool_ln: 'true',
tool_limit: 'true',
tool_sum: 'true',
tool_nthroot: 'true',
tool_e: 'true',
tool_infinity: 'true',
tool_lbrack: 'true',
tool_rbrack: 'true',
tool_pi: 'true',
tool_cos: 'true',
tool_sin: 'true',
tool_tan: 'true',
tool_lte: 'true',
tool_gte: 'true',
tool_times: 'true',
Expand All @@ -99,6 +103,12 @@ define([
tool_ninmem: 'true',
tool_union: 'true',
tool_intersec: 'true',
tool_colon: 'true',
tool_to: 'true',
tool_congruent: 'true',
tool_subset: 'true',
tool_superset: 'true',
tool_contains: '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.0.1",
"version": "2.1.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 @@ -256,13 +256,17 @@ define([
exp: toBoolean(config.tool_exp, true),
log: toBoolean(config.tool_log, true),
ln: toBoolean(config.tool_ln, true),
limit: toBoolean(config.tool_limit, true),
sum: toBoolean(config.tool_sum, true),
nthroot: toBoolean(config.tool_nthroot, true),
e: toBoolean(config.tool_e, true),
infinity: toBoolean(config.tool_infinity, true),
lbrack: toBoolean(config.tool_lbrack, true),
rbrack: toBoolean(config.tool_rbrack, true),
pi: toBoolean(config.tool_pi, true),
cos: toBoolean(config.tool_cos, true),
sin: toBoolean(config.tool_sin, true),
tan: toBoolean(config.tool_tan, true),
lte: toBoolean(config.tool_lte, true),
gte: toBoolean(config.tool_gte, true),
times: toBoolean(config.tool_times, true),
Expand All @@ -288,7 +292,13 @@ define([
inmem: toBoolean(config.tool_inmem, true),
ninmem: toBoolean(config.tool_ninmem, true),
union: toBoolean(config.tool_union, true),
intersec: toBoolean(config.tool_intersec, true)
intersec: toBoolean(config.tool_intersec, true),
colon: toBoolean(config.tool_colon, true),
to: toBoolean(config.tool_to, true),
congruent: toBoolean(config.tool_congruent, true),
subset: toBoolean(config.tool_subset, true),
superset: toBoolean(config.tool_superset, true),
contains: toBoolean(config.tool_contains, true),
},

allowNewLine: toBoolean(config.allowNewLine, false),
Expand Down Expand Up @@ -613,13 +623,17 @@ define([
exp: {label: 'x&#8319;', latex: '^', fn: 'cmd', desc: 'Exponent'},
log: {label: 'log', latex: '\\log', fn: 'cmd', desc: 'Log'},
ln: {label: 'ln', latex: '\\ln', fn: 'cmd', desc: 'Ln'},
limit: {label: 'lim', latex: '\\lim', fn: 'cmd', desc: 'Limit'},
sum: {label: 'sum', latex: '\\sum', fn: 'cmd', desc: 'Sum'},
nthroot: {label: 'n-root', latex: '\\nthroot', fn: 'cmd', desc: 'N-root'},
e: {label: 'e', latex: '\\mathrm{e}', fn: 'write', desc: 'Euler\'s constant'},
infinity: {label: '&#8734;', latex: '\\infty', fn: 'cmd', desc: 'Infinity'},
lbrack: {label: '[', latex: '\\lbrack', fn: 'cmd', desc: 'Left bracket'},
rbrack: {label: ']', latex: '\\rbrack', fn: 'cmd', desc: 'Right bracket'},
pi: {label: '&pi;', latex: '\\pi', fn: 'cmd', desc: 'Pi'},
cos: {label: 'cos', latex: '\\cos', fn: 'cmd', desc: 'Cosinus'},
sin: {label: 'sin', latex: '\\sin', fn: 'cmd', desc: 'Sinus'},
tan: {label: 'tan', latex: '\\tan', fn: 'cmd', desc: 'Tangent'},
lte: {
label: self.getLabel('&le;'),
latex: self.getLabel('\\le'),
Expand Down Expand Up @@ -655,20 +669,26 @@ define([
inmem: {label: '&isin;', latex: '\\in', fn: 'cmd', desc: 'Is a member of'},
ninmem: {label: '&notin;', latex: '\\notin', fn: 'cmd', desc: 'Is not a member of'},
union: {label: '&cup;', latex: '\\cup', fn: 'cmd', desc: 'Set union'},
intersec: {label: '&cap;', latex: '\\cap', fn: 'cmd', desc: 'Set intersection'}
intersec: {label: '&cap;', latex: '\\cap', fn: 'cmd', desc: 'Set intersection'},
colon: {label: ':', latex: ':', fn: 'write', desc: 'Colon'},
to: {label: '&#x2192;', latex: '\\to', fn: 'write', desc: 'Right arrow'},
congruent: {label: '&#x2245;', latex: '\\cong', fn: 'cmd', desc: 'Congruent'},
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'},
},
availableToolGroups = [ // we use an array to maintain order
{id: 'functions', tools: ['sqrt', 'frac', 'exp', 'subscript', 'log', 'ln']},
{id: 'functions', tools: ['sqrt', 'frac', 'exp', 'subscript', 'log', 'ln', 'limit', 'sum', 'nthroot']},
{
id: 'symbols',
tools: ['e', 'infinity', 'lparen', 'rparen', 'lbrace', 'rbrace', 'lbrack', 'rbrack', 'integral']
tools: ['e', 'infinity', 'lparen', 'rparen', 'lbrace', 'rbrace', 'lbrack', 'rbrack', 'integral', 'colon', 'to']
},
{id: 'geometry', tools: ['angle', 'triangle', 'similar', 'paral', 'perp']},
{id: 'trigo', tools: ['pi', 'sin', 'cos']},
{id: 'trigo', tools: ['pi', 'sin', 'cos','tan']},
{id: 'comparison', tools: ['lower', 'greater', 'lte', 'gte']},
{
id: 'operands',
tools: ['equal', 'plus', 'minus', 'times', 'timesdot', 'divide', 'plusminus', 'inmem', 'ninmem', 'union', 'intersec']
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.

Large diffs are not rendered by default.

Loading