Fixing Combination true/false/dont know result

skala
Julio Montoya 14 years ago
parent aa05b042b9
commit 198bca598c
  1. 19
      main/exercice/exercise.class.php
  2. 11
      main/exercice/exercise.lib.php
  3. 3
      main/exercice/exercise_result.php
  4. 8
      main/inc/lib/display.lib.php

@ -1821,13 +1821,10 @@ class Exercise {
if ($debug) error_log('manage_answer $show_result: '.$show_result);
if ($debug) error_log('manage_answer $propagate_neg: '.$propagate_neg);
if ($debug) error_log('manage_answer $hotspot_delineation_result: '.print_r($hotspot_delineation_result, 1));
if ($debug) error_log('manage_answer $safe_lp_id: '.$learnpath_id);
if ($debug) error_log('manage_answer $safe_lp_item_id: '.$learnpath_id);
error_log('manage_answer $safe_lp_id: '.$learnpath_id);
error_log('manage_answer $safe_lp_item_id: '.$learnpath_item_id);
$extra_data = array();
if ($debug) error_log('manage_answer $learnpath_id: '.$learnpath_id);
if ($debug) error_log('manage_answer $learnpath_item_id: '.$learnpath_item_id);
$extra_data = array();
$questionId = intval($questionId);
$exeId = intval($exeId);
@ -2067,8 +2064,7 @@ class Exercise {
$real_answers[$answerId] = false;
}
} else {
$studentChoice = $choice[$numAnswer];
$studentChoice = $choice[$numAnswer];
if ($answerCorrect == $studentChoice) {
//$answerCorrect = 1;
$real_answers[$answerId] = true;
@ -2870,14 +2866,15 @@ class Exercise {
$resfree = Database::query($queryfree);
$questionScore = Database::result($resfree,0,"marks");
}
$final_answer = true;
foreach ($real_answers as $my_answer) {
if (!$my_answer) {
$final_answer = false;
}
}
//we add the total score after dealing with the answers
if ($answerType == MULTIPLE_ANSWER_COMBINATION || $answerType == MULTIPLE_ANSWER_COMBINATION_TRUE_FALSE ) {
if ($final_answer) {

@ -185,7 +185,7 @@ function showQuestion($questionId, $only_questions = false, $origin = false, $cu
if ($show_comment) {
$header .= Display::tag('th', get_lang('Feedback'));
}
$s.= Display::tag('tr',$header, array('style'=>'text-align:left;'));
$s.= Display::tag('tr', $header, array('style'=>'text-align:left;'));
}
if ($show_comment) {
@ -367,19 +367,18 @@ function showQuestion($questionId, $only_questions = false, $origin = false, $cu
foreach ($objQuestionTmp->options as $key => $item) {
if (isset($my_choice[$numAnswer]) && $key == $my_choice[$numAnswer]) {
$attributes = array('class'=>'checkbox','checked'=>1, 'selected'=>1);
$attributes = array('class'=>'checkbox','checked' => 1, 'selected' => 1);
} else {
$attributes = array('class'=>'checkbox');
}
if ($debug_mark_answer) {
if ($key == $answerCorrect) {
$attributes['checked'] = 1;
$attributes['checked'] = 1;
$attributes['selected'] = 1;
}
}
$s .= Display::tag('td', Display::input('radio','choice['.$questionId.']['.$numAnswer.']', $key, $attributes));
}
$s .= Display::tag('td', Display::input('radio', 'choice['.$questionId.']['.$numAnswer.']', $key, $attributes));
}
if ($show_comment) {

@ -187,8 +187,7 @@ if (!empty($question_list)) {
$counter++;
}
// We're inside *one* question. Go through each possible answer for this question
error_log('exerc_ise______result ----> ');
// We're inside *one* question. Go through each possible answer for this question
$result = $objExercise->manage_answer($exercise_stat_info['exe_id'], $questionId, null ,'exercise_result', array(), false, true, $show_results, $objExercise->selectPropagateNeg(), $hotspot_delineation_result);
$total_score += $result['score'];

@ -676,16 +676,16 @@ class Display {
*
*/
public static function input($type, $name, $value, $extra_attributes = array()) {
if (!empty($type)) {
if (isset($type)) {
$extra_attributes['type']= $type;
}
if (!empty($name)) {
if (isset($name)) {
$extra_attributes['name']= $name;
}
if (!empty($value)) {
if (isset($value)) {
$extra_attributes['value']= $value;
}
return self::tag('input', '',$extra_attributes);
return self::tag('input', '', $extra_attributes);
}
public static function button($name, $value, $extra_attributes = array()) {

Loading…
Cancel
Save