You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
Tiobon.Web.Core/Tiobon.Core.Services/Ghre/Ghre_QuestionServices.cs

102 lines
3.1 KiB

using Tiobon.Core.IServices;
using Tiobon.Core.Model.Models;
using Tiobon.Core.Services.BASE;
using Tiobon.Core.IRepository.Base;
using Tiobon.Core.Model;
using System.Dynamic;
using Newtonsoft.Json.Linq;
namespace Tiobon.Core.Services
{
/// <summary>
/// 题目 (服务)
/// </summary>
public class Ghre_QuestionServices : BaseServices<Ghre_Question, Ghre_QuestionDto, InsertGhre_QuestionInput, EditGhre_QuestionInput>, IGhre_QuestionServices
{
private readonly IBaseRepository<Ghre_Question> _dal;
public Ghre_QuestionServices(IBaseRepository<Ghre_Question> dal)
{
this._dal = dal;
base.BaseDal = dal;
}
/// <summary>
///
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
public async Task<ServiceResult<FromGhre_QuestionInput>> QueryFrom(long Id)
{
var data = new FromGhre_QuestionInput();
#region Column
data.Column.Add(new FromGhre_QuestionColumn()
{
label = "课程名称",
field = "courseID",
elementType = "ApiSelect",
required = true,
multipleSelect = true,
editable = true,
dataSource = "TBParaDetail_GhrStaff_JTFS"
});
data.Column.Add(new FromGhre_QuestionColumn()
{
label = "题目编号",
field = "questionNo",
elementType = "Input",
required = false,
multipleSelect = false,
editable = false,
dataSource = "",
placeholder = "保存后自动生成"
});
#endregion
#region PageData
data.PageData.questionType = new List<FromGhre_QuestionQuestionType>
{
new FromGhre_QuestionQuestionType()
{
label = "单选题",
type = "Single",
isActive = 1
},
new FromGhre_QuestionQuestionType()
{
label = "多选题",
type = "Multiple",
isActive = 0,
},
new FromGhre_QuestionQuestionType()
{
label = "判断题",
type = "TrueOrFalse",
isActive = 0,
},
new FromGhre_QuestionQuestionType()
{
label = "填空题",
type = "Completion",
isActive = 0,
},
new FromGhre_QuestionQuestionType()
{
label = "简答题",
type = "ShortAnswer",
isActive = 0,
}
};
if (Id != 0)
{
}
#endregion
return ServiceResult<FromGhre_QuestionInput>.OprateSuccess("查询成功!", data);
}
}
}