Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download
Views: 1794
Image: ubuntu2004
Kernel: SageMath 9.1
# Path to bank containing __bank__.xml and *.sage/*.ptx files bank = "tbil-la" # Outcome in bank to preview: {outcome}.sage/.ptx outcome = "E1" # Loads CheckIt script oldwd=os.getcwd() try: os.chdir(".."); load("main.sage") finally: os.chdir(oldwd) # Loads Bank try: os.chdir(bank) load(f"{outcome}.sage") with open(f"{outcome}.ptx",'r') as template_file: template = template_file.read() finally: os.chdir(oldwd) # Generates and displays a sample exercise exercise = Exercise( title=outcome+" Title", slug=outcome, generator=generator, template=template, seed=randrange(1000) ) from IPython.core.display import display, HTML display(HTML(exercise.html())) exercise.preview()