';
if ($show_results) {
$show_media = false;
/*if ($objQuestionTmp->parent_id != 0 && !in_array($objQuestionTmp->parent_id, $media_list)) {
$show_media = true;
$media_list[] = $objQuestionTmp->parent_id;
}*/
//Shows question title an description
$question_content .= $objQuestionTmp->return_header(null, $counter, $score);
}
$counter++;
$question_content .= $contents;
$question_content .= '
';
$exercise_content .= $question_content;
} // end foreach() block that loops over all questions
}
$total_score_text = null;
if ($origin != 'learnpath') {
if ($show_results || $show_only_score) {
$total_score_text .= '';
$total_score_text .= get_question_ribbon($objExercise, $total_score, $total_weight, true);
$total_score_text .= '
';
}
}
if (!empty($category_list) && ($show_results || $show_only_score) ) {
// Adding total
$category_list['total'] = array('score' => $total_score, 'total' => $total_weight);
echo Testcategory::get_stats_table_by_attempt($objExercise->id, $objExercise->course_id, $category_list);
}
if ($show_all_but_expected_answer) {
$exercise_content .= "';
if ($check_pass_percentage) {
$is_success = is_success_exercise_result($score, $weight, $objExercise->selectPassPercentage());
// Color the final test score if pass_percentage activated
$ribbon_total_success_or_error = "";
if (is_pass_pourcentage_enabled($objExercise->selectPassPercentage())) {
if ($is_success) {
$ribbon_total_success_or_error = ' ribbon-total-success';
} else {
$ribbon_total_success_or_error = ' ribbon-total-error';
}
}
$ribbon .= '
';
} else {
$ribbon .= '
';
}
$ribbon .= '
'.get_lang('YourTotalScore').": ";
$ribbon .= show_score($score, $weight, false, true);
$ribbon .= '
';
$ribbon .= '';
if ($check_pass_percentage) {
$ribbon .= show_success_message($score, $weight, $objExercise->selectPassPercentage());
}
$ribbon .= '
';
return $ribbon;
}
function detectInputAppropriateClass($countLetter)
{
$limits = array(
0 => 'input-mini',
10 => 'input-mini',
15 => 'input-medium',
20 => 'input-xlarge',
40 => 'input-xlarge',
60 => 'input-xxlarge',
100 => 'input-xxlarge',
200 => 'input-xxlarge',
);
foreach ($limits as $size => $item) {
if ($countLetter <= $size) {
return $item;
}
}
return $limits[0];
}