Forráskód Böngészése

Fixed Answer option rendering CT#351

Arthur Portugal 15 éve
szülő
commit
a667d6b993

+ 0 - 1
main/css/academica/default.css

@@ -2200,7 +2200,6 @@ input.arrowl {
 	background-repeat:no-repeat;
 }
 .u-m-answer {
-	float:left;
 	width:100%;
 }
 .u-m-answer p {

+ 0 - 1
main/css/baby_orange/default.css

@@ -2190,7 +2190,6 @@ input.arrowl {
 	background-repeat:no-repeat;
 }
 .u-m-answer {
-	float:left;
 	width:100%;
 }
 .u-m-answer p {

+ 0 - 1
main/css/blue_lagoon/default.css

@@ -2595,7 +2595,6 @@ input.arrowl {
 	background-repeat:no-repeat;
 }
 .u-m-answer {
-	float:left;
 	width:100%;
 }
 .u-m-answer p {

+ 0 - 1
main/css/cool_blue/default.css

@@ -2590,7 +2590,6 @@ input.arrowl {
 	background-repeat:no-repeat;
 }
 .u-m-answer {
-	float:left;
 	width:100%;
 }
 .u-m-answer p {

+ 0 - 1
main/css/corporate/default.css

@@ -2188,7 +2188,6 @@ input.arrowl {
 	background-repeat:no-repeat;
 }
 .u-m-answer {
-	float:left;
 	width:100%;
 }
 .u-m-answer p {

+ 0 - 1
main/css/cosmic_campus/default.css

@@ -2226,7 +2226,6 @@ input.arrowl {
 	background-repeat:no-repeat;
 }
 .u-m-answer {
-	float:left;
 	width:100%;
 }
 .u-m-answer p {

+ 0 - 1
main/css/delicious_bordeaux/default.css

@@ -2607,7 +2607,6 @@ input.arrowl {
 	background-repeat:no-repeat;
 }
 .u-m-answer {
-	float:left;
 	width:100%;
 }
 .u-m-answer p {

+ 0 - 1
main/css/dokeos_blue/default.css

@@ -2596,7 +2596,6 @@ input.arrowl {
 }
 
 .u-m-answer {
-	float:left;
 	width:100%;
 }
 .u-m-answer p {

+ 0 - 1
main/css/dokeos_classic/default.css

@@ -2905,7 +2905,6 @@ input.arrowl {
 	background-repeat:no-repeat;
 }
 .u-m-answer {
-	float:left;
 	width:100%;
 }
 .u-m-answer p {

+ 0 - 1
main/css/dokeos_classic_2D/default.css

@@ -2939,7 +2939,6 @@ input.arrowl {
 	background-repeat:no-repeat;
 }
 .u-m-answer {
-	float:left;
 	width:100%;
 }
 .u-m-answer p {

+ 0 - 1
main/css/empire_green/default.css

@@ -2606,7 +2606,6 @@ input.arrowl {
 	background-repeat:no-repeat;
 }
 .u-m-answer {
-	float:left;
 	width:100%;
 }
 .u-m-answer p {

+ 0 - 1
main/css/fruity_orange/default.css

@@ -2606,7 +2606,6 @@ input.arrowl {
 	background-repeat:no-repeat;
 }
 .u-m-answer {
-	float:left;
 	width:100%;
 }
 .u-m-answer p {

+ 0 - 1
main/css/medical/default.css

@@ -2864,7 +2864,6 @@ input.arrowl {
 	background-repeat:no-repeat;
 }
 .u-m-answer {
-	float:left;
 	width:100%;
 }
 .u-m-answer p {

+ 0 - 1
main/css/public_admin/default.css

@@ -2904,7 +2904,6 @@ input.arrowl {
 	background-repeat:no-repeat;
 }
 .u-m-answer {
-	float:left;
 	width:100%;
 }
 .u-m-answer p {

+ 0 - 1
main/css/royal_purple/default.css

@@ -2602,7 +2602,6 @@ input.arrowl {
 	background-repeat:no-repeat;
 }
 .u-m-answer {
-	float:left;
 	width:100%;
 }
 .u-m-answer p {

+ 0 - 1
main/css/silver_line/default.css

@@ -2594,7 +2594,6 @@ input.arrowl {
 	background-repeat:no-repeat;
 }
 .u-m-answer {
-	float:left;
 	width:100%;
 }
 .u-m-answer p {

+ 0 - 1
main/css/sober_brown/default.css

@@ -2896,7 +2896,6 @@ input.arrowl {
 	background-repeat:no-repeat;
 }
 .u-m-answer {
-	float:left;
 	width:100%;
 }
 .u-m-answer p {

+ 0 - 1
main/css/steel_grey/default.css

@@ -2608,7 +2608,6 @@ input.arrowl {
 	background-repeat:no-repeat;
 }
 .u-m-answer {
-	float:left;
 	width:100%;
 }
 .u-m-answer p {

+ 0 - 1
main/css/tasty_olive/default.css

@@ -2607,7 +2607,6 @@ input.arrowl {
 	background-repeat:no-repeat;
 }
 .u-m-answer {
-	float:left;
 	width:100%;
 }
 .u-m-answer p {

+ 27 - 20
main/exercice/exercise.lib.php

@@ -202,30 +202,31 @@ function showQuestion($questionId, $onlyAnswers=false, $origin=false,$current_it
 				$answer=str_replace("{texcode}",$texstring,$answer);
 
 			}
-
 			// unique answer
 			if($answerType == UNIQUE_ANSWER) {
 				$s.="<input type='hidden' name='choice2[".$questionId."]' value='0'>
 				<tr>
 				 <td>
 				 	<div class='u-m-answer'>
-					<p style='float:left; padding-right:4px;'><input class='checkbox' type='radio' name='choice[".$questionId."]' value='".$answerId."'></p>";
+					<p style='float:left; padding-right:4px;'>
+					<span><input class='checkbox' type='radio' name='choice[".$questionId."]' value='".$answerId."'></p></span>";
 				$answer=api_parse_tex($answer);
-				$s.=$answer;
+				$s.=strip_tags($answer);
 				$s.="</div></td></tr>";
 
 			} elseif($answerType == MULTIPLE_ANSWER) {
 			// multiple answers
-				$s.="<tr>
+				$s.="<input type='hidden' name='choice2[".$questionId."]' value='0'>
+				<tr>
 				  <td>
-				  	<div class='u-m-answer'>
-				  	<p style='float:left; padding-right:4px;'><input class='checkbox' type='checkbox' name='choice[".$questionId."][".$answerId."]' value='1'>
-				  	<input type='hidden' name='choice2[".$questionId."][0]' value='0'></p>";
+					 <div class='u-m-answer'>
+					 <p style='float:left; padding-right:4px;'>
+					 <span><input class='checkbox' type='checkbox' name='choice[".$questionId."][".$answerId."]' value='1'></p></span>";
 				$answer = api_parse_tex($answer);
-				$s.=$answer;
+				$s.=strip_tags($answer);
 				$s.="</div></td></tr>";
-
 			}
+
 			// fill in blanks
 			elseif($answerType == FILL_IN_BLANKS)
 			{
@@ -245,11 +246,13 @@ function showQuestion($questionId, $onlyAnswers=false, $origin=false,$current_it
 					$s.="
 					<tr>
 					  <td colspan='2'>
-						<table border='0' cellpadding='0' cellspacing='0' width='100%'>
-						<tr>";
+						<div style='width:100%;' >";	
 					$answer=api_parse_tex($answer);
-					$s.="<td width='40%' valign='top'><b>".$cpt2."</b>.&nbsp;".$answer."</td>
-						  <td width='20%' valign='top' align='center'>&nbsp;&nbsp;<select name='choice[".$questionId."][".$answerId."]'>
+					//left part questions
+					$s.='	<span style=\' float:left; width:5%;\'><b>'.$cpt2.'</b>.&nbsp;</span>
+							<span style=\' float:left; width:95%;\'>'.$answer.'</span>';
+							
+					$s.="<td width='20%' valign='top' align='center'>&nbsp;&nbsp;<select name='choice[".$questionId."][".$answerId."]'>
 							<option value='0'>--</option>";
 
 		            // fills the list-box
@@ -257,16 +260,20 @@ function showQuestion($questionId, $onlyAnswers=false, $origin=false,$current_it
 						$s.="<option value='".$key."'>".$val['Lettre']."</option>";
 					}  // end foreach()
 
-					$s.="</select>&nbsp;&nbsp;</td>
-						  <td width='40%' valign='top'>";
+					$s.="</select>&nbsp;&nbsp;</td>";
+					
+					//right part (answers)
+					$s.="<td ><div style='width:100%;'>";	 
 					if(isset($Select[$cpt2]))
-						$s.='<b>'.$Select[$cpt2]['Lettre'].'.</b> '.$Select[$cpt2]['Reponse'];
+						$s.='<span style=\'float:left; width:5%;\'><b>'.$Select[$cpt2]['Lettre'].'.</b></span>
+							 <span style=\' float:left; width:95%;\'>'.$Select[$cpt2]['Reponse'].'</span>';
 					else
 						$s.='&nbsp;';
 					$s.="
-					</td>
-						</tr>
-						</table>
+						</div></td>";
+						 
+					$s.="			
+						</div>
 					  </td>
 					</tr>";
 
@@ -300,7 +307,7 @@ function showQuestion($questionId, $onlyAnswers=false, $origin=false,$current_it
 		if (!ereg("MSIE", $_SERVER["HTTP_USER_AGENT"])) {
 			$s .= '</table>';
 		}
-		$s .= '</div>';
+		$s .= '</div><br />';
 
 		// destruction of the Answer object
 		unset($objAnswerTmp);