<commit_before>import {
  BaseModel, identifiedBy, field, belongsTo,
} from 'shared/model';
import { pick } from 'lodash';
import TeacherTaskPlan from './plan';

export default
@identifiedBy('task-plans/teacher/grade')
class TeacherTaskGrade extends BaseModel {

  @belongsTo({ model: TeacherTaskPlan }) taskPlan;

  constructor({ question, points, comment }) {
    super();
    this.question = question;
    this.grader_points = points;
    this.grader_comments = comment;
  // }, task_step_id: question.task_step_id, grader_points: points, grader_comments: comment,
  }

  @field grader_points;
  @field grader_comments;

  save() {
    return {
      task_step_id: this.question.task_step_id,
      data: pick(this, 'grader_points', 'grader_comments'),
    };
  }

  onGraded({ data }) {
    this.update(data);
    this.question.update(data);
  }
  // not clear how these are populated
  @field answer_id;
  @field free_response;<commit_msg>remove commented code<commit_after>import {
  BaseModel, identifiedBy, field, belongsTo,
} from 'shared/model';
import { pick } from 'lodash';
import TeacherTaskPlan from './plan';

export default
@identifiedBy('task-plans/teacher/grade')
class TeacherTaskGrade extends BaseModel {

  @belongsTo({ model: TeacherTaskPlan }) taskPlan;

  constructor({ question, points, comment }) {
    super();
    this.question = question;
    this.grader_points = points;
    this.grader_comments = comment;
  }

  @field grader_points;
  @field grader_comments;

  save() {
    return {
      task_step_id: this.question.task_step_id,
      data: pick(this, 'grader_points', 'grader_comments'),
    };
  }

  onGraded({ data }) {
    this.update(data);
    this.question.update(data);
  }
  // not clear how these are populated
  @field answer_id;
  @field free_response;
{'fraction_non_alphanumeric': 0.12264150943396226, 'fraction_numerical': 0.0, 'mean_word_length': 3.9532967032967035, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4254506', 'n_tokens_mistral': 595, 'n_tokens_neox': 569, 'n_words': 133}