Commit 5434c5d8 authored by 黄奎's avatar 黄奎

页面修改

parent 6607a38b
...@@ -35,5 +35,10 @@ namespace Edu.Model.Entity.Question ...@@ -35,5 +35,10 @@ namespace Edu.Model.Entity.Question
/// 删除状态 /// 删除状态
/// </summary> /// </summary>
public DateStateEnum Status { get; set; } public DateStateEnum Status { get; set; }
/// <summary>
/// JSON配置
/// </summary>
public string JsonConfig { get; set; }
} }
} }
...@@ -47,31 +47,4 @@ namespace Edu.Model.ViewModel.Question ...@@ -47,31 +47,4 @@ namespace Edu.Model.ViewModel.Question
public bool IsAnswer { get; set; } public bool IsAnswer { get; set; }
} }
/// <summary>
/// 单选题
/// </summary>
public class singleQuestion
{
/// <summary>
/// 题目名称
/// </summary>
public string Title { get; set; }
/// <summary>
/// 答案解析
/// </summary>
public string AnswerAnalysis { get; set; }
/// <summary>
/// 选项列表
/// </summary>
public List<optionItem> AnswerOptionList { get; set; }
/// <summary>
/// 难易程度
/// </summary>
public DifficultyTypeEnum EasyType { get; set; }
}
} }
\ No newline at end of file
...@@ -53,5 +53,10 @@ namespace Edu.Model.ViewModel.Question ...@@ -53,5 +53,10 @@ namespace Edu.Model.ViewModel.Question
/// </summary> /// </summary>
public string QDifficultyType { get; set; } public string QDifficultyType { get; set; }
/// <summary>
/// 选项
/// </summary>
public object AnswerObj { get; set; }
} }
} }
\ No newline at end of file
using Edu.Model.ViewModel.Question;
using System;
using System.Collections.Generic;
using System.Text;
namespace Edu.Module.Question
{
/// <summary>
/// 解析问题
/// </summary>
public class AnalysisQuestionTypeModule
{
/// <summary>
/// 问题解析
/// </summary>
/// <param name="key"></param>
/// <param name="data"></param>
/// <returns></returns>
public object ParsingQuestion(string key, string data)
{
var obj = new object();
switch (key)
{
//单选题
case "single":
obj = Common.Plugin.JsonHelper.DeserializeObject<List<optionItem>>(data);
break;
//多选题
case "multiple":
obj = Common.Plugin.JsonHelper.DeserializeObject<List<optionItem>>(data);
break;
}
return obj;
}
}
}
...@@ -29,6 +29,11 @@ namespace Edu.Module.Question ...@@ -29,6 +29,11 @@ namespace Edu.Module.Question
/// </summary> /// </summary>
private readonly RB_Question_PointRepository question_PointRepository = new RB_Question_PointRepository(); private readonly RB_Question_PointRepository question_PointRepository = new RB_Question_PointRepository();
/// <summary>
/// 问题解析处理类
/// </summary>
private readonly AnalysisQuestionTypeModule analysisQuestion = new AnalysisQuestionTypeModule();
/// <summary> /// <summary>
/// 获取题目类型列表 /// 获取题目类型列表
/// </summary> /// </summary>
...@@ -143,9 +148,16 @@ namespace Edu.Module.Question ...@@ -143,9 +148,16 @@ namespace Edu.Module.Question
/// <returns></returns> /// <returns></returns>
public RB_Question_ViewModel GetQuestionModule(object QuestionId) public RB_Question_ViewModel GetQuestionModule(object QuestionId)
{ {
return questionRepository.GetEntity<RB_Question_ViewModel>(QuestionId); var extModel = questionRepository.GetEntity<RB_Question_ViewModel>(QuestionId);
if (extModel != null)
{
extModel.AnswerObj = analysisQuestion.ParsingQuestion(extModel.QuestionTypeKey, extModel.Answer);
}
return extModel;
} }
/// <summary> /// <summary>
/// 获取问题知识点列表 /// 获取问题知识点列表
/// </summary> /// </summary>
......
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