# -*- coding: utf-8 -*- from author import Author from coach import Coach from exstore import ExStore from display import Display from learner import Learner class Session: """ for stand-alone usage by the ox-user. ?for collaborative sessions see CoSession """ #print("in session.py, after class Session") def __init__(self, name, window): self._name = name self._dis = Display(window) self._co = Coach() self._learner = Learner(self._dis, self._co) self._author = Author() self._exstore = ExStore(self._dis, self._co) #self._co.create_exercises() #TODO.WN091101 replace by storing Exerc.s self._calcs = None #pop ! def setMode(self, mode): self.mode = mode def getMode(self): return self.mode def run(self): """ Start execution of RP. Execution of RP is terminated by the user going bach to the OS. """ self._co.register(self, self._dis, self._exstore, self._learner) #print("in session, before _dis.register") self._dis.register(self, self._co, self._learner, self._exstore) #print("in Session.run") # if self.mode == "Author" # pass # self._author.run() # else: self._learner.run() #self._co.request_exercise() #self._dis.init_calc() #TODOWN091101 take Exercise as argument