Commit 4d42b7f5 authored by 黄奎's avatar 黄奎

页面修改

parent a43b8308
...@@ -14,5 +14,21 @@ namespace Edu.Model.ViewModel.Exam ...@@ -14,5 +14,21 @@ namespace Edu.Model.ViewModel.Exam
/// 单词考试详情 /// 单词考试详情
/// </summary> /// </summary>
public List<RB_StuWords_ExamDetail_Extend> ExamDetailList { get; set; } public List<RB_StuWords_ExamDetail_Extend> ExamDetailList { get; set; }
/// <summary>
/// 学习分钟数
/// </summary>
public string ExamMinutes
{
get
{
string str = "";
if (this.ExamStartTime != null && this.ExamEndTime != null)
{
str = Common.ConvertHelper.CalcMinutes(Convert.ToDateTime(this.ExamStartTime), Convert.ToDateTime(this.ExamEndTime)).ToString();
}
return str;
}
}
} }
} }
...@@ -198,7 +198,9 @@ namespace Edu.Module.Exam ...@@ -198,7 +198,9 @@ namespace Edu.Module.Exam
var cItem = tempList[i]; var cItem = tempList[i];
options.Add(new optionItem() options.Add(new optionItem()
{ {
Content = !string.IsNullOrEmpty(cItem.WordContent) ? cItem.WordContent : (totalList?.FirstOrDefault(qitem => !string.IsNullOrEmpty(qitem.WordContent))?.WordContent ?? ""), Content = !string.IsNullOrEmpty(cItem.WordContent)
? cItem.WordContent
: (totalList?.FirstOrDefault(qitem => qitem.Id != item.Id &&!string.IsNullOrEmpty(qitem.WordContent))?.WordContent ?? ""),
IsAnswer = false, IsAnswer = false,
Name = "", Name = "",
ShowName = "", ShowName = "",
...@@ -223,7 +225,9 @@ namespace Edu.Module.Exam ...@@ -223,7 +225,9 @@ namespace Edu.Module.Exam
var cItem = tempList[i]; var cItem = tempList[i];
options.Add(new optionItem() options.Add(new optionItem()
{ {
Content = !string.IsNullOrEmpty(cItem.WordContent) ? cItem.WordContent : (totalList?.FirstOrDefault(qitem => !string.IsNullOrEmpty(qitem.WordContent))?.WordContent ?? ""), Content = !string.IsNullOrEmpty(cItem.WordContent)
? cItem.WordContent :
(totalList?.FirstOrDefault(qitem => qitem.Id != item.Id&&!string.IsNullOrEmpty(qitem.WordContent))?.WordContent ?? ""),
IsAnswer = false, IsAnswer = false,
Name = "", Name = "",
ShowName = "", ShowName = "",
...@@ -252,7 +256,9 @@ namespace Edu.Module.Exam ...@@ -252,7 +256,9 @@ namespace Edu.Module.Exam
var cItem = tempList[i]; var cItem = tempList[i];
options.Add(new optionItem() options.Add(new optionItem()
{ {
Content = !string.IsNullOrEmpty(cItem.WordWrite) ? cItem.WordWrite : (totalList?.FirstOrDefault(qitem => !string.IsNullOrEmpty(qitem.WordWrite))?.WordWrite ?? ""), Content = !string.IsNullOrEmpty(cItem.WordWrite)
? cItem.WordWrite
:(totalList?.FirstOrDefault(qitem => qitem.Id != item.Id &&!string.IsNullOrEmpty(qitem.WordWrite))?.WordWrite ?? ""),
IsAnswer = false, IsAnswer = false,
Name = "", Name = "",
ShowName = "", ShowName = "",
...@@ -299,6 +305,13 @@ namespace Edu.Module.Exam ...@@ -299,6 +305,13 @@ namespace Edu.Module.Exam
return singleObj; return singleObj;
} }
/// <summary>
/// 生成默认的选择题
/// </summary>
/// <param name="item"></param>
/// <param name="totalList"></param>
/// <param name="options"></param>
/// <returns></returns>
public string CreateDefaultQuestion(RB_Course_Words_Extend item, List<RB_Course_Words_Extend> totalList, List<optionItem> options) public string CreateDefaultQuestion(RB_Course_Words_Extend item, List<RB_Course_Words_Extend> totalList, List<optionItem> options)
{ {
string title = string.Format("请选择【{0}】单词的正确中文意思.", item.WordContent); string title = string.Format("请选择【{0}】单词的正确中文意思.", item.WordContent);
...@@ -314,7 +327,8 @@ namespace Edu.Module.Exam ...@@ -314,7 +327,8 @@ namespace Edu.Module.Exam
var cItem = totalList[i]; var cItem = totalList[i];
options.Add(new optionItem() options.Add(new optionItem()
{ {
Content = !string.IsNullOrEmpty(cItem.ChineseMean) ? cItem.ChineseMean : (totalList?.FirstOrDefault(qitem => !string.IsNullOrEmpty(qitem.ChineseMean))?.ChineseMean ?? ""), Content = !string.IsNullOrEmpty(cItem.ChineseMean) ? cItem.ChineseMean :
(totalList?.FirstOrDefault(qitem =>qitem.Id!=item.Id && !string.IsNullOrEmpty(qitem.ChineseMean))?.ChineseMean ?? ""),
IsAnswer = false, IsAnswer = false,
Name = "", Name = "",
ShowName = "", ShowName = "",
...@@ -478,11 +492,11 @@ namespace Edu.Module.Exam ...@@ -478,11 +492,11 @@ namespace Edu.Module.Exam
{ {
score = 1; score = 1;
} }
if (progress > 33 && progress < 70) if (progress > 34 && progress < 66)
{ {
score = 2; score = 2;
} }
if (progress >= 70) if (progress >= 66)
{ {
score = 3; score = 3;
} }
......
...@@ -154,7 +154,12 @@ namespace Edu.WebApi.Controllers.Applet ...@@ -154,7 +154,12 @@ namespace Edu.WebApi.Controllers.Applet
} }
var flag = courseExamModule.SubmitStuWordsExamModule(model); var flag = courseExamModule.SubmitStuWordsExamModule(model);
return flag ? ApiResult.Success(data: model) : ApiResult.Failed(); return flag ? ApiResult.Success(data: new
{
model.Id,
model.Score,
model.ExamMinutes
}) : ApiResult.Failed();
} }
} }
} }
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