Version 3 (modified by 13 years ago) ( diff ) | ,
---|
Database
Find student who saved the evaluation but not submit yet
SELECT * FROM users WHERE id IN (SELECT distinct(evaluator) FROM evaluation_mixevals WHERE event_id = EVENTID AND evaluator NOT IN (SELECT distinct(submitter_id) FROM evaluation_submissions WHERE event_id = EVENTID) );
Replace EVENTID to event id.
Submit for those students
INSERT INTO evaluation_submissions SELECT NULL,EVENTID, group_events.id, user_id,1,NOW(),'A',1,NOW(),NULL,NOW() FROM groups LEFT JOIN groups_members ON groups.id = groups_members.group_id LEFT JOIN group_events ON group_events.group_id = groups.id WHERE course_id = COURSEID AND user_id IN SELECT id FROM users WHERE id IN (SELECT distinct(evaluator) FROM evaluation_mixevals WHERE event_id = EVENTID AND evaluator NOT IN (SELECT distinct(submitter_id) FROM evaluation_submissions WHERE event_id = EVENTID) );;
Replace EVENTID to event id and COURSEID to course id.
Note:
See TracWiki
for help on using the wiki.