Version 5 (modified by 13 years ago) ( diff ) | ,
---|
Database
Find student who saved the evaluation but not submit yet
SET @EVENTID=EVENT_ID; 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 EVENT_ID to event id.
Submit for those students
SET @EVENTID=EVENT_ID, @COURSEID=COURSE_ID; 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 EVENT_ID to event id and COURSE_ID to course id.
Note:
See TracWiki
for help on using the wiki.