thexerteproject / xerteonlinetoolkits

Xerte Online Toolkits
www.xerte.org.uk
Apache License 2.0
62 stars 61 forks source link

Crossword - marking of letters in grid relies solely on colour #1081

Closed FayCross closed 2 years ago

FayCross commented 2 years ago

The crossword page currently uses green background on cells in the grid to indicate if they are correct. This needs to change so that the marking is also done in a non-colour dependant way. Possibly ticks/crosses after the clues when the whole word has been completed correctly. Although I this won't be simple to do as I think the the marking doesn't look at the whole word at the moment and just at individual input cells.

ronm123 commented 2 years ago

@FayCross I don't have time to check right now but is it possible to add ticks just via css with :before or ;after like we did with gapfill etc e.g. https://github.com/thexerteproject/xerteonlinetoolkits/commit/559347ad7f3d6975c8cd206f840a0f9308647293

FayCross commented 2 years ago

The marking is only done on the crossword at the moment (not on clues) so it would need to be ticks & crosses on every individual letter in crossword. I think that would look quite messy. I will have a look at how other online crosswords do it

JohnSmith-LT commented 2 years ago

@ronm123 @FayCross This probably needs someone to rework the css file as I've just hijacked the gapFill css section to add ticks and crosses on the :after pseudo element instead of the :before. Probably needs some more extensive testing also...

FayCross commented 2 years ago

@JohnSmith-LT I can see the ticks being added next to the clues after I submit my answers but they always seem to be ticks - even when the wrong answer is submitted

JohnSmith-LT commented 2 years ago

Probably something I'm overlooking for some fringe cases @FayCross - I only did a bit of testing but it was seeming to work fine:

image

Can you share your example that doesn't work and i'll try to figure out where it's going wrong?

JohnSmith-LT commented 2 years ago

Is your Capitalisation on? Both of these have it on, image above was 3 attempts, image below was single attempt:

image

JohnSmith-LT commented 2 years ago

In fact, scrap that, I also tried with mixed letters and it seems to work for me:

image

FayCross commented 2 years ago

I'm not changing any settings - just creating a crossword page & adding words to it. I've done a bit more testing and it's odd. See this example: https://xot310beta.dlearning.nl/play.php?template_id=66

Page 1 works: crossword1

Page 2 doesn't: crossword2

Same words for both and same mistakes entered (too for two and fine for five). Only difference between those pages is that the clues on page 1 match the answers while the clues on page 2 are numbers.

JohnSmith-LT commented 2 years ago

Ah right, that's my fault then @FayCross because I'm matching the words to the contents of the

tags in the Across/Down fields... didn't think about different words/clues... Not sure why they are all being considered correct though?!?

Leave that with me...

JohnSmith-LT commented 2 years ago

Try that latest commit @FayCross, seems to be working with those cases now:

image

FayCross commented 2 years ago

@JohnSmith-LT thanks, that's working for me too now