<commit_before>class ClassroomAppView extends KDScrollView

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

    options.cssClass = "classroom-app-view"

    super options, data

    @appStorage  = KD.getSingleton("appStorageController").storage "Classroom", "1.0"

    @emit "ready"

    @on "ChapterSucceed", (chapterData) => @markChapterAsCompleted chapterData

  fetchCourses: ->
    @appStorage.ready =>
      @enrolledCourses    = @appStorage.getValue("EnrolledCourses") or []
      @relatedCourses     = []
      enrolledCourseNames = []

      enrolledCourseNames.push enrolled.name for enrolled in @enrolledCourses

      for courseDetails in @getPredefinedCourses()
        courseName = courseDetails.name
        if @enrolledCourses.length is 0 or enrolledCourseNames.indexOf(courseName) is -1
          @relatedCourses.push courseDetails

      @addSubView @coursesView = new ClassroomCoursesView
        delegate : this
      ,
        enrolled : @enrolledCourses
        related  : @relatedCourses

  createHeader: ->
    @addSubView @header = new KDView
      cssClass : "container"
      partial  : """
        <div class="banner">
          <h1>&lt;classroom /&gt;</h1>
          <h2>Start learning, teaching and sharing together. <br /> It's your classroom and it's online and it's free!</h2>
          <img src="http://hindiurduflagship.org/wp-content/uploads/2010/11/ImportanceVideoThumbnail.jpg" />
        </div>
      """<commit_msg>Classroom: Added passed chapters to data for ClassroomCoursesView.<commit_after>class ClassroomAppView extends KDScrollView

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

    options.cssClass = "classroom-app-view"

    super options, data

    @appStorage  = KD.getSingleton("appStorageController").storage "Classroom", "1.0"

    @emit "ready"

    @on "ChapterSucceed", (chapterData) => @markChapterAsCompleted chapterData

  fetchCourses: ->
    @appStorage.ready =>
      @enrolledCourses    = @appStorage.getValue("EnrolledCourses") or []
      @relatedCourses     = []
      enrolledCourseNames = []

      enrolledCourseNames.push enrolled.name for enrolled in @enrolledCourses

      for courseDetails in @getPredefinedCourses()
        courseName = courseDetails.name
        if @enrolledCourses.length is 0 or enrolledCourseNames.indexOf(courseName) is -1
          @relatedCourses.push courseDetails

      @addSubView @coursesView = new ClassroomCoursesView
        delegate : this
      ,
        enrolled          : @enrolledCourses
        related           : @relatedCourses
        completedChapters : @appStorage.getValue "CompletedChapters"

  createHeader: ->
    @addSubView @header = new KDView
      cssClass : "container"
      partial  : """
        <div class="banner">
          <h1>&lt;classroom /&gt;</h1>
          <h2>Start learning, teaching and sharing together. <br /> It's your classroom and it's online and it's free!</h2>
          <img src="http://hindiurduflagship.org/wp-content/uploads/2010/11/ImportanceVideoThumbnail.jpg" />
        </div>
      """
{'fraction_non_alphanumeric': 0.10711931443638761, 'fraction_numerical': 0.00922874093605801, 'mean_word_length': 2.9313471502590676, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7250930', 'n_tokens_mistral': 930, 'n_tokens_neox': 862, 'n_words': 196}