获取考试记录明细扩展接口

master
xiaochanghai 12 months ago
parent bd8da3bcf4
commit 1f6026e98c
  1. 1249
      Model/Tiobon.Web.pdm
  2. 2
      Tiobon.Core.Api/Controllers/Ghre/Ghre_ExamRecordController.cs
  3. 46
      Tiobon.Core.Api/Tiobon.Core.Model.xml
  4. 7
      Tiobon.Core.Api/Tiobon.Core.xml
  5. 90
      Tiobon.Core.Common/Helper/ExamHelper.cs
  6. 1
      Tiobon.Core.Common/Tiobon.Core.Common.csproj
  7. 2
      Tiobon.Core.IServices/Ghre/IGhre_ExamRecordServices.cs
  8. 27
      Tiobon.Core.Model/Base/Ghre/Ghre_ExamRecordDetail.Dto.Base.cs
  9. 27
      Tiobon.Core.Model/Models/Ghre/Ghre_ExamRecordDetail.cs
  10. 2
      Tiobon.Core.Model/View/Ghre/Ghre_ExamRecordDetail.Dto.View.cs
  11. 6
      Tiobon.Core.Model/ViewModels/Extend/DefaultGhre_ExamPaperInput.cs
  12. 6
      Tiobon.Core.Services/BASE/BaseServices.cs
  13. 7
      Tiobon.Core.Services/Ghre/Ghre_ExamPaperServices.cs
  14. 45
      Tiobon.Core.Services/Ghre/Ghre_ExamRecordServices.cs
  15. 100
      Tiobon.Core.Services/Ghre/Ghre_ExamServices.cs
  16. 46
      Tiobon.Core/Tiobon.Core.Model.xml
  17. 7
      Tiobon.Core/Tiobon.Core.xml

File diff suppressed because it is too large Load Diff

@ -40,7 +40,7 @@ public class Ghre_ExamRecordController : BaseController<IGhre_ExamRecordServices
/// <param name="examRecordId"></param>
/// <returns></returns>
[HttpPost("QueryExtend/{examRecordId}")]
public async Task<ServiceResult<Ghre_ExamRecordExtend>> ExtendAsync(string examRecordId)
public async Task<ServiceResult<Ghre_ExamRecordExtend>> ExtendAsync(long examRecordId)
{
return await _service.ExtendAsync(examRecordId);
}

@ -2425,14 +2425,19 @@
Ghre_ExamRecordDetail (Dto.Base)
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecordDetailBase.ExamRecordId">
<summary>
答题记录ID
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecordDetailBase.ExamPaperId">
<summary>
试卷ID
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecordDetailBase.ExamRecordId">
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecordDetailBase.ExamPaperQuestionId">
<summary>
答题记录ID
试卷题目ID
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecordDetailBase.QuestionId">
@ -2440,9 +2445,9 @@
题目ID
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecordDetailBase.UserId">
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecordDetailBase.StaffId">
<summary>
用户ID
员工ID
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecordDetailBase.QuestionAnswerId">
@ -2465,6 +2470,16 @@
调整得分
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecordDetailBase.IsCorrect">
<summary>
是否正确
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecordDetailBase.TaxisNo">
<summary>
排序号
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecordDetailBase.RemarkSz">
<summary>
备注
@ -6906,14 +6921,19 @@
Ghre_ExamRecordDetail (Model)
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecordDetail.ExamRecordId">
<summary>
答题记录ID
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecordDetail.ExamPaperId">
<summary>
试卷ID
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecordDetail.ExamRecordId">
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecordDetail.ExamPaperQuestionId">
<summary>
答题记录ID
试卷题目ID
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecordDetail.QuestionId">
@ -6921,9 +6941,9 @@
题目ID
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecordDetail.UserId">
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecordDetail.StaffId">
<summary>
用户ID
员工ID
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecordDetail.QuestionAnswerId">
@ -6946,6 +6966,16 @@
调整得分
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecordDetail.IsCorrect">
<summary>
是否正确
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecordDetail.TaxisNo">
<summary>
排序号
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecordDetail.RemarkSz">
<summary>
备注

@ -784,6 +784,13 @@
<param name="body">条件</param>
<returns></returns>
</member>
<member name="M:Tiobon.Core.Api.Controllers.Ghre_ExamRecordController.ExtendAsync(System.Int64)">
<summary>
获取考试记录明细扩展接口
</summary>
<param name="examRecordId"></param>
<returns></returns>
</member>
<member name="T:Tiobon.Core.Api.Controllers.Ghre_ExamRecordDetailController">
<summary>
Ghre_ExamRecordDetail(Controller)

@ -0,0 +1,90 @@
using SqlSugar;
using Tiobon.Core.Model.Models;
namespace Tiobon.Core.Common.Helper;
public class ExamHelper
{
public static async Task SystemMarkAsync(ISqlSugarClient Db, Ghre_ExamRecord record, List<Ghre_ExamRecordDetail> details)
{
var questionIds = details.Where(x => x.QuestionId != null).Select(m => m.QuestionId).Distinct().ToList();
var exampaperQuestions = await Db.Queryable<Ghre_ExamPaperQuestion>().Where(x => x.ExamPaperId == record.ExamPaperId).ToListAsync();
var questions = await Db.Queryable<Ghre_Question>().Where(x => questionIds.Contains(x.Id)).ToListAsync();
var answers = await Db.Queryable<Ghre_QuestionAnswer>().Where(x => x.QuestionId != null && questionIds.Contains(x.QuestionId.Value) && x.IsCorrect == true).ToListAsync();
decimal? score = 0;
var detailGroups = details.GroupBy(m => m.QuestionId)
.Select(m => new
{
m.FirstOrDefault()?.QuestionId,
List = m.OrderBy(x => x.TaxisNo).ToList()
})
.ToList();
detailGroups.ForEach(group =>
{
var question = questions.FirstOrDefault(x => x.Id == group.QuestionId);
var detail = details.Where(x => x.QuestionId == group.QuestionId).First();
detail.IsCorrect = false;
detail.Score = 0;
switch (question.QuestionType)
{
case "Completion":
var completionAnswers = answers.OrderBy(x => x.TaxisNo).Where(x => x.QuestionId == group.QuestionId).ToList();
var contents = group.List.Select(x => x.AnswerContent).ToList();
var count = completionAnswers.Count;
if (contents.Count == count)
{
for (int i = 0; i < completionAnswers.Count; i++)
if (completionAnswers[i].AnswerContent == contents[i])
count--;
if (count == 0)
{
var exampaperQuestion = exampaperQuestions.FirstOrDefault(x => x.QuestionId == group.QuestionId);
score += exampaperQuestion.Score;
detail.Score = exampaperQuestion.Score;
detail.IsCorrect = true;
}
}
break;
case "ShortAnswer":
if (!string.IsNullOrWhiteSpace(group.List.First().AnswerContent))
{
var completionAnswers1 = answers.OrderBy(x => x.TaxisNo).Where(x => x.QuestionId == group.QuestionId).ToList();
var content = group.List.First().AnswerContent;
var count1 = completionAnswers1.Count;
for (int i = 0; i < completionAnswers1.Count; i++)
if (content.IndexOf(completionAnswers1[i].AnswerContent) > -1)
count1--;
if (count1 == 0)
{
var exampaperQuestion = exampaperQuestions.FirstOrDefault(x => x.QuestionId == group.QuestionId);
score += exampaperQuestion.Score;
detail.Score = exampaperQuestion.Score;
detail.IsCorrect = true;
}
}
break;
default:
var questionAnswerIds = group.List.Where(x => x.QuestionId != null).Select(m => m.QuestionAnswerId).ToList();
if (questionAnswerIds.Count == answers.Where(x => questionAnswerIds.Contains(x.Id)).Count())
{
var exampaperQuestion = exampaperQuestions.FirstOrDefault(x => x.QuestionId == group.QuestionId);
score += exampaperQuestion.Score;
detail.Score = exampaperQuestion.Score;
detail.IsCorrect = true;
}
break;
}
});
record.Score = score;
}
}

@ -17,6 +17,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="AgileObjects.AgileMapper" Version="1.8.1" />
<PackageReference Include="Dapper" Version="2.1.35" />
<PackageReference Include="Magicodes.IE.Excel" Version="2.7.4.5" />
<PackageReference Include="InitQ" Version="1.0.0.18" />

@ -14,6 +14,6 @@ namespace Tiobon.Core.IServices
Task<ServiceResult> ModifyAdjustScore(string examRecordId, EditGhre_ExamRecordInput edit);
Task<ServiceResult<Ghre_ExamRecordExtend>> ExtendAsync(string examRecordId);
Task<ServiceResult<Ghre_ExamRecordExtend>> ExtendAsync(long examRecordId);
}
}

@ -27,15 +27,20 @@ namespace Tiobon.Core.Model.Models
public class Ghre_ExamRecordDetailBase
{
/// <summary>
/// 答题记录ID
/// </summary>
public long? ExamRecordId { get; set; }
/// <summary>
/// 试卷ID
/// </summary>
public long? ExamPaperId { get; set; }
/// <summary>
/// 答题记录ID
/// 试卷题目ID
/// </summary>
public long? ExamRecordId { get; set; }
public long? ExamPaperQuestionId { get; set; }
/// <summary>
/// 题目ID
@ -43,19 +48,19 @@ namespace Tiobon.Core.Model.Models
public long? QuestionId { get; set; }
/// <summary>
/// 用户ID
/// 员工ID
/// </summary>
public long? UserId { get; set; }
public long? StaffId { get; set; }
/// <summary>
/// 题目答案ID
/// </summary>
public string QuestionAnswerId { get; set; }
public long? QuestionAnswerId { get; set; }
/// <summary>
/// 答案内容
/// </summary>
[Display(Name = "AnswerContent"), Description("答案内容"), MaxLength(32, ErrorMessage = "答案内容 不能超过 32 个字符")]
[Display(Name = "AnswerContent"), Description("答案内容"), MaxLength(256, ErrorMessage = "答案内容 不能超过 256 个字符")]
public string AnswerContent { get; set; }
/// <summary>
@ -70,6 +75,16 @@ namespace Tiobon.Core.Model.Models
[Display(Name = "AdjustScore"), Description("调整得分"), Column(TypeName = "decimal(20,2)")]
public decimal? AdjustScore { get; set; }
/// <summary>
/// 是否正确
/// </summary>
public bool? IsCorrect { get; set; }
/// <summary>
/// 排序号
/// </summary>
public bool? TaxisNo { get; set; }
/// <summary>
/// 备注
/// </summary>

@ -29,15 +29,20 @@ namespace Tiobon.Core.Model.Models
public class Ghre_ExamRecordDetail : BasePoco
{
/// <summary>
/// 答题记录ID
/// </summary>
public long? ExamRecordId { get; set; }
/// <summary>
/// 试卷ID
/// </summary>
public long? ExamPaperId { get; set; }
/// <summary>
/// 答题记录ID
/// 试卷题目ID
/// </summary>
public long? ExamRecordId { get; set; }
public long? ExamPaperQuestionId { get; set; }
/// <summary>
/// 题目ID
@ -45,19 +50,19 @@ namespace Tiobon.Core.Model.Models
public long? QuestionId { get; set; }
/// <summary>
/// 用户ID
/// 员工ID
/// </summary>
public long? UserId { get; set; }
public long? StaffId { get; set; }
/// <summary>
/// 题目答案ID
/// </summary>
public string QuestionAnswerId { get; set; }
public long? QuestionAnswerId { get; set; }
/// <summary>
/// 答案内容
/// </summary>
[Display(Name = "AnswerContent"), Description("答案内容"), MaxLength(32, ErrorMessage = "答案内容 不能超过 32 个字符")]
[Display(Name = "AnswerContent"), Description("答案内容"), MaxLength(256, ErrorMessage = "答案内容 不能超过 256 个字符")]
public string AnswerContent { get; set; }
/// <summary>
@ -72,6 +77,16 @@ namespace Tiobon.Core.Model.Models
[Display(Name = "AdjustScore"), Description("调整得分"), Column(TypeName = "decimal(20,2)")]
public decimal? AdjustScore { get; set; }
/// <summary>
/// 是否正确
/// </summary>
public bool? IsCorrect { get; set; }
/// <summary>
/// 排序号
/// </summary>
public bool? TaxisNo { get; set; }
/// <summary>
/// 备注
/// </summary>

@ -31,6 +31,4 @@ public class Ghre_ExamRecordDetailDto : Ghre_ExamRecordDetail
/// 修改信息
/// </summary>
public string UpdateDataInfo { get; set; }
public List<long> QuestionAnswerIds { get; set; }
}

@ -43,6 +43,7 @@ public class DefaultGhre_ExamPaperPageData
public string examPaperSetType { get; set; }
public List<Ghre_ExamPaperConfig> examPaperSetData { get; set; } = new List<Ghre_ExamPaperConfig> { };
public List<DefaultGhre_ExamPaperPreview> previewList { get; set; } = new List<DefaultGhre_ExamPaperPreview> { };
public List<DefaultGhre_ExamPaperPreview> questionList { get; set; } = new List<DefaultGhre_ExamPaperPreview> { };
}
public class DefaultGhre_ExamPaperBaseData : Ghre_ExamPaperBase
{
@ -84,6 +85,11 @@ public class DefaultGhre_ExamPaperPreview
/// </summary>
public long? ConfigId { get; set; }
public FromGhre_QuestionQuestionTypeDetail detail { get; set; } = new FromGhre_QuestionQuestionTypeDetail();
public decimal? Score { get; set; }
public decimal? RealScore { get; set; }
public string value { get; set; }
public List<string> value1 { get; set; } = new List<string> { };
}
public class InsertExamPaperConfigInput
{

@ -5,8 +5,6 @@ using AgileObjects.AgileMapper;
using Microsoft.AspNetCore.Http;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using OfficeOpenXml.Style;
using OfficeOpenXml;
using SqlSugar;
using Tiobon.Core.Common;
using Tiobon.Core.Common.Caches;
@ -21,12 +19,8 @@ using Tiobon.Core.IRepository.Base;
using Tiobon.Core.IServices.BASE;
using Tiobon.Core.Model;
using Tiobon.Core.Model.Models;
using SixLabors.ImageSharp;
using System.Reflection;
using Microsoft.EntityFrameworkCore.Metadata.Internal;
using System.Collections.Generic;
using System.Collections;
using Amazon.Runtime.Internal.Transform;
namespace Tiobon.Core.Services.BASE;

@ -688,10 +688,12 @@ public class Ghre_ExamPaperServices : BaseServices<Ghre_ExamPaper, Ghre_ExamPape
QuestionId = x.QuestionId,
ConfigId = x.parentId,
}).ToList();
int TaxisNo = 1;
questions.ForEach(x =>
{
x.Score = configs.FirstOrDefault(o => o.Id == x.ConfigId)?.Score;
x.TaxisNo = TaxisNo;
TaxisNo++;
});
await _ghre_ExamPaperQuestionServices.Add(questions);
@ -765,9 +767,12 @@ delete from Ghre_ExamPaperQuestion WHERE ExamPaperId='{id}';");
QuestionId = x.QuestionId,
ConfigId = x.parentId,
}).ToList();
int TaxisNo = 1;
questions.ForEach(x =>
{
x.Score = configs.FirstOrDefault(o => o.Id == x.ConfigId)?.Score;
x.TaxisNo = TaxisNo;
TaxisNo++;
});
await _ghre_ExamPaperQuestionServices.Add(questions);

@ -9,6 +9,8 @@ using Tiobon.Core.Model;
using Newtonsoft.Json;
using System.Text.RegularExpressions;
using System.Net;
using Tiobon.Core.Common.Helper;
using AgileObjects.AgileMapper.Extensions;
namespace Tiobon.Core.Services;
@ -155,12 +157,16 @@ public class Ghre_ExamRecordServices : BaseServices<Ghre_ExamRecord, Ghre_ExamRe
//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 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();
baseData.PaperNo = exampaper.PaperNo;
baseData.PaperName = exampaper.PaperName;
@ -187,7 +193,9 @@ public class Ghre_ExamRecordServices : BaseServices<Ghre_ExamRecord, Ghre_ExamRe
ConfigId = x.ConfigId,
parentId = x.ConfigId,
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();
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;
if (!string.IsNullOrEmpty(x.QuestionContent))
x.QuestionContent = WebUtility.HtmlDecode(x.QuestionContent);
var detail = new FromGhre_QuestionQuestionTypeDetail();
detail.content = x.QuestionContent;
detail.difficulty = questions1.FirstOrDefault(a => a.Id == x.QuestionId)?.DifficultyLevel;
@ -218,9 +225,35 @@ public class Ghre_ExamRecordServices : BaseServices<Ghre_ExamRecord, Ghre_ExamRe
}).ToList();
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);
}

@ -1377,107 +1377,13 @@ public class Ghre_ExamServices : BaseServices<Ghre_Exam, Ghre_ExamDto, InsertGhr
public async Task<ServiceResult> SystemMark(long id)
{
var record = await _ghre_ExamRecordServices.QuerySingleDto(x => x.ExamId == id || x.Id == id);
var record = await Db.Queryable<Ghre_ExamRecord>().FirstAsync(x => x.Id == id);
var examPaper = await _ghre_ExamPaperServices.QuerySingleDto(x => x.Id == record.ExamPaperId && x.ScoreMethod == "System");
if (examPaper != null)
{
var details = await _ghre_ExamRecordDetailServices.QueryDto(x => x.ExamRecordId == record.Id);
var details = await Db.Queryable<Ghre_ExamRecordDetail>().Where(x => x.ExamRecordId == record.Id).ToListAsync();
await ExamHelper.SystemMarkAsync(Db, record, details);
details.ForEach(x =>
{
if (!string.IsNullOrWhiteSpace(x.QuestionAnswerId))
x.QuestionAnswerIds = JsonConvert.DeserializeObject<List<long>>(x.QuestionAnswerId);
});
var questionIds = details.Where(x => x.QuestionId != null).SelectMany(m =>
{
return m.QuestionAnswerIds.Select((x, i) =>
{
return x;
});
}).ToList();
var exampaperQuestions = await _ghre_ExamPaperQuestionServices.Query(x => x.ExamPaperId == record.ExamPaperId);
var questions = await _ghre_QuestionServices.Query(x => questionIds.Contains(x.Id));
var answers = await _ghre_QuestionAnswerServices.Query(x => x.QuestionId != null && questionIds.Contains(x.QuestionId.Value) && x.IsCorrect == true);
decimal? score = 0;
var detailGroups = details.GroupBy(m => m.QuestionId)
.Select(m => new
{
m.FirstOrDefault()?.QuestionId,
List = m.ToList()
})
.ToList();
detailGroups.ForEach(group =>
{
var question = questions.FirstOrDefault(x => x.Id == group.QuestionId);
if (question.QuestionType != "Completion" && question.QuestionType != "ShortAnswer")
{
var questionAnswerIds = group.List.Where(x => x.QuestionId != null).SelectMany(m =>
{
return m.QuestionAnswerIds.Select((x, i) =>
{
return x;
});
}).ToList();
if (questionAnswerIds.Count == answers.Where(x => questionAnswerIds.Contains(x.Id)).Count())
{
var exampaperQuestion = exampaperQuestions.FirstOrDefault(x => x.QuestionId == group.QuestionId);
score += exampaperQuestion.Score;
var detail = details.Where(x => x.QuestionId == group.QuestionId).First();
detail.Score = exampaperQuestion.Score;
}
}
else if (question.QuestionType == "Completion")// 填空题
{
if (!string.IsNullOrWhiteSpace(group.List.First().AnswerContent))
{
var completionAnswers = answers.OrderBy(x => x.TaxisNo).Where(x => x.QuestionId == group.QuestionId).ToList();
var contents = JsonConvert.DeserializeObject<List<string>>(group.List.First().AnswerContent);
var count = completionAnswers.Count;
for (int i = 0; i < completionAnswers.Count; i++)
if (completionAnswers[i].AnswerContent == contents[i])
count--;
if (count == 0)
{
var exampaperQuestion = exampaperQuestions.FirstOrDefault(x => x.QuestionId == group.QuestionId);
score += exampaperQuestion.Score;
var detail = details.Where(x => x.QuestionId == group.QuestionId).First();
detail.Score = exampaperQuestion.Score;
}
}
}
else if (question.QuestionType == "ShortAnswer")//简单题
{
if (!string.IsNullOrWhiteSpace(group.List.First().AnswerContent))
{
var completionAnswers = answers.OrderBy(x => x.TaxisNo).Where(x => x.QuestionId == group.QuestionId).ToList();
var content = group.List.First().AnswerContent;
var count = completionAnswers.Count;
for (int i = 0; i < completionAnswers.Count; i++)
if (content.IndexOf(completionAnswers[i].AnswerContent) > -1)
count--;
if (count == 0)
{
var exampaperQuestion = exampaperQuestions.FirstOrDefault(x => x.QuestionId == group.QuestionId);
score += exampaperQuestion.Score;
var detail = details.Where(x => x.QuestionId == group.QuestionId).First();
detail.Score = exampaperQuestion.Score;
}
}
}
});
record.Score = score;
await Db.Updateable(details).UpdateColumns(it => new { it.Score }).ExecuteCommandAsync();
await Db.Updateable(record).UpdateColumns(it => new { it.Score }).ExecuteCommandAsync();
}

@ -2425,14 +2425,19 @@
Ghre_ExamRecordDetail (Dto.Base)
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecordDetailBase.ExamRecordId">
<summary>
答题记录ID
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecordDetailBase.ExamPaperId">
<summary>
试卷ID
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecordDetailBase.ExamRecordId">
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecordDetailBase.ExamPaperQuestionId">
<summary>
答题记录ID
试卷题目ID
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecordDetailBase.QuestionId">
@ -2440,9 +2445,9 @@
题目ID
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecordDetailBase.UserId">
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecordDetailBase.StaffId">
<summary>
用户ID
员工ID
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecordDetailBase.QuestionAnswerId">
@ -2465,6 +2470,16 @@
调整得分
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecordDetailBase.IsCorrect">
<summary>
是否正确
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecordDetailBase.TaxisNo">
<summary>
排序号
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecordDetailBase.RemarkSz">
<summary>
备注
@ -6906,14 +6921,19 @@
Ghre_ExamRecordDetail (Model)
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecordDetail.ExamRecordId">
<summary>
答题记录ID
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecordDetail.ExamPaperId">
<summary>
试卷ID
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecordDetail.ExamRecordId">
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecordDetail.ExamPaperQuestionId">
<summary>
答题记录ID
试卷题目ID
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecordDetail.QuestionId">
@ -6921,9 +6941,9 @@
题目ID
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecordDetail.UserId">
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecordDetail.StaffId">
<summary>
用户ID
员工ID
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecordDetail.QuestionAnswerId">
@ -6946,6 +6966,16 @@
调整得分
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecordDetail.IsCorrect">
<summary>
是否正确
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecordDetail.TaxisNo">
<summary>
排序号
</summary>
</member>
<member name="P:Tiobon.Core.Model.Models.Ghre_ExamRecordDetail.RemarkSz">
<summary>
备注

@ -784,6 +784,13 @@
<param name="body">条件</param>
<returns></returns>
</member>
<member name="M:Tiobon.Core.Api.Controllers.Ghre_ExamRecordController.ExtendAsync(System.Int64)">
<summary>
获取考试记录明细扩展接口
</summary>
<param name="examRecordId"></param>
<returns></returns>
</member>
<member name="T:Tiobon.Core.Api.Controllers.Ghre_ExamRecordDetailController">
<summary>
Ghre_ExamRecordDetail(Controller)

Loading…
Cancel
Save