def suggestAction(self, from_state): if not self._path or not self._path[0].getSourceState()==from_state: # Ask the gui (=user) for a path self._path = getTheModelGui().selectPath(from_state) else: # we still have path left, just drawing the current position getTheModelGui().stepTo(from_state) return self._path[0].getAction()
def suggestAction(self, from_state): if not self._path or not self._path[0].getSourceState() == from_state: # Ask the gui (=user) for a path self._path = getTheModelGui().selectPath(from_state) else: # we still have path left, just drawing the current position getTheModelGui().stepTo(from_state) return self._path[0].getAction()
def sendInput(self, actionname): if actionname.startswith("kw_IsTrue "): # the action is kw_IsTrue -> preventing the user to # give the wrong answer. positive = actionname.split(None, 1)[1] == "True" if positive: return getTheModelGui().executePosOrNeg(actionname, neg=False) else: return getTheModelGui().executePosOrNeg(actionname, pos=False) return getTheModelGui().executePosOrNeg(actionname)
def sendInput(self,actionname): if actionname.startswith("kw_IsTrue "): # the action is kw_IsTrue -> preventing the user to # give the wrong answer. positive = actionname.split(None,1)[1]=="True" if positive: return getTheModelGui().executePosOrNeg(actionname,neg=False) else: return getTheModelGui().executePosOrNeg(actionname,pos=False) return getTheModelGui().executePosOrNeg(actionname)