prefix}workshop_assessments wa LEFT JOIN {$CFG->prefix}workshop_submissions ws ON wa.submissionid = ws.id WHERE ws.id IS NULL"); if (!empty($orphans)) { notify('Orphaned assessment records found - cleaning...'); foreach (array_keys($orphans) as $waid) { $result = $result && delete_records('workshop_assessments', 'id', $waid); } } } return $result; } ?>