I have set up Moodle on my laptop and I am using Python script to add temp users' attendances. I am adding temp users profiles and their attendances by modifying the database.
I know that the logic is that you first have to add 'normal user' to table moodle.mdl_user and then temp user to moodle.mdl_attendance_tempusers then add attendance to moodle.mdl_attendace_log.
My problem is that I do not see those manually added attendances when I open the session page in my browser.
The SQL queries:
"INSERT INTO moodle.mdl_user(auth, confirmed, deleted, email, username, idnumber, mnethostid, lastname) " \2)
"VALUES('manual', 1, 1, %s, %s, 'tempghost', 1, %s);"
"INSERT INTO moodle.mdl_attendance_tempusers(fullname, courseid, email, created, studentid) " \3)
"VALUES(%s, %s, %s, %s, %s);"
"INSERT INTO moodle.mdl_attendance_log(sessionid, studentid, statusid, timetaken, takenby) " \
"VALUES(%s, %s, %s, UNIX_TIMESTAMP(), %s);"