MantisBT

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005836ATutorTests/Surveyspublic2018-01-18 14:352018-02-27 19:00
Reportergreg 
Assigned Togreg 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target Version2.2.3Fixed in Version2.2.3 
Summary0005836: Categories Question Layout Breaks
DescriptionIn the Question Bank, when questions are in two or more categories, a question with HTML in it breaks if the truncation happens in the middle of an HTML element. Better in AContent but still breaks the questions display in the question bank

At line:

https://github.com/atutor/ATutor/blob/master/mods/_standard/tests/html/tests_questions.inc.php#L130 [^]
https://github.com/atutor/AContent/blob/master/tests/html/tests_questions.inc.php#L114 [^]
Steps To ReproduceIn the Question Bank, within a course
Import the attached QTI question bank
Create a question category
Move the question with the HTML in it, into that category
View the display

The HTML in the Question column breaks for the created category
You may need to move the HTML around in the question, of adjust the validate_length value to break the HTML.
Additional Informationecho AT_print((validate_length($row['question'], 250, VALIDATE_LENGTH_FOR_DISPLAY)), 'tests_questions.list');
TagsNo tags attached.
Affects versionSVN
SVN Revision#0895b9a..ad8ad3a master -> master
Attached Fileszip file icon test_prerequisites-Question_Bank-20180214.zip [^] (2,003 bytes) 2018-02-13 18:17

- Relationships

-  Notes
(0007684)
greg (administrator)
2018-01-18 15:56

Problem occurs when a question with HTML in it is truncated midway through an HTML element.
(0007762)
cindy (administrator)
2018-02-17 19:27

What do you think is the correct way to display the html element in this case. Off the top of my head, there are 2 ways:

1. remove all html tags in the sentence and only display the content in certain length. For example: "<html>This is the question</html>" will be displayed as "This is the ..."

2. figure out the closing tags and append them at the end of the truncated string to match the opening tags. For example, "<html>This is the question</html>" will be displayed as "<html>This is the ...</html>"

There are advantages and disadvantages either way:

The first one is easier to implement and the display style of strings are consistent.

The second one will handle the case when a html tag, such as an image, is the only content of a question, which using the first approach will display an empty line (no content). This way is also more complicated to implement and the display style for each question might vary because of the power of html.
(0007766)
greg (administrator)
2018-02-18 16:05

Extend length to 1450 chars. Not a solution to the problem, but good enough.
(0007839)
greg (administrator)
2018-02-27 19:00

Resolved in 2.2.3

- Issue History
Date Modified Username Field Change
2018-01-18 14:35 greg New Issue
2018-01-18 15:56 greg Note Added: 0007684
2018-02-13 18:06 greg Description Updated View Revisions
2018-02-13 18:06 greg Additional Information Updated View Revisions
2018-02-13 18:16 greg Description Updated View Revisions
2018-02-13 18:16 greg Additional Information Updated View Revisions
2018-02-13 18:17 greg File Added: test_prerequisites-Question_Bank-20180214.zip
2018-02-13 18:26 greg Steps to Reproduce Updated View Revisions
2018-02-13 18:26 greg Additional Information Updated View Revisions
2018-02-13 18:36 greg Description Updated View Revisions
2018-02-13 19:02 greg Assigned To => cindy
2018-02-13 19:02 greg Status new => assigned
2018-02-17 19:27 cindy Note Added: 0007762
2018-02-18 16:05 greg SVN Revision# => 0895b9a..ad8ad3a master -> master
2018-02-18 16:05 greg Note Added: 0007766
2018-02-18 16:05 greg Status assigned => resolved
2018-02-18 16:05 greg Fixed in Version => 2.2.3
2018-02-18 16:05 greg Resolution open => fixed
2018-02-18 16:05 greg Assigned To cindy => greg
2018-02-27 19:00 greg Note Added: 0007839
2018-02-27 19:00 greg Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker