Project

General

Profile

Bug #6985

Using < or > in a "fill blanks" answer does not work

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:
13/02/2014
Due date:
24/04/2014
% Done:

100%

Estimated time:
Spent time:
Complexity:
Normal
SCRUM pts - complexity:
?

Description

Hello

Actually it is not possible to use < or > in a "fill blanks" answer since corresponding html entities (encoded by fckeditor) are decoded here : https://github.com/chamilo/chamilo-lms/blob/1.9.x/main/exercice/fill_blanks.class.php#L163

I don't see the meaning of this line, fckeditor option ProcessHTMLEntities is true for a reason, chamilo should not reverse this.


Files

Selection_002.png (23.2 KB) Selection_002.png Julio Montoya, 14/04/2014 13:52
Selection_002.png (23.2 KB) Selection_002.png Julio Montoya, 14/04/2014 13:52
chamilo_fill_in_blank.png (184 KB) chamilo_fill_in_blank.png Luis Eduardo Telaya Escobedo, 27/04/2014 23:04
chamilo_fill_in_blank_result7.png (188 KB) chamilo_fill_in_blank_result7.png Luis Eduardo Telaya Escobedo, 27/04/2014 23:04

Related issues

Related to Chamilo LMS - Bug #6933: French accents encoding issues in exercisesBug resolved18/01/2014

Actions

Associated revisions

Revision d16c0f43 (diff)
Added by Eric Marguin over 5 years ago

fix #6985 Using < or > in a "fill blanks" answer does not work

Revision ab9536e9 (diff)
Added by Eric Marguin over 5 years ago

fix #6985 Using < or > in a "fill blanks" answer does not work

History

#1

Updated by Daniel Barreto over 5 years ago

  • Status changed from New to Needs more info
  • Assignee set to Daniel Barreto
  • % Done changed from 0 to 10

tested and work whit '>' and '<' in fill blanks answers, and about that line is because

$answer = $form->getSubmitValue('answer');

this return the '<' as < and '>' as >

then the next line decode this entities by their values

$answer = api_html_entity_decode($answer, ENT_QUOTES, $charset);

and then the question have '>' and '<', and then work fine whit the answer when matching

Needs more info about this bug

#2

Updated by Daniel Barreto over 5 years ago

  • Status changed from Needs more info to Assigned
  • Assignee deleted (Daniel Barreto)

tested and work whit '>' and '<' in fill blanks answers, and about that line is because

$answer = $form->getSubmitValue('answer');

this return the '<' as &lt; and '>' as &gt;

then the next line decode this entities by their values

$answer = api_html_entity_decode($answer, ENT_QUOTES, $charset);

and then the question have '>' and '<', and then work fine whit the answer when matching

Needs more info about this bug

#3

Updated by Kevin LEVRON over 5 years ago

Here is a simple test : a<b<[c]

This has been tested with latest 1.9.x code.

#4

Updated by Kevin LEVRON over 5 years ago

Corresponding entry in databse : <p>a<b<[c]</p><p> </p>::10@

But it should be <p>a&lt;b&lt;[c]</p><p> </p>::10@

#5

Updated by Yannick Warnier over 5 years ago

  • Assignee set to Julio Montoya

This should probably be fixed inside of FCKEditor as after that it is impossible to figure out if it's part of an HTML tag or if it is a content character.
Kevin is right: it should be stored as the last value mentionned, as we are expecting HTML code in the database for the answer anyway.

Assigning Julio to this one as the changes to FCKEditor are somewhat subtle

#6

Updated by Kevin LEVRON over 5 years ago

Well, I don't agree, wysiwyg editor should convert specials chars, it is a normal behavior.

And actually, others question classes do not use api_html_entity_decode when saving rich content in database.

#7

Updated by Julio Montoya over 5 years ago

I can't reproduce the error, maybe it was resolved?

#8

Updated by Yannick Warnier over 5 years ago

This is highly related to other tasks about HTML in answers.
But maybe it is not necessary to review it anymore, given it's apparently fixed. Kevin, could you check on https://stable.chamilo.org?

#10

Updated by Yannick Warnier over 5 years ago

  • Status changed from Needs more info to Assigned
#11

Updated by Eric Marguin over 5 years ago

I can work on it next week if needed. Let me know.

#12

Updated by Yannick Warnier over 5 years ago

  • Assignee set to Eric Marguin

That would be very welcome, Eric.

#13

Updated by Yannick Warnier over 5 years ago

  • Due date set to 24/04/2014
#15

Updated by Yannick Warnier over 5 years ago

  • Status changed from Assigned to Needs testing
  • Assignee changed from Eric Marguin to Yoselyn Castillo
#16

Updated by Yannick Warnier over 5 years ago

Acabo de incluir el cambio en Chamilo 1.9.x. Debería ser visible dentro de 10 minutos en stable.chamilo.org

#17

Updated by Yannick Warnier over 5 years ago

  • Assignee deleted (Yoselyn Castillo)
  • % Done changed from 10 to 80
#18

Updated by Luis Eduardo Telaya Escobedo over 5 years ago

Tested and reviewed,

I attached screenshots which show this bug is already resolved:

chamilo_fill_in_blank.png
chamilo_fill_in_blank_result7.png

Best regards

Also available in: Atom PDF