<commit_before>import BaseCourseAPI from './Base';

export default class LearningMapAPI extends BaseCourseAPI {
  /**
   * Fetches all nodes in the learning map for the current user and course.
   *
   * @return {Promise}
   * success response: {
   *   nodes: Array.<{
   *     id: string, unlocked: boolean, satisfiabilityType: string,
   *     courseMaterialType: string, contentUrl: string,
   *     children: Array.<{ id: string, is_satisfied: boolean }>,
   *     parents: Array.<{ id: string, is_satisfied: boolean }>,
   *     unlockRate: number, unlockLevel: number,
   *     ... (Other fields specific to the individual course material type)
   *   }>,
   *   canModify: boolean
   * }
   * error response: { errors: Array.<string> }
   */
  index() {
    return this.getClient().get(this._getUrlPrefix());
  }

  /**
   * Adds a parent node to the specified node.
   *
   * @return {Promise}
   * success response: {
   *   nodes: Array.<{
   *     id: string, unlocked: boolean, satisfiabilityType: string,
   *     courseMaterialType: string, contentUrl: string,
   *     children: Array.<{ id: string, is_satisfied: boolean }>,
   *     parents: Array.<{ id: string, is_satisfied: boolean }>,
   *     unlockRate: number, unlockLevel: number,
   *     ... (Other fields specific to the individual course material type)
   *   }>,
   *   canModify: boolean
   * }
   * error response: { errors: Array.<string> }
   */
  addParentNode(params) {
    return this.getClient().post(
      `${this._getUrlPrefix()}/add_parent_node`,
      params,
    );
  }

  /**
   * Removes the specified parent node from the specified node.
   *
   * @return {Promise}
   * success response: {
   *   nodes: Array.<{
   *     id: string, unlocked: boolean, satisfiabilityType: string,
   *     courseMaterialType: string, contentUrl: string,
   *     children: Array.<{ id: string, is_satisfied: boolean }>,
   *     parents: Array.<{ id: string, is_satisfied: boolean }>,
   *     unlockRate: number, unlockLevel: number,
   *     ... (Other fields specific to the individual course material type)
   *   }>,
   *   canModify: boolean
   * }
   * error response: { errors: Array.<string> }
   */
  removeParentNode(params) {
    return this.getClient().post(
      `${this._getUrlPrefix()}/remove_parent_node`,
      params,
    );
  }

  /**
   * Toggles the satisfiability type for the specified node.
   *
   * @return {Promise}
   * success response: {
   *   nodes: Array.<{
   *     id: string, unlocked: boolean, satisfiabilityType: string,
   *     courseMaterialType: string, contentUrl: string,
   *     children: Array.<{ id: string, is_satisfied: boolean }>,
   *     parents: Array.<{ id: string, is_satisfied: boolean }>,
   *     unlockRate: number, unlockLevel: number,
   *     ... (Other fields specific to the individual course material type)
   *   }>,
   *   canModify: boolean
   * }
   * error response: { errors: Array.<string> }
   */
  toggleSatisfiabilityType(params) {
    return this.getClient().post(
      `${this._getUrlPrefix()}/toggle_satisfiability_type`,
      params,
    );
  }

  _getUrlPrefix() {
    return `/courses/${this.getCourseId()}/learning_map`;
  }
}
<commit_msg>chore (learning map): update comments in learning map api<commit_after>import BaseCourseAPI from './Base';

export default class LearningMapAPI extends BaseCourseAPI {
  /**
   * Fetches all nodes in the learning map for the current user and course.
   *
   * @return {Promise}
   * success response: {
   *   nodes: Array.<{
   *     id: string, unlocked: boolean, satisfiabilityType: string,
   *     courseMaterialType: string, contentUrl: string,
   *     children: Array.<{ id: string, isSatisfied: boolean }>,
   *     parents: Array.<{ id: string, isSatisfied: boolean }>,
   *     unlockRate: number, unlockLevel: number,
   *     ... (Other fields specific to the individual course material type)
   *   }>,
   *   canModify: boolean
   * }
   * error response: { errors: Array.<string> }
   */
  index() {
    return this.getClient().get(this._getUrlPrefix());
  }

  /**
   * Adds a parent node to the specified node.
   *
   * @return {Promise}
   * success response: {
   *   nodes: Array.<{
   *     id: string, unlocked: boolean, satisfiabilityType: string,
   *     courseMaterialType: string, contentUrl: string,
   *     children: Array.<{ id: string, isSatisfied: boolean }>,
   *     parents: Array.<{ id: string, isSatisfied: boolean }>,
   *     unlockRate: number, unlockLevel: number,
   *     ... (Other fields specific to the individual course material type)
   *   }>,
   *   canModify: boolean
   * }
   * error response: { errors: Array.<string> }
   */
  addParentNode(params) {
    return this.getClient().post(
      `${this._getUrlPrefix()}/add_parent_node`,
      params,
    );
  }

  /**
   * Removes the specified parent node from the specified node.
   *
   * @return {Promise}
   * success response: {
   *   nodes: Array.<{
   *     id: string, unlocked: boolean, satisfiabilityType: string,
   *     courseMaterialType: string, contentUrl: string,
   *     children: Array.<{ id: string, isSatisfied: boolean }>,
   *     parents: Array.<{ id: string, isSatisfied: boolean }>,
   *     unlockRate: number, unlockLevel: number,
   *     ... (Other fields specific to the individual course material type)
   *   }>,
   *   canModify: boolean
   * }
   * error response: { errors: Array.<string> }
   */
  removeParentNode(params) {
    return this.getClient().post(
      `${this._getUrlPrefix()}/remove_parent_node`,
      params,
    );
  }

  /**
   * Toggles the satisfiability type for the specified node.
   *
   * @return {Promise}
   * success response: {
   *   nodes: Array.<{
   *     id: string, unlocked: boolean, satisfiabilityType: string,
   *     courseMaterialType: string, contentUrl: string,
   *     children: Array.<{ id: string, isSatisfied: boolean }>,
   *     parents: Array.<{ id: string, isSatisfied: boolean }>,
   *     unlockRate: number, unlockLevel: number,
   *     ... (Other fields specific to the individual course material type)
   *   }>,
   *   canModify: boolean
   * }
   * error response: { errors: Array.<string> }
   */
  toggleSatisfiabilityType(params) {
    return this.getClient().post(
      `${this._getUrlPrefix()}/toggle_satisfiability_type`,
      params,
    );
  }

  _getUrlPrefix() {
    return `/courses/${this.getCourseId()}/learning_map`;
  }
}

{'fraction_non_alphanumeric': 0.13371552525565542, 'fraction_numerical': 0.0, 'mean_word_length': 2.79482657260435, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 35, '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': '5508407', 'n_tokens_mistral': 1996, 'n_tokens_neox': 1967, 'n_words': 522}