Moodle

Analysis quiz report produces a very wide tables if correct answer doesn't contain spaces

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: 1.9.5, 2.2.1
  • Fix Version/s: STABLE backlog
  • Component/s: Quiz
  • Labels:
  • Affected Branches:
    MOODLE_19_STABLE, MOODLE_22_STABLE

Description

Steps to reproduce:
1.Create a shortanswer question with a big 100% graded answer without spaces, something like

abcasdsadasdgksjdhgfkjasgdfkjasghfkajshgdfkajshgdfkjsdabcasdsadasdgksjdhgfkjasgdfkjasghfkajshgdfkajshgdfkjsdabcasdsadasdgksjdhgfkjasgdfkjasghfkajshgdfkajshgdfkjsdabcasdsadasdgksjdhgfkjasgdfkjasghfkajshgdfkajshgdfkjsdabcasdsadasdgksjdhgfkjasgdfkjasghfkajshgdfkajshgdfkjsdabcasdsadasdgksjdhgfkjasgdfkjasghfkajshgdfkajshgdfkjsdabcasdsadasdgksjdhgfkjasgdfkjasghfkajshgdfkajshgdfkjsdabcasdsadasdgksjdhgfkjasgdfkjasghfkajshgdfkajshgdfkjsdabcasdsadasdgksjdhgfkjasgdfkjasghfkajshgdfkajshgdfkjsdabcasdsadasdgksjdhgfkjasgdfkjasghfkajshgdfkajshgdfkjsdabcasdsadasdgksjdhgfkjasgdfkjasghfkajshgdfkajshgdfkjsdabcasdsadasdgksjdhgfkjasgdfkjasghfkajshgdfkajshgdfkjsdabcasdsadasdgksjdhgfkjasgdfkjasghfkajshgdfkajshgdfkjsdabcasdsadasdgksjdhgfkjasgdfkjasghfkajshgdfkajshgdfkjsdabcasdsadasdgksjdhgfkjasgdfkjasghfkajshgdfkajshgdfkjsdklkabcasdsadasdgksjdhgfkjasgdfkjasghfkajshgdfkajshgdfkjsdabcasdsadasdgksjdhgfkjasgdfkjasghfkajshgdfkajshgdfkjsdabcasdsadasdgksjdhgfkjasgdfkjasghfkajshgdfkajshgdfkjsdjkabcasdsadasdgksjdhgfkjasgdfkjasghfkajshgdfkajshgdfkjsdjkjkabcasdsadasdgksjdhgfkjasgdfkjasghfkajshgdfkajshgdfkjsdlkjabcasdsadasdgksjdhgfkjasgdfkjasghfkajshgdfkajshgdfkjsdlkjabcasdsadasdgksjdhgfkjasgdfkjasghfkajshgdfkajshgdfkjsdlkjabcasdsadasdgksjdhgfkjasgdfkjasghfkajshgdfkajshgdfkjsdlkjabcasdsadasdgksjdhgfkjasgdfkjasghfkajshgdfkajshgdfkjsdlkjabcasdsadasdgksjdhgfkjasgdfkjasghfkajshgdfkajshgdfkjsd

(a real case was a regular expression from inherited question type, for example
[\s\t\n\r]*int[\s\t\n\r]+summ[\s\t\n\r]*([\s\t\n\r]*int[\s\t\n\r]*(*[\s\t\n\r]*(Array|)|(|[\s\t\n\r]+Array)[\s\t\n\r]*[[\s\t\n\r]*])[\s\t\n\r]*,[\s\t\n\r]*int[\s\t\n\r]*(|[\s\t\n\r]+size)[\s\t\n\r]*)[\s\t\n\r]*;[\s\t\n\r]*
2. Login as student and make 1-2 attempts on this question
3. Login as teacher and go to question analysis report page.
You'll see that all answer displayed in the table cell as one string, making a very wide column that results in quite poorly usable table.

Issue Links

Activity

Hide
Tim Hunt added a comment -

Do you have any idea about a good solution? What do you think about sticking in a call to shorten_text?

Show
Tim Hunt added a comment - Do you have any idea about a good solution? What do you think about sticking in a call to shorten_text?
Hide
Oleg Sychev added a comment -

Hmm ... Jira seems having this problem too but gmail web interface - doesn't .

It seems to break strings on a sequences of about 30 characters, place them in quotes and inserting <wbr> tag between them.
like

"abcdeabcdeabcdeabcdeabcdeabcde"
<wbr>
"abcdeabcdeabcdeabcdeabcdeabcde"
<wbr>

etc. The <wbr> tag seems to be a useful one: it allows a browser to insert line break but only if browser find it necessary.
The only browser not supporting it is IE8 but there are workarounds present like described in http://yishimcgee.wordpress.com/2009/05/09/strange-ie8-text-wrapping-bug/
However <wbr> (while been de-facto supported almost on every browser) breaks XHTML compatibily, an alternatives are ​ or ­ , you can see compatibility tables on http://www.quirksmode.org/oddsandends/wbr.html
I guess Moodle could use this technique too. It ensures everething is fits to where it should.

What can use a shortnening on analysis report is a question text. They can be quite long and while they usually contains spaces (don't affecting the column width), they often result in a very high row, which isn't nice too (thought didn't bother as much as width problem)

Show
Oleg Sychev added a comment - Hmm ... Jira seems having this problem too but gmail web interface - doesn't . It seems to break strings on a sequences of about 30 characters, place them in quotes and inserting <wbr> tag between them. like "abcdeabcdeabcdeabcdeabcdeabcde" <wbr> "abcdeabcdeabcdeabcdeabcdeabcde" <wbr> etc. The <wbr> tag seems to be a useful one: it allows a browser to insert line break but only if browser find it necessary. The only browser not supporting it is IE8 but there are workarounds present like described in http://yishimcgee.wordpress.com/2009/05/09/strange-ie8-text-wrapping-bug/ However <wbr> (while been de-facto supported almost on every browser) breaks XHTML compatibily, an alternatives are ​ or ­ , you can see compatibility tables on http://www.quirksmode.org/oddsandends/wbr.html I guess Moodle could use this technique too. It ensures everething is fits to where it should. What can use a shortnening on analysis report is a question text. They can be quite long and while they usually contains spaces (don't affecting the column width), they often result in a very high row, which isn't nice too (thought didn't bother as much as width problem)
Hide
Oleg Sychev added a comment -

Oh, it seems the browser eat up the alternatives for <wbr> They are (i'm inserting spaces between every symbol)
& # 8 2 0 3 ;
and
& s h y ;

Show
Oleg Sychev added a comment - Oh, it seems the browser eat up the alternatives for <wbr> They are (i'm inserting spaces between every symbol) & # 8 2 0 3 ; and & s h y ;
Hide
Oleg Sychev added a comment -

This issue seems to should be resolved as a patch to shorten_text function to add soft hyphens (or soft line breaks) on every 10 character if there is a sequence of 20 characters without whitespaces, and use shorten_text in answers handling in analisys report with big length after that...

Show
Oleg Sychev added a comment - This issue seems to should be resolved as a patch to shorten_text function to add soft hyphens (or soft line breaks) on every 10 character if there is a sequence of 20 characters without whitespaces, and use shorten_text in answers handling in analisys report with big length after that...
Hide
Michael de Raadt added a comment -

Thanks for reporting this issue.

We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported.

If you believe that this issue is still relevant to current versions (2.1 and beyond), please comment on the issue. Issues left inactive for a further month will be closed.

Michael d;

lqjjLKA0p6

Show
Michael de Raadt added a comment - Thanks for reporting this issue. We have detected that this issue has been inactive for over a year has been recorded as affecting versions that are no longer supported. If you believe that this issue is still relevant to current versions (2.1 and beyond), please comment on the issue. Issues left inactive for a further month will be closed. Michael d; lqjjLKA0p6
Hide
Oleg Sychev added a comment -

I can't re-test it now but don't think anything was done to solve problem of too long answers without spaces in tables.

Show
Oleg Sychev added a comment - I can't re-test it now but don't think anything was done to solve problem of too long answers without spaces in tables.
Hide
Oleg Sychev added a comment -

By the way, new version of JIRA handle it correctly.

Show
Oleg Sychev added a comment - By the way, new version of JIRA handle it correctly.
Hide
Tim Hunt added a comment -

Correct. Still an issue.

The solution is probably http://w3schools.com/cssref/css3_pr_word-wrap.asp - and arguably this should be applied everywhere in Moodle, not just in quiz report tables.

Show
Tim Hunt added a comment - Correct. Still an issue. The solution is probably http://w3schools.com/cssref/css3_pr_word-wrap.asp - and arguably this should be applied everywhere in Moodle, not just in quiz report tables.
Hide
Oleg Sychev added a comment -

"arguably this should be applied everywhere in Moodle" - this seems like discussion in GDF is imminent. Tim, Do you want me to start it or prefer to do it yourself?

Show
Oleg Sychev added a comment - "arguably this should be applied everywhere in Moodle" - this seems like discussion in GDF is imminent. Tim, Do you want me to start it or prefer to do it yourself?
Hide
Tim Hunt added a comment -

Please go ahead. GDF, or Themes forum?

Show
Tim Hunt added a comment - Please go ahead. GDF, or Themes forum?

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated: