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 HomeworkRecord : CosmosEntity
    {
        
        public HomeworkRecord() {
            content = new List<HomeWorkContent>();
            stuCmt = new List<StudentComment>();
            classroom = new ClassroomItem();
           // nativeroom = new ClassroomItem();
            tchCmt = new HomeWorkComment();
        }        

        /// <summary>
        /// 上课班级
        /// </summary>
        public ClassroomItem classroom { get; set; }

        ///// <summary>
        ///// 原生班级
        ///// </summary>
        //[ProtoMember(6)]
        //public ClassroomItem nativeroom{ get; set; }

        /// <summary>
        /// 提交时间
        /// </summary>
        public long submitTime { get; set; }

        /// <summary>
        /// 分数
        /// </summary>
        public double score { get; set; }

        /// <summary>
        /// 作业内容
        /// </summary>
        public List<HomeWorkContent> content { get; set; }


        /// <summary>
        /// 作业评论 （同学互评）
        /// </summary>
        public List<StudentComment> stuCmt { get; set; }


        /// <summary>
        /// 教师评语
        /// </summary>
        public HomeWorkComment tchCmt { get; set; }
    }
    public class ClassroomItem {
        public string name { get; set; }
        public string code { get; set; }

    }

    /// <summary>
    /// 作业内容
    /// </summary>
    public class HomeWorkContent {

        /// <summary>
        /// 作答记录
        /// </summary>
        public string answers { get; set; }

        /// <summary>
        ///  其他模式url 及name
        /// </summary>
        public List<ProcessRes> resource { get; set; }

    }


    public class StudentComment
    {
        public StudentComment()
        {
            reply = new List<Reply>();
        }

        /// <summary>
        /// 评论id
        /// </summary>
        public string commentid { get; set; }

        /// <summary>
        /// 评论者id 醍摩豆或studenId
        /// </summary>
        public string fromId { get; set; }

        /// <summary>
        /// 被评论者id 醍摩豆或studenId
        /// </summary>
        public string toId { get; set; }

        /// <summary>
        /// 学生打分
        /// </summary>
        public double? score { get; set; }

        /// <summary>
        /// 评论者身份 教师 学生
        /// </summary>
        public string identity { get; set; }

        /// <summary>
        /// 评语
        /// </summary>
        public string comment { get; set; }

        /// <summary>
        /// 评论时间
        /// </summary>
        public long createTime { get; set; }

        ///// <summary>
        ///// 评论回复
        ///// </summary>
        public List<Reply>  reply { get; set; }

    }



    /// <summary>
    /// 作业评论
    /// </summary>
    public class HomeWorkComment {
       

        /// <summary>
        /// 评论者身份 教师 学生
        /// </summary>
        public string identity { get; set; }

        /// <summary>
        /// 评语
        /// </summary>
        public string comment { get; set; }

        /// <summary>
        /// 评论时间
        /// </summary>
        public long createTime { get; set; }


        /// <summary>
        /// 醍摩豆id 或者学生id
        /// </summary>
        public string TEAMModelId { get; set; }

        ///// <summary>
        ///// 评论回复
        ///// </summary>
        //public List<Reply>  reply { get; set; }

    }

    /// <summary>
    /// 评论回复
    /// </summary>
    public class Reply
    {
        /// <summary>
        /// 评论者id 醍摩豆或studenId
        /// </summary>
        public string fromId { get; set; }

        /// <summary>
        /// 被评论者id 醍摩豆或studenId
        /// </summary>
        public string toId { get; set; }

        /// <summary>
        /// 评论者身份 教师 学生
        /// </summary>
        public string identity { get; set; }

        /// <summary>
        /// 评语
        /// </summary>
        public string comment { get; set; }

        public long createTime { get; set; }

    }
}
