I'm working on improving the quiz stats module for Quiz, see #501858: Dashboard - Statistics on test results and the mockup I've attached on that issue.

The statistics module will show statistics accumulated for the quiz, statistics that are the same for each question and that are specific for each question type. And all stats are calculated for each revision. For the statistics for each question I would like to implement average time users has spent answering each question. Today this can't be done as Quiz doesn't track start and end time for each question.

I would suggest that we do implement this as this would be a great feature for the quis statistics module. What needs to be done is add two timestamp columns in database table quiz_node_results_answers called time_start and time_end, and implement time tracking the same way it is done in quiz_node_results. There is a column called answer_timestamp, but I'm not sure if it is used for anything, and could probably be removed. With the suggested changes we get this table.

CREATE TABLE `quiz_node_results_answers` (
  `result_id` int(10) unsigned NOT NULL,
  `question_nid` int(10) unsigned NOT NULL,
  `question_vid` int(10) unsigned NOT NULL,
  `is_correct` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `is_skipped` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `points_awarded` tinyint(4) NOT NULL DEFAULT '0',
  `time_start` int(10) unsigned NOT NULL,
  `time_end` int(10) unsigned NOT NULL,
  PRIMARY KEY (`result_id`,`question_nid`,`question_vid`),
  KEY `result_id` (`result_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

As for how to implement this in the code base, I'm aware of the issues raised here #163851: fixed time per question. But I do suggest that we add a hidden field to the question form called time_start and set the value to time().

Any thoughts?

Comments

sinasalek’s picture

That's quite a valuable information.
Regarding to your solution , including a hidden field is not actually very secure since it can be easily manipulated.
However we can calculate the time spent on each question by subtracting it's insertion time by the last question's answer record creation time. (For the first question we can consider quiz start time)

djdevin’s picture

Component: Code - Quiz module » Code - Quiz core
Status: Needs review » Closed (outdated)

This issue is being closed because it was filed against a version that is no longer supported. If the issue still persists in the latest version of Quiz, please open a new issue.