Skip to content

Commit

Permalink
#13 fix for 4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
frogprincess committed Dec 24, 2024
1 parent ac75b78 commit fd19b4e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions classes/completion/custom_completion.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ protected function check_graded_peers(): bool {
$peers = peerwork_get_peers($course, $peerwork, $peerwork->pwgroupingid, $groupid, $this->userid);
$gradedcount = $DB->count_records_select(
'peerwork_peers',
'peerwork = ?',
[$peerwork->id],
'peerwork = ? AND gradedby = ?',
[$peerwork->id, $this->userid],
'COUNT(DISTINCT gradefor)'
);
return count($peers) <= $gradedcount;
Expand Down
6 changes: 3 additions & 3 deletions tests/behat/activitycompletion.feature
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@ Feature: Assignment completion
@javascript
Scenario: Students who grades every peer is shown as completed
When I am on "Course 1" course homepage
And "Done" "button" should exist in the "Test peerwork name" "activity"
And "Done: Grade peers in group" "text" should exist in the "Test peerwork name" "activity"
And I log out

@javascript
Scenario: Students who has not graded every peer is not shown as completed
And I log in as "student2"
When I am on "Course 1" course homepage
And "Done" "button" should not exist in the "Test peerwork name" "activity"
And "To do" "button" should exist in the "Test peerwork name" "activity"
And "Done: Grade peers in group" "text" should not exist in the "Test peerwork name" "activity"
And "To do: Grade peers in group" "text" should exist in the "Test peerwork name" "activity"
And I log out

@javascript
Expand Down

0 comments on commit fd19b4e

Please sign in to comment.