from tkinter import * import tkinter as tk from core.Trivia import * import random #default grade to load grade = 9 score_index = 2 trivia = Trivia() #grade_idx = list() #file_name="history/history_questions.txt" file_name = "history/history_questions.txt" #Show frame selected def show_frame(self, page_name): for frame in self.frames.values(): frame.grid_remove() frame = self.frames[page_name] frame.grid() return frame #Show score def check_score(labelScore): if (int(trivia.score) == int(trivia.max_score)): labelScore.config(text="Congratulations! Your score is max: " + str(trivia.score), fg="red") elif (int(trivia.score) < int(trivia.max_score) / 2):
def get_trivia(grade): trivia = Trivia(int(grade)) return trivia
def get_trivia(grade): #Gets the Trivia piece of code trivia = Trivia(int(grade)) return trivia