Skip to content
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
2 changes: 1 addition & 1 deletion lbplanner/classes/helpers/course_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public static function get_all_lbplanner_courses(bool $onlyenrolled=true): array
$fetchedcourse->prepare_for_db()
)
);
} catch(dml_write_exception $e) {
} catch (dml_write_exception $e) {
var_dump($fetchedcourse->prepare_for_db());
throw $e;
}
Expand Down
4 changes: 4 additions & 0 deletions lbplanner/classes/helpers/modules_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ class modules_helper {
* @return integer The enum value for the grade.
*/
public static function determine_uinified_grade(int $grade, int $maxgrade, int $gradepass): int {
if ($maxgrade <= $gradepass) {
return ($grade >= $gradepass) ? MODULE_GRADE::GKV : MODULE_GRADE::RIP;
}

$p = ($grade - $gradepass) / ($maxgrade - $gradepass);

if ($p >= 0.75) {
Expand Down
2 changes: 1 addition & 1 deletion lbplanner/classes/model/course.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public function set_color(string $color) {
*/
public function set_shortname(string $shortname) {
$length = strlen($shortname);
if($length > 5 || $length < 0) {
if ($length > 5 || $length < 0) {
throw new \moodle_exception("shortname length must be <=5 and >0, but is {$length} instead");
}
$this->shortname = $shortname;
Expand Down
Loading