Skip to content

Commit

Permalink
Ajustes no estilo, relatorio e resolvido bug do group by
Browse files Browse the repository at this point in the history
  • Loading branch information
willianmano committed May 16, 2015
1 parent 9a71765 commit 8dc610a
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 13 deletions.
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This block improves gamefication into the moodle plataform.

This new version is more simpler and easy to use, but, with more visual resources.

The ranking works with the activity completion, so you need to enable that and configure the criterias for all activities you want to monitor. The plugin only add points to activities with completion criterias. The method to add points remains the same.
The ranking works with the activity completion tracking, so you need to enable that and configure the criterias for all activities you want to monitor. The plugin only add points to activities with completion criterias. The method to add points remains the same.

There are different ways to gain points.

Expand All @@ -23,8 +23,12 @@ For example:
Update Notes
------------

> - Now you don't need configure the course completion, only the activities completion criterias. Again, the plugin only monitors the activities with completion criteria.
> - The table ranking_cmc_mirror was removed.
> - Added a weekly ranking
> - Added a monthly ranking
> - Added a tiny report with top 100 students in general ranking
> - Added filter the tiny report by groups (the course group mode needs to be "separeted groups" or "visible groups")
> - Now you don't need configure the course completion tracking, only the activities completion criterias. Again, the plugin only monitors the activities with completion criteria
> - The table ranking_cmc_mirror was removed.
Installation
------------
Expand All @@ -47,5 +51,12 @@ After you have installed the block you just add it into the moodle course.

> The ranking block works together with the activity completion, so you need to enable that and configure the criterias for all activities you want to monitor. The ranking block monitors these activities and add points to the students based on accomplishing the activities.
Enabling completion tracking
-----------------------------------
>- Go to: Site administration / Advanced features
>- Turn on the item "**Enable completion tracking**"
>- Inside the course go to: Course administration / Edit settings
>- In the section Completion tracking set "**Completion tracking**" to yes
>- Save
**OBS:** The ranking block needs the moodle cron configured and working fine. Read the moodle documentation about the cron file (for more information..)
1 change: 1 addition & 0 deletions block_ranking.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.


/**
* Ranking block definition
*
Expand Down
6 changes: 3 additions & 3 deletions lang/en/block_ranking.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
// This file is part of Moodle - http://moodle.org/
// This file is part of Ranking block for Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
Expand All @@ -16,10 +16,10 @@


/**
* Progress Bar block English language translation
* Ranking block english language translation
*
* @package contrib
* @subpackage block_progress
* @subpackage block_ranking
* @copyright 2015 Willian Mano http://willianmano.net
* @authors Willian Mano
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
Expand Down
6 changes: 3 additions & 3 deletions lang/pt_br/block_ranking.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php
// This file is part of Moodle - http://moodle.org/
// This file is part of Ranking block for Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
Expand All @@ -16,10 +16,10 @@


/**
* Progress Bar block Portuguese language translation
* Ranking block portuguese language translation
*
* @package contrib
* @subpackage block_progress
* @subpackage block_ranking
* @copyright 2015 Willian Mano http://willianmano.net
* @authors Willian Mano
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
Expand Down
8 changes: 6 additions & 2 deletions lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ function block_ranking_get_students_by_date($limit = null, $datestart, $dateend)
AND c.instanceid = :courseid
AND r.courseid = :crsid
AND rl.timecreated BETWEEN :weekstart AND :weekend
GROUP BY rankingid
GROUP BY u.id
ORDER BY points DESC, u.firstname ASC
LIMIT " . $limit;

Expand Down Expand Up @@ -534,7 +534,11 @@ function get_activity_finalgrade($activity, $activityid, $userid) {

// Grade without scale -- grademax 100.
if (empty($gradeitem->scaleid)) {
$finalgrade = $gradeitem->finalgrade / 10;
$finalgrade = $gradeitem->finalgrade;

if ($finalgrade > 10) {
$finalgrade = $finalgrade / 10;
}
} else {
$finalgrade = get_finalgrade_by_scale($gradeitem->finalgrade, $gradeitem->scaleid);
}
Expand Down
3 changes: 2 additions & 1 deletion report.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
// Page info.
$PAGE->set_context($context);
$PAGE->set_pagelayout('course');
$PAGE->set_title($course->fullname.': Ranking geral dos alunos');
$PAGE->set_heading($COURSE->fullname);
$PAGE->set_url($url);

Expand Down Expand Up @@ -93,7 +94,7 @@
// Output group selector if there are groups in the course.
echo $OUTPUT->container_start('ranking-report');

if (($course->groupmode == SEPARATEGROUPS and has_capability('moodle/site:accessallgroups', $context))) {
if (has_capability('moodle/site:accessallgroups', $context)) {
$groups = groups_get_all_groups($course->id);
if (!empty($groups)) {
groups_print_course_menu($course, $PAGE->url);
Expand Down
2 changes: 1 addition & 1 deletion styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
margin-right: 2px;
line-height: 1.42857143;
border-radius: 4px 4px 0 0;
padding: 7px 20px;
padding: 7px 12px;
}

.block_ranking #ranking-tabs ul .yui3-tab-selected .yui3-tab-label{
Expand Down

0 comments on commit 8dc610a

Please sign in to comment.