using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Text;

using TEAMModelOS.SDK.Context.Attributes.Azure;


namespace TEAMModelOS.SDK.Models
{
    /// <summary>
    /// 问卷调查
    /// </summary>    
    public class Survey : CosmosEntity
    {
        public Survey() {
            pk = "Survey";
            // questions = new List<Question>();
            classes = new List<string>();
            tmdids = new List<string>();
        }
        /// <summary>
        ///发布层级 类型 school  teacher
        /// </summary>
        public string owner { get; set; }
        /// <summary>
        /// 学校编码或教室tmdid
        /// </summary>
        [Required(ErrorMessage = "owner 必须设置")]
        public string school { get; set; }
        /// <summary>
        /// 问卷名称
        /// </summary>
        [Required(ErrorMessage = "name 必须设置")]
        public string name { get; set; }
        /// <summary>
        ///  问卷描述
        /// </summary>
        public string description { get; set; }
        //public string type { get; set; }   //normal', // 问卷类型
        /// <summary>
        /// 创建者的id 
        /// </summary>
        [Required(ErrorMessage = "creatorId 必须设置")]
        public string creatorId { get; set; }
        // public int year { get; set; }
        /// <summary>
        /// pending 待发布|going 已发布|finish 已结束
        /// </summary>
        //[Required(ErrorMessage = "progress 必须设置")]
        public string progress { get; set; }
        public string scope { get; set; }

        public List<string> tmdids { get; set; }
        public List<string> classes { get; set; }

        /// <summary>
        /// 开始时间
        /// </summary>
        public long startTime { get; set; }

        /// <summary>
        /// 结束时间
        /// </summary>
        public long endTime { get; set; }
        public long createTime { get; set; } // 问卷发布时间
        /// <summary>
        /// 更新时间
        /// </summary>
        public long updateTime { get; set; }
        //将问题放入Blob  hbcn/survey/问卷调查id.json  存放内容 Question的数组
        public string  blob { get; set; }
        // public List<Question> questions { get; set; }
        /// <summary>
        /// 学生作答记录/ 状态为finish时进行结算
        /// </summary>
        public string recordUrl { get; set; }
        /// <summary>
        /// 如果本题不是客观题 则为[]空数组
        /// 客观题所有选项[["A","B","C","D"],["A","B"],[],["A","B"]]
        /// </summary>
        public List<List<string>> answers { get; set; }
        /// <summary>
        /// TTL删除改变状态使用
        /// </summary>
        public int? status { get; set; } = 0;
        public long? size { get; set; } = 0;
    }

    /// <summary>
    ///问卷题目
    /// </summary>
    //public class Question {
    //    /// <summary>
    //    /// 题目id
    //    /// </summary>
    //    public string qid { get; set; }
    //    /// <summary>
    //    /// 问卷题目
    //    /// </summary>
    //    public string question { get; set; }
    //    /// <summary>
    //    /// 问卷题目的描述
    //    /// </summary>
    //    public string description { get; set; }
    //    /// <summary>
    //    /// 问卷选项
    //    /// </summary>
    //    public List<CodeValue> options { get; set; }
    //    /// <summary>
    //    /// 判断judge  多选multiple 单选single
    //    /// </summary>
    //    public string type { get; set; }
    //    /// <summary>
    //    /// 是否必需作答
    //    /// </summary>
    //    public bool required { get; set; }
    //}
}
