<commit_before>CocoModel = require './CocoModel'
schema = require 'schemas/models/course_instance.schema'

module.exports = class CourseInstance extends CocoModel
  @className: 'CourseInstance'
  @schema: schema
  urlRoot: '/db/course_instance'

  upsertForHOC: (opts) ->
    options = {
      url: _.result(@, 'url') + '/~/create-for-hoc'
      type: 'POST'
    }
    _.extend options, opts
    @fetch(options)
    
  addMember: (userID) ->
    options = {
      method: 'POST'
      url: _.result(@, 'url') + '/~/members'
      data: { userID: userID }
    }
    _.extend options, opts
    @fetch(options)

  firstLevelURL: ->
    "/play/level/course-dungeons-of-kithgard?course=#{@get('courseID')}&course-instance=#{@id}"<commit_msg>Switch CourseInstance firstLevelURL to return dungeons-of-kithgard<commit_after>CocoModel = require './CocoModel'
schema = require 'schemas/models/course_instance.schema'

module.exports = class CourseInstance extends CocoModel
  @className: 'CourseInstance'
  @schema: schema
  urlRoot: '/db/course_instance'

  upsertForHOC: (opts) ->
    options = {
      url: _.result(@, 'url') + '/~/create-for-hoc'
      type: 'POST'
    }
    _.extend options, opts
    @fetch(options)
    
  addMember: (userID) ->
    options = {
      method: 'POST'
      url: _.result(@, 'url') + '/~/members'
      data: { userID: userID }
    }
    _.extend options, opts
    @fetch(options)

  firstLevelURL: ->
    "/play/level/dungeons-of-kithgard?course=#{@get('courseID')}&course-instance=#{@id}"
{'fraction_non_alphanumeric': 0.1600790513833992, 'fraction_numerical': 0.0, 'mean_word_length': 3.2077562326869806, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '2864209', 'n_tokens_mistral': 524, 'n_tokens_neox': 507, 'n_words': 100}