diff --git a/dist/cyllene-0.6.3-py3-none-any.whl b/dist/cyllene-0.6.3-py3-none-any.whl new file mode 100644 index 0000000..7462815 Binary files /dev/null and b/dist/cyllene-0.6.3-py3-none-any.whl differ diff --git a/dist/cyllene-0.6.3.tar.gz b/dist/cyllene-0.6.3.tar.gz new file mode 100644 index 0000000..2cb71f8 Binary files /dev/null and b/dist/cyllene-0.6.3.tar.gz differ diff --git a/pyproject.toml b/pyproject.toml index 3329435..e2c757a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "cyllene" -version = "0.6.2" +version = "0.6.3" description = "IPython package for math problem authoring" readme = "README.md" authors = [{ name = "Jan Reimann", email = "jan.reimann@psu.edu" }] @@ -15,7 +15,7 @@ classifiers = [ "Programming Language :: Python :: 3", ] dependencies = [ - "text2qti >= 0.5.0", + "text2qti <= 0.6.0", "ipython >= 8.4.0", "ipywidgets >= 8.0.1", "sympy >= 1.10.1", diff --git a/src/cyllene.egg-info/PKG-INFO b/src/cyllene.egg-info/PKG-INFO index 551f95e..30819ea 100644 --- a/src/cyllene.egg-info/PKG-INFO +++ b/src/cyllene.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: cyllene -Version: 0.6.2 +Version: 0.6.3 Summary: IPython package for math problem authoring Author-email: Jan Reimann License: MIT License @@ -31,7 +31,7 @@ Classifier: Programming Language :: Python :: 3 Requires-Python: >=3.9 Description-Content-Type: text/markdown License-File: LICENSE -Requires-Dist: text2qti>=0.5.0 +Requires-Dist: text2qti<=0.6.0 Requires-Dist: ipython>=8.4.0 Requires-Dist: ipywidgets>=8.0.1 Requires-Dist: sympy>=1.10.1 diff --git a/src/cyllene.egg-info/requires.txt b/src/cyllene.egg-info/requires.txt index 6d60b8b..426016d 100644 --- a/src/cyllene.egg-info/requires.txt +++ b/src/cyllene.egg-info/requires.txt @@ -1,4 +1,4 @@ -text2qti>=0.5.0 +text2qti<=0.6.0 ipython>=8.4.0 ipywidgets>=8.0.1 sympy>=1.10.1 diff --git a/src/cyllene/magics/problem_magics.py b/src/cyllene/magics/problem_magics.py index 751254a..7af1b29 100644 --- a/src/cyllene/magics/problem_magics.py +++ b/src/cyllene/magics/problem_magics.py @@ -47,6 +47,9 @@ def makeqti(line): ProbStack.update_user_funcs() p = ProbStack.get(pname) + if p == None: + print("ERROR: No problem with name " + pname + "found") + return make_qti(p, pnum, solution=with_solution, externals=ProbStack.user_funcs) diff --git a/src/cyllene/user/problem_cmds.py b/src/cyllene/user/problem_cmds.py index eb9474f..a724624 100644 --- a/src/cyllene/user/problem_cmds.py +++ b/src/cyllene/user/problem_cmds.py @@ -25,10 +25,10 @@ def make_problem(prob_string, externals=None, webassign=False): init_dict = parse_webassign(prob_string) else: init_dict = parse(prob_string) - + if 'parameters' in init_dict: return MultipleChoiceParameterProblem(init_dict, externals) - else: + else: return MultipleChoice(init_dict) @@ -58,8 +58,12 @@ def make_qti(problem, num_questions: int, solution=False, externals=None): qti_problem.make_text_quiz( title=title_string, shuffle_answers=True) - # print all questions as txt (for debugging) - print(qti_problem.txt_quiz) + print("Generating " + str(num_questions) + "problems and saving as QTI") + if not solution: + print("(without solutions)") + + # print all questions as txt (uncomment for debugging) + # print(qti_problem.txt_quiz) # load text2qti config config = t2q.Config() @@ -76,7 +80,7 @@ def make_qti(problem, num_questions: int, solution=False, externals=None): file_name = problem.problem_id+"_nosol.zip" qti.save(file_name) - print("QTI file save as "+file_name) + print("QTI file saved as "+file_name) def show_problem(problem): diff --git a/src/cyllene/widgets/widgets_aux.py b/src/cyllene/widgets/widgets_aux.py index ff65811..9855424 100644 --- a/src/cyllene/widgets/widgets_aux.py +++ b/src/cyllene/widgets/widgets_aux.py @@ -1,4 +1,4 @@ -from IPython.display import display, clear_output +from IPython.display import display, clear_output, Markdown import ipywidgets as widgets import markdown import random @@ -8,7 +8,9 @@ def update_output_widget(widget: widgets.Output, content: str): with widget: clear_output() - display(widgets.HTMLMath(markdown.markdown(content))) + # display(widgets.HTMLMath(markdown.markdown(content))) + display(Markdown(content)) + # display(widgets.HTMLMath(content)) def shuffle_answers(num_choices): diff --git a/src/cyllene/widgets/widgets_problem_basic.py b/src/cyllene/widgets/widgets_problem_basic.py index 5dbe5da..4fe8d04 100644 --- a/src/cyllene/widgets/widgets_problem_basic.py +++ b/src/cyllene/widgets/widgets_problem_basic.py @@ -26,15 +26,15 @@ def __init__(self, problem: Problem): self.statement = widgets.Output() self.has_solution = self.problem.has_solution - + self.solution_text = widgets.Output() with self.solution_text: display(widgets.HTMLMath(markdown.markdown(self.problem.solution))) - + self.solution_title = 'Show Solution' if self.problem.solution_title != '': self.solution_title = self.problem.solution_title - + self.solution = widgets.Accordion( children=[self.solution_text]) self.solution.selected_index = None @@ -94,9 +94,9 @@ def show(self): with self.choices: clear_output() for i in range(self.problem.num_choices): - display(widgets.HTMLMath('( ' + str(i+1) - + ' )    ' - + self.problem.choices[self.indices[i]])) + display(widgets.HTMLMath('( ' + str(i+1) + + ' )    ' + + self.problem.choices[self.indices[i]])) display(widgets.VBox([self.choices, widgets.HBox( self.choice_buttons), self.feedback])) @@ -107,7 +107,7 @@ def show(self): if self.has_solution: display(self.solution) - + def update_choices(self, choices: list): """ Update the choices widget @@ -119,13 +119,12 @@ def update_choices(self, choices: list): clear_output() for i in range(self.problem.num_choices): display(widgets.HTMLMath(markdown.markdown( - '**( ' + str(i+1) + ' )**    ' + '**( ' + str(i+1) + ' )**    ' + choices[self.indices[i]])) - ) - + ) def on_button_clicked(self, bt): - + self.check_answer(bt.description[2:-2]) def check_answer(self, answer): diff --git a/src/cyllene/widgets/widgets_problem_param.py b/src/cyllene/widgets/widgets_problem_param.py index 5fca79a..0a1bb5d 100644 --- a/src/cyllene/widgets/widgets_problem_param.py +++ b/src/cyllene/widgets/widgets_problem_param.py @@ -68,11 +68,14 @@ def update_problem_area(self): with self.problem_area: clear_output() - display(widgets.HTMLMath(markdown.markdown(self.problem.statement))) + # display(widgets.HTMLMath(markdown.markdown(self.problem.statement))) + display(Markdown(self.problem.statement)) for i in range(self.problem.num_choices): - display(widgets.HTMLMath( - value='( ' + str(i+1) + ' )    ' + self.problem.choices[self.indices[i]] + "       ")) + # display(widgets.HTMLMath( + # value='( ' + str(i+1) + ' )    ' + self.problem.choices[self.indices[i]] + "       ")) + display(Markdown( + '**( ' + str(i+1) + ' )**    ' + self.problem.choices[self.indices[i]] + "       ")) def new_button_clicked(self, bt):