示例#1
0
                    $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);
                    $percentange = 0;
                    if (!empty($count_students)) {
                        $percentange = $count / $count_students * 100;
                    }
                    $data[$id]['attempts'] = Display::bar_progress($percentange, false, $count . ' / ' . $count_students);
            }
            $id++;
        }
    }
}
// Format A table
$table = new HTML_Table(array('class' => 'data_table'));
$row = 0;
$column = 0;
foreach ($headers as $header) {
示例#2
0
                    $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());
                    $percentage = 0;
                    if (!empty($count_students)) {
                        $percentage = $count / $count_students * 100;
                    }
                    $data[$id]['attempts'] = Display::bar_progress($percentage, false, $count . ' / ' . $count_students);
                    break;
            }
            $id++;
            $mainCounter++;
        }
    }
}
//Format A table
$table = new HTML_Table(array('class' => 'data_table'));
$row = 0;