Project

General

Profile

Bug #351

Answer option rendering

Added by Carlos Vargas about 10 years ago. Updated over 9 years ago.

Status:
Feature implemented
Priority:
Normal
Category:
-
Target version:
Start date:
03/12/2009
Due date:
% Done:

100%

Estimated time:
Complexity:
Normal
SCRUM pts - complexity:
1

Description

when result of the rendering expands accross multiple lines, answer option lost its alignment

single /multiple answers
matching


Files

test.PNG (13.5 KB) test.PNG Marko Kastelic, 02/07/2010 11:53
answer_option_rendering.png (55.9 KB) answer_option_rendering.png Ivan Tcholakov, 25/07/2010 13:19
css_floar_right.png (22.9 KB) css_floar_right.png Ivan Tcholakov, 25/07/2010 19:18
div_margin.png (24.1 KB) div_margin.png Ivan Tcholakov, 25/07/2010 19:18
rtl_languages.png (25.8 KB) rtl_languages.png Ivan Tcholakov, 25/07/2010 20:30
ltr_test_1.png (26.6 KB) ltr_test_1.png Ivan Tcholakov, 26/07/2010 05:51
rtl_test_1.png (26.6 KB) rtl_test_1.png Ivan Tcholakov, 26/07/2010 05:51
ltr_test_2.png (26.1 KB) ltr_test_2.png Ivan Tcholakov, 26/07/2010 07:55
rtl_test_2.png (26.6 KB) rtl_test_2.png Ivan Tcholakov, 26/07/2010 07:55

History

#1

Updated by Carlos Vargas about 10 years ago

Actualizado por Isaac Flores hace 4 días

  • Estado changed from New to Assigned * Asignado a set to Isaac Flores

#2
Actualizado por Yannick Warnier hace 1 día

  • Asignado a changed from Isaac Flores to Arthur Portugal * Versión prevista changed from 1.8.6.1 to 1.8.6.2

#3
Actualizado por Yannick Warnier hace 1 día

Arthur, I think you already finished this. Could you confirm and close the task?

#2

Updated by Arthur Portugal about 10 years ago

  • Status changed from New to Assigned
  • SCRUM pts - complexity changed from ? to 1

I will take this task

#3

Updated by Arthur Portugal about 10 years ago

  • Status changed from Assigned to Needs testing
  • % Done changed from 0 to 90

This task is finished, ready to test

#4

Updated by Arthur Portugal about 10 years ago

  • Status changed from Needs testing to Bug resolved
  • % Done changed from 90 to 100
#5

Updated by Marko Kastelic over 9 years ago

Sorry to inform you, but this one is not resolved. I'm attaching small image ...

#6

Updated by Julio Montoya over 9 years ago

Hello, Which chamilo version are you using?
Can you add your CSS? In which type of question you found that?

Marko Kastelic wrote:

Sorry to inform you, but this one is not resolved. I'm attaching small image ...

#7

Updated by Marko Kastelic over 9 years ago

The version is 1.8.7 (original),
using default stylesheets (named Chamilo, Corporate, Cosmic

problem vas described in the original post. Here's how the answer is constructed :

<p style="float:left; padding-right:4px;">
<span><input class="checkbox" type="checkbox" name="choice[2][5]" value="1" ></p></span><p>ena</p>
<p>dva</p>
<p>tri</p>

if you look at the code, you will see, that the multiple lines cannot be align left. The whole answer field should be deviden into two fields: left one for the checkbox (or radiobutton) and right one for the answer text.

from this, i suspect, single, multiple and strict typos suffers from this problem

#8

Updated by Marko Kastelic over 9 years ago

sorry for typos,

#9

Updated by Marko Kastelic over 9 years ago

exercice.lib.php ( method showQuestion )

// cross-sectioned <p> && <span> elements // lines 224-225,245-246,266-267

// sample from original source from line 243-249:
<tr>
    <td colspan="3">
        <div class="u-m-answer">
         <p style="float:left; padding-right:4px;">
         <span><input class="checkbox" type="checkbox" name="choice['.$questionId.']['.$numAnswer.']" value="1" '.$selected.'></p></span>';
        $answer = api_parse_tex($answer);
        $s .= Security::remove_XSS($answer, STUDENT);
        $s .= '</div></td></tr>';

is interpreted as :
<tr> 
   <td colspan="3"> 
       <div class="u-m-answer"> 
      <p style="float:left; padding-right:4px;"> 
            <span><input class="checkbox" type="radio" name="choice[2]" value="5" >
          </p>
                 </span>

           <p>// three + lines </p> 
           <p>for (int i=0;i&lt;100;i++){</p> 
           <p>cout &lt;&lt; "test";</p> 
           <p>}</p>
       </div>
    </td>
</tr>

proposed / how it shoud be :
nesting 'answer' section to separate div, that is floated to the right, replaceing span&p tags:

<tr> 
   <td colspan="3"> 
       <div class="u-m-answer">     
      <p style="float:left; padding-right:4px;"> 
            <span><input class="checkbox" type="radio" name="choice[2]" value="5" >

                 </span>
           </p>

          <div style="float: right;">
            <p>// three + lines </p> 
            <p>for (int i=0;i&lt;100;i++){</p> 
            <p>cout &lt;&lt; "test";</p> 
            <p>}</p>
           </div> 
       </div>
    </td>
</tr>

where & what :

sequence of the lines (3 sections) : 226-228, 243-249, 264-270
that currently read as

-$answer = api_parse_tex($answer);
-$s .= Security::remove_XSS($answer, STUDENT);
-$s .= '</div></td></tr>';

should be changed as :

$answer = api_parse_tex($answer);
s .= '<div style="float: right;">;
s .= Security::remove_XSS($answer, STUDENT);
s .= '</div>';
$s .= '</div></td></tr>';
#10

Updated by Marko Kastelic over 9 years ago

oups,
forgot to replace the position of the span and p tag (just a line above)

#11

Updated by Marko Kastelic over 9 years ago

and ... width:95% to the answer div tag style

#12

Updated by Marko Kastelic over 9 years ago

reminder : this one is closed but not fixed ...

#13

Updated by Ivan Tcholakov over 9 years ago

I confirm, it has not been fixed.

#16

Updated by Ivan Tcholakov over 9 years ago

The suggestion
$s .= '<div style="float: right;">';
moves the texts to the right (tried with Opera).

I am going to make a commit this way:
$s .= '<div style="margin-left: 20px;">';
$s .= ...answer...
$s .= '</div>';

After that I will check how the test appears on all the visual themes.

#17

Updated by Ivan Tcholakov over 9 years ago

  • Status changed from Bug resolved to Needs testing
  • Assignee changed from Arthur Portugal to Ivan Tcholakov
  • Target version changed from 1.8.6.2 alpha to 1.8.7.1
  • % Done changed from 100 to 50
#18

Updated by Ivan Tcholakov over 9 years ago

12215:3f3d69a28871 Task #351 - Visual corrections for the tests, about the answer text margins.
http://code.google.com/p/chamilo/source/detail?r=3f3d69a288712eb7304f054cecfa84758424bd34&repo=classic

This change is not good enough for the languages with right-to-left writing system (arabic, etc.). Tomorrow I will try something else.

#19

Updated by Marko Kastelic over 9 years ago

Ivan Tcholakov wrote:

The suggestion
$s .= '<div style="float: right;">';
moves the texts to the right (tried with Opera).

Thanks Ivan, except for the rtl, it's good enough; btw. text is moved right if the width of the div is not set ...

#21

Updated by Ivan Tcholakov over 9 years ago

12241:54b368c18911 Task #351 - HTML-changes in "Tests" tool, showing proposed answers: Trying to use of the existing hidden table.
http://code.google.com/p/chamilo/source/detail?r=54b368c18911c36e265a6f72c99b4d5eab679762&repo=classic

#23

Updated by Ivan Tcholakov over 9 years ago

12253:04e532e85315 Task #351 - Bringing back the implementation with the <div> blocks.
http://code.google.com/p/chamilo/source/detail?r=04e532e85315ab6104ea76ca7d93715b141782a4&repo=classic

Are we Ok for closing this task?

#24

Updated by Ivan Tcholakov over 9 years ago

  • Status changed from Needs more info to Feature implemented
  • % Done changed from 90 to 100

I tried all the visual styles. The last transaction is good enough for me. I am closing this task.

Also available in: Atom PDF