Commit 8e1c50c7 authored by 罗超's avatar 罗超

Merge branch 'master' of http://gitlab.oytour.com/Kui2/education

parents 45f2b0e0 e21c893d
using System;
using VT.FW.DB;
namespace Edu.Model.Entity.Exam
{
/// <summary>
/// 试卷发布实体类
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Examination_Publish
{
/// <summary>
/// 发布考试主键编号
/// </summary>
public int Id { get; set; }
/// <summary>
/// 试卷编号
/// </summary>
public int PaperId { get; set; }
/// <summary>
/// 发放类型(1-按班级发放,2-指定学生发放)
/// </summary>
public int PublishType { get; set; }
/// <summary>
/// 考试开始时间
/// </summary>
public DateTime ExamStartTime { get; set; }
/// <summary>
/// 考试结束时间
/// </summary>
public DateTime ExamEndTime { get; set; }
/// <summary>
/// 考试限时
/// </summary>
public int ExamTimes { get; set; }
/// <summary>
/// 限时提交(多少分钟内不允许提交)
/// </summary>
public int SubmitTimes { get; set; }
/// <summary>
/// 限时进入(多少分钟后不允许参加考试)
/// </summary>
public int EnterTimes { get; set; }
/// <summary>
/// 创建人
/// </summary>
public int CreateBy { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateTime { get; set; }
/// <summary>
/// 集团编号
/// </summary>
public int Group_Id { get; set; }
/// <summary>
/// 学校编号
/// </summary>
public int School_Id { get; set; }
/// <summary>
/// 删除状态
/// </summary>
public int Status { get; set; }
/// <summary>
/// 题目乱序(1-是)
/// </summary>
public int IsQuestionRandom { get; set; }
/// <summary>
/// 选项乱序(1-是)
/// </summary>
public int IsOptionRandom { get; set; }
/// <summary>
/// 学生离开作答页面(1-是)
/// </summary>
public int IsLeaveAnswer { get; set; }
/// <summary>
/// 离开次数
/// </summary>
public int LeaveTimes { get; set; }
/// <summary>
/// 是否禁用多终端(1-是)
/// </summary>
public int IsDisableMultiTerminal { get; set; }
/// <summary>
/// 是否只允许(App、PC)考试(1-是)
/// </summary>
public int IsExamType { get; set; }
/// <summary>
/// 考试终端类型(1-App,2-PC)
/// </summary>
public int ExamTypeValue { get; set; }
/// <summary>
/// 考试须知
/// </summary>
public string ExamNotice { get; set; }
/// <summary>
/// 及格分数
/// </summary>
public decimal PassScore { get; set; }
/// <summary>
/// 考试到达截止时间后自动提交(1-是)
/// </summary>
public int IsAutoSubmit { get; set; }
/// <summary>
/// 填空类型的题目设为主观题(1-是)
/// </summary>
public int FillInIsSubject { get; set; }
/// <summary>
/// 填空题答案不区分大小写(1-是)
/// </summary>
public int FillInIsIgnore { get; set; }
/// <summary>
/// 多选题未选全给一半分(1-是)
/// </summary>
public int IsHalfScore { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Text;
namespace Edu.Model.ViewModel.Exam
{
/// <summary>
/// 试卷文件树形结构
/// </summary>
public class ExamFolderTreeModel
{
/// <summary>
/// 试卷编号
/// </summary>
public int PaperId { get; set; }
/// <summary>
/// 试卷名称
/// </summary>
public string PaperName { get; set; }
/// <summary>
/// 父节点编号
/// </summary>
public int ParentId { get; set; }
/// <summary>
/// 下级文件夹列表
/// </summary>
public List<ExamFolderTreeModel> ChildList { get; set; }
}
}
......@@ -21,5 +21,15 @@ namespace Edu.Model.ViewModel.Exam
/// 问题数量
/// </summary>
public int QuestionCount { get; set; }
/// <summary>
/// 试卷编号
/// </summary>
public string QPaperIds { get; set; }
/// <summary>
/// 是否查询文件夹
/// </summary>
public int IsQueryFolder { get; set; }
}
}
using Edu.Model.Entity.Exam;
using System;
using System.Collections.Generic;
using System.Text;
namespace Edu.Model.ViewModel.Exam
{
/// <summary>
/// 试卷发布视图实体类
/// </summary>
public class RB_Examination_Publish_ViewModel : RB_Examination_Publish
{
}
}
This diff is collapsed.
......@@ -43,11 +43,73 @@ WHERE 1=1
builder.AppendFormat(" AND A.{0} LIKE @PaperName ", nameof(RB_Examination_Paper_ViewModel.PaperName));
parameters.Add("PaperName", "%" + query.PaperName.Trim() + "%");
}
if (query.ParentId > 0)
{
builder.AppendFormat(@" AND A.{0}={1} ", nameof(RB_Examination_Paper_ViewModel.ParentId), query.ParentId);
}
if (query.PaperId > 0)
{
builder.AppendFormat(@" AND A.{0}={1} ", nameof(RB_Examination_Paper_ViewModel.PaperId), query.PaperId);
}
if (!string.IsNullOrEmpty(query.QPaperIds))
{
builder.AppendFormat(@" AND A.{0} IN({1}) ", nameof(RB_Examination_Paper_ViewModel.PaperId), query.QPaperIds);
}
}
builder.AppendFormat(" ORDER BY A.{0} DESC ", nameof(RB_Examination_Paper_ViewModel.PaperId));
return GetPage<RB_Examination_Paper_ViewModel>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList();
}
/// <summary>
/// 获取试卷列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Examination_Paper_ViewModel> GetExaminationPaperListRepository(RB_Examination_Paper_ViewModel query)
{
var parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*
FROM RB_Examination_Paper AS A
WHERE 1=1
");
builder.AppendFormat(@" AND A.{0}={1} ", nameof(RB_Examination_Paper_ViewModel.ParentId), 0);
if (query != null)
{
if (query.Group_Id > 0)
{
builder.AppendFormat(@" AND A.{0}={1} ", nameof(RB_Examination_Paper_ViewModel.Group_Id), query.Group_Id);
}
if (!string.IsNullOrEmpty(query.PaperName))
{
builder.AppendFormat(" AND A.{0} LIKE @PaperName ", nameof(RB_Examination_Paper_ViewModel.PaperName));
parameters.Add("PaperName", "%" + query.PaperName.Trim() + "%");
}
if (query.ParentId > 0)
{
builder.AppendFormat(@" AND A.{0}={1} ", nameof(RB_Examination_Paper_ViewModel.ParentId), query.ParentId);
}
if (query.PaperId > 0)
{
builder.AppendFormat(@" AND A.{0}={1} ", nameof(RB_Examination_Paper_ViewModel.PaperId), query.PaperId);
}
if (!string.IsNullOrEmpty(query.QPaperIds))
{
builder.AppendFormat(@" AND A.{0} IN({1}) ", nameof(RB_Examination_Paper_ViewModel.PaperId), query.QPaperIds);
}
//查询文件夹
if (query.IsQueryFolder == 1)
{
builder.AppendFormat(@" AND A.{0}=1 ", nameof(RB_Examination_Paper_ViewModel.PaperType));
}
}
builder.AppendFormat(" ORDER BY A.{0} DESC ", nameof(RB_Examination_Paper_ViewModel.PaperId));
return Get<RB_Examination_Paper_ViewModel>(builder.ToString(), parameters).ToList();
}
/// <summary>
/// 获取试卷所有下级列表
/// </summary>
......
using Edu.Model.Entity.Exam;
using Edu.Model.ViewModel.Exam;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Edu.Repository.Exam
{
/// <summary>
/// 试卷发布仓储层
/// </summary>
public class RB_Examination_PublishRepository : BaseRepository<RB_Examination_Publish>
{
/// <summary>
/// 获取发布试卷分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public List<RB_Examination_Publish_ViewModel> GetExaminationPublishPageRepository(int pageIndex, int pageSize, out long rowsCount, RB_Examination_Publish_ViewModel query)
{
StringBuilder builder = new StringBuilder();
builder.AppendFormat(@"
SELECT A.*
FROM RB_Examination_Publish AS A
WHERE 1=1
");
if (query != null)
{
if (query.Group_Id > 0)
{
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Examination_Publish_ViewModel.Group_Id), query.Group_Id);
}
}
return GetPage<RB_Examination_Publish_ViewModel>(pageIndex, pageSize, out rowsCount, builder.ToString()).ToList();
}
}
}
......@@ -208,6 +208,7 @@ namespace Edu.WebApi.Controllers.Course
item.QuestionId,
item.CourseId,
Title = newTitle,
SourceTitle=item.Title,
item.QuestionTypeId,
item.QuestionTypeKey,
QuestionTypeName = item.QuestionTypeKey != "single-number" ? item.QuestionTypeName : "选择题",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment