|
|
@ -9,6 +9,8 @@ using Tiobon.Core.Model; |
|
|
|
using Newtonsoft.Json; |
|
|
|
using Newtonsoft.Json; |
|
|
|
using System.Text.RegularExpressions; |
|
|
|
using System.Text.RegularExpressions; |
|
|
|
using System.Net; |
|
|
|
using System.Net; |
|
|
|
|
|
|
|
using Tiobon.Core.Common.Helper; |
|
|
|
|
|
|
|
using AgileObjects.AgileMapper.Extensions; |
|
|
|
|
|
|
|
|
|
|
|
namespace Tiobon.Core.Services; |
|
|
|
namespace Tiobon.Core.Services; |
|
|
|
|
|
|
|
|
|
|
@ -155,12 +157,16 @@ public class Ghre_ExamRecordServices : BaseServices<Ghre_ExamRecord, Ghre_ExamRe |
|
|
|
|
|
|
|
|
|
|
|
//return await QueryFilterPage(body, $"ExamId='{examId}'"); |
|
|
|
//return await QueryFilterPage(body, $"ExamId='{examId}'"); |
|
|
|
} |
|
|
|
} |
|
|
|
public async Task<ServiceResult<Ghre_ExamRecordExtend>> ExtendAsync(string examRecordId) |
|
|
|
public async Task<ServiceResult<Ghre_ExamRecordExtend>> ExtendAsync(long examRecordId) |
|
|
|
{ |
|
|
|
{ |
|
|
|
var extend = new Ghre_ExamRecordExtend(); |
|
|
|
var extend = new Ghre_ExamRecordExtend(); |
|
|
|
var entity = await QuerySingle(examRecordId); |
|
|
|
var record = await QuerySingle(x => x.Id == examRecordId); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var details = await Db.Queryable<Ghre_ExamRecordDetail>().OrderBy(x => x.TaxisNo).Where(x => x.ExamRecordId == record.Id).ToListAsync(); |
|
|
|
|
|
|
|
await ExamHelper.SystemMarkAsync(Db, record, details); |
|
|
|
|
|
|
|
|
|
|
|
var exampaper = await Db.Queryable<Ghre_ExamPaper>().FirstAsync(x => x.Id == entity.ExamPaperId); |
|
|
|
|
|
|
|
|
|
|
|
var exampaper = await Db.Queryable<Ghre_ExamPaper>().FirstAsync(x => x.Id == record.ExamPaperId); |
|
|
|
var baseData = new DefaultGhre_ExamPaperBaseData(); |
|
|
|
var baseData = new DefaultGhre_ExamPaperBaseData(); |
|
|
|
baseData.PaperNo = exampaper.PaperNo; |
|
|
|
baseData.PaperNo = exampaper.PaperNo; |
|
|
|
baseData.PaperName = exampaper.PaperName; |
|
|
|
baseData.PaperName = exampaper.PaperName; |
|
|
@ -187,7 +193,9 @@ public class Ghre_ExamRecordServices : BaseServices<Ghre_ExamRecord, Ghre_ExamRe |
|
|
|
ConfigId = x.ConfigId, |
|
|
|
ConfigId = x.ConfigId, |
|
|
|
parentId = x.ConfigId, |
|
|
|
parentId = x.ConfigId, |
|
|
|
QuestionId = x.QuestionId.Value, |
|
|
|
QuestionId = x.QuestionId.Value, |
|
|
|
ExamPaperId = x.ExamPaperId |
|
|
|
ExamPaperId = x.ExamPaperId, |
|
|
|
|
|
|
|
Score = x.Score, |
|
|
|
|
|
|
|
RealScore = details.Where(m => m.QuestionId == x.QuestionId).Sum(m => (m.Score ?? 0) + (m.AdjustScore ?? 0)) |
|
|
|
}).ToList(); |
|
|
|
}).ToList(); |
|
|
|
|
|
|
|
|
|
|
|
var questionIds = previews.Select(x => x.QuestionId).Distinct().ToList(); |
|
|
|
var questionIds = previews.Select(x => x.QuestionId).Distinct().ToList(); |
|
|
@ -202,7 +210,6 @@ public class Ghre_ExamRecordServices : BaseServices<Ghre_ExamRecord, Ghre_ExamRe |
|
|
|
x.QuestionContent = questions1.FirstOrDefault(a => a.Id == x.QuestionId)?.QuestionContent; |
|
|
|
x.QuestionContent = questions1.FirstOrDefault(a => a.Id == x.QuestionId)?.QuestionContent; |
|
|
|
if (!string.IsNullOrEmpty(x.QuestionContent)) |
|
|
|
if (!string.IsNullOrEmpty(x.QuestionContent)) |
|
|
|
x.QuestionContent = WebUtility.HtmlDecode(x.QuestionContent); |
|
|
|
x.QuestionContent = WebUtility.HtmlDecode(x.QuestionContent); |
|
|
|
|
|
|
|
|
|
|
|
var detail = new FromGhre_QuestionQuestionTypeDetail(); |
|
|
|
var detail = new FromGhre_QuestionQuestionTypeDetail(); |
|
|
|
detail.content = x.QuestionContent; |
|
|
|
detail.content = x.QuestionContent; |
|
|
|
detail.difficulty = questions1.FirstOrDefault(a => a.Id == x.QuestionId)?.DifficultyLevel; |
|
|
|
detail.difficulty = questions1.FirstOrDefault(a => a.Id == x.QuestionId)?.DifficultyLevel; |
|
|
@ -218,9 +225,35 @@ public class Ghre_ExamRecordServices : BaseServices<Ghre_ExamRecord, Ghre_ExamRe |
|
|
|
}).ToList(); |
|
|
|
}).ToList(); |
|
|
|
|
|
|
|
|
|
|
|
x.detail = detail; |
|
|
|
x.detail = detail; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
switch (x.QuestionType) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
case "Completion": |
|
|
|
|
|
|
|
case "ShortAnswer": |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var answerIds1 = details.Where(m => m.QuestionId == x.QuestionId && m.QuestionAnswerId == null).Select(m => m.AnswerContent).ToList(); |
|
|
|
|
|
|
|
answerIds1.ForEach(m => |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
x.value1.Add(m); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
x.value = x.value1.First(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
default: |
|
|
|
|
|
|
|
var answerIds = details.Where(m => m.QuestionId == x.QuestionId && m.QuestionAnswerId != null).Select(m => m.QuestionAnswerId).ToList(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
answers1.Where(m => answerIds.Contains(m.Id)).ForEach(m => |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
x.value1.Add(m.QuestionNo); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
x.value = x.value1.First(); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
extend.previewList = previews; |
|
|
|
extend.questionList = previews; |
|
|
|
|
|
|
|
|
|
|
|
return ServiceResult<Ghre_ExamRecordExtend>.OprateSuccess("查询成功!", extend); |
|
|
|
return ServiceResult<Ghre_ExamRecordExtend>.OprateSuccess("查询成功!", extend); |
|
|
|
} |
|
|
|
} |
|
|
|