in2lambda.main.runnerΒΆ

in2lambda.main.runner(question_file: str, chosen_filter: str, output_dir: str | None = None, answer_file: str | None = None) Module[source]ΒΆ

Takes in a TeX file for a given subject and outputs how it’s broken down within Lambda Feedback.

Parameters:
  • question_file – The absolute path to a TeX question file.

  • chosen_filter – The filter chosen to parse the TeX file.

  • output_dir – An optional argument for where to output the Lambda Feedback compatible json/zip files.

  • answer_file – The absolute path to a TeX answer file.

Returns:

A list of questions and how they would be broken down into different Lambda Feedback sections in a Python-readable format. If output_dir is specified, the corresponding json/zip files are produced.

Examples

>>> import os
>>> from in2lambda.main import runner
>>> # Retrieve an example TeX file and run the given filter.
>>> runner(f"{os.path.dirname(in2lambda.__file__)}/filters/PartsSepSol/example.tex", "PartsSepSol") 
Module(questions=[Question(title='', parts=[Part(text=..., worked_solution=''), ...], images=[], main_text='This is a sample question\n\n'), ...])
>>> runner(f"{os.path.dirname(in2lambda.__file__)}/filters/PartsOneSol/example.tex", "PartsOneSol") 
Module(questions=[Question(title='', parts=[Part(text='This is part (a)\n\n', worked_solution=''), ...], images=[], main_text='Here is some preliminary question information that might be useful.'), ...)