gradelib.policies.attempts#
Allow multiple attempts on assignments.
- gradelib.policies.attempts.take_best(gradebook: Gradebook, attempts: Mapping[str, Sequence[str]], *, remove=True, policy: Callable[[Series], Series] | None = None, points_possible: int | float = 1.0)#
Replaces multiple attempts at an assignment with the best.
- Parameters:
gradebook (Gradebook) – The gradebook that will be modified.
attempts (Mapping[str, Sequence[str]]) – A mapping from the name of the new assignment to a sequence of existing assignments that will be used to determine the score on the new assignment.
remove (bool, optional) – Whether to remove the existing assignments, by default True.
policy (Optional[Callable[[int, float], float]], optional) – A function that takes a Series of the student’s previous scores and returns a Series of the effective scores after applying any penalties. The index of the new Series should match that of the input Series. A value of
Noneindicates that no penalties should be applied; this is the default.points_possible (Union[int, float], optional) – The number of points possible on the new assignment, by default 1.