package cn.com.qmth.stmms.biz.mark.model;

import java.io.Serializable;

import cn.com.qmth.stmms.biz.exam.model.Marker;

/**
 * 阅卷轨迹交换类
 * 
 * @author luoshi
 * 
 */
public class TrackDTO implements Serializable {

    private static final long serialVersionUID = 4336042741848228793L;

    private String questionNumber;

    private int number;

    private double score;

    private double positionX;

    private double positionY;

    public TrackDTO() {

    }

    public TrackDTO(MarkTrack track) {
        setQuestionNumber(track.getQuestionNumber());
        setNumber(track.getNumber());
        setScore(track.getScore());
        setPositionX(track.getPositionX());
        setPositionY(track.getPositionY());
    }

    public TrackDTO(TrialTrack track) {
        setQuestionNumber(track.getQuestionNumber());
        setNumber(track.getNumber());
        setScore(track.getScore());
        setPositionX(track.getPositionX());
        setPositionY(track.getPositionY());
    }

    public MarkTrack transform(MarkLibrary library, Marker marker) {
        MarkTrack track = new MarkTrack();
        track.setLibraryId(library.getId());
        track.setQuestionNumber(getQuestionNumber());
        track.setNumber(getNumber());
        track.setStudentId(library.getStudentId());
        track.setExamId(library.getExamId());
        track.setSubjectCode(library.getSubjectCode());
        track.setGroupNumber(library.getGroupNumber());
        track.setMarkerId(marker.getId());
        track.setScore(getScore());
        track.setPositionX(getPositionX());
        track.setPositionY(getPositionY());
        return track;
    }

    public TrialTrack transform(TrialHistory history) {
        TrialTrack track = new TrialTrack();
        track.setLibraryId(history.getLibraryId());
        track.setMarkerId(history.getMarkerId());
        track.setQuestionNumber(getQuestionNumber());
        track.setNumber(getNumber());
        track.setStudentId(history.getStudentId());
        track.setExamId(history.getExamId());
        track.setSubjectCode(history.getSubjectCode());
        track.setGroupNumber(history.getGroupNumber());
        track.setMarkerId(history.getMarkerId());
        track.setScore(getScore());
        track.setPositionX(getPositionX());
        track.setPositionY(getPositionY());
        return track;
    }

    public String getQuestionNumber() {
        return questionNumber;
    }

    public void setQuestionNumber(String questionNumber) {
        this.questionNumber = questionNumber;
    }

    public int getNumber() {
        return number;
    }

    public void setNumber(int number) {
        this.number = number;
    }

    public double getScore() {
        return score;
    }

    public void setScore(double score) {
        this.score = score;
    }

    public double getPositionX() {
        return positionX;
    }

    public void setPositionX(double positionX) {
        this.positionX = positionX;
    }

    public double getPositionY() {
        return positionY;
    }

    public void setPositionY(double positionY) {
        this.positionY = positionY;
    }

}
