[svn r11548] Fix the bug with question number

skala
Julian Prud'homme 19 years ago
parent 2384e178dc
commit 51c1cc9927
  1. 6
      main/exercice/exercise_result.php
  2. 4
      main/exercice/exercise_show.php

@ -27,7 +27,7 @@
* @package dokeos.exercise
* @author Olivier Brouckaert, main author
* @author Roan Embrechts, some refactoring
* @version $Id: exercise_result.php 11546 2007-03-12 15:52:51Z guim_led $
* @version $Id: exercise_result.php 11548 2007-03-12 16:03:43Z elixir_julian $
*
* @todo split more code up in functions, move functions to library?
*/
@ -299,8 +299,10 @@ $exerciseTitle=api_parse_tex($exerciseTitle);
$exeId =mysql_result($res,0,"id");
$exeId=$exeId+1;
$counter=0;
foreach($questionList as $questionId)
{
$counter++;
// gets the student choice for this question
$choice=$exerciseResult[$questionId];
// creates a temporary Question object
@ -336,7 +338,7 @@ $exerciseTitle=api_parse_tex($exerciseTitle);
<table width="100%" border="0" cellpadding="3" cellspacing="2">
<tr bgcolor="#E6E6E6">
<td colspan="<?php echo $colspan; ?>">
<?php echo get_lang("Question").' '.($i+1); ?>
<?php echo get_lang("Question").' '.($counter); ?>
</td>
</tr>
<tr>

@ -306,6 +306,7 @@ $result =api_sql_query($query, __FILE__, __LINE__);
$questionList = array();
$exerciseResult = array();
$k=0;
$counter=0;
while ($row = mysql_fetch_array($result))
{
$questionList[] = $row['question_id'];
@ -313,6 +314,7 @@ $result =api_sql_query($query, __FILE__, __LINE__);
}
foreach($questionList as $questionId)
{
$counter++;
$k++;
$choice=$exerciseResult[$questionId];
// creates a temporary Question object
@ -341,7 +343,7 @@ $result =api_sql_query($query, __FILE__, __LINE__);
}?>
<tr bgcolor="#E6E6E6">
<td colspan="2" > <?php echo get_lang("Question").' '.($i+1); ?> </td>
<td colspan="2" > <?php echo get_lang("Question").' '.($counter); ?> </td>
</tr>
<tr>
<td colspan="2"><?php echo $questionName; ?> </td>

Loading…
Cancel
Save