Conversation
plegner
left a comment
There was a problem hiding this comment.
Looks good! You can remove the left.svg and right.svg files, and there is also a bit of code cleanup we can do, e.g. removing/commenting out) the all console.log statements. (This last part could happen in a later PR if you prefer, or are still working on those components.)
| move: (p: Point) => { | ||
| // Check that this row not equal to the other output | ||
| const row = clamp(Math.round((p.y - 20) / 40), 0, this.size - 1); | ||
| this.model[key] = row; |
There was a problem hiding this comment.
I don't think the output rows need to be interactive right? They are the same (or swapped) as the input rows
|
|
||
| if (this.checkForSolvedIdentity()) { | ||
| console.log('Success!'); | ||
| this.$step.tools.confetti(); |
There was a problem hiding this comment.
Rather than showing confetti, maybe something more subtle like this.$step.addHint('correct')
There was a problem hiding this comment.
That's definitely more appropriate, I just really wanted a chance to use the confetti 😆
| let expr; | ||
| let value; | ||
| try { | ||
| // FIXME: @philipp this might throw an error, Not sure how else to handle it. |
There was a problem hiding this comment.
For now, I would just make factor a number (e.g. 1 or 0.5). We can allow things like 1/2 in the future, but then we should use a proper equation editor rather than an input field
There was a problem hiding this comment.
I will try this for now, but I'm not sure it would work with numbers like 1/3 or 1/12.
There was a problem hiding this comment.
Some things to try:
(a) Rounding? With error margins?
(b) Just switch the problems until we add the expression editor.
(c) Ignore the problem (but China matrix will be close to unsolvable, as checkForSolvedIdentity checks for exact value)
| for (let j = 0; j < numRows; j++) { | ||
| // console.log(`Checking row=${i}; col=${j}; value=${values[j]}`); | ||
| if (j === i) { | ||
| if (values[j].text != '1') { |
There was a problem hiding this comment.
We should avoid storing state in the DOM. Rather than accessing .text (which is quite an expensive operation), we should just have a numeric, nested array that contains the current value of the output matrix
No description provided.