$counter++;
    $question_content .= $contents;
    $question_content .= '</div>';
    $exercise_content .= $question_content;
}
// end of large foreach on questions
$total_score_text = null;
//Total score
if ($origin != 'learnpath' || $origin == 'learnpath' && isset($_GET['fb_type'])) {
    if ($show_results || $show_only_total_score) {
        $total_score_text .= '<div class="question_row">';
        $my_total_score_temp = $totalScore;
        if ($objExercise->selectPropagateNeg() == 0 && $my_total_score_temp < 0) {
            $my_total_score_temp = 0;
        }
        $total_score_text .= ExerciseLib::get_question_ribbon($objExercise, $my_total_score_temp, $totalWeighting, true);
        $total_score_text .= '</div>';
    }
}
if (!empty($category_list) && ($show_results || $show_only_total_score)) {
    // Adding total
    $category_list['total'] = array('score' => $my_total_score_temp, 'total' => $totalWeighting);
    echo TestCategory::get_stats_table_by_attempt($objExercise->id, $category_list);
}
echo $total_score_text;
echo $exercise_content;
echo $total_score_text;
if ($isFeedbackAllowed) {
    if (is_array($arrid) && is_array($arrmarks)) {
        $strids = implode(",", $arrid);
        $marksid = implode(",", $arrmarks);