How to Store milliseconds time stamp into quiz_attempt table

How to Store milliseconds time stamp into quiz_attempt table

by sarendar vennapureddy -
Number of replies: 2

Hi.

By default moodle is storing unix time stamp in quiz_attempts table.

but how can i store the milliseconds time stamp in quiz_attempts table for  'timestart' and 'timefinish' columns.

Here i want student Time taken for the quiz format should be  in 15min 20 sec 26 milliseconds.

I hope using milliseconds timestamp only work for this, 

Or else can we convert unix tiem stamp to milliseconds time stamp?


Average of ratings: -
In reply to sarendar vennapureddy

Re: How to Store milliseconds time stamp into quiz_attempt table

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Why?!

How can some milliseconds possibly be significant. This is a client-server system operating over the internet, you will be lucky if ping times are that small. Whatever you are trying to do with the data, one-second precision seems more than adequate.

 But, to answer your question, you could only do this with major changes to the core Moodle code and the database structure. Not easy.

In reply to Tim Hunt

Re: How to Store milliseconds time stamp into quiz_attempt table

by sarendar vennapureddy -

Thanks Tim.. for reply.

understood Tim,

Why because, Actually i am customizing quiz attempts  functionality.

I am assigning ranks to students based on grade and Time taken to quiz. Here higher grade and less timetaken student get best rank.

as of now i am sorting timetaken value  and assign ranks to students. But in this scenario  some students getting same ranks. TO avoid this i want to use milliseconds to assign ranks.


user    grade    timetaken    rank

AAA      17.5     5min 2Sec      1

BBB     17.5      5min 2Sec      1


In above example, If  milliseconds came to picture ranks will differ right?

Do we have any methods to store milliseconds time stamp in moodle.