+SetIntervalMixin =
+  componentWillMount: ->
+    @intervals = []
+
+  setInterval: ->
+    @intervals.push setInterval.apply(null, arguments)
+
+  componentWillUnmount: ->
+    @intervals.map(clearInterval)
+
 @ExerciseBase = React.createClass
-  SetIntervalMixin:
-    componentWillMount: ->
-      @intervals = []
-
-    setInterval: ->
-      @intervals.push setInterval.apply(null, arguments)
-
-    componentWillUnmount: ->
-      @intervals.map(clearInterval)
-
   outputSeconds: ->
     @getFormattedTime @state.second
 


  tick_start: ->
    unless @interval
      @interval = setInterval(@tick, 1000)
      @setState
        play: true
        is_start: true

    @setState
      second: @state.second + 1

  mixins: [SetIntervalMixin]

  getInitialState: ->
    @question_count = @props.data.questions.length
