Hi guys,
I am working on a report plugin for Moodle, the main purpose of which is to allow for the user to 'nail down' further into the log files already provided by Moodle.
The input is in the form of 4 dropdown boxes, as follows:
- Report Type (this is the main part, where the user can select a report such as 'Course Views' / 'Resource Views' / 'Forum Posts')
- From date
- To date (this and the above obviously work in conjunction to allow the user to select a date range from the beginning of the course to the current date)
- User (this selection is either All Users / Selection of one user enrolled within the course)
Obviously the SQL query run is dependent on the selection of these - the way I see it, for using 'Course Views' as an example, will be by using something similar to the following:
SELECT time, user, course
FROM {log}
WHERE module = 'course' AND action = 'view'
I understand this is very dumbed down SQL, though I've just come to a relative standstill on the two points below:
- Is there an added benefit in using a moodleform as opposed to html_writer::?
- Is querying the mdl_log table suitable or going to balloon the time it takes to process (the reason I've chosen it is that it already provides a great level of detail)
The output when the user clicks a 'Submit' button once selecting from the dropdown boxes, will be a table of data resulting from the query that matches their input.
After this, I want to take this data and visualise it, preferably using the D3.js library, however that's quite a way off right now.
Sorry it's quite a longwinded question, I've just been shifting through masses of code from core plugins to third-party ones and they have many different ideas and ways of implementation, so I thought I'd try and pick the minds of people here who could give me a push in the right direction.
Many thanks,
Jordan