|
@@ -18,48 +18,12 @@ namespace HTEX.Test.Controllers
|
|
private readonly AzureCosmosFactory _azureCosmos;
|
|
private readonly AzureCosmosFactory _azureCosmos;
|
|
private readonly AzureStorageFactory _azureStorage;
|
|
private readonly AzureStorageFactory _azureStorage;
|
|
|
|
|
|
- // 创建一个字典来存储状态编号和对应的分数
|
|
|
|
- private readonly Dictionary<int, double> states = new Dictionary<int, double>();
|
|
|
|
|
|
+
|
|
public LessonRecordController(ILogger<LessonRecordController> logger, AzureCosmosFactory azureCosmos, AzureStorageFactory azureStorage)
|
|
public LessonRecordController(ILogger<LessonRecordController> logger, AzureCosmosFactory azureCosmos, AzureStorageFactory azureStorage)
|
|
{
|
|
{
|
|
_logger = logger;
|
|
_logger = logger;
|
|
_azureCosmos = azureCosmos;
|
|
_azureCosmos = azureCosmos;
|
|
_azureStorage = azureStorage;
|
|
_azureStorage = azureStorage;
|
|
- #region
|
|
|
|
- // 无二次作答的互动,且未设置正确答案
|
|
|
|
- states.Add(1, 0); // 未作答0
|
|
|
|
- states.Add(2, 1); // 已作答1
|
|
|
|
-
|
|
|
|
- // 无二次作答的互动,且设置了正确答案
|
|
|
|
- states.Add(3, 0); // 未作答0
|
|
|
|
- states.Add(4, 1); // 已作答1
|
|
|
|
- states.Add(5, 1.5); // 作答正确1.5
|
|
|
|
-
|
|
|
|
- // 有二次作答的互动,且未设置正确答案
|
|
|
|
- states.Add(6, 0); // 第一次未作答0,第二次未作答0
|
|
|
|
- states.Add(7, 1); // 第一次已作答1,第二次未作答0
|
|
|
|
- states.Add(8, 1); // 第一次未作答0,第二次已作答1
|
|
|
|
- states.Add(9, 2); // 第一次已作答1,第二次已作答1
|
|
|
|
-
|
|
|
|
- // 有二次作答的互动,且设置了正确答案
|
|
|
|
- states.Add(10, 0); // 第一次未作答0,第二次未作答0
|
|
|
|
- states.Add(11, 1.5); // 第一次已作答,作答正确1.5,第二次未作答0
|
|
|
|
- states.Add(12, 1); // 第一次已作答,作答错误1.5,第二次未作答0
|
|
|
|
- states.Add(13, 1.5); // 第一次未作答0,第二次已作答,作答正确1.5
|
|
|
|
- states.Add(14, 1); // 第一次未作答0,第二次已作答,作答错误1
|
|
|
|
- states.Add(15, 2); // 第一次已作答,作答错误1,第二次已作答,作答错误1
|
|
|
|
- states.Add(16, 2.5); // 第一次已作答,作答正确1.5,第二次已作答,作答错误1
|
|
|
|
- states.Add(17, 2.5); // 第一次已作答,作答错误1,第二次已作答,作答正确1.5
|
|
|
|
- states.Add(18, 3); // 第一次已作答,作答正确1.5,第二次已作答,作答正确1.5
|
|
|
|
-
|
|
|
|
- // 抢权模式
|
|
|
|
- states.Add(19, 0); // 未参与抢权0
|
|
|
|
- states.Add(20, 1); // 参与抢权1
|
|
|
|
- states.Add(21, 1.5); // 抢权成功1.5
|
|
|
|
- // 挑人时被挑到
|
|
|
|
- states.Add(22, 1.5); // 被挑到1.5
|
|
|
|
-
|
|
|
|
- #endregion
|
|
|
|
}
|
|
}
|
|
[HttpPost("read")]
|
|
[HttpPost("read")]
|
|
public async Task<IActionResult> Read(JsonElement json)
|
|
public async Task<IActionResult> Read(JsonElement json)
|
|
@@ -82,8 +46,6 @@ namespace HTEX.Test.Controllers
|
|
var count = mlist.Where(x => x.knowledge.Contains(item)).Count();
|
|
var count = mlist.Where(x => x.knowledge.Contains(item)).Count();
|
|
cm.Add(new CodeLong() { code = item, value = count });
|
|
cm.Add(new CodeLong() { code = item, value = count });
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
return Ok(new { cm,cp });
|
|
return Ok(new { cm,cp });
|
|
}
|
|
}
|
|
[HttpPost("process-history")]
|
|
[HttpPost("process-history")]
|
|
@@ -116,6 +78,7 @@ namespace HTEX.Test.Controllers
|
|
//base.json
|
|
//base.json
|
|
LessonBase? lessonBase = null;
|
|
LessonBase? lessonBase = null;
|
|
List<StudentLessonData> studentLessonDatas = new List<StudentLessonData>();
|
|
List<StudentLessonData> studentLessonDatas = new List<StudentLessonData>();
|
|
|
|
+ //名单出席率低于30%的 不纳入计算。
|
|
try
|
|
try
|
|
{
|
|
{
|
|
BlobDownloadResult baseblobDownload = await _azureStorage.GetBlobContainerClient(item.school).GetBlobClient($"/records/{item.id}/IES/base.json").DownloadContentAsync();
|
|
BlobDownloadResult baseblobDownload = await _azureStorage.GetBlobContainerClient(item.school).GetBlobClient($"/records/{item.id}/IES/base.json").DownloadContentAsync();
|