Quiz report: Started on in a date format, duration in a time format and with IP addresses
Has anybody generated the quiz report with the following modifications:
- the "started on" column in a standard date format
- duration in a time format, or numerical in seconds
- the IP address of the candidate (as seen by the server)
Could be a SQL output or a spread-sheet.
The Moodle version is 2.7.
Re: Quiz report: Started on in a date format, duration in a time format and with IP addresses
When request the marks of a test as an Excel spread sheet, the duration is in text, eg. 10 min 34 sec. I would like to have it as a number, say 634 (sec). The starting time is similar.
And I need a new column with the IP address.
Any idea how I get such a report?
Re: Quiz report: Started on in a date format, duration in a time format and with IP addresses
The easiest method might be to use a language customization to change strftimedatetime which uses unix date format string arguments.
Re: Quiz report: Started on in a date format, duration in a time format and with IP addresses
Thanks for the "trick"! Haven't tested, but believe doable.
So the other information, the IP-address, seems to be more difficult. Does it have to be an own SQL querry?
Re: Quiz report: Started on in a date format, duration in a time format and with IP addresses
Yes, and you will have to think about how you want to determine IP address. There is not normally a unique IP for a quiz attempt unless you restrict this somehow. The IP is logged and you would probably have to match the attempt context with an event in the log table. If you know it is unique, you could use either start or submission events. If it is not unique, you would find a list of IPs used.
You could do the whole thing using the custom SQL Block if you prefer that to working with PHP. However, it is not difficult in the quiz report API to add an additional column. It just requires adding a couple simple methods to do the IP lookup and return the information.