import { IncrementIdEntity } from 'src/common/entities/increment-id.entity';
import { Column, Entity } from 'typeorm';

/**
 * 学员对于某课件的学习信息
 */
@Entity()
export class CourseStudyRecord extends IncrementIdEntity {
  @Column({ type: 'longtext', name: 'student_id', comment: '学员id' })
  studentId: string;

  @Column({ name: 'course_id', comment: '相对应课程的id' })
  courseId: number;

  @Column({ name: 'study_time', comment: '学习时长' })
  studyTime: number;

  @Column({
    name: 'study_progress',
    comment: '0为未开始，1为进行中，2为已完成',
  })
  studyProgress: number;

  @Column({ name: 'exercise_grade', comment: '练习题分数' })
  exerciseGrade: number;

  @Column({ type: 'longtext', name: 'self_evael', comment: '自我评价信息' })
  selfEvael: string;

  @Column({ type: 'longtext', name: 'course_eveal', comment: '课程评价信息' })
  courseEveal: string;

  @Column({ comment: '课程得分' })
  score: number;

  @Column({ comment: '是否第一次学习', default: 1 })
  isFirst: number;

  @Column({ comment: '是否参与了练习题', default: 0 })
  isAnswer: number;
}
