Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface QuestionGrader<RK, GR>

An interface for question graders. A grader itself defines the grading process, and may be instantiated e.g. with a particular rubric. A grader is immutable during the grading process and calls to each of the functions are idempotent. In other words, a grader does not "remember" the questions it grades.

Type parameters

  • RK: ResponseKind = ResponseKind

    The kind(s) of responses this grader can grade

  • GR: GradingResult = GradingResult

    Representation of a grading result from this kind of grader

Hierarchy

  • QuestionGrader

Implemented by

Index

Methods

  • isGrader<T>(responseKind: T): this is QuestionGrader<T, GradingResult>
  • prepare(exam_id: string, question_id: string, grader_data: any): void
  • Gives the grader a chance to do any one-time preparation depending on the exam and question it is being used for. Generally, this is used to process manual grading results, which are loaded externally and provided as a parameter when prepare() is called.

    Parameters

    • exam_id: string
    • question_id: string
    • grader_data: any

    Returns void

  • Grades the given assigned question and returns the grading result. This function does not itself modify the assigned question to contain the result (just returns it).

    Parameters

    Returns undefined | GR

    The result of

  • pointsEarned(gr: GR): number
  • Computes the number of points earned for the given grading result. Heads up! This could be negative or more than the number of points a question is worth, depending on the type of grader. That's not the concern of the grader, and it's presumed to be handled elsewhere (e.g. by clamping the value between 0 and max points possible on a question).

    Parameters

    • gr: GR

    Returns number

  • renderOverview(gqs: readonly GradedQuestion<RK, GradingResult>[]): string

Generated using TypeDoc