Commit d0caed85 authored by liudong1993's avatar liudong1993

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

parents afed56be c984b64b
...@@ -63,5 +63,10 @@ namespace Edu.Cache ...@@ -63,5 +63,10 @@ namespace Edu.Cache
/// </summary> /// </summary>
public static string QYWECHAT_GLOBAL_CONFIG_KEY = "QYWECHAT_GLOBAL_CONFIG"; public static string QYWECHAT_GLOBAL_CONFIG_KEY = "QYWECHAT_GLOBAL_CONFIG";
/// <summary>
/// 微信公众号token
/// </summary>
public static readonly string DATA_WeChatAccountToken = "DATA_WeChatAccountToken_";
} }
} }
...@@ -845,5 +845,28 @@ namespace Edu.Common ...@@ -845,5 +845,28 @@ namespace Edu.Common
return ReadConfigKey("TempToken"); return ReadConfigKey("TempToken");
} }
} }
/// <summary>
/// 公众号的AppId
/// </summary>
public static string WeChatAccountAppId
{
get
{
return ReadConfigKey("WeChatAccountAppId");
}
}
/// <summary>
/// 公众号的AppSecret
/// </summary>
public static string WeChatAccountAppSecret
{
get
{
return ReadConfigKey("WeChatAccountAppSecret");
}
}
} }
} }
\ No newline at end of file
...@@ -61,5 +61,10 @@ namespace Edu.Common.Enum.Course ...@@ -61,5 +61,10 @@ namespace Edu.Common.Enum.Course
[EnumField("阅读选择")] [EnumField("阅读选择")]
ReadingChoose = 8, ReadingChoose = 8,
/// <summary>
/// 听力
/// </summary>
[EnumField("听力")]
Listening = 9,
} }
} }
\ No newline at end of file
using Edu.Common.Plugin;
namespace Edu.Common.Enum.Exam
{
/// <summary>
/// 试卷组卷类型
/// </summary>
public enum ExamGroupTypeEnum
{
/// <summary>
/// 题目类型(单选题、多选题等)
/// </summary>
[EnumField("题目类型")]
QuestionType = 1,
/// <summary>
/// 题目类型(读音题、语法题等)
/// </summary>
[EnumField("题目分类")]
QuestionClassify = 2,
}
}
...@@ -127,5 +127,10 @@ namespace Edu.Model.Entity.Exam ...@@ -127,5 +127,10 @@ namespace Edu.Model.Entity.Exam
/// 题目分数 /// 题目分数
/// </summary> /// </summary>
public decimal Score { get; set; } public decimal Score { get; set; }
/// <summary>
/// 分组编号
/// </summary>
public int GId { get; set; }
} }
} }
using System; using Edu.Common.Enum.Course;
using Edu.Common.Enum.Exam;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
using VT.FW.DB; using VT.FW.DB;
...@@ -28,12 +30,12 @@ namespace Edu.Model.Entity.Exam ...@@ -28,12 +30,12 @@ namespace Edu.Model.Entity.Exam
public string GroupName { get; set; } public string GroupName { get; set; }
/// <summary> /// <summary>
/// 问题类型编号 /// 问题类型编号【GroupType=1时使用】
/// </summary> /// </summary>
public int QuestionTypeId { get; set; } public int QuestionTypeId { get; set; }
/// <summary> /// <summary>
/// 问题类型Key /// 问题类型Key【GroupType=1时使用】
/// </summary> /// </summary>
public string QuestionTypeKey { get; set; } public string QuestionTypeKey { get; set; }
...@@ -46,5 +48,15 @@ namespace Edu.Model.Entity.Exam ...@@ -46,5 +48,15 @@ namespace Edu.Model.Entity.Exam
/// 分数 /// 分数
/// </summary> /// </summary>
public decimal GScore { get; set; } public decimal GScore { get; set; }
/// <summary>
/// 组卷类型
/// </summary>
public ExamGroupTypeEnum GroupType { get; set; }
/// <summary>
/// 题目分类编号【GroupType=2时使用】
/// </summary>
public QuestionCategoryEnum CategoryId { get; set; }
} }
} }
using Edu.Common.Enum.Question; using Edu.Common.Enum.Exam;
using Edu.Common.Enum.Question;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
...@@ -102,5 +103,15 @@ namespace Edu.Model.Entity.Exam ...@@ -102,5 +103,15 @@ namespace Edu.Model.Entity.Exam
/// 审核和备注 /// 审核和备注
/// </summary> /// </summary>
public string ExamineRemark { get; set; } public string ExamineRemark { get; set; }
/// <summary>
/// 组卷类型
/// </summary>
public ExamGroupTypeEnum GroupType { get; set; }
/// <summary>
/// 试卷总分数
/// </summary>
public decimal PaperScore { get; set; }
} }
} }
using Edu.Common.Enum; using Edu.Common.Enum;
using Edu.Common.Enum.Exam;
using Edu.Common.Enum.Question; using Edu.Common.Enum.Question;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
...@@ -73,5 +74,10 @@ namespace Edu.Model.Entity.Exam ...@@ -73,5 +74,10 @@ namespace Edu.Model.Entity.Exam
/// 模板题库编号 /// 模板题库编号
/// </summary> /// </summary>
public string TemplateBankIds { get; set; } public string TemplateBankIds { get; set; }
/// <summary>
/// 组卷类型
/// </summary>
public ExamGroupTypeEnum GroupType { get; set; }
} }
} }
\ No newline at end of file
using Edu.Common.Enum;
using System;
using VT.FW.DB;
namespace Edu.Model.Entity.Grade
{
/// <summary>
/// 班级学员上课反馈实体类
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_Class_FeedBack
{
/// <summary>
/// 主键编号
/// </summary>
public int FeedBackId { get; set; }
/// <summary>
/// 班级编号
/// </summary>
public int ClassId { get; set; }
/// <summary>
/// 状态
/// </summary>
public DateStateEnum Status { get; set; }
/// <summary>
/// 集团编号
/// </summary>
public int Group_Id { get; set; }
/// <summary>
/// 所属校区
/// </summary>
public int School_Id { get; set; }
/// <summary>
/// 教师编号
/// </summary>
public int TeacherId { get; set; }
/// <summary>
/// 学员id
/// </summary>
public int OrderGuestId { get; set; }
/// <summary>
/// 创建人
/// </summary>
public int CreateBy { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateTime { get; set; }
/// <summary>
/// 上课计划时间id
/// </summary>
public int ClassTimeId { get; set; }
/// <summary>
/// 上课计划id
/// </summary>
public int ClassPlanId { get; set; }
/// <summary>
/// 评分
/// </summary>
public int Score { get; set; }
/// <summary>
/// 评语
/// </summary>
public string Comment { get; set; }
/// <summary>
/// 照片/视频
/// </summary>
public string Photo { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Text;
using Edu.Common.Enum;
using VT.FW.DB;
namespace Edu.Model.Entity.LearningGarden
{
/// <summary>
/// 学习园地管理实体类
/// </summary>
[Serializable]
[DB(ConnectionName = "DefaultConnection")]
public class RB_LearningGarden
{
/// <summary>
/// 编号
/// </summary>
public int Id { get; set; }
/// <summary>
/// 标题
/// </summary>
public string Title { get; set; }
/// <summary>
/// 封面图片
/// </summary>
public string Img { get; set; }
/// <summary>
/// 内容
/// </summary>
public string Content { get; set; }
/// <summary>
/// 摘要
/// </summary>
public string Digest { get; set; }
/// <summary>
/// 对应公众号文章的url
/// </summary>
public string LinkUrl { get; set; }
/// <summary>
/// 更新时间
/// </summary>
public DateTime UpdateTime { get; set; }
/// <summary>
/// 类型图片(image)、视频(video)、语音 (voice)、图文(news)
/// </summary>
public string TypeId { get; set; }
/// <summary>
/// 微信公众号对应的文章id(media_id)
/// </summary>
public string WeChatAccountId { get; set; }
/// <summary>
/// 删除状态
/// </summary>
public DateStateEnum Status { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateDate { get; set; }
/// <summary>
/// 创建人编号
/// </summary>
public int CreateBy { get; set; }
/// <summary>
/// 作者
/// </summary>
public string Author { get; set; }
/// <summary>
/// 集团编号
/// </summary>
public int Group_Id { get; set; }
/// <summary>
/// 学校编号
/// </summary>
public int School_Id { get; set; }
}
}
using Edu.Common.Enum.Course; using Edu.Common.Enum.Course;
using Edu.Common.Enum.Exam;
using Edu.Common.Enum.Question; using Edu.Common.Enum.Question;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text;
namespace Edu.Model.ViewModel.Exam namespace Edu.Model.ViewModel.Exam
{ {
...@@ -11,13 +10,14 @@ namespace Edu.Model.ViewModel.Exam ...@@ -11,13 +10,14 @@ namespace Edu.Model.ViewModel.Exam
/// </summary> /// </summary>
public class ExamTemplate public class ExamTemplate
{ {
/// <summary> /// <summary>
/// 问题类型编号 /// 问题类型编号【GroupType=1时使用】
/// </summary> /// </summary>
public int QuestionTypeId { get; set; } public int QuestionTypeId { get; set; }
/// <summary> /// <summary>
/// 问题类型Key /// 问题类型Key【GroupType=1时使用】
/// </summary> /// </summary>
public string QuestionTypeKey { get; set; } public string QuestionTypeKey { get; set; }
...@@ -51,10 +51,6 @@ namespace Edu.Model.ViewModel.Exam ...@@ -51,10 +51,6 @@ namespace Edu.Model.ViewModel.Exam
/// </summary> /// </summary>
public List<DifficultyTypeItem> ChooseList { get; set; } public List<DifficultyTypeItem> ChooseList { get; set; }
/// <summary>
/// 题目分类列表
/// </summary>
public List<CategoryItem> CategoryList { get; set; }
} }
/// <summary> /// <summary>
...@@ -72,26 +68,4 @@ namespace Edu.Model.ViewModel.Exam ...@@ -72,26 +68,4 @@ namespace Edu.Model.ViewModel.Exam
/// </summary> /// </summary>
public int ChooseNum { get; set; } public int ChooseNum { get; set; }
} }
/// <summary>
/// 题型分类
/// </summary>
public class CategoryItem
{
/// <summary>
/// 题型分类
/// </summary>
public QuestionCategoryEnum Category { get; set; }
/// <summary>
/// 选择题目数
/// </summary>
public int ChooseNum { get; set; }
/// <summary>
/// 难易程度选题【ChooseType=2时使用】
/// </summary>
public List<DifficultyTypeItem> ChooseList { get; set; }
}
} }
using System;
using System.Collections.Generic;
using System.Text;
using Edu.Model.Entity.Grade;
namespace Edu.Model.ViewModel.Grade
{
public class RB_Class_FeedBack_ViewModel: RB_Class_FeedBack
{
/// <summary>
/// ids
/// </summary>
public string Q_ClassTimeIds { get; set; }
/// <summary>
/// ids
/// </summary>
public string Q_ClassIds { get; set; }
/// <summary>
/// 老师名称
/// </summary>
public string TeacherName { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Text;
using Edu.Model.Entity.LearningGarden;
namespace Edu.Model.ViewModel.LearningGarden
{
public class RB_LearningGarden_ViewModel : RB_LearningGarden
{
}
/// <summary>
/// 公众号文章对应的实体
/// </summary>
public class WeChatLearningGarden
{
public WeChatLearningGardenItem item { get; set; }
/// <summary>
/// 该类型的素材的总数
/// </summary>
public int total_count { get; set; }
/// <summary>
/// 本次调用获取的素材的数量
/// </summary>
public int item_count { get; set; }
}
public class WeChatLearningGardenItem
{
/// <summary>
///
/// </summary>
public string media_id { get; set; }
public WeChatLearningGardenContent content { get; set; }
/// <summary>
/// 更新时间
/// </summary>
public string update_time { get; set; }
}
public class WeChatLearningGardenContent
{
public List<WeChatLearningGardenNewsItem> news_item { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public long create_time { get; set; }
/// <summary>
/// 更新时间
/// </summary>
public long update_time { get; set; }
}
public class WeChatLearningGardenNewsItem
{
/// <summary>
/// 图文消息的标题
/// </summary>
public string title { get; set; }
/// <summary>
/// 作者
/// </summary>
public string author { get; set; }
/// <summary>
/// 文消息的摘要,仅有单图文消息才有摘要,多图文此处为空
/// </summary>
public string digest { get; set; }
/// <summary>
/// 文消息的具体内容,支持HTML标签,必须少于2万字符,小于1M,且此处会去除JS
/// </summary>
public string content { get; set; }
/// <summary>
/// 是否显示封面,0为false,即不显示,1为true,即显示
/// </summary>
public int show_cover_pic { get; set; }
/// <summary>
/// 链接地址
/// </summary>
public string url { get; set; }
/// <summary>
/// 封面图片地址
/// </summary>
public string thumb_url { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Text;
using Edu.Model.ViewModel.LearningGarden;
using Edu.Repository.LearningGarden;
using VT.FW.DB;
namespace Edu.Module.Course
{
public class LearningGardenModule
{
/// <summary>
/// 订单
/// </summary>
private readonly RB_LearningGardenRepository learningGardenRepository = new RB_LearningGardenRepository();
#region 学习园地
/// <summary>
/// 获取学习园地分页列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示调试</param>
/// <param name="rowsCount">总条数</param>
/// <param name="query">查询条件</param>
/// <returns></returns>
public List<RB_LearningGarden_ViewModel> GetLearningGardenPageModule(int pageIndex, int pageSize, out long rowsCount, RB_LearningGarden_ViewModel query)
{
return learningGardenRepository.GetLearningGardenPageRepository(pageIndex, pageSize, out rowsCount, query);
}
/// <summary>
/// 获取学习园地列表
/// </summary>
/// <param name="query">查询条件</param>
/// <returns></returns>
public List<RB_LearningGarden_ViewModel> GetLearningGardenListModule(RB_LearningGarden_ViewModel query)
{
return learningGardenRepository.GetLearningGardenListRepository(query);
}
/// <summary>
/// 新增修改新闻
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool SetLearningGardenModule(RB_LearningGarden_ViewModel model)
{
bool flag;
if (model.Id > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_LearningGarden_ViewModel.Title),model.Title },
{nameof(RB_LearningGarden_ViewModel.Img),model.Img },
{nameof(RB_LearningGarden_ViewModel.Content),model.Content },
{nameof(RB_LearningGarden_ViewModel.TypeId),model.TypeId },
{nameof(RB_LearningGarden_ViewModel.Digest),model.Digest },
{nameof(RB_LearningGarden_ViewModel.LinkUrl),model.LinkUrl }
};
flag = learningGardenRepository.Update(fileds, new WhereHelper(nameof(RB_LearningGarden_ViewModel.Id), model.Id));
}
else
{
var newId = learningGardenRepository.Insert(model);
model.Id = newId;
flag = newId > 0;
}
return flag;
}
/// <summary>
/// 批量新增修改学习园地
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public bool SetBatchWebNewsModule(List<RB_LearningGarden_ViewModel> list)
{
bool flag = false;
foreach (var model in list)
{
if (model.Id > 0)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_LearningGarden_ViewModel.Title),model.Title },
{nameof(RB_LearningGarden_ViewModel.Img),model.Img },
{nameof(RB_LearningGarden_ViewModel.Content),model.Content },
{nameof(RB_LearningGarden_ViewModel.TypeId),model.TypeId },
{nameof(RB_LearningGarden_ViewModel.Digest),model.Digest },
{nameof(RB_LearningGarden_ViewModel.LinkUrl),model.LinkUrl },
{nameof(RB_LearningGarden_ViewModel.UpdateTime),model.UpdateTime }
};
flag = learningGardenRepository.Update(fileds, new WhereHelper(nameof(RB_LearningGarden_ViewModel.Id), model.Id));
}
else
{
var newId = learningGardenRepository.Insert(model);
model.Id = newId;
flag = newId > 0;
}
}
return flag;
}
/// <summary>
/// 根据编号获取学习园地详情
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
public RB_LearningGarden_ViewModel GetLearningGardenModule(object Id)
{
return learningGardenRepository.GetEntity<RB_LearningGarden_ViewModel>(Id);
}
/// <summary>
/// 修改学习园地状态
/// </summary>
/// <param name="Id"></param>
/// <param name="Status">0-正常,1-删除</param>
/// <returns></returns>
public bool RemoveLearningGardenStatusModule(int Id, int Status)
{
Dictionary<string, object> fileds = new Dictionary<string, object>()
{
{nameof(RB_LearningGarden_ViewModel.Status),Status },
};
var flag = learningGardenRepository.Update(fileds, new WhereHelper(nameof(RB_LearningGarden_ViewModel.Id), Id));
return flag;
}
#endregion
}
}
This diff is collapsed.
...@@ -185,54 +185,56 @@ namespace Edu.Module.Question ...@@ -185,54 +185,56 @@ namespace Edu.Module.Question
/// <param name="isOptionRandom"></param> /// <param name="isOptionRandom"></param>
/// <param name="isNoAnswer"></param> /// <param name="isNoAnswer"></param>
/// <returns></returns> /// <returns></returns>
private object GetChooseOptionList(string data,int isOptionRandom,bool isNoAnswer,bool isSingleNum=false,bool isEdit=false) private object GetChooseOptionList(string data, int isOptionRandom, bool isNoAnswer, bool isSingleNum = false, bool isEdit = false)
{ {
var obj = new object(); var obj = new object();
var singleList = Common.Plugin.JsonHelper.DeserializeObject<List<optionItem>>(data);
var newList = new List<optionItem>(); var singleList = Common.Plugin.JsonHelper.DeserializeObject<List<optionItem>>(data);
if (!isEdit) var newList = new List<optionItem>();
{ if (!isEdit)
singleList.ForEach(item =>
{ {
item.ShowName = item.Name; singleList.ForEach(item =>
}); {
} item.ShowName = item.Name;
//选项随机 });
if (isOptionRandom == 1) }
{ //选项随机
var tempList = singleList.OrderBy(qitem => Guid.NewGuid()).ToList(); if (isOptionRandom == 1)
for (var i = 0; i < tempList.Count; i++)
{ {
var item = new optionItem() var tempList = singleList.OrderBy(qitem => Guid.NewGuid()).ToList();
for (var i = 0; i < tempList.Count; i++)
{ {
Name = tempList[i].Name, var item = new optionItem()
Content = tempList[i].Content, {
IsAnswer = tempList[i].IsAnswer Name = tempList[i].Name,
}; Content = tempList[i].Content,
item.ShowName = isSingleNum? (i + 1).ToString() : LetterArray[i]; IsAnswer = tempList[i].IsAnswer
newList.Add(item); };
item.ShowName = isSingleNum ? (i + 1).ToString() : LetterArray[i];
newList.Add(item);
}
} }
} //去掉答案
//去掉答案 if (isNoAnswer)
if (isNoAnswer)
{
singleList.ForEach(item =>
{ {
item.IsAnswer = false; singleList.ForEach(item =>
}); {
newList.ForEach(item => item.IsAnswer = false;
});
newList.ForEach(item =>
{
item.IsAnswer = false;
});
}
if (isOptionRandom == 1)
{ {
item.IsAnswer = false; obj = newList;
}); }
} else
if (isOptionRandom == 1) {
{ obj = singleList;
obj = newList; }
}
else
{
obj = singleList;
}
return obj; return obj;
} }
...@@ -410,20 +412,32 @@ namespace Edu.Module.Question ...@@ -410,20 +412,32 @@ namespace Edu.Module.Question
//单选、多选、单选(数字)题 //单选、多选、单选(数字)题
if (QuestionTypeKey == "single" || QuestionTypeKey == "multiple" || QuestionTypeKey == "single-number") if (QuestionTypeKey == "single" || QuestionTypeKey == "multiple" || QuestionTypeKey == "single-number")
{ {
var optionItems = Common.Plugin.JsonHelper.DeserializeObject<List<optionItem>>(QuestionContent); if (!string.IsNullOrEmpty(QuestionContent))
message = CheckChoose(optionItems);
var tempList = optionItems.Where(qitem => qitem.IsAnswer == true);
if (tempList != null && tempList.Count() > 0)
{
AnalysisAnswer = string.Join(",", tempList.OrderBy(qitem => qitem.Name).Select(qitem => qitem.Name));
}
else
{ {
AnalysisAnswer = ""; var optionItems = new List<optionItem>();
} try
if (!string.IsNullOrEmpty(message)) {
{ optionItems = Common.Plugin.JsonHelper.DeserializeObject<List<optionItem>>(QuestionContent);
return message; }
catch (Exception ex)
{
Common.Plugin.LogHelper.Write(ex, " CheckQuestion:____" + QuestionContent);
}
message = CheckChoose(optionItems);
var tempList = optionItems.Where(qitem => qitem.IsAnswer == true);
if (tempList != null && tempList.Count() > 0)
{
AnalysisAnswer = string.Join(",", tempList.OrderBy(qitem => qitem.Name).Select(qitem => qitem.Name));
}
else
{
AnalysisAnswer = "";
}
if (!string.IsNullOrEmpty(message))
{
return message;
}
} }
} }
//判断题 //判断题
......
...@@ -125,7 +125,19 @@ namespace Edu.Module.Question ...@@ -125,7 +125,19 @@ namespace Edu.Module.Question
/// <returns></returns> /// <returns></returns>
public List<RB_Question_ViewModel> GetQuestionPageListModule(int pageIndex, int pageSize, out long rowsCount, RB_Question_ViewModel query) public List<RB_Question_ViewModel> GetQuestionPageListModule(int pageIndex, int pageSize, out long rowsCount, RB_Question_ViewModel query)
{ {
return questionRepository.GetQuestionPageListRepository(pageIndex, pageSize, out rowsCount, query); var list = questionRepository.GetQuestionPageListRepository(pageIndex, pageSize, out rowsCount, query);
if (list != null && list.Count > 0)
{
foreach (var item in list)
{
if (item.QuestionTypeKey == "reading-comprehensio" || item.QuestionTypeKey == "listening" || item.QuestionTypeKey == "cloze")
{
var obj = ParsingQuestionModule(item.QuestionTypeKey, item.QuestionContent);
item.QuestionContent = Common.Plugin.JsonHelper.Serialize(obj);
}
}
}
return list;
} }
/// <summary> /// <summary>
...@@ -143,7 +155,7 @@ namespace Edu.Module.Question ...@@ -143,7 +155,7 @@ namespace Edu.Module.Question
/// </summary> /// </summary>
/// <param name="query"></param> /// <param name="query"></param>
/// <returns></returns> /// <returns></returns>
public List<object> GetQuestionCategoryListModule(RB_Question_ViewModel query) public List<object> GetQuestionTypeStaticListModule(RB_Question_ViewModel query)
{ {
List<object> list = new List<object>(); List<object> list = new List<object>();
var dataList = questionRepository.GetQuestionStaticsListRepository(query); var dataList = questionRepository.GetQuestionStaticsListRepository(query);
...@@ -158,11 +170,12 @@ namespace Edu.Module.Question ...@@ -158,11 +170,12 @@ namespace Edu.Module.Question
{ {
var qType = questionTypeList?.Where(qitem => qitem.QId == item.QuestionTypeId)?.FirstOrDefault(); var qType = questionTypeList?.Where(qitem => qitem.QId == item.QuestionTypeId)?.FirstOrDefault();
var diffTypeList = dataList.Where(qitem => qitem.QuestionTypeId == item.QuestionTypeId) var diffTypeList = dataList.Where(qitem => qitem.QuestionTypeId == item.QuestionTypeId)
.GroupBy(qitem =>new { qitem.DifficultyType })
.Select(qitem => new .Select(qitem => new
{ {
qitem.DifficultyType, qitem.Key.DifficultyType,
DifficultyTypeName = qitem.DifficultyType.ToName(), DifficultyTypeName = qitem.Key.DifficultyType.ToName(),
DifficultyTypeCount = qitem.QuestionCount, DifficultyTypeCount = qitem.Sum(sItem=>sItem.QuestionCount),
ChooseNum = 0 ChooseNum = 0
}); });
...@@ -190,22 +203,21 @@ namespace Edu.Module.Question ...@@ -190,22 +203,21 @@ namespace Edu.Module.Question
/// </summary> /// </summary>
/// <param name="query"></param> /// <param name="query"></param>
/// <returns></returns> /// <returns></returns>
public List<object> GetQuestionCategoryList_V2Module(RB_Question_ViewModel query) public List<object> GetQuestionCategoryStaticListModule(RB_Question_ViewModel query)
{ {
List<object> list = new List<object>(); List<object> list = new List<object>();
var dataList = questionRepository.GetQuestionStaticsListRepository(query); var dataList = questionRepository.GetQuestionStaticsListRepository(query);
if (dataList != null && dataList.Count > 0) if (dataList != null && dataList.Count > 0)
{ {
var questionTypeList = GetQuestionTypeListModule(new RB_Question_Type_ViewModel()); var questionTypeList = GetQuestionTypeListModule(new RB_Question_Type_ViewModel());
var groupList = dataList.GroupBy(qitem => new { qitem.QuestionTypeId, }).Select(qitem => new var groupList = dataList.GroupBy(qitem => new { qitem.Category, }).Select(qitem => new
{ {
qitem.Key.QuestionTypeId qitem.Key.Category
}); });
foreach (var item in groupList) foreach (var item in groupList)
{ {
var qType = questionTypeList?.Where(qitem => qitem.QId == item.QuestionTypeId)?.FirstOrDefault(); var diffTypeList = dataList.Where(qitem => qitem.Category == item.Category)
var diffTypeList = dataList.Where(qitem => qitem.QuestionTypeId == item.QuestionTypeId) .GroupBy(qitem => new {qitem.DifficultyType})
.GroupBy(qitem => new { qitem.QuestionTypeId,qitem.DifficultyType})
.Select(qitem => new .Select(qitem => new
{ {
qitem.Key.DifficultyType, qitem.Key.DifficultyType,
...@@ -213,41 +225,17 @@ namespace Edu.Module.Question ...@@ -213,41 +225,17 @@ namespace Edu.Module.Question
DifficultyTypeCount = qitem.Sum(c=>c.QuestionCount), DifficultyTypeCount = qitem.Sum(c=>c.QuestionCount),
ChooseNum = 0 ChooseNum = 0
}); });
var categoryList = dataList.Where(qitem => qitem.QuestionTypeId == item.QuestionTypeId).GroupBy(qitem => new { qitem.Category }).Select(qitem => new { qitem.Key.Category });
List<object> resultCategoryList = new List<object>();
foreach (var subItem in categoryList)
{
var tempCategoryList = dataList.Where(qitem => qitem.QuestionTypeId == item.QuestionTypeId && qitem.Category == subItem.Category)?.ToList();
if (tempCategoryList != null && tempCategoryList.Count > 0)
{
var cObj = new
{
subItem.Category,
CategoryName = subItem.Category.ToName(),
QuestionTypeNum = tempCategoryList.Sum(qitem=>qitem.QuestionCount),
ChooseNum = 0,
ChooseList= tempCategoryList?.Select(qitem => new
{
qitem.DifficultyType,
DifficultyTypeName = qitem.DifficultyType.ToName(),
DifficultyTypeCount = qitem.QuestionCount,
ChooseNum = 0
})
};
resultCategoryList.Add(cObj);
}
}
var obj = new var obj = new
{ {
item.QuestionTypeId, QuestionTypeId=item.Category,
QuestionTypeKey = qType?.Key, QuestionTypeKey = "",
QuestionTypeName = qType?.Name, QuestionTypeName =item.Category.ToName(),
QuestionScore = 0, QuestionScore = 0,
QuestionDesc = "", QuestionDesc = "",
ChooseType = 1, ChooseType = 1,
ChooseNum = 0, ChooseNum = 0,
QuestionTypeNum = dataList.Where(qitem => qitem.QuestionTypeId == item.QuestionTypeId).Sum(qitem => qitem.QuestionCount), QuestionTypeNum = dataList.Where(qitem => qitem.Category == item.Category).Sum(qitem => qitem.QuestionCount),
CategoryList= resultCategoryList,
ChooseList = diffTypeList, ChooseList = diffTypeList,
}; };
list.Add(obj); list.Add(obj);
......
using System;
using System.Collections.Generic;
using System.Text;
using Edu.Model.Entity.Grade;
namespace Edu.Repository.Grade
{
public class RB_Class_FeedBackRepository:BaseRepository<RB_Class_FeedBack>
{
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Edu.Common.Enum;
using Edu.Model.Entity.LearningGarden;
using Edu.Model.ViewModel.LearningGarden;
using VT.FW.DB.Dapper;
namespace Edu.Repository.LearningGarden
{
public class RB_LearningGardenRepository:BaseRepository<RB_LearningGarden>
{
/// <summary>
/// 获取学习园地分页列表
/// </summary>
/// <param name="pageIndex">页码</param>
/// <param name="pageSize">每页显示调试</param>
/// <param name="rowsCount">总条数</param>
/// <param name="query">查询条件</param>
/// <returns></returns>
public List<RB_LearningGarden_ViewModel> GetLearningGardenPageRepository(int pageIndex, int pageSize, out long rowsCount, RB_LearningGarden_ViewModel query)
{
rowsCount = 0;
var parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder();
builder.Append(@"
SELECT A.*
FROM RB_LearningGarden AS A
WHERE 1=1
");
builder.AppendFormat(@" AND A.{0}={1} ", nameof(RB_LearningGarden_ViewModel.Status), (int)DateStateEnum.Normal);
if (query == null)
{
return new List<RB_LearningGarden_ViewModel>();
}
else
{
if (query.Group_Id > 0)
{
builder.AppendFormat(@" AND A.{0}={1} ", nameof(RB_LearningGarden_ViewModel.Group_Id), query.Group_Id);
}
if (!string.IsNullOrEmpty(query.Title))
{
builder.AppendFormat(" AND A.{0} LIKE @Title ", nameof(RB_LearningGarden_ViewModel.Title));
parameters.Add("Title", "%" + query.Title.Trim() + "%");
}
}
builder.AppendFormat(" ORDER BY A.{0} DESC ", nameof(RB_LearningGarden_ViewModel.Id));
return GetPage<RB_LearningGarden_ViewModel>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList();
}
/// <summary>
/// 获取学习园地列表
/// </summary>
/// <param name="query">查询条件</param>
/// <returns></returns>
public List<RB_LearningGarden_ViewModel> GetLearningGardenListRepository(RB_LearningGarden_ViewModel query)
{
var parameters = new DynamicParameters();
StringBuilder builder = new StringBuilder();
builder.Append(@"
SELECT A.*
FROM RB_LearningGarden AS A
WHERE 1=1
");
builder.AppendFormat(@" AND A.{0}={1} ", nameof(RB_LearningGarden_ViewModel.Status), (int)DateStateEnum.Normal);
if (query == null)
{
return new List<RB_LearningGarden_ViewModel>();
}
else
{
if (query.Group_Id > 0)
{
builder.AppendFormat(@" AND A.{0}={1} ", nameof(RB_LearningGarden_ViewModel.Group_Id), query.Group_Id);
}
if (!string.IsNullOrEmpty(query.Title))
{
builder.AppendFormat(" AND A.{0} LIKE @Title ", nameof(RB_LearningGarden_ViewModel.Title));
parameters.Add("Title", "%" + query.Title.Trim() + "%");
}
}
return Get<RB_LearningGarden_ViewModel>(builder.ToString()).ToList();
}
}
}
...@@ -22,10 +22,11 @@ namespace Edu.Repository.Question ...@@ -22,10 +22,11 @@ namespace Edu.Repository.Question
{ {
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
builder.AppendFormat(@" builder.AppendFormat(@"
SELECT * SELECT A.*
FROM RB_Question FROM RB_Question AS A INNER JOIN rb_question_bank AS B ON A.BankId=B.BankId
WHERE 1=1 WHERE 1=1 AND B.Status=0
"); ");
if (query == null) if (query == null)
{ {
return new List<RB_Question_ViewModel>(); return new List<RB_Question_ViewModel>();
...@@ -34,15 +35,19 @@ WHERE 1=1 ...@@ -34,15 +35,19 @@ WHERE 1=1
{ {
if (!string.IsNullOrEmpty(query.QBankIds)) if (!string.IsNullOrEmpty(query.QBankIds))
{ {
builder.AppendFormat(" AND {0} IN({1}) ", nameof(RB_Question_ViewModel.BankId), query.QBankIds); builder.AppendFormat(" AND A.{0} IN({1}) ", nameof(RB_Question_ViewModel.BankId), query.QBankIds);
} }
if (query.CourseId > 0) if (query.CourseId > 0)
{ {
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Question_ViewModel.CourseId), query.CourseId); builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Question_ViewModel.CourseId), query.CourseId);
} }
if (!string.IsNullOrEmpty(query.Q_QuestionTypeIds)) if (!string.IsNullOrEmpty(query.Q_QuestionTypeIds))
{ {
builder.AppendFormat(" AND {0} IN({1}) ", nameof(RB_Question_ViewModel.QuestionTypeId), query.Q_QuestionTypeIds); builder.AppendFormat(" AND A.{0} IN({1}) ", nameof(RB_Question_ViewModel.QuestionTypeId), query.Q_QuestionTypeIds);
}
if (!string.IsNullOrEmpty(query.QCategoryId))
{
builder.AppendFormat(" AND A.{0} IN({1}) ", nameof(RB_Question_ViewModel.Category), query.QCategoryId);
} }
return Get<RB_Question_ViewModel>(builder.ToString()).ToList(); return Get<RB_Question_ViewModel>(builder.ToString()).ToList();
} }
...@@ -57,9 +62,9 @@ WHERE 1=1 ...@@ -57,9 +62,9 @@ WHERE 1=1
{ {
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
builder.AppendFormat(@" builder.AppendFormat(@"
SELECT QuestionTypeId,DifficultyType,Category,Count(QuestionId) AS QuestionCount SELECT A.QuestionTypeId, A.DifficultyType,A.Category,Count(A.QuestionId) AS QuestionCount
FROM RB_Question FROM RB_Question AS A INNER JOIN rb_question_bank AS B ON A.BankId=B.BankId
WHERE 1=1 AND `Status`=0 WHERE 1=1 AND B.Status=0 AND A.Status=0
"); ");
if (query == null) if (query == null)
{ {
...@@ -69,21 +74,22 @@ WHERE 1=1 AND `Status`=0 ...@@ -69,21 +74,22 @@ WHERE 1=1 AND `Status`=0
{ {
if (!string.IsNullOrEmpty(query.QBankIds)) if (!string.IsNullOrEmpty(query.QBankIds))
{ {
builder.AppendFormat(" AND {0} IN({1}) ", nameof(RB_Question_ViewModel.BankId), query.QBankIds); builder.AppendFormat(" AND A.{0} IN({1}) ", nameof(RB_Question_ViewModel.BankId), query.QBankIds);
} }
if (query.CourseId > 0) if (query.CourseId > 0)
{ {
builder.AppendFormat(" AND {0}={1} ", nameof(RB_Question_ViewModel.CourseId), query.CourseId); builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Question_ViewModel.CourseId), query.CourseId);
} }
if (!string.IsNullOrEmpty(query.Q_QuestionTypeIds)) if (!string.IsNullOrEmpty(query.Q_QuestionTypeIds))
{ {
builder.AppendFormat(" AND {0} IN({1}) ", nameof(RB_Question_ViewModel.QuestionTypeId), query.Q_QuestionTypeIds); builder.AppendFormat(" AND A.{0} IN({1}) ", nameof(RB_Question_ViewModel.QuestionTypeId), query.Q_QuestionTypeIds);
} }
builder.AppendFormat(" GROUP BY QuestionTypeId,DifficultyType,Category "); builder.AppendFormat(" GROUP BY A.QuestionTypeId,A.DifficultyType,A.Category ");
return Get<RB_Question_ViewModel>(builder.ToString()).ToList(); return Get<RB_Question_ViewModel>(builder.ToString()).ToList();
} }
} }
/// <summary> /// <summary>
/// 获取问题分页列表 /// 获取问题分页列表
/// </summary> /// </summary>
...@@ -100,7 +106,9 @@ WHERE 1=1 AND `Status`=0 ...@@ -100,7 +106,9 @@ WHERE 1=1 AND `Status`=0
builder.AppendFormat(@" builder.AppendFormat(@"
SELECT A.*,IFNULL(B.`Name` ,'') AS QuestionTypeName SELECT A.*,IFNULL(B.`Name` ,'') AS QuestionTypeName
FROM RB_Question AS A LEFT JOIN RB_Question_Type B ON A.QuestionTypeId=B.QId FROM RB_Question AS A LEFT JOIN RB_Question_Type B ON A.QuestionTypeId=B.QId
WHERE 1=1 "); INNER JOIN rb_question_bank AS C ON A.BankId=C.BankId
WHERE 1=1
");
builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Question_ViewModel.Status), (int)DateStateEnum.Normal); builder.AppendFormat(" AND A.{0}={1} ", nameof(RB_Question_ViewModel.Status), (int)DateStateEnum.Normal);
if (query == null) if (query == null)
{ {
......
...@@ -2,12 +2,15 @@ ...@@ -2,12 +2,15 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Edu.Cache.User;
using Edu.Common.API; using Edu.Common.API;
using Edu.Common.Enum;
using Edu.Common.Enum.Exam; using Edu.Common.Enum.Exam;
using Edu.Common.Enum.Question; using Edu.Common.Enum.Question;
using Edu.Common.Plugin; using Edu.Common.Plugin;
using Edu.Model.ViewModel.Exam; using Edu.Model.ViewModel.Exam;
using Edu.Model.ViewModel.Grade; using Edu.Model.ViewModel.Grade;
using Edu.Model.ViewModel.LearningGarden;
using Edu.Model.ViewModel.User; using Edu.Model.ViewModel.User;
using Edu.Module.Course; using Edu.Module.Course;
using Edu.Module.EduTask; using Edu.Module.EduTask;
...@@ -55,6 +58,12 @@ namespace Edu.WebApi.Controllers.Applet ...@@ -55,6 +58,12 @@ namespace Edu.WebApi.Controllers.Applet
/// </summary> /// </summary>
private readonly Module.Exam.PaperModule paperModule = AOP.AOPHelper.CreateAOPObject<Module.Exam.PaperModule>(); private readonly Module.Exam.PaperModule paperModule = AOP.AOPHelper.CreateAOPObject<Module.Exam.PaperModule>();
/// <summary>
/// 学习园地处理类对象
/// </summary>
private readonly LearningGardenModule learningGardenModule = AOP.AOPHelper.CreateAOPObject<LearningGardenModule>();
#region 小程序首页 #region 小程序首页
/// <summary> /// <summary>
/// 小程序首页 /// 小程序首页
...@@ -649,5 +658,84 @@ namespace Edu.WebApi.Controllers.Applet ...@@ -649,5 +658,84 @@ namespace Edu.WebApi.Controllers.Applet
} }
#endregion #endregion
#region 学习园地
/// <summary>
/// 获取学习园地分页
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GeLearningGardenPage()
{
var pageModel = Common.Plugin.JsonHelper.DeserializeObject<ResultPageModel>(RequestParm.Msg.ToString());
var query = new RB_LearningGarden_ViewModel()
{
Title = base.ParmJObj.GetStringValue("Title"),
Group_Id = base.ParmJObj.GetInt("Group_Id")
};
query.Status = DateStateEnum.Normal;
query.Group_Id = base.AppletUserInfo.Group_Id;
var list = learningGardenModule.GetLearningGardenPageModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
List<object> resultList = new List<object>();
foreach (var item in list)
{
string CreateByName = "甲鹤教育";
if (item.CreateBy > 0)
{
CreateByName = UserReidsCache.GetUserLoginInfo(item.CreateBy)?.AccountName ?? "";
}
resultList.Add(new
{
item.Id,
item.Title,
item.Content,
item.Img,
item.Digest,
item.LinkUrl,
CreateByName,
CreateTime = Common.Plugin.StringHelper.DateFormatToString(item.CreateDate)
});
}
pageModel.Count = rowsCount;
pageModel.PageData = resultList;
return ApiResult.Success(data: pageModel);
}
/// <summary>
/// 获取学习园地详情
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetLearningGarden()
{
var Id = base.ParmJObj.GetInt("Id", 0);
var extModel = learningGardenModule.GetLearningGardenModule(Id);
object obj = new object();
if (extModel != null && extModel.Id > 0)
{
string CreateByName = "甲鹤教育";
if (extModel.CreateBy > 0)
{
CreateByName = UserReidsCache.GetUserLoginInfo(extModel.CreateBy)?.AccountName ?? "";
}
obj = new
{
extModel.Id,
extModel.Title,
extModel.Img,
extModel.Content,
extModel.Digest,
extModel.LinkUrl,
CreateByName,
CreateTime = Common.Plugin.StringHelper.DateFormatToString(extModel.CreateDate)
};
}
return ApiResult.Success(data: obj);
}
#endregion
} }
} }
...@@ -241,13 +241,31 @@ namespace Edu.WebApi.Controllers.Course ...@@ -241,13 +241,31 @@ namespace Edu.WebApi.Controllers.Course
return ApiResult.Success(data: pageModel); return ApiResult.Success(data: pageModel);
} }
/// <summary>
/// 根据题库编号获取题库题型列表【试卷组卷使用】
/// </summary>
/// <returns></returns>
[HttpPost]
public ApiResult GetQuestionTypeStaticList()
{
var query = new RB_Question_ViewModel()
{
CourseId = base.ParmJObj.GetInt("CourseId"),
Title = base.ParmJObj.GetStringValue("Title"),
PointName = base.ParmJObj.GetStringValue("PointName"),
BankId = base.ParmJObj.GetInt("BankId"),
QBankIds = base.ParmJObj.GetStringValue("QBankIds"),
};
var data = questionModule.GetQuestionTypeStaticListModule(query);
return ApiResult.Success(data: data);
}
/// <summary> /// <summary>
/// 根据题库编号获取题库题型分类列表【试卷组卷使用】 /// 根据题库编号获取题库题型分类列表【试卷组卷使用】
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
[HttpPost] [HttpPost]
public ApiResult GetQuestionCategoryList() public ApiResult GetQuestionCategoryStaticList()
{ {
var query = new RB_Question_ViewModel() var query = new RB_Question_ViewModel()
{ {
...@@ -257,11 +275,10 @@ namespace Edu.WebApi.Controllers.Course ...@@ -257,11 +275,10 @@ namespace Edu.WebApi.Controllers.Course
BankId = base.ParmJObj.GetInt("BankId"), BankId = base.ParmJObj.GetInt("BankId"),
QBankIds = base.ParmJObj.GetStringValue("QBankIds"), QBankIds = base.ParmJObj.GetStringValue("QBankIds"),
}; };
var data = questionModule.GetQuestionCategoryList_V2Module(query); var data = questionModule.GetQuestionCategoryStaticListModule(query);
return ApiResult.Success(data: data); return ApiResult.Success(data: data);
} }
/// <summary> /// <summary>
/// 获取问题难易列表 /// 获取问题难易列表
/// </summary> /// </summary>
......
...@@ -179,7 +179,7 @@ namespace Edu.WebApi.Controllers.Course ...@@ -179,7 +179,7 @@ namespace Edu.WebApi.Controllers.Course
Group_Id = base.UserInfo.Group_Id, Group_Id = base.UserInfo.Group_Id,
School_Id = -1, School_Id = -1,
ClassId = base.ParmJObj.GetInt("ClassId"), ClassId = base.ParmJObj.GetInt("ClassId"),
OrderBy= base.ParmJObj.GetInt("OrderBy",0), OrderBy = base.ParmJObj.GetInt("OrderBy", 0),
ClassType = base.ParmJObj.GetInt("ClassType")// //课程类型(0-全部,1-正常,2-试听课) ClassType = base.ParmJObj.GetInt("ClassType")// //课程类型(0-全部,1-正常,2-试听课)
}; };
var result = classModule.GetTeacherPlan(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query); var result = classModule.GetTeacherPlan(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
...@@ -272,7 +272,7 @@ namespace Edu.WebApi.Controllers.Course ...@@ -272,7 +272,7 @@ namespace Edu.WebApi.Controllers.Course
} }
/// <summary> /// <summary>
/// 获取学员列表 /// 获取学员列表
...@@ -322,5 +322,10 @@ namespace Edu.WebApi.Controllers.Course ...@@ -322,5 +322,10 @@ namespace Edu.WebApi.Controllers.Course
return ApiResult.Success(data: result); return ApiResult.Success(data: result);
} }
#endregion #endregion
#region 上课反馈
#endregion
} }
} }
...@@ -136,6 +136,8 @@ namespace Edu.WebApi.Controllers.Exam ...@@ -136,6 +136,8 @@ namespace Edu.WebApi.Controllers.Exam
PaperType = base.ParmJObj.GetInt("PaperType"), PaperType = base.ParmJObj.GetInt("PaperType"),
ParentId = base.ParmJObj.GetInt("ParentId"), ParentId = base.ParmJObj.GetInt("ParentId"),
IsOpen = base.ParmJObj.GetInt("IsOpen"), IsOpen = base.ParmJObj.GetInt("IsOpen"),
GroupType=(ExamGroupTypeEnum)base.ParmJObj.GetInt("GroupType"),
PaperScore=base.ParmJObj.GetDecimal("PaperScore"),
}; };
if (string.IsNullOrEmpty(extModel.PaperName)) if (string.IsNullOrEmpty(extModel.PaperName))
{ {
...@@ -157,12 +159,23 @@ namespace Edu.WebApi.Controllers.Exam ...@@ -157,12 +159,23 @@ namespace Edu.WebApi.Controllers.Exam
GId = jobj.GetInt("GId"), GId = jobj.GetInt("GId"),
PaperId = jobj.GetInt("PaperId"), PaperId = jobj.GetInt("PaperId"),
GroupName = jobj.GetStringValue("GroupName"), GroupName = jobj.GetStringValue("GroupName"),
QuestionTypeId = jobj.GetInt("QuestionTypeId"),
QuestionTypeKey = jobj.GetStringValue("QuestionTypeKey"),
GSortNum = gSortNum, GSortNum = gSortNum,
GScore = jobj.GetDecimal("GScore"), GScore = jobj.GetDecimal("GScore"),
DetailsList = new List<RB_Examination_Details_ViewModel>(), DetailsList = new List<RB_Examination_Details_ViewModel>(),
GroupType=extModel.GroupType,
}; };
if (extModel.GroupType == ExamGroupTypeEnum.QuestionType)
{
gModel.QuestionTypeId = jobj.GetInt("QuestionTypeId");
gModel.QuestionTypeKey = jobj.GetStringValue("QuestionTypeKey");
gModel.CategoryId = 0;
}
else if (extModel.GroupType == ExamGroupTypeEnum.QuestionClassify)
{
gModel.QuestionTypeId = 0;
gModel.QuestionTypeKey = "";
gModel.CategoryId = (QuestionCategoryEnum)jobj.GetInt("QuestionTypeId");
}
gSortNum++; gSortNum++;
string details = jobj.GetStringValue("DetailsList"); string details = jobj.GetStringValue("DetailsList");
if (!string.IsNullOrEmpty(details)) if (!string.IsNullOrEmpty(details))
...@@ -202,7 +215,7 @@ namespace Edu.WebApi.Controllers.Exam ...@@ -202,7 +215,7 @@ namespace Edu.WebApi.Controllers.Exam
string msg = analysisQuestion.CheckQuestion(detailModel.QuestionTypeKey, detailModel.QuestionContent, detailModel.Answer, out string newAnswer); string msg = analysisQuestion.CheckQuestion(detailModel.QuestionTypeKey, detailModel.QuestionContent, detailModel.Answer, out string newAnswer);
if (!string.IsNullOrEmpty(msg)) if (!string.IsNullOrEmpty(msg))
{ {
return ApiResult.Failed(message: msg); return ApiResult.Failed(message: "【" + gModel.GroupName + "," + (dSortNum) + "题】" + msg);
} }
else else
{ {
...@@ -245,6 +258,7 @@ namespace Edu.WebApi.Controllers.Exam ...@@ -245,6 +258,7 @@ namespace Edu.WebApi.Controllers.Exam
IsSaveTemplate = base.ParmJObj.GetBoolValue("IsSaveTemplate"), IsSaveTemplate = base.ParmJObj.GetBoolValue("IsSaveTemplate"),
ParentId = base.ParmJObj.GetInt("ParentId"), ParentId = base.ParmJObj.GetInt("ParentId"),
IsOpen = base.ParmJObj.GetInt("IsOpen"), IsOpen = base.ParmJObj.GetInt("IsOpen"),
GroupType=(ExamGroupTypeEnum)base.ParmJObj.GetInt("GroupType"),
}; };
string TemplateData = base.ParmJObj.GetStringValue("TemplateData"); string TemplateData = base.ParmJObj.GetStringValue("TemplateData");
if (!string.IsNullOrEmpty(TemplateData)) if (!string.IsNullOrEmpty(TemplateData))
...@@ -314,7 +328,9 @@ namespace Edu.WebApi.Controllers.Exam ...@@ -314,7 +328,9 @@ namespace Edu.WebApi.Controllers.Exam
TemplateDifficultyTypeName = item.TemplateDifficultyType.ToName(), TemplateDifficultyTypeName = item.TemplateDifficultyType.ToName(),
TemplateData = templist, TemplateData = templist,
item.TemplateBankIds, item.TemplateBankIds,
QuestionStructure = QuestionStructure.TrimStart(';') QuestionStructure = QuestionStructure.TrimStart(';'),
item.GroupType,
GroupTypeName=item.GroupType.ToName(),
}); });
} }
pageModel.Count = rowsCount; pageModel.Count = rowsCount;
......
...@@ -43,6 +43,8 @@ ...@@ -43,6 +43,8 @@
"JHTenantId": "15", "JHTenantId": "15",
"JHMallBaseId": "5", "JHMallBaseId": "5",
"JHMallUserOpenId": "oshxs5I-6uR1J91Rs3QVyi2rJIm4", "JHMallUserOpenId": "oshxs5I-6uR1J91Rs3QVyi2rJIm4",
"WeChatAccountAppId": "wx7c2cedaebbfca211",
"WeChatAccountAppSecret": "6fd676c7f599bc2783fab6ae6c7a12d4",
"Notice_BaseKey": "Notice_BaseKey", "Notice_BaseKey": "Notice_BaseKey",
"EducationContractSchool": "EducationContractSchool", "EducationContractSchool": "EducationContractSchool",
"EducationContractAdmin": "EducationContractAdmin", "EducationContractAdmin": "EducationContractAdmin",
......
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