2022-03-22 23:09:39 +01:00
|
|
|
from assets import config, question_answer_output
|
|
|
|
from menu import database_menu
|
|
|
|
|
|
|
|
|
|
|
|
# Main Menu
|
|
|
|
|
2022-03-24 09:18:02 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
2022-03-22 23:09:39 +01:00
|
|
|
def main_menu():
|
|
|
|
enable_menu = True
|
2022-03-24 09:18:02 +01:00
|
|
|
selection = {0: 'Datenbank Tool (Nur möglich wenn der Mysql-Server gestartet wurde)', 1: 'Zufallsfrage', 2: 'Info', 3: 'Komplette Liste', 4: 'Programm beenden\n'}
|
2022-03-22 23:09:39 +01:00
|
|
|
|
|
|
|
print('# Main Menü #\n')
|
|
|
|
while enable_menu:
|
|
|
|
for key, value in selection.items():
|
|
|
|
print(key, value)
|
|
|
|
selection_number = int(input('Bitte Auswahl treffen\n'))
|
|
|
|
match selection_number:
|
|
|
|
case 0:
|
|
|
|
database_menu.menu()
|
|
|
|
break
|
|
|
|
case 1:
|
|
|
|
while True:
|
2022-03-23 11:21:17 +01:00
|
|
|
print('\n#Frage#\n' + '-' * 60 + '\n' + question_answer_output.random_question(config.json_file)[0])
|
2022-03-22 23:09:39 +01:00
|
|
|
input('\nBitte Enter drücken um die Antwort zu sehen\n')
|
2022-03-23 11:21:17 +01:00
|
|
|
print('\n#Antwort#\n')
|
|
|
|
print(question_answer_output.random_question(config.json_file)[1])
|
2022-03-22 23:09:39 +01:00
|
|
|
number = int(input('\nZurück zum Hauptmenü\n 1: Ja \n 2: Nein, nächste Frage\n'))
|
|
|
|
if number == 1:
|
|
|
|
break
|
|
|
|
case 2:
|
2022-03-24 09:18:02 +01:00
|
|
|
print('# Info # \n In diesem Programm sind ca 300 Prüfungsrelevante Fragen zur ersten Prüfung gespeichert. \n')
|
|
|
|
case 3:
|
|
|
|
print('\n Liste der Fragen und Antworten')
|
|
|
|
print(question_answer_output.complete_list(config.json_file))
|
|
|
|
case 4:
|
|
|
|
break
|