using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace QYZH.InteractiveMagazine.Models.Enum
{
    public enum TaskBankTypeEnum
    {
        /// <summary>
        /// 无效题目
        /// </summary>
        [Description("无效")]
        Default = 0,
        /// <summary>
        /// 单选题
        /// </summary>
        [Description("单选题")]
        Single = 1,

        /// <summary>
        /// 多选题
        /// </summary>
        [Description("多选题")]
        Multiple = 2,

        /// <summary>
        /// 判断题
        /// </summary>
        [Description("判断题")]
        Whether = 3,

        /// <summary>
        /// 填空题
        /// </summary>
        [Description("填空题")]
        FillIn = 4,

        /// <summary>
        /// 应用题
        /// </summary>
        [Description("应用题")]
        Problem = 5,

        /// <summary>
        /// 简答题
        /// </summary>
        [Description("简答题")]
        ShortAnswer = 6,

    }

    public class TaskBankType
    {
        /// <summary>
        /// 客观题
        /// </summary>
        public TaskBankTypeEnum[] ObjectiveTypes => new[] { TaskBankTypeEnum.Single, TaskBankTypeEnum.Multiple, TaskBankTypeEnum.Whether };

        /// <summary>
        /// 获取客观题类型的整数值
        /// </summary>
        public List<int> ObjectiveTypeValues => ObjectiveTypes.Select(t => (int)t).ToList();

        /// <summary>
        /// 主观题
        /// </summary>
        public TaskBankTypeEnum[] SubjectiveTypes => new[] { TaskBankTypeEnum.FillIn, TaskBankTypeEnum.Problem, TaskBankTypeEnum.ShortAnswer };

        /// <summary>
        /// 获取主观题类型的整数值
        /// </summary>
        public List<int> SubjectiveTypeValues => SubjectiveTypes.Select(t => (int)t).ToList();
    }
}
