Exemplo n.º 1
0
    def proverka(self):
        self.flag = True
        self.k = 0
        id_i_list = ['i1', 'i2', 'i3', 'i4', 'i5', 'i6']
        id_o_list = ['o1', 'o2', 'o3', 'o4', 'o5', 'o6']

        for i in range(len(id_o_list)):
            if self.ids[id_o_list[i]].text == '':
                self.show_alert_dialog()
                self.flag = False
        if self.flag == True:
            for i in range(len(id_i_list)):
                self.ids[id_i_list[i]].opacity = 1
            z = int(self.ids.o1.text)
            if self.rez1 == z:
                self.ids.i1.source = "Image/yes.png"
                self.k = self.k + 1
            else:
                self.ids.i1.source = "Image/no.png"
            z = int(self.ids.o2.text)
            if self.rez2 == z:
                self.ids.i2.source = "Image/yes.png"
                self.k = self.k + 1
            else:
                self.ids.i2.source = "Image/no.png"
            z = int(self.ids.o3.text)
            if self.rez3 == z:
                self.ids.i3.source = "Image/yes.png"
                self.k = self.k + 1
            else:
                self.ids.i3.source = "Image/no.png"
                self.k = self.k + 1
            z = int(self.ids.o4.text)
            if self.rez4 == z:
                self.ids.i4.source = "Image/yes.png"
                self.k = self.k + 1
            else:
                self.ids.i4.source = "Image/no.png"
            z = int(self.ids.o5.text)
            if self.rez5 == z:
                self.ids.i5.source = "Image/yes.png"
                self.k = self.k + 1
            else:
                self.ids.i5.source = "Image/no.png"
            z = int(self.ids.o6.text)
            if self.rez6 == z:
                self.ids.i6.source = "Image/yes.png"
                self.k = self.k + 1
            else:
                self.ids.i6.source = "Image/no.png"
        print('k', self.k)

        if self.k == 6:
            if Login.urok < 2:
                Login.urok = 2
                self.pars_urok(str(Login.urok))
            Lesson_one.show_alert_dialog(Lesson_one)
            print(Login.urok)
Exemplo n.º 2
0
 def build(self):
     self.icon = 'Image/icon.png'
     self.title = 'Mental_math'
     self.theme_cls.primary_palette = "Yellow"
     manager = ScreenManager()
     manager.add_widget(First(name='first'))
     manager.add_widget(Login(name='login'))
     manager.add_widget(Registration(name='registration'))
     manager.add_widget(MainScreen(name='mainscreen'))
     manager.add_widget(Introductory_lesson(name='introductory_lesson'))
     manager.add_widget(Lesson_one(name='lesson_one'))
     manager.add_widget(Lesson_two(name='lesson_two'))
     manager.add_widget(Lesson_three(name='lesson_three'))
     manager.add_widget(Lesson_four(name='lesson_four'))
     manager.add_widget(Lesson_five(name='lesson_five'))
     manager.add_widget(Lesson_six(name='lesson_six'))
     manager.add_widget(Lesson_seven(name='lesson_seven'))
     manager.add_widget(Lesson_eight(name='lesson_eight'))
     manager.add_widget(Lesson_nine(name='lesson_nine'))
     manager.add_widget(Soroban(name='soroban'))
     manager.add_widget(Flashcards(name='flashcards'))
     manager.add_widget(Stolb(name='stolb'))
     manager.add_widget(Help(name='help'))
     manager.add_widget(Audio_tren(name='audio_tren'))
     return manager
Exemplo n.º 3
0
 def answer1_pressed(self):
     if self.ids.screen_4.opacity == 1:
         sound = SoundLoader.load('sounds/success.WAV')
         self.ids.screen_1.opacity = 1
         self.ids.screen_2.opacity = 0
         self.ids.screen_3.opacity = 0
         self.ids.screen_4.opacity = 0
         print(Login.urok)
         if Login.urok < 1:
             Login.urok = 1
             self.pars_urok()
         Lesson_one.show_alert_dialog(Lesson_one)
         print(Login.urok)
     else:
         sound = SoundLoader.load('sounds/error.wav')
     sound.play()