|
@@ -108,8 +108,8 @@ namespace IES.ExamServer.Controllers
|
|
|
EvaluationClient? evaluationClient = _liteDBFactory.GetLiteDatabase().GetCollection<EvaluationClient>().FindOne(x => x.id!.Equals(id) && x.shortCode!.Equals(shortCode));
|
|
|
if (teacher != null && evaluationClient!= null)
|
|
|
{
|
|
|
- var dataInfo= await GetEvaluationFromCenter(teacher, _configuration, _httpClientFactory, shortCode, evaluationClient.id!);
|
|
|
- if (dataInfo.centerCode.Equals("200"))
|
|
|
+ var dataInfo= await GetEvaluationFromCenter(GetXAuthToken(), _configuration, _httpClientFactory, shortCode, evaluationClient.id!);
|
|
|
+ if (dataInfo.centerCode.Equals("200")&& dataInfo.evaluationCloud!=null)
|
|
|
{
|
|
|
string? CenterUrl = _configuration.GetValue<string>("ExamServer:CenterUrl");
|
|
|
var client = _httpClientFactory.CreateClient();
|
|
@@ -255,7 +255,9 @@ namespace IES.ExamServer.Controllers
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- (successMsgs, errorMsgs) = await ManageService.CheckFile(evaluationClient, successMsgs, errorMsgs, _signalRExamServerHub, _memoryCache, _logger, deviceId, evaluationPath);
|
|
|
+ _liteDBFactory.GetLiteDatabase().GetCollection<EvaluationClient>().Upsert(dataInfo.evaluationCloud!);
|
|
|
+
|
|
|
+ (successMsgs, errorMsgs) = await ManageService.CheckFile(dataInfo.evaluationCloud!, successMsgs, errorMsgs, _signalRExamServerHub, _memoryCache, _logger, deviceId, evaluationPath);
|
|
|
//下载完成后,对数据进行检查,然后在加密压缩。
|
|
|
string zipPath = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", "zip");
|
|
|
if (!Directory.Exists(zipPath))
|
|
@@ -264,6 +266,7 @@ namespace IES.ExamServer.Controllers
|
|
|
}
|
|
|
string zipFilePath = Path.Combine(zipPath, $"{evaluationClient.id}-{evaluationClient.blobHash}.zip");
|
|
|
var zipInfo = ZipHelper.CreatePasswordProtectedZip(evaluationPath, zipFilePath, evaluationClient.openCode!);
|
|
|
+
|
|
|
if (zipInfo.res)
|
|
|
{
|
|
|
successMsgs.Add("评测数据压缩包创建成功!");
|
|
@@ -451,7 +454,7 @@ namespace IES.ExamServer.Controllers
|
|
|
Teacher? teacher = _liteDBFactory.GetLiteDatabase().GetCollection<Teacher>().FindOne(x => x.id!.Equals(token.id));
|
|
|
if (teacher != null)
|
|
|
{
|
|
|
- (evaluationCloud, centerCode, centerMsg)= await ManageService.GetEvaluationFromCenter(teacher, _configuration,_httpClientFactory,shortCode,evaluationId);
|
|
|
+ (evaluationCloud, centerCode, centerMsg)= await ManageService.GetEvaluationFromCenter(GetXAuthToken(), _configuration,_httpClientFactory,shortCode,evaluationId);
|
|
|
}
|
|
|
else
|
|
|
{
|