Skip to content

Commit

Permalink
Merge pull request #20 from bfh/nothingfound
Browse files Browse the repository at this point in the history
Show the same message as the others quiz reports.
  • Loading branch information
lucaboesch committed Nov 11, 2023
2 parents 8fbcf90 + 10c9f01 commit e19bf59
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions report.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public function display($quiz, $cm, $course) {

// What sort of page to display?
if (!$hasquestions) {
echo $OUTPUT->notification(get_string('noattemptstoshow', 'quiz'));
echo $OUTPUT->notification(get_string('nothingfound', 'quiz_grading'));
} else {
$this->display_archive();
}
Expand All @@ -139,7 +139,7 @@ protected function display_archive() {
global $OUTPUT;
$studentattempts = $this->quizreportgetstudentandattempts($this->quizobj);
if (count($studentattempts) === 0) {
echo $OUTPUT->notification(get_string('noattemptstoshow', 'quiz'));
echo $OUTPUT->notification(get_string('nothingfound', 'quiz_grading'));
}
foreach ($studentattempts as $studentattempt) {
echo $this->quiz_report_get_student_attempt($studentattempt['attemptid'], $studentattempt['userid']);
Expand Down
4 changes: 2 additions & 2 deletions tests/behat/noattempts.feature
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Feature: Showing a message if there are no attempts to show

Scenario: Check handling of no attempts situation
# Check if no attempt
Then I should see "There are no attempts to show"
Then I should see "Nothing to display"

# Add an attempt
And I log in as "student1"
Expand All @@ -48,4 +48,4 @@ Feature: Showing a message if there are no attempts to show
And I am on the "Quiz 1" "quiz_archive > Archive" page logged in as "teacher1"

# Check that the message is gone
Then I should not see "There are no attempts to show"
Then I should not see "Nothing to display"

0 comments on commit e19bf59

Please sign in to comment.