diff --git a/repobee_csvgrades/_marker.py b/repobee_csvgrades/_marker.py
index 4c70e7e..6ed87a4 100644
--- a/repobee_csvgrades/_marker.py
+++ b/repobee_csvgrades/_marker.py
@@ -10,6 +10,7 @@ import itertools
 import re
 import heapq
 import contextlib
+import dataclasses
 from typing import List
 
 import daiquiri
@@ -17,9 +18,18 @@ import daiquiri
 import repobee_plug as plug
 
 from repobee_csvgrades import _exception
+from repobee_csvgrades import _containers
 
 LOGGER = daiquiri.getLogger(__file__)
 
+@dataclasses.dataclass(frozen=True, order=True)
+class _SpeccedIssue:
+    """Wrapper for an issue and associated grade spec, which is ordered by the
+    gradespec.
+    """
+
+    spec: _containers.GradeSpec = dataclasses.field(compare=True)
+    issue: plug.platform.Issue = dataclasses.field(compare=False)
 
 def get_authorized_issues(issues, teachers, grade_spec, repo_name):
     matched_issues = [
@@ -61,13 +71,13 @@ def mark_grade(
     issue_heap = []
     for spec in grade_specs:
         for issue in get_authorized_issues(issues, teachers, spec, repo_name):
-            heapq.heappush(issue_heap, (spec, issue))
+            heapq.heappush(issue_heap, _SpeccedIssue(spec, issue))
 
     graded_students = []
     author = None
     symbol = None
     if issue_heap:
-        spec, issue = issue_heap[0]
+        spec, issue = issue_heap[0].spec, issue_heap[0].issue
         for student in team.members:
             with log_error(_exception.GradingError):
                 old = grades.set(student, master_repo_name, spec)
diff --git a/requirements.txt b/requirements.txt
index a0618ec..3c3c9c4 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,1 +1,2 @@
-repobee>=3.0.0
+repobee>=3.5.0
+dataclasses>='0.7';python_version<'3.7'
diff --git a/setup.py b/setup.py
index a833643..c9db413 100644
--- a/setup.py
+++ b/setup.py
@@ -11,7 +11,7 @@ with open("repobee_csvgrades/__version.py", mode="r", encoding="utf-8") as f:
     assert re.match(r"^\d+(\.\d+){2}(-(alpha|beta|rc)(\.\d+)?)?$", __version__)
 
 test_requirements = ["pytest", "pytest-cov", "pytest-mock", "tox"]
-required = ["repobee>=3.0.0"]
+required = ["repobee>=3.5.0", "dataclasses>='0.7';python_version<'3.7'"]
 
 setup(
     name="repobee-csvgrades",

diff --git a/tests/test_csvgrades.py b/tests/test_csvgrades.py
index a5e8eb6..a659a7d 100644
--- a/tests/test_csvgrades.py
+++ b/tests/test_csvgrades.py
@@ -36,11 +36,11 @@ FAIL_GRADESPEC_FORMAT = "2:F:[Ff]ail"
 KOMP_GRADESPEC_FORMAT = "3:K:[Kk]omplettering"
 
 
-def create_pass_hookresult(author):
+def create_pass_hookresult(author, number=3):
     pass_issue = plug.Issue(
         title="Pass",
         body="This is a pass",
-        number=3,
+        number=number,
         created_at=datetime(1992, 9, 19),
         author=author,
     )
@@ -79,6 +79,17 @@ def create_komp_and_pass_hookresult(author):
     )
 
 
+def create_duplicated_pass_hookresult(author):
+    first_pass = create_pass_hookresult(author, number=3)
+    second_pass = create_pass_hookresult(author, number=4)
+    return plug.Result(
+        name="list-issues",
+        status=plug.Status.SUCCESS,
+        msg=None,
+        data={**first_pass.data, **second_pass.data},
+    )
+
+
 @pytest.fixture
 def mocked_hook_results(mocker):
     """Hook results with passes for glassey-glennol in week-1 and week-2, and
@@ -91,7 +102,7 @@ def mocked_hook_results(mocker):
         for team, repo_name, result in [
             (slarse, "week-1", create_komp_hookresult(SLARSE_TA)),
             (slarse, "week-2", create_komp_hookresult(SLARSE_TA)),
-            (slarse, "week-4", create_pass_hookresult(SLARSE_TA)),
+            (slarse, "week-4", create_duplicated_pass_hookresult(SLARSE_TA)),
             (slarse, "week-6", create_komp_and_pass_hookresult(SLARSE_TA)),
             (
                 glassey_glennol,

Crash multiple issues matching the same grade spec
This causes a crash when pushing to the heap, as the issues themselves are then used for comparison, and `<` isn't implemented for them.
tests/test_csvgrades.py::TestCallback::test_correctly_marks_passes tests/test_csvgrades.py::TestCallback::test_writes_edit_msg tests/test_csvgrades.py::TestCallback::test_multiple_specs tests/test_csvgrades.py::TestCallback::test_repos_without_hook_results_are_skipped
tests/test_csvgrades.py::TestCallback::test_writes_nothing_if_graders_are_not_teachers tests/test_csvgrades.py::TestCallback::test_does_not_overwrite_lower_priority_grades tests/test_csvgrades.py::TestCallback::test_students_missing_from_grades_file_causes_crash tests/test_csvgrades.py::TestCallback::test_raises_if_state_is_not_all tests/test_csvgrades.py::test_register