Commit d1c0612d authored by 黄奎's avatar 黄奎

页面修改

parent b3bffeb0
...@@ -121,18 +121,18 @@ namespace Edu.Common.Data ...@@ -121,18 +121,18 @@ namespace Edu.Common.Data
{ {
if (rootItem.QuestionList != null && rootItem.QuestionList.Count > 0) if (rootItem.QuestionList != null && rootItem.QuestionList.Count > 0)
{ {
if (rootItem.BigTitle == "阅读理解") if (rootItem.BigTitle == "阅读选择")
{ {
foreach (var item in rootItem.QuestionList) foreach (var item in rootItem.QuestionList)
{ {
if(!string.IsNullOrEmpty(item)) if(!string.IsNullOrEmpty(item))
{ {
string readStr = item.Replace("阅读理解", "").Trim(); string readStr = item.Replace("阅读选择", "").Trim();
if (!string.IsNullOrEmpty(readStr)) if (!string.IsNullOrEmpty(readStr))
{ {
ImportModel model = new ImportModel ImportModel model = new ImportModel
{ {
Category = rootItem.BigTitle, Category = rootItem.BigTitle.Trim(),
SubQuestionList = new List<ImportModel>(), SubQuestionList = new List<ImportModel>(),
QuestionTypeName= "阅读理解" QuestionTypeName= "阅读理解"
}; };
...@@ -148,7 +148,7 @@ namespace Edu.Common.Data ...@@ -148,7 +148,7 @@ namespace Edu.Common.Data
{ {
ImportModel model = new ImportModel() ImportModel model = new ImportModel()
{ {
Category = rootItem.BigTitle Category = rootItem.BigTitle.Trim()
}; };
if (!string.IsNullOrEmpty(item)) if (!string.IsNullOrEmpty(item))
{ {
...@@ -541,7 +541,7 @@ namespace Edu.Common.Data ...@@ -541,7 +541,7 @@ namespace Edu.Common.Data
ImportModel subQuestion = new ImportModel(); ImportModel subQuestion = new ImportModel();
AnalysisQuestionTitle(item, subQuestion); AnalysisQuestionTitle(item, subQuestion);
model.SubQuestionList.Add(subQuestion); model.SubQuestionList.Add(subQuestion);
model.AnswerAnalysis += (index) + "、" + subQuestion.AnswerAnalysis; model.AnswerAnalysis += "<p>"+(index) + "、" + subQuestion.AnswerAnalysis+"</p>";
} }
index++; index++;
} }
......
...@@ -15,32 +15,51 @@ namespace Edu.Common.Enum.Course ...@@ -15,32 +15,51 @@ namespace Edu.Common.Enum.Course
/// </summary> /// </summary>
[EnumField("默认")] [EnumField("默认")]
Default = 0, Default = 0,
/// <summary> /// <读音选择题>
/// 日语选择题 /// 日语选择题
/// </summary> /// </summary>
[EnumField("日语选择题")] [EnumField("读音选择题")]
JapaneseChoose = 1, JapaneseSoundChoose = 1,
/// <summary> /// <summary>
/// 中文选择题 /// 汉字选择题
/// </summary> /// </summary>
[EnumField("中文选择题")] [EnumField("汉字选择题")]
ChineseChoose = 2, ChineseChoose = 2,
/// <summary> /// <summary>
/// 阅读理解 /// 选择最适当的单词
/// </summary>
[EnumField("选择最适当的单词")]
ChooseWord = 3,
/// <summary>
/// 选择意义最接近的单词
/// </summary> /// </summary>
[EnumField("阅读理解")] [EnumField("选择意义最接近的单词")]
ReadingComprehensio = 3, ChooseMean = 4,
/// <summary> /// <summary>
/// 文字词汇 /// 选择单词正确用法
/// </summary> /// </summary>
[EnumField("文字词汇")] [EnumField("选择单词正确用法")]
WordVocabulary = 4, ChooseWordUse =5,
/// <summary> /// <summary>
/// /// 选择单词正确用
/// </summary> /// </summary>
[EnumField("语法")] [EnumField("选择语法正确的一项")]
Grammar =5 ChooseGrammarUse = 6,
/// <summary>
/// 选择★应该填入的词
/// </summary>
[EnumField("选择★应该填入的词")]
ChooseFillInWord = 7,
/// <summary>
/// 阅读选择
/// </summary>
[EnumField("阅读选择")]
ReadingChoose = 8,
} }
} }
\ No newline at end of file
...@@ -80,5 +80,10 @@ namespace Edu.Model.ViewModel.Question ...@@ -80,5 +80,10 @@ namespace Edu.Model.ViewModel.Question
return Common.Plugin.EnumHelper.ToName(this.Category); return Common.Plugin.EnumHelper.ToName(this.Category);
} }
} }
/// <summary>
/// 分类编号
/// </summary>
public string QCategoryId { get; set; }
} }
} }
\ No newline at end of file
...@@ -85,6 +85,10 @@ WHERE 1=1 "); ...@@ -85,6 +85,10 @@ WHERE 1=1 ");
{ {
builder.AppendFormat(" AND A.{0} IN({1}) ", nameof(RB_Question_ViewModel.DifficultyType), query.QDifficultyType); builder.AppendFormat(" AND A.{0} IN({1}) ", nameof(RB_Question_ViewModel.DifficultyType), query.QDifficultyType);
} }
if (!string.IsNullOrEmpty(query.QCategoryId))
{
builder.AppendFormat(" AND A.{0} IN({1}) ", nameof(RB_Question_ViewModel.Category), query.QCategoryId);
}
builder.AppendFormat(" ORDER BY A.{0} DESC ", nameof(RB_Question_ViewModel.QuestionId)); builder.AppendFormat(" ORDER BY A.{0} DESC ", nameof(RB_Question_ViewModel.QuestionId));
return GetPage<RB_Question_ViewModel>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList(); return GetPage<RB_Question_ViewModel>(pageIndex, pageSize, out rowsCount, builder.ToString(), parameters).ToList();
} }
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
<ProjectReference Include="..\Edu.Module.User\Edu.Module.User.csproj" /> <ProjectReference Include="..\Edu.Module.User\Edu.Module.User.csproj" />
<ProjectReference Include="..\Edu.Repository\Edu.Repository.csproj" /> <ProjectReference Include="..\Edu.Repository\Edu.Repository.csproj" />
<ProjectReference Include="..\Edu.ThirdCore\Edu.ThirdCore.csproj" /> <ProjectReference Include="..\Edu.ThirdCore\Edu.ThirdCore.csproj" />
<ProjectReference Include="..\Edu.WebApi\Edu.WebApi.csproj" />
</ItemGroup> </ItemGroup>
</Project> </Project>
using System; using Edu.WebApi.Controllers.Course;
using System;
namespace Edu.Test namespace Edu.Test
{ {
...@@ -7,14 +8,12 @@ namespace Edu.Test ...@@ -7,14 +8,12 @@ namespace Edu.Test
static void Main(string[] args) static void Main(string[] args)
{ {
string filePath = ""; string filePath = "";
filePath = @"C:/Users/qiaoyajun/Desktop/源模板.docx"; filePath = @"C:/Users/qiaoyajun/Desktop/EduWordTemplate.doc";
//filePath = @"C:/Users/qiaoyajun/Desktop/EduWordTemplate.doc"; //filePath = @"C:/Users/qiaoyajun/Desktop/EduWordTemplate.doc";
var data = Common.Data.QuestionHelper.GetWordQuestionData(filePath); //var data = Common.Data.QuestionHelper.GetWordQuestionData(filePath);
Console.WriteLine(Common.Plugin.JsonHelper.Serialize(data)); var data2= new QuestionController().ImportWordQuestion(filePath, 1, 1);
if (data != null && data.Count > 0) Console.WriteLine(Common.Plugin.JsonHelper.Serialize(data2));
{
Console.WriteLine("总共:" + data.Count);
}
} }
} }
} }
...@@ -76,6 +76,18 @@ namespace Edu.WebApi.Controllers.Course ...@@ -76,6 +76,18 @@ namespace Edu.WebApi.Controllers.Course
} }
catch catch
{ {
}
try
{
var categoryList = Common.Plugin.JsonHelper.DeserializeObject<List<int>>(base.ParmJObj.GetStringValue("QCategoryId"));
if (categoryList != null && categoryList.Count > 0)
{
query.QCategoryId = string.Join(",", categoryList);
}
}
catch
{
} }
var list = questionModule.GetQuestionPageListModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query); var list = questionModule.GetQuestionPageListModule(pageModel.PageIndex, pageModel.PageSize, out long rowsCount, query);
List<object> resultList = new List<object>(); List<object> resultList = new List<object>();
...@@ -753,20 +765,29 @@ namespace Edu.WebApi.Controllers.Course ...@@ -753,20 +765,29 @@ namespace Edu.WebApi.Controllers.Course
{ {
switch (item.Category) switch (item.Category)
{ {
case "日语选择题": case "读音选择题":
Category = QuestionCategoryEnum.JapaneseChoose; Category = QuestionCategoryEnum.JapaneseSoundChoose;
break; break;
case "中文选择题": case "汉字选择题":
Category = QuestionCategoryEnum.ChineseChoose; Category = QuestionCategoryEnum.ChineseChoose;
break; break;
case "阅读理解": case "选择最适当的单词":
Category = QuestionCategoryEnum.ReadingComprehensio; Category = QuestionCategoryEnum.ChooseWord;
break;
case "选择意义最接近的单词":
Category = QuestionCategoryEnum.ChooseMean;
break;
case "选择单词正确用法":
Category = QuestionCategoryEnum.ChooseWordUse;
break;
case "选择语法正确的一项":
Category = QuestionCategoryEnum.ChooseGrammarUse;
break; break;
case "文字词汇": case "选择★应该填入的词":
Category = QuestionCategoryEnum.WordVocabulary; Category = QuestionCategoryEnum.ChooseFillInWord;
break; break;
case "语法": case "阅读选择":
Category = QuestionCategoryEnum.Grammar; Category = QuestionCategoryEnum.ReadingChoose;
break; break;
} }
} }
......
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