getNextLevelLink = (levelData, options) => {
  let link = ''
  if (levelData.type === 'intro') {
    link = '/play/intro/' + levelData.slug
  } else {
    link = '/play/level/' + levelData.slug
  }

  if (options.courseId && options.courseInstanceId) {
    link += `?course=${encodeURIComponent(options.courseId)}&course-instance=${encodeURIComponent(options.courseInstanceId)}`
    if (levelData.primerLanguage) {
      link += `&codeLanguage=${encodeURIComponent(levelData.primerLanguage)}`
    }
    if (options.nextLevelStage) {
      link += `&capstoneStage=${encodeURIComponent(options.nextLevelStage)}`
    }
    if (options.classroomId) {
      link += `&classroom=${encodeURIComponent(options.classroomId)}`
    }
  } else if (options.courseInstanceId) {
    link += `?course-instance=${encodeURIComponent(options.courseInstanceId)}`
    if (options.codeLanguage) {
      link += `&codeLanguage=${encodeURIComponent(options.codeLanguage)}`
    }
    if (options.nextLevelStage) {
      link += `&capstoneStage=${encodeURIComponent(options.nextLevelStage)}`
    }
  } else if (options.courseId) {
    link += `?course=${encodeURIComponent(options.courseId)}`
    if (options.codeLanguage) {
      link += `&codeLanguage=${encodeURIComponent(options.codeLanguage)}`
    }
    if (options.nextLevelStage) {
      link += `&capstoneStage=${encodeURIComponent(options.nextLevelStage)}`
    }
  } else if (options.codeLanguage) {
    link += `?codeLanguage=${encodeURIComponent(options.codeLanguage)}`
    if (options.nextLevelStage) {
      link += `&capstoneStage=${encodeURIComponent(options.nextLevelStage)}`
    }
  } else if (options.nextLevelStage) {
    link += `?capstoneStage=${encodeURIComponent(options.nextLevelStage)}`
  }
  return link
}
Constructs the next level link
@param {Object} levelData - Level object
@param {string} levelData.type - level type
@param {string} levelData.slug - level slug
@param {string} levelData.primerLanguage - Optional, used only if it exists
@param {Object} options - Options for the next level link
@param {string} options.courseId
@param {string} options.courseInstanceId
@param {string} options.campaignId
@param {string} options.codeLanguage
@returns {string}