plom.finish module

Plom tools related to post-grading finishing tasks.

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(shortname: str, *, longname: str = 'Plom Assessment', use_hex: bool = True, digits: int = 9, salt=None, solutions=False) None[source]

Make the secret codes and the return-code webpage.

Parameters:

shortname – an abbreviated name for the assessment being returned.

Keyword Arguments:
  • longname – a human-readable name for this assessment. We will escape parts of it as appropriate for HTML. If omitted, defaults to “Plom Assessment”.

  • 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. Not supported

Returns:

None.

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: Path | str = PosixPath('reassembled'), tmpdir: Path | str | None = None, skip: bool = False) None[source]

Reassemble all papers.

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

  • outdir – 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 – 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(papernum: int, *, msgr, outdir: Path | str = PosixPath('reassembled'), tmpdir: Path | str | None = None, skip: bool = False) Path | None[source]

Reassemble a particular paper.

Parameters:

papernum – which paper 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 – 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 – Default False, but if True, skip any pdf files we already have (Careful: without checking for changes!)

Returns:

The full path of the reassembled paper pdf, if one was created else None.

Raises:

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