 {EventService} = require '../services/event-service'
-{Question} = require '../models/question'
+{QuestionService} = require '../services/question-service'
 {SentenceService} = require '../services/sentence-service'
 
 class Controller

    @translated = null

  generateQuestions: (sentence) ->
    @questions = @sentences.map (i) ->
      new Question(i)

module.exports = ->
  bindToController: true

  constructor: (@$timeout) ->
    event = EventService.getInstance()
    service = SentenceService.getInstance()

    event.on 'question-service:changed', (questions) =>
      @$timeout => @questions = questions

    event.on 'sentence-service:changed', (sentences) =>
      @$timeout => @sentences = sentences
