Brilliant Rick thanks worked a treat.
I think I was trying to take extra lines out at FROM and getting confused.
Cheers
Al
Brilliant Rick thanks worked a treat.
I think I was trying to take extra lines out at FROM and getting confused.
Cheers
Al
I answered a question...................hahahaha
Good things are continuing to head my way.
I am glad it worked.
Hello,
We're working with a client who needs to report on forums, which essentially make up the material of their Single Activity Format courses. They require reporting on the gender (custom profile field) of the user and the dates they posted. I created and tested a Configurable Report on test site and then when I went to add it to their Single Activity Format course, there was no option to add the Configurable Reports block (which is installed). Is there a way that I can access these forums with Configurable reports to Single Activity Format courses...or a work around?
Also, is it possible to report on documents posted to the forum?
Thanks!
Erin
Moodle 2.7.3
The whole idea of configurable reports is that you can create reports across the whole site. You do not need to add it to the course - you could actually limit the report to those courses by adding a filter in your sql query to just select courses with that format. Or at least list course format and then you can filter from Excel when you download your data. If you want individual course reports just add a course number filter and filter that way.
I want to buil a report, which is based on the activity modules Face-to-Face and a Mynewplugin, which I am developing.
As both plugins provide us with similar data about the user attendance, the report has to be based on the face-to-face-sessions report. (user name, trainer/teacher name, session start date, session finish date, session address etc)
In facetoface/rb_sources/rb_source_facetoface_sessions.php we have the definition of the data we need from Face-to-face.
But how to build the report in mynewplugin//rb_sources/rb_source_mynewplugin.php, so when I am making a report about the user, it will pull the data, which we need.
Or should I make completely new rb_source_files for both plugins?
Couldn't find any similar question here and will appreciate any help.
S.
Are you looking for assistance in the building the sql report in configurable reports or writing php to create a report within a plugin?
In configurable reports, you just need to find a way to join the tables and then you can pull data from both tables from your database.
If you need help with php, I will leave that to one of our wonderful coders!
Thank you Emma for the guidance. I already builded a report within mynewplugin and I am looking to combine it with the report of facetoface-sessions.
As described by you, I will look to join the tables in configurable reports and should be capable to manage this by myself, at least that one I can do by myself, if not I will write you back in 2 days.
But I will have help regarding this question https://moodle.org/mod/forum/discuss.php?d=319931 Can you suggest me a way to find a solution?
Regards,
S.
I am interested in being able to create a report in Moodle 2.8 where people with specific permissions are easily able to go to a spot (like a block), select a link (like "Completion Report"), select a specific "Group" or "Grouping," and run a site-wide report. The information returned would be a list of their specific Group of participants and the Date of Completion for the courses that each of them have taken.
Further, the structure of the platform that I have inherited are set up as metacourses (group of courses from the Master List) or "Course Tracks" ... where Student A may be in Course Track 1 taking courses Alpha, Beta, Gamma, Delta, and Student B make take courses Alpha, Beta and Epsilon from Course Track 2. But in our reporting, we need to see both Student A and Student B on the same report, even though they are in different Course Tracks.
There are so many elements to use in Moodle, I need some suggestions for the best way to create this report. I see it much like the Course Completion Report, only that it would gather all Course Completion Dates from courses site-wide for a specific Group from a pull-down menu at the top of the page.
Does the fact that it exists in a Metacourse mean anything to the reporting function? Can I set up an independent, site-wide report that can be accessed (with permissions) by others? And keep in mind, courses have already started for the year so I don't want anything that will damage the integrity of the existing data.
Any help of direction would be appreciated. Thank you!
Hi,
I've recently updated my Ad-hoc database queries report plugin to latest version (3.0) on Moodle 2.9.2, and now, when i launch admin/cli/check_database_schema.php, i've got :
-------------------------------------------------------------------------------
report_customsql_categories
* column 'name' should be NOT NULL (C)
* column 'name' has default 'Miscellaneous', expected 'NULL' (C)
-------------------------------------------------------------------------------
It seems something was not well handled when upgrading.
Séverin
Hi,
i then launched XMLDB editor, and started default values check, which showed :
Table: report_customsql_categories. Champ: name, Valeur attendue '' Valeur actuelle 'Miscellaneous'
ALTER
TABLE mdl_report_customsql_categories MODIFY COLUMN name VARCHAR(255)
CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' after id;
After launching the SQL, i tried again the two checks, and everything was OK (after purging caches)
Séverin
PS : would be useful if check_database_schema.php could also have an option to make corrections, or at least provide a list of SQL commands for that
I thought we had fixed this recently? https://github.com/moodleou/moodle-report_customsql/commit/602a2a4b476b45df9f9de1528ef898e3b6f0b009
I don't know exactly what happened.
Just can say i'm using Moodle 2.9.2, was using latest existing version of "Ad-hoc database queries report" and upgraded to the 3.0 version (using web installer) when it came out in plugin database.
Fixed for me with the SQL command provided by default values check in XMLDB editor.
hi,
Jonathan Moore did you find solution to creating DYNAMIC columns using Pivot table or Stored procedure or prepared statements?
I spent some time to do same you were going to do with no luck. As for semi colon issue this can be easily HACKED in the code (/reports/customsql/edit_form.php) by removing/changing the restrictions in the source code but still it does not work.
for example:
SET @s = 'SELECT * FROM prefix_assign';
PREPARE stmt3 FROM @s;
EXECUTE stmt3;
ad hoc report allows its execution even though it gives following error
Error when executing the query: Error reading from database You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'PREPARE stmt3 FROM @s; EXECUTE stmt3; LIMIT 0, 2' at line 2 SET @s = 'SELECT * FROM mdl_assign'; PREPARE stmt3 FROM @s; EXECUTE stmt3; LIMIT 0, 2 [array ]
Hi all,
I have an SQL query which works ok but missing the DOB (custom field) for those born before Unix (1970-01-01) and it also reports the day before given server is US but I'm in Adelaide.
SELECT u.firstname AS 'First Name', u.lastname AS 'Last name', DATE_FORMAT(FROM_UNIXTIME(uid.data), '%d-%m-%Y') AS DateofBirth,
u.email AS email, uid2.data AS 'LEA Site', c.idnumber AS 'System Code', c.shortname AS 'Module Completed',
DATE_FORMAT(FROM_UNIXTIME(ci.timecreated),'%d-%m-%Y') AS 'Certificate Date'
FROM prefix_course_completions AS p
JOIN prefix_course AS c ON p.course = c.id
JOIN prefix_user AS u ON p.userid = u.id
JOIN prefix_user_info_data AS uid ON uid.userid = u.id
JOIN prefix_user_info_field AS uif ON uid.fieldid = uif.id
JOIN prefix_user_info_data AS uid2 ON uid2.userid = u.id
JOIN prefix_user_info_field AS uif2 ON uid2.fieldid = uif2.id
JOIN prefix_simplecertificate_issues AS ci ON u.id = ci.userid
WHERE c.id=170 and uif.shortname = 'DOB' and uif2.shortname = 'School'
ORDER BY u.lastname
Any ideas on how to tweak the query to correct the above.
Thanks
Well the DOB thing is odd. MYSQL should store that as a signed integer. So you can go as far back with a negative timestamp as you can forward with a positive one. If you just return the raw integer (uid.date) does it have any negatives in it? I think that is a custom field as well so I'd suspect that it isn't going in properly.
For the times being returned you probably wouldn't change those here. It will be in the timezone settings for the server. Now it could be a couple. Could be the MYSQL or possibly the PHP timezone setting. Google for how to change both of them to oz.
Thanks for the ideas Sam.
The timestamp is recorded in a custom profile field 'Date of Birth' and is stored in the user_info_data field, where other custom profile data is stored so the (uid_data) can't change to (uid_date) as 'data' is the column name.
Some success thanks to Google and persistence
Replaced
DATE_FORMAT(FROM_UNIXTIME(uid.data), '%d-%m-%Y')
with
DATE_FORMAT(DATE_ADD(FROM_UNIXTIME(0), INTERVAL uid.data SECOND), '%d-%m-%Y')
so now show's pre 1970 dates.
Just need to sort out the timezone issue
Hi !
I need a big help from my friends here. Our Moodle Site is serving apprx 30 thousand students from 29 different yet connected institutions. I have now been asked to prepare certain reports for which I have installed the ad-hoc reports query plugin however I am a novice as far as SQL is concerned hence I need help with SQL queries as the ones available under contributed reports are not suitable for my requirements.
I will be grateful if someone can help create the following queries ;
1. To get the list of active student accounts (not suspended) accounts where profile_field_institutionname (Custom Profile field) = School A and profile_field_rolename="Student" AND profile_field_ecourse="Class XYZ"
2. To get the list of active staff accounts (not suspended ) where profile_field_institutionname (Custom Profile field) = "School A" and profile_field_rolename="Staff".
3. To get the list of no. of logins and activities undertaken (add, update, delete) by staff (profile_field_rolename="Staff") of a particular institution(profile_field_institutionname="School A") between date1 and date2.
4. To get the list of (active accounts) students who have never logged in. for a particular institute(category) where profile_field_institutionname = "School A" AND profile_field_ecourse="Class *" .
5. To get the list of (active accounts) Staff who have never logged in. for a particular institute(category) where profile_field_institutionname = "School A".
Earlier I was preparing these reports manually by using filters available in the Browse Users section however now, as we are moving towards automation of a few things I am required to make and run these queries through SQL.
Further, is there any way we can increase the number of rows for the report from 5000 to 30000 ?
Please help.
Thanks and Regards
Deepak Bhalla
New Delhi
Thanks for the reply. I'm getting the following error:
[17-Oct-2015 15:53:51 America/New_York] PHP Fatal error: Class 'ZipArchive' not found in /home/rabata/public_html/ribaat/lib/phpexcel/PHPExcel/Writer/Excel2007.php on line 234
Is that some sort of dependency that's gone missing?
Greetings - and thanks ahead of time for any assistance.
The short version of my question is, Can I use Configurable Reports to delete automated backup files after I have identified them?
And more specifically, What should I do with the information returned from the particular Contributed Ad-hoc report described below?
And I’ll ask forgiveness ahead of time, as well, for what may be a poorly worded post (I am not a sysadmin or anything close to that, but I do most of our Moodle administration).
The longer version:
I would like to delete the automated course backups from our Moodle installation. After installing the Configurable Reports block I’ve identified almost 48 GB of these automated backup files.
I’ve been working in our test server (Moodle 2.9.2+ Build: 20151014) - a clone of our production server) and have done the following: