Validation of multiplication operators

Validation of multiplication operators

by Martin Kraska -
Number of replies: 2

I wonder how the validation for STACK input fields can provide reasonable information if the students use . instead of * (or implicit multiplication).

I had a case where a student got stuck with the input 


Validation looks fine but the prt refuses this as incompatible unit.

From maxima side, the dot is a legal multiplication operator for matrices (non-commutative multiply). The tex display unfortunately is identical to that of commutative multiply. Perhaps, the built in unit check might check for this issue if incompatibility is detected?

These ideas come to my mind:

- add . to the forbidden words. Works in the given case but isn't a general option, because this would have to be done for any input field with multiplication in the possible response.

- use some special markup for . in the validation. Actually, currently we can have this, if multiplication sign is switched from dot to cross or blank. It seems that this doesn't extend to .

- add e hint: "Note, you are using matrix multiplication. If that is not your intent, use * instead of ." along with the incompatibility message.

This is the first time I encounter this problem but I can understand the frustration of the student. I add this to the validation problem list in https://github.com/mkraska/meclib/wiki/Feedback-Overview


Average of ratings: Useful (1)
In reply to Martin Kraska

Re: Validation of multiplication operators

by Oleg Melnikov -
Hi Martin. I haven't tried it in STACK, but subst(["."="*"], m.K); might work (where m.K is in the student's answer variable) ? In wxMaxima and in TryItOnline it gives K m, which should be multiplication.
-------------------------------------------------------------------------------------------
In my STACK questions, I add a collapsible section "Quick Maxima+STACK syntax" at the bottom of each question with a reference to entering solutions. It's not cluttering the screen, but expands to a list of rules. Here is HTML:
<details><summary><strong>Quick Maxima+STACK syntax</strong> (click here)</summary>Instruction text goes here</details>
Here is a preview:
quick maxima + STACK syntax
----------------------------------------------------------------------------------------------------------------------------
Also, I add an information button for the answers, where students are particularly prone to making a mistake in entry (but I still expect a solution in a specific form). I'm hoping that students won't get stuck on data entry for more than a couple of attempts (or none at all, if they read the instructions).
Here is HTML:
<span title="You must enter a set of solutions, 
even if there is only one solution. 
Use Maxima's set notation.">ℹ️</span>
Here is a preview:
critical points
In reply to Martin Kraska

Re: Validation of multiplication operators

by Christopher Sangwin -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Yes Oleg,
Basically mathematicians overload notation a lot. Normally this doesn't cause us problems (as humans) but there are only so many "contexts" we can take into account. E.g. the space has at least three meanings, (1) multiplication "4 x", (2) addition "4 1/2" (I can send you elementary school textbooks as evidence here as I know this falls out of use in advanced maths!), and (3) function application "sin x". Well, take your pick, but STACK has to choose one and stick to it.

I like the idea of forbidding "." as multiplication in contexts where matrices can't occur, and adding a validation warning. Scientific units is probably one of those contexts! We do some of this kind of thing already. Thanks for the useful suggestion.
Chris