Options
All
  • Public
  • Public/Protected
  • All
Menu

Progress tracker for tracking how far the user is within the activity, how well the user is doing and track the activity state

Hierarchy

  • ProgressTracker

Index

Accessors

attemptAccuracy

  • get attemptAccuracy(): number
  • returns attempt accuracy [0..1], with 1 being all attempts answered correctly

    Returns number

attempts

  • get attempts(): number
  • Return the number of answer attempts

    Returns number

completed

  • get completed(): number
  • set completed(value: number): void
  • The number of promblems/points completed

    Returns number

  • The number of promblems/points completed

    Parameters

    • value: number

    Returns void

hasState

  • get hasState(): boolean
  • Is there a state?

    Returns boolean

isDone

  • get isDone(): boolean
  • Returns true if progress has reached the end (problems/points completed)

    Returns boolean

isInitialized

  • get isInitialized(): boolean
  • Is the tracking data initialized?

    Returns boolean

isTracking

  • get isTracking(): boolean
  • Is the user/system setup for tracking and tracking is on?

    Returns boolean

percentComplete

  • get percentComplete(): number
  • Returns number

state

  • get state(): any
  • set state(value: any): void
  • Activity specific state data that can be used to restore/resume an activity

    Returns any

  • Activity specific state data that can be used to restore/resume an activity

    Parameters

    • value: any

    Returns void

successfulAttempts

  • get successfulAttempts(): number
  • Return the number of answer attempts that were successfull.

    Returns number

total

  • get total(): number
  • set total(value: number): void
  • The total number of problems/points that represent 100% completion

    Returns number

  • The total number of problems/points that represent 100% completion

    Parameters

    • value: number

    Returns void

version

  • get version(): string
  • set version(value: string): void
  • SemVer version string that defines the version of the activity it was created from. Used to check progress.state compatibility when resuming an activity by checking it against the version of the activity

    Returns string

  • SemVer version string that defines the version of the activity it was created from. Used to check progress.state compatibility when resuming an activity by checking it against the version of the activity

    Parameters

    • value: string

    Returns void

Static instance

Methods

addAttempt

  • addAttempt(isCorrect: boolean): void
  • Add an answer attempt. Attempts represent 'tries' and not submitted results (i.e. there can be multiple incorrect attempts on 1 incorrect problem)

    Parameters

    • isCorrect: boolean

      True if the attempt was the correct answer

    Returns void

clear

  • clear(): void
  • Immediately clears any progress

    Returns void

fromJSON

  • fromJSON(json: object): void
  • Parameters

    • json: object

    Returns void

initialize

  • initialize(_total: number, _state?: any): void
  • Reset the track counts and tracked problems

    Parameters

    • _total: number
    • Default value _state: any = null

    Returns void

load

  • load(): boolean
  • Load progress passed back from page load, or loaded from local cache

    Returns boolean

loadLatest

  • loadLatest(successCB: Function, failCB: Function): void
  • Load progress (i.e. load()) then attempt to get the latest from the reporting service

    Parameters

    • successCB: Function
    • failCB: Function

    Returns void

save

  • save(): boolean
  • Persist the tracking data and state

    Returns boolean