Anpassungen REQUIRE_FULL_SOLVE

This commit is contained in:
2024-12-21 19:41:23 +01:00
parent 789b2db221
commit c0aafe41b4
4 changed files with 13 additions and 4 deletions

View File

@ -9,7 +9,7 @@
# https://www.gnu.org/licenses/gpl-3.0.txt
import re
from typing import Callable
from typing import Callable, List
from ums.agent import GatekeeperAgent
from ums.utils import Riddle, RiddleSolution, AgentMessage
@ -21,9 +21,12 @@ class SimpleSolveAgent(GatekeeperAgent):
# do not send a response, if this is not a calculator riddle!
return not self.stop_response
def handle(self, solution: RiddleSolution, riddle: Riddle) -> RiddleSolution:
def handle(self, solution: List[RiddleSolution], riddle: Riddle) -> List[RiddleSolution]:
self.stop_response = False
# iterate over all poss. solutions
return [self._check_single_solution(s) for s in solution]
def _check_single_solution(self, solution:RiddleSolution) -> RiddleSolution:
# first check for errors
if solution.solution == "Error":
solution.accepted = True