Ejemplo n.º 1
0
    def __init__(self, parent, id, mainWin, mainPanel, currentLesson, gameType):
        self.mainWin = mainWin
        self.mainPanel = mainPanel
        self.currentLesson = currentLesson
        answer, answerList, answerImgList = 0, [], []
        self.answerImageList = ''
        self.gameType = gameType

        self.displayPanel = wx.Panel(parent, -1, (0, 0), (800, 600))
        self.displayPanel.SetBackgroundColour(config.backgroundColour)

        if (self.currentLesson == "animals" or self.currentLesson == "colour") and self.gameType == "Img":
            answer, answerImgList =findDifferenceUtils.nextFindDifferenceQuestion(self.currentLesson, self.gameType)
            answerImgList = resizeImage(answerImgList, 65)
            if self.currentLesson == "colour":
                answer, answerImgList = self.rotateImage(answer, answerImgList)
            else:
                pass
            self.answerImageList = findDifferenceImageAnswerList.imageAnswerList(self.displayPanel, answer, answerImgList)
        elif (self.currentLesson == "kaKha" or self.currentLesson == "aaa")  and self.gameType == "Char":
            answer, answerList = findDifferenceUtils.nextFindDifferenceQuestionWithoutImage(self.currentLesson, self.gameType)
            self.answerImageList = findDifferenceAnswerList.charAnswerList(self.displayPanel, answer, answerList)
        elif (self.currentLesson == "kaKha" or self.currentLesson == "aaa")  and self.gameType == "Img":
            answer, answerImgList =findDifferenceUtils.nextFindDifferenceQuestion(self.currentLesson, self.gameType)
            answerImgList = resizeImage(answerImgList, 65)
            self.answerImageList = findDifferenceImageAnswerList.imageAnswerList(self.displayPanel, answer, answerImgList)
        
        nextQuestionImg = wx.Bitmap(join(config.buttonsPath,'nextQuestion.png'), wx.BITMAP_TYPE_PNG)
        self.nextQuestionButton = wx.BitmapButton(self.displayPanel, 4, nextQuestionImg, (460,400), style = wx.NO_BORDER)
        self.nextQuestionButton.SetBackgroundColour(config.backgroundColour)
        self.nextQuestionButton.Bind(wx.EVT_BUTTON, self.OnNextQuestion, id=4)

        bottomMenu.bottomMenu([self.displayPanel], parent, self.mainWin, 'threeButton', self.mainPanel)
Ejemplo n.º 2
0
    def __init__(self, parent, id, mainWin, mainPanel, currentLesson,
                 gameType):
        self.mainWin = mainWin
        self.mainPanel = mainPanel
        self.currentLesson = currentLesson
        answer, answerList, answerImgList = 0, [], []
        self.answerImageList = ''
        self.gameType = gameType

        self.displayPanel = wx.Panel(parent, -1, (0, 0), (800, 600))
        self.displayPanel.SetBackgroundColour(config.backgroundColour)

        if (self.currentLesson == "animals"
                or self.currentLesson == "colour") and self.gameType == "Img":
            answer, answerImgList = findDifferenceUtils.nextFindDifferenceQuestion(
                self.currentLesson, self.gameType)
            answerImgList = resizeImage(answerImgList, 65)
            if self.currentLesson == "colour":
                answer, answerImgList = self.rotateImage(answer, answerImgList)
            else:
                pass
            self.answerImageList = findDifferenceImageAnswerList.imageAnswerList(
                self.displayPanel, answer, answerImgList)
        elif (self.currentLesson == "kaKha"
              or self.currentLesson == "aaa") and self.gameType == "Char":
            answer, answerList = findDifferenceUtils.nextFindDifferenceQuestionWithoutImage(
                self.currentLesson, self.gameType)
            self.answerImageList = findDifferenceAnswerList.charAnswerList(
                self.displayPanel, answer, answerList)
        elif (self.currentLesson == "kaKha"
              or self.currentLesson == "aaa") and self.gameType == "Img":
            answer, answerImgList = findDifferenceUtils.nextFindDifferenceQuestion(
                self.currentLesson, self.gameType)
            answerImgList = resizeImage(answerImgList, 65)
            self.answerImageList = findDifferenceImageAnswerList.imageAnswerList(
                self.displayPanel, answer, answerImgList)

        nextQuestionImg = wx.Bitmap(
            join(config.buttonsPath, 'nextQuestion.png'), wx.BITMAP_TYPE_PNG)
        self.nextQuestionButton = wx.BitmapButton(self.displayPanel,
                                                  4,
                                                  nextQuestionImg, (460, 400),
                                                  style=wx.NO_BORDER)
        self.nextQuestionButton.SetBackgroundColour(config.backgroundColour)
        self.nextQuestionButton.Bind(wx.EVT_BUTTON, self.OnNextQuestion, id=4)

        bottomMenu.bottomMenu([self.displayPanel], parent, self.mainWin,
                              'threeButton', self.mainPanel)
Ejemplo n.º 3
0
 def OnNextQuestion(self, event=None):
     answer, answerList, answerImgList = 0, [], []
     if (self.currentLesson == "animals" or self.currentLesson == "colour") and self.gameType == "Img":
         answer, answerImgList =findDifferenceUtils.nextFindDifferenceQuestion(self.currentLesson, self.gameType)
         answerImgList = resizeImage(answerImgList, 65)
         if self.currentLesson == "colour":
             answer, answerImgList = self.rotateImage(answer, answerImgList)
         else:
             pass
         self.answerImageList.nextQuestion(answer, answerImgList)
     elif (self.currentLesson == "kaKha"  or self.currentLesson == "aaa") and self.gameType == "Char":
         answer, answerList = findDifferenceUtils.nextFindDifferenceQuestionWithoutImage(self.currentLesson, self.gameType)
         self.answerImageList.nextQuestion(answer, answerList)
     elif (self.currentLesson == "kaKha"  or self.currentLesson == "aaa") and self.gameType == "Img":
         answer, answerImgList =findDifferenceUtils.nextFindDifferenceQuestion(self.currentLesson, self.gameType)
         answerImgList = resizeImage(answerImgList, 65)
         self.answerImageList.nextQuestion(answer, answerImgList)
Ejemplo n.º 4
0
 def OnNextQuestion(self, event=None):
     answer, answerList, answerImgList = 0, [], []
     if (self.currentLesson == "animals"
             or self.currentLesson == "colour") and self.gameType == "Img":
         answer, answerImgList = findDifferenceUtils.nextFindDifferenceQuestion(
             self.currentLesson, self.gameType)
         answerImgList = resizeImage(answerImgList, 65)
         if self.currentLesson == "colour":
             answer, answerImgList = self.rotateImage(answer, answerImgList)
         else:
             pass
         self.answerImageList.nextQuestion(answer, answerImgList)
     elif (self.currentLesson == "kaKha"
           or self.currentLesson == "aaa") and self.gameType == "Char":
         answer, answerList = findDifferenceUtils.nextFindDifferenceQuestionWithoutImage(
             self.currentLesson, self.gameType)
         self.answerImageList.nextQuestion(answer, answerList)
     elif (self.currentLesson == "kaKha"
           or self.currentLesson == "aaa") and self.gameType == "Img":
         answer, answerImgList = findDifferenceUtils.nextFindDifferenceQuestion(
             self.currentLesson, self.gameType)
         answerImgList = resizeImage(answerImgList, 65)
         self.answerImageList.nextQuestion(answer, answerImgList)