Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevents play score percentages over 100 #1584

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions fuel/app/classes/materia/score/manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ static public function get_widget_score_distribution($inst_id)
$semesters = [];
foreach ($result as $log)
{
// remove any erroneous > 100% scores from the distribution graph
if ($log['bracket'] > 9) continue;

$key = $log['id'];
if ( ! isset($semesters[$key]))
{
Expand Down
3 changes: 3 additions & 0 deletions fuel/app/classes/materia/session/play.php
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,9 @@ public function get_by_id($play_id=0)

public function set_complete($score, $possible, $percent)
{
// ensure percent is never inadvertently set to a value over 100, which will break things
if ($percent > 100) $percent = 100;

// set max score to the current score
$max_percent = $percent;

Expand Down
Loading