Project

General

Profile

Bug #7155

Exercice description JS bug

Added by Kevin LEVRON over 5 years ago. Updated over 5 years ago.

Status:
Bug resolved
Priority:
Normal
Assignee:
Category:
Exercises
Target version:
Start date:
14/05/2014
Due date:
% Done:

100%

Estimated time:
Complexity:
Easy
SCRUM pts - complexity:
?

Description

Hello

There's a bug in exercice description accordion, when description contains more than one line, corresponding js code is not escaped correctly :
https://github.com/chamilo/chamilo-lms/blob/1.9.x/main/exercice/exercise_submit.php#L687

addslashes is not the right way to use a php var in js code, json_encode is much better.

PS: by the way, description should be output directly (not using js).

Associated revisions

Revision 0bd99fe9
Added by Yannick Warnier over 5 years ago

Merge pull request #300 from uppa/uppa.7155

Fixes #7155 : Exercice description bug

History

#1

Updated by Yannick Warnier over 5 years ago

Adding Daniel and Francis to this one, as they're working on similar issues with audio players in description. Just in case.

#3

Updated by Yannick Warnier over 5 years ago

Kevin LEVRON wrote:

PS: by the way, description should be output directly (not using js).

Not sure how it is done exactly now, but we do want to load the description dynamically through AJAX only when it is "unfolded", to avoid loading a long page in case the description is very long (which then affects all questions in a one-question-per-page test)

#4

Updated by Yannick Warnier over 5 years ago

  • Status changed from New to Bug resolved
  • Assignee set to Kevin LEVRON
  • % Done changed from 0 to 100

Patch checked and merged. Thanks!

#5

Updated by Yannick Warnier over 5 years ago

  • Subject changed from Exercice description bug to Exercice description JS bug

Also available in: Atom PDF