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

feature: Redesign WYSIWYG LaTeX #2646

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

taopkorczak
Copy link
Contributor

Redesign the WYSIWYG LaTeX formula editor

Symbols commonly used in Geometry items:

Triangle: △ ( not the delta symbol ∆ )
Angle: ∠
Congruent: ≅
Similar: ~
Parallel: ∥
Perpendicular: ⊥
Pi: 𝜋
Degrees: °
Alpha: 𝛼
Beta: 𝛽
Theta: 𝜃
Delta: ∆
Fractions:
Radicals:
Equations: (can be built using existing functionality)
Proportions: =
Multiplication: x
Parentheses: ( )
Colon: :

Symbols with overbars for the following geometric terms:

*Line
*Ray
*Line segment
*Arc
*Vector

Screen.Recording.2024-12-11.at.09.51.03.mov

@taopkorczak taopkorczak requested review from a team, olga-kulish and oatymart December 11, 2024 08:54
Copy link

github-actions bot commented Dec 11, 2024

Front-end summary Node 18

💯 Total ✅ Passed ⏭️ Skipped ❌ Failed
287 287 0 0

Copy link
Contributor

@oatymart oatymart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Result looks ok. The rendering of the double-arrow is a bit bad when "AB" is changed to something longer. I doubt that's fixable?
Screenshot 2024-12-11 at 13 34 53

Some styling things:
Screenshot 2024-12-11 at 13 42 24

In general I have concerns about editing directly mathquill.js. Can you investigate if the version in the forked repo is equivalent to mathquill.js? Perhaps it's better to update that before copying in.

views/js/lib/mathquill/mathquill.js Outdated Show resolved Hide resolved
views/js/lib/mathquill/mathquill.css Outdated Show resolved Hide resolved
Comment on lines -77 to -81
{ id: 'functions', tools: ['sqrt', 'frac', 'exp', 'log', 'ln'] },
{ id: 'symbols', tools: ['e', 'infinity', 'lbrack', 'rbrack'] },
{ id: 'trigo', tools: ['pi', 'sin', 'cos'] },
{ id: 'comparison', tools: ['lte', 'gte'] },
{ id: 'operands', tools: ['times', 'divide', 'plusminus'] }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have to be sure that the old ids were not used by anything (for example, is there a qtiCreator config to turn groups on or off?)

views/js/qtiCreator/editor/mathInput/mathInput.js Outdated Show resolved Hide resolved
views/js/qtiCreator/editor/mathInput/mathInput.js Outdated Show resolved Hide resolved
views/js/qtiCreator/editor/mathInput/mathInput.js Outdated Show resolved Hide resolved
@taopkorczak
Copy link
Contributor Author

Updated mathquill editor, here PR: oat-sa/mathquill#7

@taopkorczak taopkorczak requested a review from oatymart December 18, 2024 08:22
@taopkorczak taopkorczak marked this pull request as ready for review December 18, 2024 08:22
@taopkorczak taopkorczak force-pushed the feature/AUT-3966/redesign-WYSIWYG-latex branch from 105cefc to b1bf915 Compare December 20, 2024 07:42
@taopkorczak
Copy link
Contributor Author

Now all methods are working correctly:

mathquill.mov

Copy link

Version

Target Version 30.26.0
Last version 30.25.2

There are 0 BREAKING CHANGE, 1 feature, 3 fixes

@taopkorczak
Copy link
Contributor Author

Copy link
Contributor

@olga-kulish olga-kulish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work!

e: { label: '℮', latex: '\\mathrm{e}', fn: 'write', desc: __('Euler\'s constant') },
infinity: { label: '∞', latex: '\\infty', fn: 'cmd', desc: __('Infinity') },
colon: { label: ':', latex: ':', fn: 'write', desc: __('Colon') },
lbrack: { label: '[', latex: '\\lbrack', fn: 'cmd', desc: __('Left bracket') },
rbrack: { label: ']', latex: '\\rbrack', fn: 'cmd', desc: __('Right bracket') },
Copy link
Contributor

@olga-kulish olga-kulish Dec 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I click on [ or ], there's text not symbol in the editor:
Screenshot_43

Is it fine for you? If yes, ok, let's ignore this.

equals: { label: '=', latex: '=', fn: 'write', desc: __('Equals') },

// Comparison
equiv: { label: '≡', latex: '\\equiv', fn: 'cmd', desc: __('Equivalent') },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it the wrong symbol? The upper line should be ~: https://www.compart.com/en/unicode/U+2245 and the wording should be Congruent.

desc: __('Ray')
},
line: {
label: '<math xmlns="http://www.w3.org/1998/Math/MathML"><mover accent="true"><mrow><mi>A</mi><mi>B</mi></mrow><mo style="margin-bottom: 0.2rem;">&#x2E3A;</mo></mover></math>',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm worried about accessibility, but I don't have anything to suggest so maybe we can ignore it for now and leave it for QA.

NVDA, for overline and overparen, doesn't announce anything at all, which is pretty bad.
For other three it announces right arrow, left right arrow, right harpoon which is more or less understandable. I guess it announces the "names" of unicode symbols.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants