$percentange = 0; if (!empty($count_students)) { $percentange = $count / $count_students * 100; } $data[$id]['attempts'] = Display::bar_progress($percentange, false, $count . ' / ' . $count_students); } break; case HOT_SPOT: if ($answer_id == 1) { $data[$id]['name'] = cut($question_obj->question, 100); } else { $data[$id]['name'] = '-'; } $data[$id]['answer'] = $answer_info; $data[$id]['correct'] = '-'; $count = ExerciseLib::get_number_students_answer_hotspot_count($answer_id, $question_id, $exercise_id, $courseCode, $sessionId); $percentange = 0; if (!empty($count_students)) { $percentange = $count / $count_students * 100; } $data[$id]['attempts'] = Display::bar_progress($percentange, false, $count . ' / ' . $count_students); break; default: if ($answer_id == 1) { $data[$id]['name'] = cut($question_obj->question, 100); } else { $data[$id]['name'] = '-'; } $data[$id]['answer'] = $answer_info; $data[$id]['correct'] = $correct_answer; $count = ExerciseLib::get_number_students_answer_count($real_answer_id, $question_id, $exercise_id, $courseCode, $sessionId);
$percentage = 0; if (!empty($count_students)) { $percentage = $count / $count_students * 100; } $data[$id]['attempts'] = Display::bar_progress($percentage, false, $count . ' / ' . $count_students); } break; case HOT_SPOT: if ($mainCounter == 1) { $data[$id]['name'] = Text::cut($question_obj->question, 100); } else { $data[$id]['name'] = '-'; } $data[$id]['answer'] = $answer_info; $data[$id]['correct'] = '-'; $count = ExerciseLib::get_number_students_answer_hotspot_count($answer_id, $question_id, $exercise_id, api_get_course_int_id(), api_get_session_id()); $percentage = 0; if (!empty($count_students)) { $percentage = $count / $count_students * 100; } $data[$id]['attempts'] = Display::bar_progress($percentage, false, $count . ' / ' . $count_students); break; default: if ($mainCounter == 1) { $data[$id]['name'] = Text::cut($question_obj->question, 100); } else { $data[$id]['name'] = '-'; } $data[$id]['answer'] = $answer_info; $data[$id]['correct'] = $correct_answer; $count = ExerciseLib::get_number_students_answer_count($answer_id, $question_id, $exercise_id, api_get_course_int_id(), api_get_session_id());