API Docs for:
Show:

Survey Class

Extends Backbone.Model
Module: backbone-survey

Methods

addAnsweredSectionId

(
  • Section.id
)

Add an answered section ID.

Parameters:

  • Section.id String

answeredRoutes

() Array

Returns the route keys in the sections.

Returns:

Array:

answers

() Array

Returns all answers.

Returns:

Array:

availablePages

() Array

Returns available page numbers.

Returns:

Array:

currentSections

() Array

Returns an array of Section in a current page.

Returns:

Array:

initAnswers

(
  • p
  • option
)

Initialize all the answers and the status.

Parameters:

  • p Number

    A current page

  • option Object

    Survey#set option

isFirstPage

() Boolean

Returns:

Boolean:

isLastPage

() Boolean

Returns:

Boolean:

nextPage

()

Move to the next page.

parse

(
  • resp
  • options
)
Object

Parser method for using { parse: true } option.

var survey = new BackboneSurvey.Survey({
   survey: {
     // Survey.attributes ....
   }
 , sections: [
     // An array of Section.attributes ....
   ]
}, { parse: true });

Parameters:

  • resp Object
  • options Object

Returns:

Object: attributes

prevPage

()

Move to the previous page.

serializeStatus

() String

Serialize the survey status.

Returns:

String:

startPage

()

Move to a first page, and reset all answers.

unserializeStatus

(
  • serialized
  • option
)
Boolean

Unserialize a survey status.

Parameters:

  • serialized String

    A serialized string Survey#serializeStatus returns

  • option Object

    Survey#set option

Returns:

Boolean:

Properties