# HG changeset patch # User Nathan Phillip Brink # Date 2012-11-28 00:23:13 # Node ID 59de04d99da6dc1864e35d76ec84d4cbae1e6c09 # Parent 0e5a369b205fc038d053f138e645a1fdb7cf39eb Fix support for displaying the number of credit hours in a permutation for schools with course slots, reported by bot10berg. https://www.facebook.com/zimjimmy/posts/231316953666045?comment_id=886608&offset=0&total_comments=11 The linked schedule was displaying 24 credit hours instead of 14 credit hours because there were two course slots with two sections each (each of these course slots having 4 credit hours) causing 8 credit hours to be doubly-counted. diff --git a/inc/class.schedule.php b/inc/class.schedule.php --- a/inc/class.schedule.php +++ b/inc/class.schedule.php @@ -778,7 +778,17 @@ class Schedule $section_credit_hours = $section->credit_hours_get(); if ($section_credit_hours >= 0) { - $credit_hours[$section->getSynonym()] = $section_credit_hours; + /* + * We can only count credit + * hours once per course, + * otherwise for school that + * use course_slots we count + * credit hours for multiple + * sections in the same + * course and get ridiculous + * numbers. https://www.facebook.com/zimjimmy/posts/231316953666045?comment_id=886608&offset=0&total_comments=11 + */ + $credit_hours[$course->getName()] = $section_credit_hours; $have_credit_hours = TRUE; echo htmlentities('Credits: ' . htmlentities($section_credit_hours, ENT_QUOTES) . $carret, ENT_QUOTES);