marcusgreen / moodle-qtype_wordselect

langHighlight words by clicking e.g. select all nouns in this sentence
2 stars 10 forks source link

WordSelect: Spacing issue on row with punctuation #24

Closed mkassaei closed 4 years ago

mkassaei commented 4 years ago

Hi Marcus, Happy New Year!

An issue has been reported with spacing when a word is adjacent with punctuation.

qtype_WS_spacing1 qtype_WS_spacing1

qtype_WS_spacing2 qtype_WS_spacing2

qtype_WS_spacing3 qtype_WS_spacing3

As you see from the screenshots (qtype_WS_spacing2) the ',' after the word 'corner' and the ';' after the word 'pie' are barely visible. I have just add a css margin to '.que.wordselect .selected' class. It looks better, however, I think we might need a better solution. For instance, in Spanish they use punctuation at the start and also middle of a sentence (such as inverted question and exclamation marks). In other words, we need some sort of logic that the margin-left or margin-right is used conditionally in context when a selectable word is adjacent with punctuation (left or right of the word without a white-space). Also, some question author may create questions where only punctuation are the selectable item. In this case the selected punctuation will overlap the adjacent word.

marcusgreen commented 4 years ago

Thanks Mahmoud, this reminds me of the issue (or possibly feature) that when you select a word there is a re-adjustment of the other text. I will look into this over the coming weekend, but my first reaction is to agree and say we should start off with some CSS and then look into alternatives solutions. I will be looking into this at the same time.

https://github.com/marcusgreen/moodle-qtype_wordselect/issues/22

marcusgreen commented 4 years ago

I will be investigating why the behat part of the travis process keep failing with a time out while I am at it. I have a feeling this is a generic/standard issue but am not sure of the fix right now.

mkassaei commented 4 years ago

It was a conflict with margin appearing twice in the same css class, which I notice later and forced pushed again.

marcusgreen commented 4 years ago

Would it be OK if I merge but then change margin: 0 3px 0 3px; to margin: 0 2px 0 2px;

I looked into why the behat tests are failing but have not come up with a solution.

mkassaei commented 4 years ago

I think this is a good compromise for now.

marcusgreen commented 4 years ago

OK, will merge so it is in the history then do a commit with margin: 0 2px 0 2px; Later on.

marcusgreen commented 4 years ago

I will also add a sample question in https://github.com/marcusgreen/moodle-qtype_wordselect/blob/master/examples/en/wordselect_examples.xml That includes some punctuation to test this stuff. Thanks