Anpassungen REQUIRE_FULL_SOLVE
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user