Cater Waiter a11y Issue

In the introduction to sets, there is an explanation regarding how multiple unique items in a set all remain there. A line of code in a code block illustrates this:

>>> multiple_elements = {'😀', '😃', '😄', '😁'}
{'😀', '😃', '😄', '😁'}

However, when using the “Accessibility Dark” theme, the emojis’ colors are all inverted (on macOS and Chrome, anyways). This makes them very difficult to see, and from my perspective they all looked the same. Because of this, it looked like adding 4 identical items to a new set resulted in a set of length 4 (when it should have been of length 1). It wasn’t until I copied & pasted the code into a Python editor myself did I notice that the glyphs were actually different.

I suggest using four extremely separate glyphs to avoid confusion:

>>> multiple_elements = {'🐍', '⭐️', '💻', '🎉'}
{'💻', '⭐️', '🐍', '🎉'}

Of course, it doesn’t have to be those four – just a series of glyphs that are significantly different such that they cannot be misconstrued as being identical.

3 Likes

Isn’t the following after that in the reading sufficient?

>>> multiple_duplicates =  {'Hello!', 'Hello!', 'Hello!', 
                            '¡Hola!','Привіт!', 'こんにちは!', 
                            '¡Hola!','Привіт!', 'こんにちは!'}
{'こんにちは!', '¡Hola!', 'Hello!', 'Привіт!'}

It illustrates two different things. The first illustrates that if every item is unique, then the resultant set will contain every item. The second illustrates that if some items are not unique, the resultant set will only contain a single item from each. They are related, but the second example builds upon the first.

Another note is that the second example contains a lot of characters that can appear similar to someone who isn’t multilingual. Only after carefully examining the words in the second example do I see that it is an illustration of the following:

>>> multiple_duplicates =  {1, 1, 1, 
                            2,3, 4, 
                            2,3, 4}
{4, 2, 1, 3}

Personally, I think that is much clearer, but I understand that not everyone things the same way, so I can understand wanting to use words. Plus, if all examples only used bland numbers, it’s definitely not as “fun.” :wink:

Ultimately, what caused me to trip up on this was the first example. The second example may not be bad per se, but I was so confused on the first one that I didn’t even bother looking further down the page, as I was trying to reconcile the difference between what was just taught to me with the apparent contradiction in this seemingly simple first example.

I hope this doesn’t come across as being pedantic or bikeshedding. My reasoning behind mentioning this at all was that if I was getting tripped up on this, it was likely others were too.

Given this is a Python concept exercise, this is @BethanyG’s call as the track maintainer, but I’d also prefer the glyphs to be more distinct. I had some trouble just now telling at a glance whether those emojis were the same or not, and that was a bit distracting.

1 Like

Someone might tell you that I do not mind “pendantic” given the definition of the word (when used with honesty).

I definitely do understand the “but I was so stunned I stopped at the thing that stunned me” but often we have to consider all the information to understand something. That is not a bad thing to encourage. Still, I agree, this has visual acuity issues, as well as “one of these things is not like the other” on Hard Difficulty in any case other than using some kind of thing to look deeper such as a hexdump, or good eyesight, or particularly honed attention to minute details.

The only one that I truly count on is the hexdump. ;)

Yeah honestly, if this was a Medium or Hard exercise, I’d already be in the mindset of “let’s look everywhere,” but this wasn’t even an Easy exercise – my mindset was framed as “let’s learn the absolute basics and not throw in anything else.” It’s the reason I thought that the answer was only in what was previously taught to me and just that example.

Ultimately, I was able to figure it out (albeit after a few minutes of testing and head-scratching). I figured I’d leave this here for you guys to get some feedback; whether or not you adjust it is up to you.

2 Likes

I didn’t know emojis inverted like that. Funky! With my webmaster hat on, I don’t think there’s much we can do about this, as these are in a codeblock, rather than being html elements we could add a class to, and we just invert the colours on everything. So I’m not sure what the best way forward is to solve this. I wouldn’t want to stop using emojis particularly, but maybe we could switch to some obviously different emojis that are still recognisable inverted?

I’m open to any suggestions if anyone has any.


FWIW, the Insiders dark mode doesn’t have this issue as it’s a lot more sophisticated (ie we have colors and styles for everything rather than inverting).

1 Like

You can attach classes to them, as they are classified when highlighting, but HLJS (currently) doesn’t tokenize the emojis by themselves, so it’s the entire string right now. It’s likely possible with an extension adding a regex to the contains of QUOTE_STRING_MODE, but you’d then need that in every language.

2 Likes

I mean, this satisfies both the “I think the glyphs should be different” and the “I want the glyphs to be fun emojis” requirements.

1 Like

Thanks for reporting.

Emojis changed in [Cater Waiter & Sets Concept]: Better Differentiation of Emoji Examples in Introduction & About Files by BethanyG · Pull Request #3991 · exercism/python · GitHub, which will be merged after CI clears has been merged.

1 Like

Not sure this solves all the inversion issues, but I did test these out on my Spyder IDE set to a very dark theme, and they weren’t terribly readable in detail, but were differentiable by outline. Granted, my IDE is set to 6pt font, so …



1 Like

Dear Michael
I’d also not say, it is easy…
as I don’t know the tests(I’m using the online editor)
and:
it seems I have to include exception handling… which was not told in the lesson.

Hi @AnandNisang,

I think you may be confused. This is a concept exercise on the Python track - not julia - and we don’t require or teach error handling in any of the concept exercises.

We do have some practice exercises that have error handling, but none of the concept exercises do.

I don’t know why you think that. There is nothing in the instructions or the tests that mentions exceptions.

The Julia authors gratefully plagiarized Bethany’s Python work and ported it to the Julia syllabus (with just a few changes).

2 Likes