plom.finish module

Plom tools related to post-grading finishing tasks.

plom.finish.assemble_solutions(*, msgr, testnum=None, watermark=False, outdir=PosixPath('solutions'), verbose=True)[source]

Assessemble solution documents.

Keyword Arguments:
  • testnum (int) – which test number to reassemble.

  • msgr (plom.Messenger/tuple) – either a connected Messenger or a tuple appropriate for credientials.

  • watermark (bool) – whether to watermark solns with student-id.

  • outdir (pathlib.Path/str) – where to save the reassembled pdf file Defaults to “solutions/” in the current working directory. It will be created if it does not exist.

  • verbose (bool) – print messages or not. Note: still prints in case of None for an student id.

Returns:

None

Raises:
  • ValueError – paper number does not exist, or is not ready.

  • RuntimeError – cannot get solution images.

plom.finish.clear_manager_login(server=None, password=None)[source]

Force clear the “manager” authorisation, e.g., after a crash.

Parameters:
  • server (str) – in the form “example.com” or “example.com:41984”.

  • password (str) – if not specified, prompt on the command line.

plom.finish.download_rubric_files(*, msgr)[source]

Download two files with information about rubrics.

Keyword Arguments:

msgr (plom.Messenger/tuple) – either a connected Messenger or a tuple appropriate for credientials.

plom.finish.make_coded_return_webpage(use_hex, digits, salt=None, server=None, solutions=False)[source]

Make the secret codes and the return-code webpage.

Parameters:
  • use_hex (bool) – use random hex digits, otherwise an integer without leading zeros.

  • digits (int) – length of secret code.

  • salt (str) – instead of random, hash from student ID salted with this string. Defaults to None, which means do not do this, use random secret codes.

  • solutions (bool) – add a solutions link to the website

  • server (str/None) – server to contact or None for default (probably localhost).

plom.finish.pull_spreadsheet(*, msgr, filename='marks.csv', verbose=True)[source]

Download the “marks.csv” spreadsheet from the server, optionally printing status messages.

Keyword Arguments:
  • msgr (plom.Messenger/tuple) – either a connected Messenger or a tuple appropriate for credientials.

  • filename (pathlib.Path/str) – where to save the csv, defaults to “marks.csv”.

  • verbose (bool) – echo diagnostics to stdout, default True.

Returns:

True if all grading is complete and identified. False if grading is incomplete or some papers are not IDed. Note in either case we write the spreadsheet.

Return type:

bool

plom.finish.reassemble_all_papers(*, msgr, outdir=PosixPath('reassembled'), tmpdir=None, skip=False)[source]

Reassemble all test papers.

Keyword Arguments:
  • msgr (plom.Messenger/tuple) – either a connected Messenger or a tuple appropriate for credientials.

  • outdir (pathlib.Path/str) – where to save the reassembled pdf file Defaults to “reassembled/” in the current working directory. It will be created if it does not exist.

  • tmpdir (pathlib.Path/str/None) – temporary space for download of images. If you provide this, its your responsibility to clean it up. The default is None, in which case we will use an OS temporary space and clean up afterward.

  • skip (bool) – Default False, but if True, skip any pdf files we already have (Careful: without checking for changes!)

plom.finish.reassemble_paper(testnum, *, msgr, outdir=PosixPath('reassembled'), tmpdir=None, skip=False)[source]

Reassemble a particular test paper.

Parameters:

testnum (int) – which test number to reassemble.

Keyword Arguments:
  • msgr (plom.Messenger/tuple) – either a connected Messenger or a tuple appropriate for credientials.

  • outdir (pathlib.Path/str) – where to save the reassembled pdf file Defaults to “reassembled/” in the current working directory. It will be created if it does not exist.

  • tmpdir (pathlib.Path/str/None) – temporary space for download of images. If you provide this, its your responsibility to clean it up. The default is None, in which case we will use an OS temporary space and clean up afterward.

  • skip (bool) – Default False, but if True, skip any pdf files we already have (Careful: without checking for changes!)

Returns:

the full path of the reassembled test pdf.

Return type:

pathlib.Path

Raises:

ValueError – paper number does not exist, or is not ready.