|
@@ -133,10 +133,10 @@ namespace TEAMModelOS.FunctionV4
|
|
|
//await _serviceBus.GetServiceBusClient().SendMessageAsync(Environment.GetEnvironmentVariable("Azure:ServiceBus:ActiveTask"), messageBlob);
|
|
|
#endregion
|
|
|
//List<string> classes = new List<string>();
|
|
|
+ //处理活动中间件
|
|
|
+ List<RGroupList> members = await Activity(_coreAPIHttpService, info, classes, client, _dingDing, sub, examClassResults);
|
|
|
if (examClassResults.Count == 0)
|
|
|
{
|
|
|
- //处理活动中间件
|
|
|
- List<RGroupList> members = await Activity(_coreAPIHttpService, info, classes, client, _dingDing, sub, examClassResults);
|
|
|
foreach (string cla in classes)
|
|
|
{
|
|
|
int m = 0;
|
|
@@ -642,7 +642,9 @@ namespace TEAMModelOS.FunctionV4
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
- bool flag = false;
|
|
|
+ bool iss = false;
|
|
|
+ //标记学生作答状态
|
|
|
+ int ts = 0;
|
|
|
if (results.Count > 0)
|
|
|
{
|
|
|
foreach (ExamClassResult exam in results)
|
|
@@ -650,14 +652,30 @@ namespace TEAMModelOS.FunctionV4
|
|
|
int index = exam.studentIds.IndexOf(x.id);
|
|
|
if (index != -1)
|
|
|
{
|
|
|
- flag = exam.studentScores[index].Exists(x => x == -1);
|
|
|
- if (!flag)
|
|
|
+ if (exam.studentAnswers[index].Count > 0)
|
|
|
{
|
|
|
- break;
|
|
|
+ bool flag = exam.studentScores[index].Exists(x => x == -1);
|
|
|
+ if (!flag)
|
|
|
+ {
|
|
|
+ ts = 1;
|
|
|
+ iss = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ ts = 0;
|
|
|
+ }
|
|
|
}
|
|
|
+ else {
|
|
|
+ ts = -1;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ ts = -1;
|
|
|
+ }
|
|
|
tmdActivities.Add(new StuActivity
|
|
|
{
|
|
|
pk = "Activity",
|
|
@@ -675,10 +693,10 @@ namespace TEAMModelOS.FunctionV4
|
|
|
subjects = sub,
|
|
|
blob = null,
|
|
|
owner = info.owner,
|
|
|
- createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(),
|
|
|
- taskStatus = -1,
|
|
|
+ createTime = info.createTime,
|
|
|
+ taskStatus = ts,
|
|
|
ext = new Dictionary<string, JsonElement>() { { "type", info.type.ToJsonString().ToObject<JsonElement>() }, { "subjects", info.subjects.ToJsonString().ToObject<JsonElement>() } },
|
|
|
- sStatus = flag ? 0 : 1,
|
|
|
+ sStatus = iss ? 1 : 0,
|
|
|
classIds = classIds.ToList()
|
|
|
|
|
|
}); ;
|
|
@@ -699,7 +717,9 @@ namespace TEAMModelOS.FunctionV4
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
- bool flag = false;
|
|
|
+ bool iss = false;
|
|
|
+ //标记学生作答状态
|
|
|
+ int ts = 0;
|
|
|
if (results.Count > 0)
|
|
|
{
|
|
|
foreach (ExamClassResult exam in results)
|
|
@@ -707,14 +727,31 @@ namespace TEAMModelOS.FunctionV4
|
|
|
int index = exam.studentIds.IndexOf(x.id);
|
|
|
if (index != -1)
|
|
|
{
|
|
|
- flag = exam.studentScores[index].Exists(x => x == -1);
|
|
|
- if (!flag)
|
|
|
+ if (exam.studentAnswers[index].Count > 0)
|
|
|
+ {
|
|
|
+ bool flag = exam.studentScores[index].Exists(x => x == -1);
|
|
|
+ if (!flag)
|
|
|
+ {
|
|
|
+ ts = 1;
|
|
|
+ iss = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ ts = 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
{
|
|
|
- break;
|
|
|
+ ts = -1;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ else
|
|
|
+ {
|
|
|
+ ts = -1;
|
|
|
+ }
|
|
|
|
|
|
stuActivities.Add(new StuActivity
|
|
|
{
|
|
@@ -734,11 +771,11 @@ namespace TEAMModelOS.FunctionV4
|
|
|
blob = null,
|
|
|
owner = info.owner,
|
|
|
classIds = classIds.ToList(),
|
|
|
- createTime = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds(),
|
|
|
+ createTime = info.createTime,
|
|
|
ext = new Dictionary<string, JsonElement>() { { "type", info.type.ToJsonString().ToObject<JsonElement>() },
|
|
|
{ "subjects", info.subjects.ToJsonString().ToObject<JsonElement>() } },
|
|
|
- taskStatus = -1,
|
|
|
- sStatus = flag ? 0 : 1,
|
|
|
+ taskStatus = ts,
|
|
|
+ sStatus = iss ? 1 : 0,
|
|
|
});
|
|
|
});
|
|
|
}
|