       result = config.validation? panel, workspace
       if result
         @handleChapterSuccess()
+        @getDelegate().emit "ChapterSucceed", @getData().courseMeta
         config.onSuccess? panel, workspace
       else
         config.onFailed?  panel, workspace


  constructor: (options = {}, data) ->

    panelOptions    = data.config.panel
    config          = @extendOptions panelOptions
    config.delegate = options.delegate # TODO: fatihacet - it's a quick hack, we neeed to merge all other options.

    @addDefaultButtons panelOptions

    super config, data

    @createChapterList()

  extendOptions: (options) ->
    config = {}

    modal.destroy()
    parent.destroySubViews()

    {index, name} = @getData().courseMeta
    {chapters}    = @getData().courseManifest
    if chapters.length > index
      KD.getSingleton("router").handleQuery "?course=#{name}&chapter=#{++index}"

  createChapterList: ->
    @addSubView @chapterList = new ClassroomChapterList {}, @getData().courseManifest

  createChapterDescription: ->
    @addSubView @chapterDescription = new KDView
      cssClass : "chapter-description"
      partial  : """
        <h2 class="chapter-index">Chapter #{@getData().courseMeta.index}</h2>
        #{@getData().config.panel.hint}
      """

  animateContent: (container) ->
    container.toggleClass "active"
    if container.hasClass "active"
      KD.getSingleton("windowController").addLayer container
      container.once "ReceivedClickElsewhere", ->
        container.toggleClass "active"