本文整理汇总了PHP中ExerciseLib::get_student_stats_by_question方法的典型用法代码示例。如果您正苦于以下问题:PHP ExerciseLib::get_student_stats_by_question方法的具体用法?PHP ExerciseLib::get_student_stats_by_question怎么用?PHP ExerciseLib::get_student_stats_by_question使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ExerciseLib
的用法示例。
在下文中一共展示了ExerciseLib::get_student_stats_by_question方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$table->setCellContents($row, $column, $cell);
$table->updateCellAttributes($row, $column, 'align="center"');
$column++;
}
$table->updateRowAttributes($row, $row % 2 ? 'class="row_even"' : 'class="row_odd"', true);
$row++;
}
$content = $table->toHtml();
// Format B
$headers = array(get_lang('Question'), get_lang('Answer'), get_lang('Correct'), get_lang('NumberStudentWhoSelectedIt'));
$data = array();
if (!empty($question_list)) {
$id = 0;
foreach ($question_list as $question_id) {
$question_obj = Question::read($question_id);
$exercise_stats = ExerciseLib::get_student_stats_by_question($question_id, $exercise_id, $courseCode, $sessionId);
$answer = new Answer($question_id);
$answer_count = $answer->selectNbrAnswers();
for ($answer_id = 1; $answer_id <= $answer_count; $answer_id++) {
$answer_info = $answer->selectAnswer($answer_id);
$is_correct = $answer->isCorrect($answer_id);
$correct_answer = $is_correct == 1 ? get_lang('Yes') : get_lang('No');
$real_answer_id = $answer->selectAutoId($answer_id);
// Overwriting values depending of the question
switch ($question_obj->type) {
case FILL_IN_BLANKS:
$answer_info_db = $answer_info;
$answer_info = substr($answer_info, 0, strpos($answer_info, '::'));
$correct_answer = $is_correct;
$answers = $objExercise->fill_in_blank_answer_to_array($answer_info);
$counter = 0;
示例2: array
$table->updateCellAttributes($row, $column, 'align="center"');
$column++;
}
$table->updateRowAttributes($row, $row % 2 ? 'class="row_even"' : 'class="row_odd"', true);
$row++;
}
$content = $table->toHtml();
// Format B.
$headers = array(get_lang('Question'), get_lang('Answer'), get_lang('Correct'), get_lang('NumberStudentWhoSelectedIt'));
$data = array();
if (!empty($question_list)) {
$id = 0;
foreach ($question_list as $row) {
$question_id = $row['question_id'];
$question_obj = Question::read($question_id);
$exercise_stats = ExerciseLib::get_student_stats_by_question($question_id, $exercise_id, api_get_course_int_id(), api_get_session_id());
$answer = new Answer($question_id);
$answer->read();
$mainCounter = 1;
$counter = 1;
foreach ($answer->answer as $answer_id => $answer_item) {
$answer_info = $answer->selectAnswer($answer_id);
$is_correct = $answer->isCorrect($answer_id);
$correct_answer = $is_correct == 1 ? get_lang('Yes') : get_lang('No');
// Overwriting values depending of the question.
switch ($question_obj->type) {
case FILL_IN_BLANKS:
$answer_info_db = $answer_info;
$answer_info = substr($answer_info, 0, strpos($answer_info, '::'));
$correct_answer = $is_correct;
$answers = $objExercise->fill_in_blank_answer_to_array($answer_info);