package cn.reghao.tnb.content.app.exam.model.dto;

import cn.reghao.tnb.content.app.exam.model.vo.QuestionAnswer;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * @author reghao
 * @date 2024-08-24 16:39:41
 */
@AllArgsConstructor
@NoArgsConstructor
@Setter
@Getter
public class UserResult {
    @NotNull
    private Integer paperId;
    private Map<Long, QuestionAnswer> cachedUserAnswers;
    @Size(min = 1, max = 100)
    private List<QuestionAnswer> submitUserAnswers;

    public UserResult(int paperId, Map<Long, QuestionAnswer> questionAnswerMap) {
        this.paperId = paperId;
        this.cachedUserAnswers = questionAnswerMap;
    }
}
