Skip to content

Commit

Permalink
Update v1.1.7
Browse files Browse the repository at this point in the history
  • Loading branch information
gamingwithevets authored Aug 2, 2022
1 parent 91aa48d commit cfb8374
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
6 changes: 3 additions & 3 deletions editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import tempfile
import traceback

version = '1.4.1'
quizprog_version = '1.1.6'
version = '1.4.2'
quizprog_version = '1.1.7'


import argparse
Expand Down Expand Up @@ -263,7 +263,7 @@ def change_wrongmsg():
if len(question_data['wrongmsg']) >= 1:
if choice == 4:
text = input_string('wrong message for choice ' + m, 'message', question_data['wrongmsg'][m])
if text: datafile['wrongmsg'][m] = text
if text: question_data['wrongmsg'][m] = text
elif choice == 5:
if len(question_data['wrongmsg']) < 4:
l = len(available_choices)
Expand Down
22 changes: 12 additions & 10 deletions quizprog.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import traceback
from datetime import datetime

version = '1.1.6'
version = '1.1.7'

import argparse
parser = argparse.ArgumentParser(description = 'Loads a pre-made quiz from a JSON, either from the internet or locally.', epilog = 'QuizProg v{}\n(c) 2022 GamingWithEvets Inc. All rights reserved.'.format(version), formatter_class = argparse.RawTextHelpFormatter, allow_abbrev = False)
Expand All @@ -19,7 +19,7 @@
parser.add_argument('-n', '--no-tk', action = 'store_true', help = 'don\'t use Tkinter')
args = parser.parse_args()

if args.enable_log: logfile = open('quizprog.log', 'a', encoding = 'utf-8')
if args.enable_log: logfile = open('quizprog.log', 'a', encoding = 'utf-8')

if not args.no_tk:
try:
Expand Down Expand Up @@ -60,6 +60,7 @@ def abort(): print_tag('aborting.\n\n')
print_tag('quizprog v' + version)

if args.path != None:
path = args.path
is_url = bool(re.search('(?P<url>https?://[^\s]+)', args.path))

if is_url:
Expand Down Expand Up @@ -98,6 +99,7 @@ def abort(): print_tag('aborting.\n\n')
abort()
parser.error('invalid JSON data')
else:
path = ''
is_url = False
loaded_quiz = False
datafile = {}
Expand Down Expand Up @@ -358,7 +360,7 @@ def quit_quiz():
def openf():
function = 'openf'

global message, datafile, loaded_quiz
global message, datafile, loaded_quiz, path
path = ''
if args.no_tk:
tempmsg = 'Is this correct?'
Expand Down Expand Up @@ -436,9 +438,9 @@ def openf():

def set_title():
print_tag('setting title', 'set_title')
if args.path:
if is_url: title = 'QuizProg Loader - ' + datafile['title'] + ' - ' + args.path
else: title = 'QuizProg Loader - ' + datafile['title'] + ' - ' + os.path.realpath(args.path)
if loaded_quiz:
if is_url: title = 'QuizProg Loader - ' + datafile['title'] + ' - ' + path
else: title = 'QuizProg Loader - ' + datafile['title'] + ' - ' + os.path.realpath(path)
else: title = 'QuizProg Loader'
if os.name == 'nt': ctypes.windll.kernel32.SetConsoleTitleW(title)
else: sys.stdout.write('\x1b]2;' + title + '\x07')
Expand All @@ -449,14 +451,13 @@ def set_title():
message = 'Welcome to QuizProg! Any errors while opening a quiz will be displayed here.'
while not quitted:
try:
set_title()
clear()
if loaded_quiz:
set_title()
message = ''
print_tag('displaying quiz menu')
print(datafile['title'].upper())
print('\nPowered by QuizProg v' + version + '\n')
if check_optional_element('description'): print(datafile['description'])
print(datafile['title'] + '\nPowered by QuizProg')
if check_optional_element('description'): print('\n' + datafile['description'])
print('\n[1] Start quiz\n')
print('[2] Open another quiz')
print('[3] Quit quiz\n')
Expand Down Expand Up @@ -484,6 +485,7 @@ def set_title():
elif choice == 4: about()
else: pass
else:
set_title()
print_tag('displaying quizprog menu')
print('QUIZPROG LOADER\n')
print(message + '\n')
Expand Down

0 comments on commit cfb8374

Please sign in to comment.