Пример #1
0
    def __init__(self, master):
        self.data = DbUtil.DbUtil()
        self.master = master
        self.master.resizable(0, 0)
        master.title("Menu")

        self.mainFrame = Frame(master)
        self.mainFrame.pack()

        self.label = Label(self.mainFrame, text="Wybierz kategorię")
        self.label.pack()

        #Stwórz listę kategorii
        self.selectCategoty = Listbox(self.mainFrame, selectmode=SINGLE)
        for i in self.data.data:
            self.selectCategoty.insert(0, i)
        self.selectCategoty.select_set(0)
        self.selectCategoty.pack(fill=X)
        #-----------------------#

        self.scale = Scale(self.mainFrame,
                           from_=5,
                           to=15,
                           orient=HORIZONTAL,
                           label='       Ilość słówek')
        self.scale.pack(fill=X)

        self.startButton = Button(self.mainFrame,
                                  text="Start",
                                  command=self.openCurseWindow)
        self.startButton.pack()

        self.wordCounter = 0
        self.mistakeCounter = 0
        self.gotWords = False
Пример #2
0
 def __init__(self, configs):
     super(BackupData, self).__init__()
     self.__db = DbUtil.DbUtil(
         configs['dbhost'], Config.INPUT_DB_USERNAME,
         Config.INPUT_DB_PASSWORD, Config.INPUT_DB_DATABASE
         if configs['dbname'] is None else configs['dbname'],
         Config.INPUT_DB_CHARSET)
     self.__logger = Logger.Logger(__name__)
Пример #3
0
 def __init__(self, configs):
     super(CalcTeacherMetric, self).__init__()
     self.__db = DbUtil.DbUtil(
         configs['dbhost'], Config.INPUT_DB_USERNAME,
         Config.INPUT_DB_PASSWORD, Config.INPUT_DB_DATABASE
         if configs['dbname'] is None else configs['dbname'],
         Config.INPUT_DB_CHARSET)
     self.__logger = Logger.Logger(__name__)
     self.__delimiter = '@'
Пример #4
0
 def __init__(self):
     super(CreateTable, self).__init__()
     self.__configs = CommonUtil.parse_arguments()
     self.__db = DbUtil.DbUtil(
         self.__configs['dbhost'], Config.INPUT_DB_USERNAME,
         Config.INPUT_DB_PASSWORD, Config.INPUT_DB_DATABASE
         if configs['dbname'] is None else configs['dbname'],
         Config.INPUT_DB_CHARSET)
     self.__logger = Logger.Logger(__name__)
Пример #5
0
 def __init__(self, configs):
     super(Preprocessor, self).__init__()
     self.__db = DbUtil.DbUtil(
         configs['dbhost'], Config.INPUT_DB_USERNAME,
         Config.INPUT_DB_PASSWORD, Config.INPUT_DB_DATABASE
         if configs['dbname'] is None else configs['dbname'],
         Config.INPUT_DB_CHARSET)
     self.__logger = Logger.Logger(__name__)
     self.__teaching = True if configs[
         'teaching'] == 1 else False  # teaching=1 表示评估课堂的教学情况
     self.__teacher = True if configs[
         'teaching'] == 2 else False  # teaching=2 表示基于S-T评估教师的教学情况
Пример #6
0
 def __init__(self, configs):
     super(EstimateMental, self).__init__()
     self.__logger = Logger.Logger(__name__)
     self.__preprocessor = Preprocessor.Preprocessor(configs)
     self.__poster = PostMetric.PostMetric(configs)
     self.__db = DbUtil.DbUtil(configs['dbhost'], Config.INPUT_DB_USERNAME, Config.INPUT_DB_PASSWORD, Config.INPUT_DB_DATABASE if configs['dbname'] is None else configs['dbname'], Config.INPUT_DB_CHARSET)
     self.__date = configs['date']
     self.__teaching = True if configs['teaching'] == 1 else False  # teaching=1 表示评估课堂的教学情况
     self.__teacher = True if configs['teaching'] == 2 else False  # teaching=2 表示基于S-T评估教师的教学情况
     if self.__teaching:  # 不识别学生情况下的教学效果评估
         self.__teaching_metric = CalcTeachingMetric.CalcTeachingMetric(configs)
         self.__teaching_analyzer = AnalyzeTeachingGrade.AnalyzeTeachingGrade(configs)
     elif self.__teacher:  # 基于S-T分析教师教学情况
         self.__teacher_metric = CalcTeacherMetric.CalcTeacherMetric(configs)
     else:  # 需要识别学生,基于学生的行为评估学生学习状态
         self.__metric = CalcMetric.CalcMetric(configs)
         self.__course = CalcCourseMetric.CalcCourseMetric(configs)
         self.__analyzer = AnalyzeGrade.AnalyzeGrade(configs)
         self.__interests = {}
Пример #7
0
 def __init__(self, configs):
     super(MockData, self).__init__()
     self.__logger = Logger.Logger(__name__)
     self.__db = DbUtil.DbUtil(
         configs['dbhost'], Config.INPUT_DB_USERNAME,
         Config.INPUT_DB_PASSWORD, Config.INPUT_DB_DATABASE
         if configs['dbname'] is None else configs['dbname'],
         Config.INPUT_DB_CHARSET)
     self.__students = [['9001', '李小霖', '语文'], ['9002', '黄小莹', '英语'],
                        ['9003', '贺小文', '数学'], ['9004', '梁小浩', '物理'],
                        ['9005', '李小霞', '英语']]
     self.__classid = '201901'
     self.__grade = '2019'
     self.__class = '演示1班'
     self.__date = configs['date']
     self.__courses = ['语文', '英语', '数学', '物理', '化学', '德育']
     self.__times = [['09:00:00', '09:59:59'], ['10:00:00', '10:59:59'],
                     ['11:00:00', '11:59:59'], ['14:00:00', '14:59:59'],
                     ['15:00:00', '15:59:59'], ['16:00:00', '16:59:59']]
Пример #8
0
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import traceback

# import hashlib
from DateUtil import *
from DbUtil import *

VIP_USE_TIMES = (5, 80, 600, 1300, 0)
# 月会员3次
# 季度10次
# 半年会员21次
# 年会员43次
# 永久会员
db = DbUtil()
date_util = DateUtil()


def is_use_forever(vip_type):
    if vip_type == VipType.forever:
        return True
    else:
        return False


# def get_use_times(vip_type):
# 	if vip_type in VipType:
# 		return VIP_USE_TIMES[vip_type.value]
# 	else:
# 		return 0
Пример #9
0
    def __init__(self, master):
        self.data = DbUtil.DbUtil()
        self.master = master
        self.master.resizable(0 ,0)
        master.title("Edycja")

        self.mainFrame = Frame(master)
        self.mainFrame.pack()

        self.bottomFrame = Frame(master, borderwidth=10)
        self.bottomFrame.pack()

        self.leftFrame = Frame(self.mainFrame, borderwidth = 5)
        self.leftFrame.pack(side='left')

        self.rightFrame = Frame(self.mainFrame, borderwidth = 5)
        self.rightFrame.pack(side='right')

        self.label = Label(self.leftFrame, text="Wybierz kategorię")
        self.label.pack()

        #Stwórz listę kategorii
        self.selectCategotyScrollbarY = Scrollbar(self.leftFrame)
        self.selectCategotyScrollbarY.pack(side=RIGHT, fill=Y)
        self.selectCategotyScrollbarX = Scrollbar(self.leftFrame, orient=HORIZONTAL)
        self.selectCategotyScrollbarX.pack(side=BOTTOM, fill=X)
        self.selectCategoty = Listbox(self.leftFrame, selectmode=SINGLE, yscrollcommand=self.selectCategotyScrollbarY.set, xscrollcommand=self.selectCategotyScrollbarX.set, exportselection=0)

        for i in self.data.data:
            self.selectCategoty.insert(0, i)
        self.selectCategoty.bind('<<ListboxSelect>>', self.selectCategory)
        self.selectCategoty.pack()

        self.selectCategotyScrollbarY.config(command=self.selectCategoty.yview)
        self.selectCategotyScrollbarX.config(command=self.selectCategoty.xview)
        #-----------------------#

        self.label2 = Label(self.rightFrame, text='Słowa')
        self.label2.pack()

        #Wyświetl listę słów z danej kategorii
        self.showWordsScrollbarY = Scrollbar(self.rightFrame)
        self.showWordsScrollbarY.pack(side=RIGHT, fill=Y)
        self.showWordsScrollbarX = Scrollbar(self.rightFrame, orient=HORIZONTAL)
        self.showWordsScrollbarX.pack(side=BOTTOM, fill=X)
        self.showWords = Listbox(self.rightFrame, selectmode=SINGLE, yscrollcommand=self.showWordsScrollbarY.set, xscrollcommand=self.showWordsScrollbarX.set, exportselection=0)

        self.showWords = Listbox(self.rightFrame, selectmode=SINGLE)
        self.showWords.select_set(0)
        self.showWords.pack()
        self.showWords.bind('<<ListboxSelect>>')

        self.showWordsScrollbarY.config(command=self.showWords.yview)
        self.showWordsScrollbarX.config(command=self.showWords.xview)
        #-----------------------#

        self.deleteButton = Button(self.bottomFrame, text='Usuń', command=self.getWordToDelete)
        self.deleteButton.pack()

        self.labelEdit = LabelFrame(self.bottomFrame, text='Edycja - wpisz słowo i jego tłumaczenie')
        self.labelEdit.pack(side='bottom')

        self.wordInfo = Label(self.labelEdit, text='Słowo:')
        self.wordInfo.pack()
        self.wordData = StringVar()
        self.wordInput = Entry(self.labelEdit, textvariable=self.wordData)
        self.wordInput.pack()

        self.translationInfo = Label(self.labelEdit, text='Tłumaczenie:')
        self.translationInfo.pack()
        self.translationData = StringVar()
        self.translationInput = Entry(self.labelEdit, textvariable=self.translationData)
        self.translationInput.pack()

        self.categoryInfo = Label(self.labelEdit, text='Kategoria:')
        self.categoryInfo.pack()
        self.categoryData = StringVar()
        self.categoryInput = Entry(self.labelEdit, textvariable=self.categoryData)
        self.categoryInput.pack()

        self.commitButton = Button(self.labelEdit, text='Dodaj', command=self.commit)
        self.commitButton.pack(pady = 5)