[svn r18541] Logic change - Fixed results about sequential exercises - see FS#3510

skala
Cristian Fasanando 16 years ago
parent 125b0fa6d8
commit 1fb0dd70fa
  1. 9
      main/exercice/exercice_submit.php
  2. 8
      main/exercice/exercise.lib.php

@ -1,4 +1,4 @@
<?php // $Id: exercice_submit.php 18530 2009-02-16 22:09:02Z cfasanando $
<?php // $Id: exercice_submit.php 18541 2009-02-17 14:48:55Z cfasanando $
/*
==============================================================================
@ -42,7 +42,7 @@
* @package dokeos.exercise
* @author Olivier Brouckaert
* @author Julio Montoya multiple fill in blank option added
* @version $Id: exercice_submit.php 18530 2009-02-16 22:09:02Z cfasanando $
* @version $Id: exercice_submit.php 18541 2009-02-17 14:48:55Z cfasanando $
*/
@ -117,6 +117,9 @@ if ( empty ( $exerciseId ) ) {
if ( empty ( $choice ) ) {
$choice = $_REQUEST['choice'];
}
if (empty($_REQUEST['choice'])) {
$choice = $_REQUEST['choice2'];
}
if ( empty ( $questionNum ) ) {
$questionNum = Database::escape_string($_REQUEST['questionNum']);
}
@ -540,7 +543,7 @@ if ($formSent) {
} elseif ($answerType==UNIQUE_ANSWER) {
$sql = "select id from $table_ans where question_id='".Database::escape_string($questionId)."' and position='".Database::escape_string($choice)."'";
$res = api_sql_query($sql, __FILE__, __LINE__);
$answer = mysql_result($res,0,"id");
$answer = Database::result($res,0,"id");
exercise_attempt($questionScore,$answer,$quesId,$exeId,0);
} else {
exercise_attempt($questionScore,$answer,$quesId,$exeId,0);

@ -1,4 +1,4 @@
<?php // $Id: exercise.lib.php 18522 2009-02-16 20:20:29Z juliomontoya $
<?php // $Id: exercise.lib.php 18541 2009-02-17 14:48:55Z cfasanando $
/*
==============================================================================
@ -29,7 +29,7 @@
* shows a question and its answers
* @package dokeos.exercise
* @author Olivier Brouckaert <oli.brouckaert@skynet.be>
* @version $Id: exercise.lib.php 18522 2009-02-16 20:20:29Z juliomontoya $
* @version $Id: exercise.lib.php 18541 2009-02-17 14:48:55Z cfasanando $
*/
/**
@ -162,7 +162,7 @@ function showQuestion($questionId, $onlyAnswers=false, $origin=false,$current_it
// unique answer
if($answerType == UNIQUE_ANSWER)
{
$s.="
$s.="<input type='hidden' name='choice2[".$questionId."]' value='0'>
<tr>
<td width=\"50\">
<input class='checkbox' type='radio' name='choice[".$questionId."]' value='".$answerId."'>
@ -177,7 +177,7 @@ function showQuestion($questionId, $onlyAnswers=false, $origin=false,$current_it
elseif($answerType == MULTIPLE_ANSWER)
{
$s.="<tr>
<td width=\"50\">
<td width=\"50\"><input type='hidden' name='choice2[".$questionId."][0]' value='0'>
<input class='checkbox' type='checkbox' name='choice[".$questionId."][".$answerId."]' value='1'>
</td>
<td>";

Loading…
Cancel
Save