using DocumentFormat.OpenXml.Bibliography;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text;
using System.Text.Json.Serialization;
using TEAMModelOS.SDK.Context.Attributes.Azure;

namespace TEAMModelOS.SDK.Models
{
    /// <summary>
    /// 考试基础信息
    /// </summary>    
    public class ExamInfo :CosmosEntity
    { 
        public ExamInfo() {
            pk = "Exam";
            period = new PeriodSimple();
            grades = new List<Grade>();
            subjects = new List<ExamSubject>();
            papers = new List<PaperSimple>();
            classes = new List<string>();
        }
        /// <summary>
        ///发布层级 类型 school  teacher
        /// </summary>
        public string owner { get; set; }
        public string name { get; set; }
        public string school { get; set; }
        public string creatorId { get; set; }
        public int stuCount { get; set; }
/*        //实际考试人数
        public int realCount { get; set; }
        //平均分
        public double piont { get; set; }*/
        //指标
        //public double index { get; set; }
        public long createTime { get; set; }
        public long updateTime { get; set; }
        //public string examCode { get; set; }

        /// <summary>
        /// 施测起始时间
        /// </summary>
        public long startTime { get; set; }
        /// <summary>
        /// 施测结束时间
        /// </summary>
        public long endTime { get; set; }
        /// <summary>
        /// 施测对象
        /// </summary>
       // public List<string> target { get; set; }
        /// <summary>
        /// 发布
        /// </summary>
        public string publish { get; set; }

       
        public int year { get; set; }
        public string range { get; set; }
        public string source { get; set; }
        public List<string> classes { get; set; }
        public List<PaperSimple> papers { get; set; }
        ///考试类型 段考 stage  联考 union 平常考 normal 其他 other
        /// </summary>
        public string type { get; set; }
        public PeriodSimple period { get; set; }
        public List<Grade> grades { get; set; }
        public List<ExamSubject> subjects { get; set; }
        //public long sequenceNumber { get; set; }
        //public Condition conditions { get; set; }
        //public List<string> blobUrl { get; set; }
        public string progress { get; set; }
        public string scope { get; set; }
        public Custom examType { get; set; }
        /// <summary>
        /// 所有试卷阅卷状态
        /// </summary>
        //public List<int> marks { get; set; }
        /// <summary>
        /// TTL删除改变状态使用
        /// </summary>
        public int? status { get; set; } = 0;
        public double average { get; set; } = -1;
        //得分率
        public double sRate { get; set; }
        //缺考人数
        public List<string> lostStu { get; set; } = new List<string>();
        public double standard { get; set; }
        //记录该评测内容下blob大小
        public long? size { get; set; } = 0;
        //容器名称 container name
        //public string cn { get; set; }
    }
    public class Custom {
        public string id { get; set; }
        public string name { get; set; }
    }
    public class ExamSubject
    {
        public string id { get; set; }
        public string name { get; set; }
        public int classCount { get; set; }


    }
    public class PaperSimple { 
        public string id { get; set; }
        public string code { get; set; }
        public string name { get; set; }
        public string blob { get; set; }
        public string scope { get; set; }
        public int multipleRule { get; set; }
        //该试卷配分情况
        public List<double> point { get; set; } = new List<double>();
        public List<List<string>> answers { get; set; } = new List<List<string>>();
        public List<List<string>> knowledge { get; set; } = new List<List<string>>();
        //题目类型
        public List<string> type { get; set; } = new List<string>();
        public List<int> field { get; set; } = new List<int>();
        //public List<Dictionary<string, int>> record { get; set; } = new List<Dictionary<string, int>>();
    }
    /*public class Condition
    {
        public string period { get; set; }
        public string grade { get; set; }
        public string semester { get; set; }
        /// <summary>
        /// 评测范围 class 班级测验，年级测验 grade , 区级测验 distric
        /// </summary>
        public string range { get; set; }
        /// <summary>
        /// feedBackType ==>>source 评测来源 考试阅卷 marking ,互动课堂 teach ,线上评测 exam ，手动录入import
        /// </summary>
        public string source { get; set; }
        /// <summary>
        /// 科目
        /// </summary>
        public List<string> subject { get; set; }
    }*/

}
