Skip to content
Open
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: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
*.pyc
.codex/
.claude/
32 changes: 30 additions & 2 deletions polygon_api/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,28 @@ def problem_tests(self, problem_id, testset, no_inputs=None):
)
return [Test.from_json(self, problem_id, testset, js) for js in response.result]

def problem_test_input(self, problem_id, testset, test_index):
response = self._request_raw(
self._PROBLEM_TEST_INPUT,
args={
'problemId': problem_id,
'testset': testset,
'testIndex': test_index,
}
)
return response

def problem_test_answer(self, problem_id, testset, test_index):
response = self._request_raw(
self._PROBLEM_TEST_ANSWER,
args={
'problemId': problem_id,
'testset': testset,
'testIndex': test_index,
}
)
return response

def problem_save_test_group(self, problem_id, testset, group, points_policy=None, feedback_policy=None,
dependencies=None):
if isinstance(dependencies, list):
Expand Down Expand Up @@ -621,6 +643,12 @@ def save_test(self, testset, test_index, test_input, test_group=None, test_point
def tests(self, testset, no_inputs=None):
return self._polygon.problem_tests(self.id, testset, no_inputs)

def test_input(self, testset, test_index):
return self._polygon.problem_test_input(self.id, testset, test_index)

def test_answer(self, testset, test_index):
return self._polygon.problem_test_answer(self.id, testset, test_index)

def save_test_group(self, testset, group, points_policy=None, feedback_policy=None, dependencies=None):
return self._polygon.problem_save_test_group(self.id, testset, group,
points_policy, feedback_policy, dependencies)
Expand Down Expand Up @@ -713,8 +741,8 @@ class Test:
_SCRIPT_LINE = "scriptLine"
_GROUP = "group"
_POINTS = "points"
_INPUT_FOR_STATEMENTS = "inputForStatements"
_OUTPUT_FOR_STATEMENTS = "outputForStatements"
_INPUT_FOR_STATEMENTS = "inputForStatement"
_OUTPUT_FOR_STATEMENTS = "outputForStatement"
_VERIFY_INPUT_OUTPUT_FOR_STATEMENTS = "verifyInputOutputForStatements"

@classmethod
Expand Down