Class: ExperimentManager

Angular. ExperimentManager

new ExperimentManager()

The ExperimentManager service has two main responsibilities: managing the state (the 'slide' that is presented to the user) and the TrialData service.

Source:

Members

stateChanging :boolean

Reflects the current state as reported by Angular's $stateProvider. When the state is changing (a new 'slide' is being presented--typically after a call to advanceSlide, this will be set to true. When the change completes, this will be set to true.

Type:
  • boolean
Source:

Methods

advanceSlide() → {undefined}

Advances the state to the next state as defined in the study specification document (see the README).

Source:
Returns:
Type
undefined

masterReset() → {$q.promise}

Resets the experiment session.

In resetting the session, after resetting the TrialData service, masterReset() does the following:

  • Generates a new UUID for the session number
  • Fetches a random experiment schema from the backend
  • Gets the custom metadata (as specified in config/custom.js

    The TrialData service is then updated with these new data.

Source:
Returns:

This promise is resolved when the reset is complete and rejected if the reset fails.

Type
$q.promise