Adding missing question type column see #3864

skala
Julio Montoya 13 years ago
parent 75f4f42cc9
commit c7e498606c
  1. 8
      main/exercice/question.class.php
  2. 2
      main/exercice/stats.php

@ -545,7 +545,7 @@ abstract class Question
*/
function exportPicture($questionId, $course_info) {
$course_id = $course_info['real_id'];
$TBL_QUESTIONS = Database::get_course_table(TABLE_QUIZ_QUESTION, $course_info['db_name']);
$TBL_QUESTIONS = Database::get_course_table(TABLE_QUIZ_QUESTION);
$destination_path = api_get_path(SYS_COURSE_PATH).$course_info['path'].'/document/images';
$source_path = api_get_path(SYS_COURSE_PATH).$this->course['path'].'/document/images';
@ -1041,6 +1041,12 @@ abstract class Question
$this->exportPicture($new_question_id, $course_info);
return $new_question_id;
}
function get_question_type_name() {
$key = self::$questionTypes[$this->type];
return get_lang($key[1]);
}
function get_question_type($type) {
if ($type == ORAL_EXPRESSION && api_get_setting('enable_nanogong') != 'true') {
return null;

@ -26,6 +26,7 @@ $data = array();
//Question title # of students who tool it Lowest score Average Highest score Maximum score
$headers = array(
get_lang('Question'),
get_lang('QuestionType'),
get_lang('NumberOfStudentsWhoTryTheExercise'),
get_lang('LowestScore'),
get_lang('AverageScore'),
@ -39,6 +40,7 @@ if (!empty($question_list)) {
$exercise_stats = get_student_stats_by_question($question_id, $exercise_id, api_get_course_id(), api_get_session_id());
$data[$question_id]['name'] = cut($question_obj->question, 100);
$data[$question_id]['type'] = $question_obj->get_question_type_name();
$data[$question_id]['students_who_try_exercise'] = $exercise_stats['users'];
$data[$question_id]['lowest_score'] = round($exercise_stats['min'], 2);
$data[$question_id]['average_score'] = round($exercise_stats['average'], 2);

Loading…
Cancel
Save