Text in problems gets truncated if in non latin language

I have this strange problem since I first upgraded to Juniper release, and now also with the KOA release.

The text seems to be unexpectedly interrupted in some sentences, while in others it’s ok (the text is suddenly cut before the end of the sentence).

I must note that I only have this problem when the text inside the problems is in the Greek language (I have also tried a couple of other languages with non Latin characters and the problem occurs there too).

There is no problem when using English or when the text is in raw html or other non-problem components (at least the ones I have checked).

I noticed the problem always happens with text inside a Problem surrounded by this DIV tag:

<div id="seq_contents_0"
    aria-labelledby="tab_0" ...

but it also happens in some discussion forum posts.

The HTML inside this DIV appears encoded so I believe it’s parsed by the mathjax or some other browser-side javascript module on browser side so as to appear correctly on the user’s browser…

A hint that led me to this observation is that when I view the page source, the text inside the mentioned DIV tag is full and the html appears to be encoded, but when I use the browser’s inspect function (of the browser’s web developer tools), the text is truncated just like it is shown on the page (probably because, the inspect tool shows the final code, while view source shows what arrives to the browser before being parsed and shown).

To check if the problem is created by the mathjax module, I “turned off” mathjax to see what will happen, but although the math in the problems (and in forum) didn’t parse (as expected), the text remained incomplete in certain problems or in certain forum posts…

If I break the problematic sentences in paragraphs with the <P> tag, the text appears to be ok, but because I have many older courses that re-run often, it’s not possible to do this everywhere as a workaround (especially when it seems to be a bit random, it doesn’t happen everywhere)…
The picture I have linked below is a small example of the problem!

1 Like

The same happened for me with arabic recently.
Possible solution:

The workaround I found is to add some invisible html markup as follows:

  1. Find exactly where the text is truncated.
  2. insert some invisible html markup just before that point. You can use for example <i></i>.
>>Your truncated question prompt. Insert <i></i> just before the the truncated part starts.<<
( ) answer 1
(x) answer 2
( ) answer 3

Hypotheses:

  • The problem text / Markdown is too long (mine is 20 questions with long prompts)
  • The question prompt that was truncated is too long (mine is over 300 characters), but I didn’t have the issue with other longer prompts.
  • That question in that emplacement sucks ! (I know it’s not clear, I tried with mine in a new blank problem and it displayed flawlessly. So I can’t say for sure when this happens.

Please tell us if this also works for you.

@ARMBouhali Thank you for your hint.

I tried a similar approach, I break the long sentences into shorter ones with a <p> tag around them and this seems to work but it’s not a solution, it’s just a sloppy workaround!

The problem is a bit random, and I have to first create all the problems/excercises, then eye-scan them one by one, and check if there is something wrong with them, and still, I cannot be sure as for different people (when viewed from different devices or browsers possibly) the sentences break in different parts.

Moreover, I have many old courses that have re-runs very often, and I have to go through all their texts over and over again in order to find the problematic sentences and use the <p> tag workaround…

It’s too time consuming, and it’s also quite strange, as I didn’t have this problem some versions back!
It started after I upgraded to Juniper release and it happens ever since!!!

I really hope I get some answers at least for the reason why this happens so I might try to find a solution, if none is given by the Open Edx developers team…

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.