Skip to content

Commit

Permalink
Fixed unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
frogprincess committed Dec 24, 2024
1 parent 22a94f8 commit 70827d2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/moodle-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ jobs:
fail-fast: false
matrix:
include:
- php: '8.1'
moodle-branch: 'MOODLE_402_STABLE'
database: 'pgsql'
- php: '8.0'
moodle-branch: 'MOODLE_401_STABLE'
database: 'mariadb'
Expand Down Expand Up @@ -67,6 +64,7 @@ jobs:
env:
DB: ${{ matrix.database }}
MOODLE_BRANCH: ${{ matrix.moodle-branch }}
MUSTACHE_IGNORE_NAMES: 'peergrades_start.mustache,peergrades_end.mustache'
# Uncomment this to run Behat tests using the Moodle App.
# MOODLE_APP: 'true'

Expand Down
4 changes: 2 additions & 2 deletions calculator/webpa/tests/calculator_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public function test_webpa_result_outlier_b(): void {
$result = $calculator->calculate($grades, 80, 0, 1, true);

$fracs = $result->get_reduced_scores('alice');
$this->assertEquals(1, array_sum($fracs));
$this->assertEquals(1, round(array_sum($fracs), 2));
$this->assertEquals([
'bob' => 0.40,
'claire' => 0.30,
Expand Down Expand Up @@ -233,7 +233,7 @@ public function test_webpa_result_outlier_c(): void {
$this->assertFalse($result->has_submitted('elaine'));

// Values are stlightly different from the source because of rounding issues.
$this->assertEquals(5, array_sum($result->get_scores()));
$this->assertEquals(5, round(array_sum($result->get_scores()), 2));
$this->assertEquals(1.43, round($result->get_score('alice'), 2));
$this->assertEquals(1.43, round($result->get_score('bob'), 2));
$this->assertEquals(1.07, round($result->get_score('claire'), 2));
Expand Down

0 comments on commit 70827d2

Please sign in to comment.