patrickpollet / moodle_local_mass_enroll Goto Github PK
View Code? Open in Web Editor NEWA tool to allow teachers to enrol existing users to their courses using CSV files (without bothering the admins)
A tool to allow teachers to enrol existing users to their courses using CSV files (without bothering the admins)
My site has the language pack set to American English and "enroll" is being spelled with two l's everywhere except in the Mass Enrolments plugin. Is that because the plugin isn't programmed to read the language pack, or is there something we need to configure? Thanks!
----Josh
Hi, Patrick!
Everytime my users use this script there is an error from database with the "Recent Activity" Block.
Here is an exemple of Debug info :
Debug info: ERROR: invalid input syntax for integer: "Inscriptions massives"
SELECT u.id, u.firstname, u.lastname, MAX(l.time)
FROM mdl_user u, mdl_role_assignments ra, mdl_log l
WHERE l.time > $1
AND l.course = $2
AND l.module = 'course'
AND l.action = 'enrol'
AND CAST(l.info AS INT) = u.id
AND u.id = ra.userid
AND ra.contextid IN (182,3,1)
GROUP BY u.id, u.firstname, u.lastname
ORDER BY MAX(l.time) ASC
[array (
0 => 1414853300,
1 => '20',
)]
Error code: dmlreadexception
Stack trace:line 425 of /lib/dml/moodle_database.php: dml_read_exception thrown
line 252 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()
line 757 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
line 423 of /lib/deprecatedlib.php: call to pgsql_native_moodle_database->get_records_sql()
line 109 of /blocks/recent_activity/block_recent_activity.php: call to get_recent_enrolments()
line 72 of /blocks/recent_activity/block_recent_activity.php: call to block_recent_activity->get_recent_enrolments()
line 292 of /blocks/moodleblock.class.php: call to block_recent_activity->get_content()
line 238 of /blocks/moodleblock.class.php: call to block_base->formatted_contents()
line 951 of /lib/blocklib.php: call to block_base->get_content_for_output()
line 1003 of /lib/blocklib.php: call to block_manager->create_block_contents()
line 353 of /lib/blocklib.php: call to block_manager->ensure_content_created()
line 7 of /theme/univ_rouen/layout/general.php: call to block_manager->region_has_content()
line 864 of /lib/outputrenderers.php: call to include()
line 794 of /lib/outputrenderers.php: call to core_renderer->render_page_layout()
line 251 of /course/view.php: call to core_renderer->header()
My environnement : Moodle 2.5.7, PHP 5.3.3, PostGreSQL 8.4.
The only remedy is to reset the course history. I believe the problem could come from the PostGreSQL's syntax.
Thanks for your help.
Patrick
There was a small bug in the code that was leading to a serious problem. If there is a blank record in the CSV, the plugin tries to match with existing blank idnumbers, email address or username in user table and enrols the very first blank record, in which case the Guest gets enrolled because it is before everyone in the mdl_user table whose idnumber is blank. A recent push to a new branch resolves this issue.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.