Skip to content

Instantly share code, notes, and snippets.

@mikebuchanon
mikebuchanon / disable_gradebook_override.sql
Created May 13, 2013 21:17
Turn off gradebook override for one user for one assignment in one course.
UPDATE mdl_grade_grades AS mgg
SET overridden=0
FROM mdl_grade_items mgi,
mdl_user mu,
mdl_course mc
WHERE mgi.id=mgg.itemid
AND mu.id=mgg.userid
AND mc.id=mgi.courseid
AND mgg.overridden != 0
AND mc.shortname='mdc03'
@mikehas
mikehas / modules_by_course_detail_v1
Created July 30, 2012 01:12
Moodle Modules by Course Detail V1
select c.id as course_id,
c.visible as visible,
c.shortname as course_name,
fac.userid as instructor,
COALESCE(q.all_quizs,0) as all_quizs,
COALESCE(ass.all_assignments,0) as all_assignmenets,
COALESCE(wiki.all_wikis,0) as all_wikis,
COALESCE(r.all_resources,0) as all_resources,
COALESCE(u.all_urls,0) as all_urls,
COALESCE(pa.all_pages,0) as all_pages,
@mkolb
mkolb / var_dump-log.php
Last active January 3, 2023 14:53
var_dump into error log
<?php
ob_start();
var_dump($this);
error_log(ob_get_clean());
?>