public function delete_assessment($id) {
        global $DB;

        if (empty($id)) {
            return true;
        }

        $fs = get_file_storage();

        if (is_array($id)) {
            $DB->delete_records_list('workshop_grades', 'assessmentid', $id);
            foreach ($id as $itemid) {
                $fs->delete_area_files($this->context->id, 'mod_workshop', 'overallfeedback_content', $itemid);
                $fs->delete_area_files($this->context->id, 'mod_workshop', 'overallfeedback_attachment', $itemid);
            }
            $DB->delete_records_list('workshop_assessments', 'id', $id);

        } else {
            $DB->delete_records('workshop_grades', array('assessmentid' => $id));
            $fs->delete_area_files($this->context->id, 'mod_workshop', 'overallfeedback_content', $id);
            $fs->delete_area_files($this->context->id, 'mod_workshop', 'overallfeedback_attachment', $id);
            $DB->delete_records('workshop_assessments', array('id' => $id));
        }

        return true;
    }