Skip to content

Commit

Permalink
Resolvido problema de queries com mdl no inicio
Browse files Browse the repository at this point in the history
  • Loading branch information
willianmano committed Jan 15, 2015
1 parent 283ef07 commit 4446640
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
Empty file modified README.md
100644 → 100755
Empty file.
Empty file modified db/install.xml
100644 → 100755
Empty file.
Empty file modified edit_form.php
100644 → 100755
Empty file.
14 changes: 7 additions & 7 deletions lib.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ function block_ranking_get_students($limit = null) {
$sql = "SELECT
DISTINCT $userfields, concat(u.firstname, ' ',u.lastname) as fullname, r.points
FROM
mdl_user u
INNER JOIN mdl_role_assignments a ON a.userid = u.id
INNER JOIN mdl_ranking_points r ON r.userid = u.id
INNER JOIN mdl_context c ON c.id = a.contextid
{user} u
INNER JOIN {role_assignments} a ON a.userid = u.id
INNER JOIN {ranking_points} r ON r.userid = u.id
INNER JOIN {context} c ON c.id = a.contextid
WHERE a.contextid = :contextid
AND a.userid = u.id
AND a.roleid = :roleid
Expand Down Expand Up @@ -349,8 +349,8 @@ function get_activity_finalgrade($activity, $activityid, $userid) {
$sql = "SELECT
gg.itemid, gg.userid, gg.rawscaleid, gg.finalgrade, gi.scaleid
FROM
mdl_grade_grades gg
INNER JOIN mdl_grade_items gi ON gi.id = gg.itemid
{grade_grades} gg
INNER JOIN {grade_items} gi ON gi.id = gg.itemid
WHERE gi.itemmodule = :activity AND gi.iteminstance = :iteminstance AND gg.userid = :userid";
$params['activity'] = $activity;
$params['iteminstance'] = $activityid;
Expand Down Expand Up @@ -381,7 +381,7 @@ function get_activity_finalgrade($activity, $activityid, $userid) {
function get_finalgrade_by_scale($finalgrade, $scaleid) {
global $DB;

$sql = "SELECT scale FROM mdl_scale WHERE id = :scaleid";
$sql = "SELECT scale FROM {scale} WHERE id = :scaleid";
$params['scaleid'] = $scaleid;

$scale = $DB->get_records_sql($sql, $params);
Expand Down
Empty file modified settings.php
100644 → 100755
Empty file.
Empty file modified styles.css
100644 → 100755
Empty file.

0 comments on commit 4446640

Please sign in to comment.