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

namespace TEAMModelOS.SDK.Models
{
    /// <summary>
    /// 用于表示学员的 技能点学习记录 放在Teacher表中
    /// </summary>
    public class AbilityRecord : CosmosEntity
    {

        //id  设计：技能点任务的 abilityTaskId
        //code 分区键设计    AbilityRecord-hbcn-tmdid
        /// <summary>
        /// 技能点的id
        /// </summary>
        public string abilityId { get; set; }
        public string codeval { get; set; }
        public string scope { get; set; }
        public List<TaskRecord> children { get; set; }
    }
    public class TaskRecord {
        public string id { get; set; }
        public string pid { get; set; }
        public long updateTime { get; set; }
    }


    /// <summary>
    /// 订阅记录和学习记录
    /// </summary>
    public class AbilitySub : CosmosEntity
    {
        //id  设计：技能点的 abilityId
        //code 分区键设计    AbilitySub-hbcn-tmdid
        /// <summary>
        /// 学校编码
        /// </summary>
        public string school { get; set; }
        /// <summary>
        /// 创建者醍摩豆id
        /// </summary>
        public string creatorId { get; set; }
        //public string creatorName { get; set; }
        /// <summary>
        /// 是否已完成
        /// </summary>
        public bool done { get; set; } = false;
        public bool allDone { get; set; } = false;
        /// <summary>
        /// 学习完成活得多少学时，从技能点获取
        /// </summary>
        public int hour { get; set; } = 0;
        /// <summary>
        /// 能力点数量
        /// </summary>
        public int abilityCount { get; set; }
        /// <summary>
        /// 上传作品
        /// </summary>
        public List<SubUpload> uploads { get; set; } = new List<SubUpload>();
        /// <summary>
        /// 自评打分 -1未评，0未通过，1合格，2优秀
        /// </summary>
        public int self { get; set; } = -1;//未自评
        /// <summary>
        /// 自测练习题 -1未练习，0未通过，1通过
        /// </summary>
        public int exerciseScore { get; set; } = -1;//未练习
        /// <summary>
        /// 互评结果 ，并检查是否重复
        /// </summary>
        public List<OtherScore> otherScore { get; set; } = new List<OtherScore>();
        /// <summary>
        /// 评论/话题的统一id,用于被关联
        /// </summary>
        public string comid { get; set; }
        /// <summary>
        /// 资源节点的学习记录
        /// </summary>
        public List<AbilityTaskRcd> taskRcds { get; set; } = new List<AbilityTaskRcd>();
        /// <summary>
        /// 自评时间
        /// </summary>
        public long selfTime { get; set; }

    }
    public class SubUpload {
        /// <summary>
        /// ability的stds:id
        /// </summary>
        public string stdid { get; set; }
        /// <summary>
        /// ability的task:id
        /// </summary>
        public string taskid { get; set; }
        /// <summary>
        /// 一个标准可以上传多个文件
        /// </summary>
        public List<AbilityFile> urls { get; set; } = new List<AbilityFile>();
        /// <summary>
        /// 勾选了的评语记录
        /// </summary>
        public List<string> titleIds { get; set; }
        /// <summary>
        /// 时间
        /// </summary>
        public long time { get; set; }
    }

    /// <summary>
    /// 订阅者的资源学习记录
    /// </summary>
    public class AbilityTaskRcd
    {
        public string id { get; set; }
        public bool done { get; set; } = false;
        /// <summary>
        /// 资源的学习记录链接 ，后面再优化
        /// </summary>
        public List<string> urls { get; set; }

    }
    public class OtherScore
    {
        /// <summary>
        /// 角色类型  成员 member   学校 school  专家 expert
        /// </summary>
        public string roleType { get; set; }
        /// <summary>
        /// 评论人的id
        /// </summary>
        public string tmdid { get; set; }
        /// <summary>
        /// 评论人
        /// </summary>
        public string tmdname { get; set; }
        //总评   -1未评，0未通过，1合格，2优秀
        public int score { get; set; } = -1;
        /// <summary>
        /// 某人对你这个能力点的学习评价的的评语记录的Id集合。
        /// </summary>
        public List<string> replyIds { get; set; } = new List<string>();
        /// <summary>
        /// 根据评判标准进行打分
        /// </summary>
        public List<ScoreUpload> scoreUploads { get; set; } = new List<ScoreUpload>();
        public long time { get; set; }
    }
    /// <summary>
    /// 互评对所有作品的评价
    /// </summary>
    public class ScoreUpload{
        /// <summary>
        /// ability的stds:id
        /// </summary>
        public string stdid { get; set; }
        /// <summary>
        /// ability的task:id
        /// </summary>
        public string taskid { get; set; }
        /// <summary>
        /// 勾选了的评语记录
        /// </summary>
        public List<string> titleIds { get; set; }
        /// <summary>
        /// 当前标准得分  -1未评，0未通过，1合格，2优秀
        /// </summary>
        public int score { get; set; } = -1;
    }
}
