Cleaning exercise page result + adding nicer UI not finished yet see #4541

skala
Julio Montoya 13 years ago
parent c6faaebc73
commit 636360e8b7
  1. 140
      main/css/base.css
  2. 21
      main/css/base_chamilo.css
  3. 30
      main/exercice/exercise.class.php
  4. 144
      main/exercice/exercise.lib.php
  5. 79
      main/exercice/exercise_result.php
  6. 82
      main/exercice/exercise_show.php
  7. 8
      main/exercice/fill_blanks.class.php
  8. 14
      main/exercice/freeanswer.class.php
  9. 16
      main/exercice/global_multiple_answer.class.php
  10. 18
      main/exercice/matching.class.php
  11. 23
      main/exercice/multiple_answer.class.php
  12. 21
      main/exercice/multiple_answer_combination.class.php
  13. 21
      main/exercice/multiple_answer_true_false.class.php
  14. 17
      main/exercice/oral_expression.class.php
  15. 25
      main/exercice/question.class.php
  16. 298
      main/exercice/result.php
  17. 13
      main/exercice/testcategory.class.php
  18. 16
      main/exercice/unique_answer.class.php
  19. 16
      main/exercice/unique_answer_no_option.class.php
  20. 46
      main/inc/lib/exercise_show_functions.lib.php

@ -2296,11 +2296,6 @@ div.admin_section h4 {
overflow:hidden;
}
.tableFloatingHeaderOriginal th, .tableWithFloatingHeader th{
height:80px;
}
/* chosen javascript checkbox select width fix */
.chzn-select {
min-width: 173px;
@ -2500,6 +2495,7 @@ div.admin_section h4 {
font-weight: bold;
padding:10px 0px 10px 0px;
}
.question_title {
font-size: 1.2em;
font-weight: bold;
@ -2529,6 +2525,131 @@ div.admin_section h4 {
width: 88%;
}
#question_description {
padding-left:5px;
padding-top:10px;
}
#question_score {
padding-top:10px;
padding-bottom:10px;
font-weight:bold;
font-size:130%;
}
.question_row {
margin-bottom: 40px;
}
.ribbon {
float:left;
width:100%;
margin-bottom: 20px;
background: #fff;
border: 1px solid #d2d2d2;
border-radius: 3px;
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
position: relative;
}
.ribbon .rib {
height: 30px;
width: 100px;
display: block;
line-height: 1.3;
left: -2px;
top: 0px;
color: #cfcfcf;
margin: 0;
padding: 5px 10px;
position: relative;
text-shadow: 0 1px 1px #111;
border-top: 1px solid #363636;
border-bottom: 1px solid #202020;
background: #333;
background: linear-gradient(top, #383838 0%, #262626 100%);
border-radius: 2px 2px 0 0;
box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.ribbon .rib-total {
width:350px;
}
.ribbon .rib-error{
background:red;
border-top: 1px solid #C20B1B;
border-bottom: 1px solid #FF3F4F;
}
.ribbon .rib-success{
background:green;
border-top: 1px solid #7AE155;
border-bottom: 1px solid #7AE155;
}
.ribbon h4 {
display: block;
left: 130px;
height: 30px;
line-height: 1.3;
width: 360px;
margin: 0;
padding: 5px 10px;
position: absolute;
top: 8px;
color: #444;
}
.ribbon h5 {
display: block;
height: 30px;
line-height: 1.3;
width: 120px;
margin: 0;
padding: 15px 10px;
position: absolute;
right: 0px;
top: 0px;
}
.ribbon .rib::before {
content: '';
display: block;
width: 0;
height: 0;
position: absolute;
bottom: -11px;
z-index: -10;
border: 5px solid;
border-color: #242424 transparent transparent transparent;
}
.ribbon .rib-error::before {
border-color: #9E1500 transparent transparent transparent;
}
.ribbon .rib-success::before {
border-color: #82AC25 transparent transparent transparent;
}
.ribbon .rib::before {left: 0;}
.ribbon .rib::after {right: 0;}
.ribbon .success {
}
.ribbon .error {
color: red;
}
.ribbon .success {
color: green;
}
.exercise_save_now_button img {
position: relative;
top: 4px;
@ -2810,7 +2931,6 @@ form .formw .freeze {
background-color: #fff;
}
.data_table_no_border td .highlight{
font-weight: bold;
}
@ -2820,7 +2940,6 @@ form .formw .freeze {
margin-top: 8px;
}
.form-stacked .label {
display: block;
float: none;
@ -2853,7 +2972,14 @@ form .formw .freeze {
font-size: 11px;
}
/* Stick table header */
.tableWithFloatingHeader th {
padding: 5px 5px 0px 5px;
}
.tableFloatingHeaderOriginal th, .tableWithFloatingHeader th{
height:80px;
}
/* jsPlumb */

@ -1288,21 +1288,7 @@ span.radio {
clear: left;
float: left;
}
#question_title {
font-size: 1.5em;
font-weight: bold;
}
#question_description {
padding-left:5px;
padding-top:10px;
}
#question_score {
padding-left:5px;
padding-top:10px;
padding-bottom:10px;
font-weight:bold;
font-size:130%;
}
#exercise_close_link {
padding-left: 20px;
@ -1311,11 +1297,6 @@ span.radio {
padding-left: 20px;
}
/*****************************************************
* BUTTONS *
*****************************************************/
.icon_image_content {
width:70px;
cursor:hand;

@ -1869,8 +1869,7 @@ class Exercise {
$course_id = api_get_course_int_id();
$objQuestionTmp = Question::read($questionId, $course_id);
$questionName = $objQuestionTmp->selectTitle();
$questionDescription = $objQuestionTmp->selectDescription();
$questionName = $objQuestionTmp->selectTitle();
$questionWeighting = $objQuestionTmp->selectWeighting();
$answerType = $objQuestionTmp->selectType();
$quesId = $objQuestionTmp->selectId();
@ -2233,7 +2232,7 @@ class Exercise {
}
$answer = '';
$real_correct_tags = $correct_tags;
$chosen_list = array ();
$chosen_list = array();
for ($i = 0; $i < count($real_correct_tags); $i++) {
if ($i == 0) {
@ -2468,8 +2467,7 @@ class Exercise {
$_SESSION['hotspot_coord'][1] = $delineation_cord;
$_SESSION['hotspot_dest'][1] = $answer_delineation_destination;
break;
} // end switch Answertype
} // end switch Answertype
global $origin;
@ -2710,16 +2708,11 @@ class Exercise {
ExerciseShowFunctions::display_multiple_answer_true_false($answerType, $studentChoice, $answer, $answerComment, $answerCorrect,$exeId,$questionId, "");
}
break;
case FILL_IN_BLANKS:
echo '<tr><td>';
ExerciseShowFunctions::display_fill_in_blanks_answer($answer,$exeId,$questionId);
echo '</td></tr>';
case FILL_IN_BLANKS:
ExerciseShowFunctions::display_fill_in_blanks_answer($answer,$exeId,$questionId);
break;
case FREE_ANSWER:
echo '<tr>
<td valign="top">'.ExerciseShowFunctions::display_free_answer($choice, $exeId, $questionId).'</td>
</tr>
</table>';
echo ExerciseShowFunctions::display_free_answer($choice, $exeId, $questionId);
break;
case ORAL_EXPRESSION:
echo '<tr>
@ -3097,16 +3090,17 @@ class Exercise {
}
}
if ($origin != 'learnpath') {
if ($origin != 'learnpath') {
if ($show_result) {
echo '</table>';
echo '<div id="question_score">';
echo '</table>';
}
/*echo '<div id="question_score">';
if ($propagate_neg == 0 && $questionScore < 0) {
$questionScore = 0;
}
echo get_lang('Score').": ".show_score($questionScore, $questionWeighting, false, false);
echo '</div>';
}
echo '</div>';*/
//}
}
}
unset ($objAnswerTmp);

@ -1932,4 +1932,148 @@ function delete_chat_exercise_session($exe_id) {
if (isset($_SESSION['current_exercises'])) {
$_SESSION['current_exercises'][$exe_id] = false;
}
}
function display_question_list_by_attempt($objExercise, $exe_id, $save_user_result = false) {
global $origin;
$exercise_stat_info = $objExercise->get_stat_track_exercise_info_by_exe_id($exe_id);
$question_list = array();
if (!empty($exercise_stat_info['data_tracking'])) {
$question_list = explode(',', $exercise_stat_info['data_tracking']);
}
$counter = 1;
$total_score = $total_weight = 0;
$exercise_content = null;
//Hide results
$show_results = false;
$show_only_score = false;
if ($objExercise->results_disabled == EXERCISE_FEEDBACK_TYPE_END) {
$show_results = true;
}
if ($objExercise->results_disabled == EXERCISE_FEEDBACK_TYPE_EXAM) {
$show_only_score = true;
}
if ($show_results || $show_only_score) {
$user_info = api_get_user_info($exercise_stat_info['exe_user_id']);
//Shows exercise header
$objExercise->description = '';
echo $objExercise->show_exercise_result_header(api_get_person_name($user_info['firstName'], $user_info['lastName']), api_convert_and_format_date($exercise_date, DATE_TIME_FORMAT_LONG));
}
if ($save_user_result) {
// Display text when test is finished #4074
// Don't display the text when finished message if we are from a LP #4227
// but display it from page exercice_show.php
$end_of_message = $objExercise->selectTextWhenFinished();
if (!empty($end_of_message) && ($origin != 'learnpath')) {
Display::display_normal_message($end_of_message, false);
echo "<div class='clear'>&nbsp;</div>";
}
}
// Loop over all question to show results for each of them, one by one
if (!empty($question_list)) {
if ($debug) { error_log('Looping question_list '.print_r($question_list,1));}
foreach ($question_list as $questionId) {
// creates a temporary Question object
$objQuestionTmp = Question :: read($questionId);
//this variable commes from exercise_submit_modal.php
//$hotspot_delineation_result = $_SESSION['hotspot_delineation_result'][$objExercise->selectId()][$quesId];
ob_start();
// 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'];
$total_weight += $result['weight'];
$my_total_score = $result['score'];
$my_total_weight = $result['weight'];
if ($objExercise->selectPropagateNeg() == 0 && $my_total_score < 0) {
$my_total_score = 0;
}
$score = array();
if ($show_results) {
$score['result'] = get_lang('Score')." : ".show_score($my_total_score, $my_total_weight, false, false);
$score['pass'] = $my_total_score >= $my_total_weight ? true : false;
}
if ($show_results) {
$comnt = get_comments($exe_id, $questionId);
if (!empty($comnt)) {
echo '<b>'.get_lang('Feedback').'</b>';
echo '<div id="question_feedback">'.$comnt.'</div>';
}
}
$contents = ob_get_clean();
$question_content = '<div class="question_row">';
if ($show_results) {
// display question category, if any
$question_content .= Testcategory::returnCategoryAndTitle($questionId);
//Shows question title an description
$question_content .= $objQuestionTmp->return_header("", $counter, $score);
}
$counter++;
$question_content .= $contents;
$question_content .= '</div>';
$exercise_content .= $question_content;
} // end foreach() block that loops over all questions
}
if ($origin != 'learnpath') {
if ($show_results || $show_only_score) {
echo '<div class="question_row">
<div class="ribbon">
<div class="rib rib-total">';
echo '<h3>';
echo get_lang('YourTotalScore')." ";
if ($objExercise->selectPropagateNeg() == 0 && $total_score < 0) {
$total_score = 0;
}
echo show_score($total_score, $total_weight, false, true, true, $objExercise->selectPassPercentage());
echo '</h3>';
echo '</div>';
echo '</div>';
echo '</div>';
}
}
echo $exercise_content;
if ($save_user_result) {
// Tracking of results
$learnpath_id = $exercise_stat_info['orig_lp_id'];
$learnpath_item_id = $exercise_stat_info['orig_lp_item_id'];
$learnpath_item_view_id = $exercise_stat_info['orig_lp_item_view_id'];
if (api_is_allowed_to_session_edit()) {
update_event_exercice($exercise_stat_info['exe_id'], $objExercise->selectId(), $total_score, $total_weight, api_get_session_id(), $learnpath_id, $learnpath_item_id, $learnpath_item_view_id, $exercise_stat_info['exe_duration'], $question_list, '', array(), $end_date);
}
}
}

@ -85,18 +85,6 @@ if ($origin != 'learnpath') {
Display::display_reduced_header();
}
//Hide results
$show_results = false;
$show_only_score = false;
if ($objExercise->results_disabled == 0) {
$show_results = true;
}
if ($objExercise->results_disabled == 2) {
$show_only_score = true;
}
/* DISPLAY AND MAIN PROCESS */
// I'm in a preview mode as course admin. Display the action menu.
@ -143,75 +131,10 @@ if ($objExercise->selectAttempts() > 0) {
}
}
$user_info = api_get_user_info(api_get_user_id());
if ($show_results || $show_only_score) {
echo $exercise_header = $objExercise->show_exercise_result_header(api_get_person_name($user_info['firstName'], $user_info['lastName']));
}
Display :: display_normal_message(get_lang('Saved').'<br />',false);
// Display text when test is finished #4074
// Don't display the text when finished message if we are from a LP #4227
// but display it from page exercice_show.php
$end_of_message = $objExercise->selectTextWhenFinished();
if (!empty($end_of_message) && ($origin != 'learnpath')) {
Display::display_normal_message($end_of_message, false);
echo "<div class='clear'>&nbsp;</div>";
}
$counter = 1;
$total_score = $total_weight = 0;
// Loop over all question to show results for each of them, one by one
if (!empty($question_list)) {
if ($debug) { error_log('Looping question_list '.print_r($question_list,1));}
foreach ($question_list as $questionId) {
// destruction of the Question object
unset($objQuestionTmp);
// gets the student choice for this question
$choice = $exerciseResult[$questionId];
// creates a temporary Question object
$objQuestionTmp = Question :: read($questionId);
//this variable commes from exercise_submit_modal.php
display_question_list_by_attempt($objExercise, $exe_id, true);
//$hotspot_delineation_result = $_SESSION['hotspot_delineation_result'][$objExercise->selectId()][$quesId];
if ($show_results) {
// show category
Testcategory::displayCategoryAndTitle($objQuestionTmp->id);
// show titles
echo $objQuestionTmp->return_header($objExercise->feedback_type, $counter);
$counter++;
}
// 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'];
$total_weight += $result['weight'];
} // end foreach() block that loops over all questions
}
if ($origin != 'learnpath') {
if ($show_results || $show_only_score) {
echo '<div id="question_score">';
echo get_lang('YourTotalScore')." ";
if ($objExercise->selectPropagateNeg() == 0 && $total_score < 0) {
$total_score = 0;
}
echo show_score($total_score, $total_weight, false, true, true, $objExercise->selectPassPercentage());
echo '</div>';
}
}
// Tracking of results
if (api_is_allowed_to_session_edit()) {
update_event_exercice($exercise_stat_info['exe_id'], $objExercise->selectId(), $total_score, $total_weight, api_get_session_id(), $learnpath_id, $learnpath_item_id, $learnpath_item_view_id, $exercise_stat_info['exe_duration'], $question_list, '', array(), $end_date);
}
//If is not valid
$session_control_key = get_session_time_control_key($objExercise->id, $learnpath_id, $learnpath_item_id);

@ -59,7 +59,7 @@ if ( empty ( $objExercise ) ) { $objExercise = $_SESSION['objExercise
if ( empty ( $exeId ) ) { $exeId = $_REQUEST['id'];}
if ( empty ( $action ) ) { $action = $_REQUEST['action']; }
$id = intval($_REQUEST['id']); //exe id
$id = intval($_REQUEST['id']); //exe id
if (empty($id)) {
api_not_allowed();
@ -131,7 +131,7 @@ if ($origin != 'learnpath') {
Display::display_reduced_header();
}
?>
<script type="text/javascript">
<script>
function showfck(sid,marksid) {
document.getElementById(sid).style.display='block';
document.getElementById(marksid).style.display='block';
@ -271,6 +271,8 @@ foreach ($questionList as $questionId) {
}
$counter = 1;
$exercise_content = null;
foreach ($questionList as $questionId) {
$choice = $exerciseResult[$questionId];
@ -282,13 +284,8 @@ foreach ($questionList as $questionId) {
$questionWeighting = $objQuestionTmp->selectWeighting();
$answerType = $objQuestionTmp->selectType();
if ($show_results) {
// display question category, if any
Testcategory::displayCategoryAndTitle($questionId);
echo $objQuestionTmp->return_header("", $counter);
}
$counter++;
// Start buffer
ob_start();
if ($answerType == MULTIPLE_ANSWER || $answerType == MULTIPLE_ANSWER_TRUE_FALSE) {
$question_result = $objExercise->manage_answer($id, $questionId, $choice,'exercise_show', array(), false, true, $show_results, $objExercise->selectPropagateNeg());
@ -364,8 +361,7 @@ foreach ($questionList as $questionId) {
$threadhold1 = $question_result['extra']['threadhold1'];
$threadhold2 = $question_result['extra']['threadhold2'];
$threadhold3 = $question_result['extra']['threadhold3'];
$threadhold3 = $question_result['extra']['threadhold3'];
if ($show_results) {
@ -384,8 +380,7 @@ foreach ($questionList as $questionId) {
$excess_color='green';
} else {
$excess_color='red';
}
}
if (!is_numeric($final_overlap)) {
$final_overlap = 0;
@ -492,17 +487,17 @@ foreach ($questionList as $questionId) {
}
}
if ($show_results) {
//if ($show_results) {
if (0) {
echo '<table width="100%" border="0" cellspacing="3" cellpadding="0">';
if ($is_allowedToEdit && $locked == false && !api_is_drh() ) {
if ($is_allowedToEdit && $locked == false && !api_is_drh() ) {
echo '<tr><td>';
$name = "fckdiv".$questionId;
$marksname = "marksName".$questionId;
?>
<br />
<a href="javascript://" onclick="showfck('<?php echo $name; ?>','<?php echo $marksname; ?>');">
<a class="btn" href="javascript://" onclick="showfck('<?php echo $name; ?>','<?php echo $marksname; ?>');">
<?php
if (in_array($answerType, array(FREE_ANSWER, ORAL_EXPRESSION))) {
echo get_lang('EditCommentsAndMarks');
@ -580,38 +575,65 @@ foreach ($questionList as $questionId) {
</tr>
</table>';
}
$my_total_score = $questionScore;
$my_total_score = $questionScore;
$my_total_weight = $questionWeighting;
$totalWeighting += $questionWeighting;
if ($objExercise->selectPropagateNeg() == 0 && $my_total_score < 0) {
$my_total_score = 0;
}
if ($show_results) {
echo '<div id="question_score">';
echo get_lang('Score')." : ".show_score($my_total_score, $my_total_weight, false, false);
echo '</div>';
}
$score = array();
if ($show_results) {
$score['result'] = get_lang('Score')." : ".show_score($my_total_score, $my_total_weight, false, false);
$score['pass'] = $my_total_score >= $my_total_weight ? true : false;
}
unset($objAnswerTmp);
$i++;
$totalWeighting += $questionWeighting;
$contents = ob_get_clean();
$question_content = '<div class="question_row">';
if ($show_results) {
// display question category, if any
$question_content .= Testcategory::returnCategoryAndTitle($questionId);
//Shows question title an description
$question_content .= $objQuestionTmp->return_header("", $counter, $score);
}
$counter++;
$question_content .= $contents;
$question_content .= '</div>';
$exercise_content .= $question_content;
} // end of large foreach on questions
//Total score
if ($origin!='learnpath' || ($origin == 'learnpath' && isset($_GET['fb_type']))) {
if ($show_results || $show_only_total_score ) {
echo '<div id="question_score">'.get_lang('YourTotalScore').": ";
if ($show_results || $show_only_total_score ) {
echo '<div class="question_row">
<div class="ribbon">
<div class="rib rib-total">';
echo '<h3>'.get_lang('YourTotalScore').": ";
$my_total_score_temp = $totalScore;
if ($objExercise->selectPropagateNeg() == 0 && $my_total_score_temp < 0) {
$my_total_score_temp = 0;
}
echo show_score($my_total_score_temp, $totalWeighting, false);
echo '</div>';
echo '</h3>';
echo '</div>';
echo '</div>';
echo '</div>';
}
}
echo $exercise_content;
if (is_array($arrid) && is_array($arrmarks)) {
$strids = implode(",",$arrid);
$marksid = implode(",",$arrmarks);
@ -640,7 +662,7 @@ if ($is_allowedToEdit && $locked == false && !api_is_drh()) {
}
//Came from lpstats in a lp
if ($origin =='student_progress') {?>
if ($origin =='student_progress') { ?>
<button type="button" class="back" onclick="window.back();" value="<?php echo get_lang('Back'); ?>" ><?php echo get_lang('Back');?></button>
<?php
} else if($origin=='myprogress') {

@ -191,11 +191,11 @@ class FillBlanks extends Question
$objAnswer->save();
}
function return_header($feedback_type = null, $counter = null) {
parent::return_header($feedback_type, $counter);
$header = '<table width="100%" class="data_table_exercise_result_left">
function return_header($feedback_type = null, $counter = null, $score = null) {
$header = parent::return_header($feedback_type, $counter, $score);
$header .= '<table class="'.$this->question_table_class .'">
<tr>
<td><i>'.get_lang("Answer").'</i> </td>
<th>'.get_lang("Answer").'</th>
</tr>';
return $header;
}

@ -58,15 +58,13 @@ class FreeAnswer extends Question {
$this->save();
}
function return_header($feedback_type = null, $counter = null) {
parent::return_header($feedback_type, $counter);
$header = '<table width="100%" class="data_table_exercise_result_left" >
function return_header($feedback_type = null, $counter = null, $score = null) {
$header = parent::return_header($feedback_type, $counter, $score);
$header .= '<table class="'.$this->question_table_class .'" >
<tr>
<td><i>'.get_lang("Answer").'</i></td>
<th>'.get_lang("Answer").'</th>
</tr>';
return $header;
}
}
}
endif;
?>
endif;

@ -236,17 +236,17 @@ if (!class_exists('GlobalMultipleAnswer')):
$this->save();
}
function return_header($feedback_type = null, $counter = null) {
parent::return_header($feedback_type, $counter);
$header = '<table width="100%" class="data_table_exercise_result">
function return_header($feedback_type = null, $counter = null, $score = null) {
$header = parent::return_header($feedback_type, $counter, $score);
$header .= '<table class="'.$this->question_table_class .'">
<tr>
<td><i>' . get_lang("Choice") . '</i> </td>
<td><i>' . get_lang("ExpectedChoice") . '</i></td>
<td><i>' . get_lang("Answer") . '</i></td>';
<th>' . get_lang("Choice") . '</th>
<th>' . get_lang("ExpectedChoice") . '</th>
<th>' . get_lang("Answer") . '</th>';
if ($feedback_type != EXERCISE_FEEDBACK_TYPE_EXAM) {
$header .= '<td><i>' . get_lang("Comment") . '</i></td>';
$header .= '<th>' . get_lang("Comment") . '</th>';
} else {
$header .= '<td>&nbsp;</td>';
$header .= '<th>&nbsp;</th>';
}
$header .= '</tr>';
return $header;

@ -232,17 +232,15 @@ class Matching extends Question {
$this->save();
}
function return_header($feedback_type = null, $counter = null) {
parent::return_header($feedback_type, $counter);
echo '<table width="100%" height="71" class="data_table_exercise_result_left">';
echo '<tr>
<td><span style="font-style: italic;">'.get_lang('ElementList').'</span> </td>
<td><span style="font-style: italic;">'.get_lang('CorrespondsTo').'</span></td>
function return_header($feedback_type = null, $counter = null, $score = null) {
$header = parent::return_header($feedback_type, $counter, $score);
$header .= '<table class="'.$this->question_table_class .'">';
$header .= '<tr>
<th>'.get_lang('ElementList').'</th>
<th>'.get_lang('CorrespondsTo').'</th>
</tr>';
return $header;
}
}
endif;
?>
?>

@ -207,23 +207,20 @@ class MultipleAnswer extends Question {
$this->save();
}
function return_header($feedback_type = null, $counter = null) {
parent::return_header($feedback_type, $counter);
$header = '<table width="100%" class="data_table_exercise_result">
function return_header($feedback_type = null, $counter = null, $score = null) {
$header = parent::return_header($feedback_type, $counter, $score);
$header .= '<table class="'.$this->question_table_class .'">
<tr>
<td><i>'.get_lang("Choice").'</i> </td>
<td><i>'. get_lang("ExpectedChoice").'</i></td>
<td><i>'. get_lang("Answer").'</i></td>';
<th>'.get_lang("Choice").'</th>
<th>'. get_lang("ExpectedChoice").'</th>
<th>'. get_lang("Answer").'</th>';
if ($feedback_type != EXERCISE_FEEDBACK_TYPE_EXAM) {
$header .= '<td><i>'.get_lang("Comment").'</i></td>';
$header .= '<th>'.get_lang("Comment").'</th>';
} else {
$header .= '<td>&nbsp;</td>';
$header .= '<th>&nbsp;</th>';
}
$header .= '</tr>';
return $header;
return $header;
}
}
endif;
?>
endif;

@ -211,22 +211,19 @@ class MultipleAnswerCombination extends Question {
$this -> save();
}
function return_header($feedback_type = null, $counter = null) {
parent::return_header($feedback_type, $counter);
$header = '<table width="100%" class="data_table_exercise_result">
function return_header($feedback_type = null, $counter = null, $score = null) {
$header = parent::return_header($feedback_type, $counter, $score);
$header .= '<table class="'.$this->question_table_class .'">
<tr>
<td><i>'.get_lang("Choice").'</i> </td>
<td><i>'. get_lang("ExpectedChoice").'</i></td>
<td><i>'. get_lang("Answer").'</i></td>';
<th>'.get_lang("Choice").'</th>
<th>'. get_lang("ExpectedChoice").'</th>
<th>'. get_lang("Answer").'</i></th>';
if ($feedback_type != EXERCISE_FEEDBACK_TYPE_EXAM) {
$header .= '<td><i>'.get_lang("Comment").'</i></td>';
$header .= '<th>'.get_lang("Comment").'</th>';
} else {
$header .= '<td>&nbsp;</td>';
$header .= '<th>&nbsp;</th>';
}
$header .= '</tr>';
return $header;
}
}
?>
}

@ -269,22 +269,17 @@ class MultipleAnswerTrueFalse extends Question {
$this -> save();
}
function return_header($feedback_type = null, $counter = null) {
$header = "";
if ($in_echo == 1) {
parent::return_header($feedback_type, $counter, $in_echo);
} else {
$header = parent::return_header($feedback_type, $counter, $in_echo) . $header;
}
$header .= '<table width="100%" class="data_table_exercise_result">
function return_header($feedback_type = null, $counter = null, $score = null) {
$header = parent::return_header($feedback_type, $counter, $score);
$header .= '<table class="'.$this->question_table_class .'">
<tr>
<td><i>'.get_lang("Choice").'</i> </td>
<td><i>'. get_lang("ExpectedChoice").'</i></td>
<td><i>'. get_lang("Answer").'</i></td>';
<th>'.get_lang("Choice").'</th>
<th>'. get_lang("ExpectedChoice").'</th>
<th>'. get_lang("Answer").'</th>';
if ($feedback_type != EXERCISE_FEEDBACK_TYPE_EXAM) {
$header .= '<td><i>'.get_lang("Comment").'</i></td>';
$header .= '<th>'.get_lang("Comment").'</th>';
} else {
$header .= '<td>&nbsp;</td>';
$header .= '<th>&nbsp;</th>';
}
$header .= '</tr>';
return $header;

@ -52,24 +52,23 @@ class OralExpression extends Question {
* @param the formvalidator instance
*/
function processAnswersCreation($form) {
$this -> weighting = $form -> getSubmitValue('weighting');
$this->weighting = $form -> getSubmitValue('weighting');
$this->save();
}
function return_header($feedback_type = null, $counter = null) {
parent::return_header($feedback_type, $counter);
$header = '<table width="100%" border="0" cellspacing="3" cellpadding="3">
function return_header($feedback_type = null, $counter = null, $score = null) {
$header = parent::return_header($feedback_type, $counter, $score);
$header .= '<table class="'.$this->question_table_class.'">
<tr>
<td>&nbsp;</td>
<th>&nbsp;</th>
</tr>
<tr>
<td><i>'.get_lang("Answer").'</i> </td>
<th>'.get_lang("Answer").'</th>
</tr>
<tr>
<td>&nbsp;</td>
<th>&nbsp;</th>
</tr>';
return $header;
}
}
}
endif;

@ -63,6 +63,8 @@ abstract class Question
static $typePicture = 'new_question.png';
static $explanationLangVar = '';
public $question_table_class = 'table table-striped';
static $questionTypes = array(
UNIQUE_ANSWER => array('unique_answer.class.php' , 'UniqueAnswer'),
MULTIPLE_ANSWER => array('multiple_answer.class.php' , 'MultipleAnswer'),
@ -1363,13 +1365,28 @@ abstract class Question
return $result;
}
function return_header($feedback_type = null, $counter = null) {
/**
* Shows question title an description
*
* @param type $feedback_type
* @param type $counter
* @param type $score
*/
function return_header($feedback_type = null, $counter = null, $score = null) {
$counter_label = '';
if (!empty($counter)) {
$counter_label = intval($counter);
}
echo Display::div(get_lang("Question").' '.($counter_label).' : '.$this->question, array('id'=>'question_title', 'class'=>'sectiontitle'));
echo Display::div($this->description, array('id'=>'question_description'));
}
$score_label = get_lang('Wrong');
$class = 'error';
if ($score['pass'] == true) {
$score_label = get_lang('Correct');
$class = 'success';
}
$question_title = get_lang("Question").' '.($counter_label).' : '.$this->question;
$header = Display::div('<div class="rib rib-'.$class.'"><h3>'.$score_label.'</h3></div><h4>'.$question_title.'</h4><h5 class="'.$class.'">'.$score['result'].' </h5>', array('class'=>'ribbon'));
$header .= Display::div($this->description, array('id'=>'question_description'));
return $header;
}
/**

@ -26,7 +26,7 @@ if (empty($origin)) {
}
if ($origin == 'learnpath')
api_protect_course_script();
api_protect_course_script();
else
api_protect_course_script(true);
@ -81,301 +81,7 @@ if ($show_headers) {
Display::display_reduced_header();
}
$show_results = true;
$show_only_total_score = false;
$display_category_name = 1;
// Avoiding the "Score 0/0" message when the exe_id is not set
if (!empty($track_exercise_info)) {
// if the results_disabled of the Quiz is 1 when block the script
$result_disabled = $track_exercise_info['results_disabled'];
$display_category_name = $track_exercise_info['display_category_name'];
if (!(api_is_platform_admin() || api_is_course_admin()) ) {
if ($result_disabled == EXERCISE_FEEDBACK_TYPE_DIRECT) {
$show_results = false;
Display::display_warning_message(get_lang('CantViewResults'));
} elseif ($result_disabled == EXERCISE_FEEDBACK_TYPE_EXAM) {
$show_results = false;
$show_only_total_score = true;
}
}
}
if ($show_results || $show_only_total_score) {
$user_info = api_get_user_info($student_id);
//Shows exercise header
$objExercise->description = '';
echo $objExercise->show_exercise_result_header(api_get_person_name($user_info['firstName'], $user_info['lastName']), api_convert_and_format_date($exercise_date, DATE_TIME_FORMAT_LONG));
}
$i = $totalScore = $totalWeighting = 0;
$result = get_exercise_results_by_attempt($id);
$question_list = $result[$id]['question_list'];
// for each question
$total_weighting = 0;
$counter = 1;
if (!empty($question_list)) {
foreach ($question_list as $question_item) {
$objQuestionTmp = Question::read($question_item['question_id'], api_get_course_int_id());
$total_weighting += $objQuestionTmp->selectWeighting();
}
//Needed in the manage_answer function
$feedback_type = $objExercise->feedback_type;
foreach ($question_list as $question_item) {
$choice = $question_item['answer'];
// creates a temporary Question object
$questionId = $question_item['question_id'];
$objQuestionTmp = Question::read($questionId, api_get_course_int_id());
$questionWeighting = $objQuestionTmp->selectWeighting();
$answerType = $objQuestionTmp->selectType();
if ($show_results) {
// display question category, if any
Testcategory::displayCategoryAndTitle($questionId, $display_category_name );
echo $objQuestionTmp->return_header($objExercise->feedback_type, $counter);
}
$counter++;
if ($answerType == MULTIPLE_ANSWER || $answerType == MULTIPLE_ANSWER_TRUE_FALSE) {
$question_result = $objExercise->manage_answer($id, $questionId, $choice,'exercise_show', array(), false, true, $show_results, $objExercise->selectPropagateNeg());
$questionScore = $question_result['score'];
$totalScore += $question_result['score'];
} elseif ($answerType == GLOBAL_MULTIPLE_ANSWER) {
$question_result = $objExercise->manage_answer($id, $questionId, $choice,'exercise_show', array(), false, true, $show_results, $objExercise->selectPropagateNeg());
$questionScore = $question_result['score'];
$totalScore += $question_result['score'];
} elseif ($answerType == MULTIPLE_ANSWER_COMBINATION || $answerType == MULTIPLE_ANSWER_COMBINATION_TRUE_FALSE) {
$choice = array();
$question_result = $objExercise->manage_answer($id, $questionId, $choice,'exercise_show', array(), false, true, $show_results, $objExercise->selectPropagateNeg());
$questionScore = $question_result['score'];
$totalScore += $question_result['score'];
} elseif ($answerType == UNIQUE_ANSWER || $answerType == UNIQUE_ANSWER_NO_OPTION) {
$question_result = $objExercise->manage_answer($id, $questionId, $choice,'exercise_show', array(), false, true, $show_results, $objExercise->selectPropagateNeg());
$questionScore = $question_result['score'];
$totalScore += $question_result['score'];
} elseif ($answerType == FILL_IN_BLANKS) {
$question_result = $objExercise->manage_answer($id, $questionId, $choice,'exercise_show', array(), false, true, $show_results, $objExercise->selectPropagateNeg());
$questionScore = $question_result['score'];
$totalScore += $question_result['score'];
} elseif ($answerType == FREE_ANSWER) {
$question_result = $objExercise->manage_answer($id, $questionId, $choice,'exercise_show', array(), false, true, $show_results, $objExercise->selectPropagateNeg());
$questionScore = $question_result['score'];
$totalScore += $question_result['score'];
} elseif ($answerType == MATCHING) {
$question_result = $objExercise->manage_answer($id, $questionId, $choice,'exercise_show', array(), false, true, $show_results, $objExercise->selectPropagateNeg());
$questionScore = $question_result['score'];
$totalScore += $question_result['score'];
} elseif ($answerType == HOT_SPOT) {
//@todo move this in the manage_answer function
if ($show_results) {
echo '<table width="500" border="0"><tr>
<td valign="top" align="center" style="padding-left:0px;" >
<table border="1" bordercolor="#A4A4A4" style="border-collapse: collapse;" width="552">';
}
$question_result = $objExercise->manage_answer($id, $questionId, $choice,'exercise_show', array(), false, true, $show_results, $objExercise->selectPropagateNeg());
$questionScore = $question_result['score'];
$totalScore += $question_result['score'];
if ($show_results) {
echo '</table></td></tr>';
echo '<tr>
<td colspan="2">'.
'<object type="application/x-shockwave-flash" data="'.api_get_path(WEB_CODE_PATH).'plugin/hotspot/hotspot_solution.swf?modifyAnswers='.Security::remove_XSS($questionId).'&exe_id='.$id.'&from_db=1" width="552" height="352">
<param name="movie" value="../plugin/hotspot/hotspot_solution.swf?modifyAnswers='.Security::remove_XSS($questionId).'&exe_id='.$id.'&from_db=1" />
</object>
</td>
</tr>
</table><br/>';
}
} else if($answerType == HOT_SPOT_DELINEATION) {
$question_result = $objExercise->manage_answer($id, $questionId, $choice,'exercise_show', array(), false, true, $show_results, $objExercise->selectPropagateNeg(), 'database');
$questionScore = $question_result['score'];
$totalScore += $question_result['score'];
$final_overlap = $question_result['extra']['final_overlap'];
$final_missing = $question_result['extra']['final_missing'];
$final_excess = $question_result['extra']['final_excess'];
$overlap_color = $question_result['extra']['overlap_color'];
$missing_color = $question_result['extra']['missing_color'];
$excess_color = $question_result['extra']['excess_color'];
$threadhold1 = $question_result['extra']['threadhold1'];
$threadhold2 = $question_result['extra']['threadhold2'];
$threadhold3 = $question_result['extra']['threadhold3'];
if ($show_results) {
if ($overlap_color) {
$overlap_color='green';
} else {
$overlap_color='red';
}
if ($missing_color) {
$missing_color='green';
} else {
$missing_color='red';
}
if ($excess_color) {
$excess_color='green';
} else {
$excess_color='red';
}
if (!is_numeric($final_overlap)) {
$final_overlap = 0;
}
if (!is_numeric($final_missing)) {
$final_missing = 0;
}
if (!is_numeric($final_excess)) {
$final_excess = 0;
}
if ($final_excess>100) {
$final_excess = 100;
}
$table_resume='<table class="data_table">
<tr class="row_odd" >
<td></td>
<td ><b>'.get_lang('Requirements').'</b></td>
<td><b>'.get_lang('YourAnswer').'</b></td>
</tr>
<tr class="row_even">
<td><b>'.get_lang('Overlap').'</b></td>
<td>'.get_lang('Min').' '.$threadhold1.'</td>
<td><div style="color:'.$overlap_color.'">'.(($final_overlap < 0)?0:intval($final_overlap)).'</div></td>
</tr>
<tr>
<td><b>'.get_lang('Excess').'</b></td>
<td>'.get_lang('Max').' '.$threadhold2.'</td>
<td><div style="color:'.$excess_color.'">'.(($final_excess < 0)?0:intval($final_excess)).'</div></td>
</tr>
<tr class="row_even">
<td><b>'.get_lang('Missing').'</b></td>
<td>'.get_lang('Max').' '.$threadhold3.'</td>
<td><div style="color:'.$missing_color.'">'.(($final_missing < 0)?0:intval($final_missing)).'</div></td>
</tr></table>';
if ($answerType!= HOT_SPOT_DELINEATION) {
$item_list=explode('@@',$destination);
//print_R($item_list);
$try = $item_list[0];
$lp = $item_list[1];
$destinationid= $item_list[2];
$url=$item_list[3];
$table_resume='';
} else {
if ($next==0) {
$try = $try_hotspot;
$lp = $lp_hotspot;
$destinationid= $select_question_hotspot;
$url=$url_hotspot;
} else {
//show if no error
//echo 'no error';
$comment=$answerComment=$objAnswerTmp->selectComment($nbrAnswers);
$answerDestination=$objAnswerTmp->selectDestination($nbrAnswers);
}
}
echo '<h1><div style="color:#333;">'.get_lang('Feedback').'</div></h1>';
if ($answerType == HOT_SPOT_DELINEATION) {
if ($organs_at_risk_hit>0) {
$message='<br />'.get_lang('ResultIs').' <b>'.$result_comment.'</b><br />';
$message.='<p style="color:#DC0A0A;"><b>'.get_lang('OARHit').'</b></p>';
} else {
$message='<p>'.get_lang('YourDelineation').'</p>';
$message.=$table_resume;
$message.='<br />'.get_lang('ResultIs').' <b>'.$result_comment.'</b><br />';
}
$message.='<p>'.$comment.'</p>';
echo $message;
} else {
echo '<p>'.$comment.'</p>';
}
//showing the score
/*
$queryfree = "select marks from ".$TBL_TRACK_ATTEMPT." where exe_id = '".Database::escape_string($id)."' and question_id= '".Database::escape_string($questionId)."'";
$resfree = Database::query($queryfree);
$questionScore= Database::result($resfree,0,"marks");
$totalScore+=$questionScore;*/
?>
</table>
</td></tr>
<?php
echo '<tr>
<td colspan="2">
<object type="application/x-shockwave-flash" data="../plugin/hotspot/hotspot_solution.swf?modifyAnswers='.$questionId.'&exe_id='.$id.'&from_db=1" width="556" height="350">
<param name="movie" value="../plugin/hotspot/hotspot_solution.swf?modifyAnswers='.$questionId.'&exe_id='.$id.'&from_db=1" />
</object>
</td>
</tr>
</table>';
}
}
if ($show_results) {
if ($answerType != HOT_SPOT) {
echo '</table>';
}
}
if ($show_results) {
$comnt = get_comments($id, $questionId);
if (!empty($comnt)) {
echo '<b>'.get_lang('Feedback').'</b>';
echo '<div id="question_feedback">'.$comnt.'</div>';
}
}
$my_total_score = $questionScore;
$my_total_weight = $questionWeighting;
if ($objExercise->selectPropagateNeg() == 0 && $my_total_score < 0) {
$my_total_score = 0;
}
if ($show_results) {
echo '<div id="question_score">';
echo get_lang('Score')." : ".show_score($my_total_score, $my_total_weight, false, false);
echo '</div>';
}
unset($objAnswerTmp);
unset($objQuestionTmp);
$i++;
$totalWeighting += $questionWeighting;
} // end of large foreach on questions
}
//Total score
if ($show_results || $show_only_total_score) {
echo '<div id="question_score">'.get_lang('YourTotalScore').": ";
$my_total_score_temp = $totalScore;
if ($objExercise->selectPropagateNeg() == 0 && $my_total_score_temp < 0) {
$my_total_score_temp = 0;
}
echo show_score($my_total_score_temp, $totalWeighting, false, true, true, $objExercise->selectPassPercentage());
echo '</div>';
}
display_question_list_by_attempt($objExercise, $id, false);
if ($show_headers) {
Display::display_footer();

@ -366,16 +366,23 @@ class Testcategory {
* display the category
*/
public static function displayCategoryAndTitle($in_questionID, $in_display_category_name = 1) {
echo self::returnCategoryAndTitle($in_questionID, $in_display_category_name);
}
public static function returnCategoryAndTitle($in_questionID, $in_display_category_name = 1) {
$is_student = !(api_is_allowed_to_edit(null,true) || api_is_session_admin());
$objExercise = $_SESSION['objExercise'];
if (!empty($objExercise)) {
$in_display_category_name = $objExercise->display_category_name;
}
$content = null;
if (Testcategory::getCategoryNameForQuestion($in_questionID) != "" && ($in_display_category_name == 1 || !$is_student)) {
echo '<div id="question_title" class="sectiontitle">';
echo get_lang('Category').": ".Testcategory::getCategoryNameForQuestion($in_questionID);
echo "</div>";
$content .= '<div id="question_title" class="sectiontitle">';
$content .= get_lang('Category').": ".Testcategory::getCategoryNameForQuestion($in_questionID);
$content .= "</div>";
}
return $content;
}

@ -350,17 +350,17 @@ class UniqueAnswer extends Question {
$this -> save();
}
function return_header($feedback_type = null, $counter = null) {
parent::return_header($feedback_type, $counter);
$header = '<table width="100%" class="data_table_exercise_result">
function return_header($feedback_type = null, $counter = null, $score = null) {
$header = parent::return_header($feedback_type, $counter, $score);
$header .= '<table class="'.$this->question_table_class .'">
<tr>
<td><i>'.get_lang("Choice").'</i> </td>
<td><i>'. get_lang("ExpectedChoice").'</i></td>
<td><i>'. get_lang("Answer").'</i></td>';
<th>'.get_lang("Choice").'</th>
<th>'. get_lang("ExpectedChoice").'</th>
<th>'. get_lang("Answer").'</th>';
if ($feedback_type != EXERCISE_FEEDBACK_TYPE_EXAM) {
$header .= '<td><i>'.get_lang("Comment").'</i></td>';
$header .= '<th>'.get_lang("Comment").'</th>';
} else {
$header .= '<td>&nbsp;</td>';
$header .= '<th>&nbsp;</th>';
}
$header .= '</tr>';
return $header;

@ -399,17 +399,17 @@ class UniqueAnswerNoOption extends Question {
$this -> save();
}
function return_header($feedback_type = null, $counter = null) {
parent::return_header($feedback_type, $counter);
$header = '<table width="100%" class="data_table_exercise_result">
function return_header($feedback_type = null, $counter = null, $score = null) {
$header = parent::return_header($feedback_type, $counter, $score);
$header .= '<table class="'.$this->question_table_class .'">
<tr>
<td><i>'.get_lang("Choice").'</i> </td>
<td><i>'. get_lang("ExpectedChoice").'</i></td>
<td><i>'. get_lang("Answer").'</i></td>';
<th>'.get_lang("Choice").'</th>
<th>'. get_lang("ExpectedChoice").'</th>
<th>'. get_lang("Answer").'</th>';
if ($feedback_type != EXERCISE_FEEDBACK_TYPE_EXAM) {
$header .= '<td><i>'.get_lang("Comment").'</i></td>';
$header .= '<th>'.get_lang("Comment").'</th>';
} else {
$header .= '<td>&nbsp;</td>';
$header .= '<th>&nbsp;</th>';
}
$header .= '</tr>';
return $header;

@ -24,7 +24,6 @@ class ExerciseShowFunctions {
* @param int Question ID
* @return void
*/
static function display_fill_in_blanks_answer($answer,$id,$questionId) {
global $feedback_type;
if (empty($id)) {
@ -32,20 +31,19 @@ class ExerciseShowFunctions {
} else {
?>
<tr>
<td>
<?php echo nl2br(Security::remove_XSS($answer,COURSEMANAGERLOWSECURITY)); ?>
</td>
<td>
<?php echo nl2br(Security::remove_XSS($answer,COURSEMANAGERLOWSECURITY)); ?>
</td>
<?php
if(!api_is_allowed_to_edit(null,true) && $feedback_type != EXERCISE_FEEDBACK_TYPE_EXAM) {?>
if (!api_is_allowed_to_edit(null,true) && $feedback_type != EXERCISE_FEEDBACK_TYPE_EXAM) { ?>
<td>
<?php
$comm = get_comments($id,$questionId);
?>
<?php
$comm = get_comments($id,$questionId);
?>
</td>
<?php } ?>
</tr>
</tr>
<?php
}
}
@ -62,12 +60,12 @@ class ExerciseShowFunctions {
if (empty($id)) {
if (!empty($answer)) {
echo '<tr>';
echo Display::tag('td',nl2br(Security::remove_XSS($answer,COURSEMANAGERLOWSECURITY)), array('width'=>'55%'));
echo Display::tag('td', nl2br(Security::remove_XSS($answer,COURSEMANAGERLOWSECURITY)), array('width'=>'55%'));
echo '</tr>';
}
if ($feedback_type != EXERCISE_FEEDBACK_TYPE_EXAM) {
echo '<tr>';
echo Display::tag('td',get_lang('notCorrectedYet'), array('width'=>'45%'));
echo Display::tag('td', get_lang('notCorrectedYet'), array('width'=>'45%'));
echo '</tr>';
} else {
echo '<tr><td>&nbsp;</td></tr>';
@ -202,22 +200,22 @@ class ExerciseShowFunctions {
global $feedback_type;
?>
<tr>
<td width="5%" align="center">
<td width="5%">
<img src="../img/<?php echo (in_array($answerType, array(UNIQUE_ANSWER, UNIQUE_ANSWER_NO_OPTION))) ? 'radio':'checkbox'; echo $studentChoice?'_on':'_off'; ?>.gif"
border="0" alt="" />
</td>
<td width="5%" align="center">
<td width="5%">
<img src="../img/<?php echo (in_array($answerType, array(UNIQUE_ANSWER, UNIQUE_ANSWER_NO_OPTION))) ? 'radio':'checkbox'; echo $answerCorrect?'_on':'_off'; ?>.gif"
border="0" alt=" " />
</td>
<td width="40%" style="border-bottom: 1px solid #4171B5;">
<td width="40%">
<?php
echo $answer;
?>
</td>
<?php if ($feedback_type != EXERCISE_FEEDBACK_TYPE_EXAM) { ?>
<td width="20%" style="border-bottom: 1px solid #4171B5;">
<td width="20%">
<?php
if ($studentChoice) {
@ -268,7 +266,7 @@ class ExerciseShowFunctions {
global $feedback_type;
?>
<tr>
<td width="5%" align="center">
<td width="5%">
<?php
$question = new MultipleAnswerTrueFalse();
@ -283,7 +281,7 @@ class ExerciseShowFunctions {
}
?>
</td>
<td width="5%" align="center">
<td width="5%">
<?php
//Expected choice
if (isset($new_options[$answerCorrect])) {
@ -293,12 +291,12 @@ class ExerciseShowFunctions {
}
?>
</td>
<td width="40%" style="border-bottom: 1px solid #4171B5;">
<td width="40%">
<?php echo $answer; ?>
</td>
<?php if ($feedback_type != EXERCISE_FEEDBACK_TYPE_EXAM) { ?>
<td width="20%" style="border-bottom: 1px solid #4171B5;">
<td width="20%">
<?php
$color = "black";
if (isset($new_options[$studentChoice])) {
@ -338,7 +336,7 @@ class ExerciseShowFunctions {
global $feedback_type;
?>
<tr>
<td width="5%" align="center">
<td width="5%">
<?php
//Your choice
$question = new MultipleAnswerCombinationTrueFalse();
@ -349,7 +347,7 @@ class ExerciseShowFunctions {
}
?>
</td>
<td width="5%" align="center">
<td width="5%">
<?php
//Expected choice
if (isset($question->options[$answerCorrect])) {
@ -359,7 +357,7 @@ class ExerciseShowFunctions {
}
?>
</td>
<td width="40%" style="border-bottom: 1px solid #4171B5;">
<td width="40%">
<?php
//my answer
echo $answer;
@ -367,7 +365,7 @@ class ExerciseShowFunctions {
</td>
<?php if ($feedback_type != EXERCISE_FEEDBACK_TYPE_EXAM) { ?>
<td width="20%" style="border-bottom: 1px solid #4171B5;">
<td width="20%">
<?php
//@todo replace this harcoded value
if ($studentChoice) {

Loading…
Cancel
Save