freeCodeCamp: Swap blockquotes with code block in finding remainder file

in this file https://github.com/freeCodeCamp/freeCodeCamp/blob/bcc9beff1feffe611965ccb95060c42eae8fe864/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/finding-a-remainder-in-javascript.md

We have these quotes, which describe a code example. This breaks the RTL layout, and working around it is weird because quotes should be used to mention previous sentences or previous challenge info.

image

To sort this, we can use code block instead of quotes to display the example.

instead of

5 % 2 = 1 because Math.floor(5 / 2) = 2 (Quotient) 2 * 2 = 4 5 - 4 = 1 (Remainder)

we use

const five = 5;
const two = 2;
const quotient = Math.floor(5 / 2);
console.log(quotient); // logs 2

and instead of

17 % 2 = 1 (17 is Odd) 48 % 2 = 0 (48 is Even)

we use

const oddNumber = 17;
const evenNumber = 48;

If you would like to fix this issue, please make sure you read our guidelines for contributing, we prioritize contributors following the instructions in our guides. Join us in our chat room or the forum if you need help contributing, our moderators will guide you through this.

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 21 (21 by maintainers)

Most upvoted comments

okay to use mathematical expressions inside a code block?

I think for simple mathematical expressions like this it is fine. As long as we define the % operator (which it appears we do), then a screen reader user will know what that operator represents in the equation.

In my previous job we used Mathjax quite a bit and it is very helpful (especially for complex equations), but it is not perfect and does have some accessibility issues. This has a lot to do with the fact that not all browsers and screen readers support MathML yet. So for these simple equations I would recommend just putting them in a code block over using Mathjax anyway.

I just noticed, why is there a mentioning of Quotient in the example? this confused me

Edit: updated the example

Maybe it want to potray that the answer after dividing is the quotient ie the number after dividing 2 other numbers.

Ya, I have removed the label, because I don’t want the campers to add changes, then tell them “you know what, we have changed our mind, can you do this instead”

Yes you’re right @hbar1st . If a topic is covered in a later challenge then we don’t mention it in the earlier challenge so as to not confuse the user.

we can give a small intro or example of Math.floor because not everyone would go through each question in a sequence.

Math.floor is a function and the user has not learnt about functions till the challenge being discussed in this issue so this could end up confusing new users as they’re more likely to go through the challenges in sequence.