add templates to funcs

This commit is contained in:
lukew3
2021-10-06 23:19:57 -04:00
parent 4cf160e7b2
commit cde4a73867
2 changed files with 44 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
from .__init__ import *
def gen_func(format='string'):
if format == 'string':
return problem, solution
elif format == 'latex':
return 'Latex unavailable'
else:
return
generator_name = Generator("<Title>", id, gen_func,
["<kwarg1>"])

View File

@@ -0,0 +1,25 @@
from .__init__ import *
def gen_func(format='string'):
# your generator code goes here
if format == 'string':
# code that generates problem, solution strings goes here
return problem, solution
elif format == 'latex':
# code that generates latex representation of problem, and solution goes here
# if you can't do this, leave the return 'Latex unavailable'
#return latex_problem, latex_solution
return 'Latex unavailable'
else:
# Return necessary variables here
# Any variables that go into the problem and solution string without formatting
return a, b
# generator_name should be the same as the file name
# id can be generated by running nextId.py inside of the scripts folder
# last argument of Generator should be a list of the kwargs used in your gen_func().
generator_name = Generator("<Title>", <id>, gen_func,
["<kwarg1>"])
# Delete all comments before submitting a pr