|
@@ -751,6 +751,7 @@ namespace TEAMModelOS.Controllers.Learn
|
|
|
if (!request.TryGetProperty("userid", out JsonElement __userid)) return BadRequest();
|
|
|
if (!request.TryGetProperty("userName", out JsonElement __userName)) return BadRequest();
|
|
|
if (!request.TryGetProperty("userType", out JsonElement __userType)) return BadRequest();
|
|
|
+ if (!request.TryGetProperty("identity", out JsonElement __identity)) return BadRequest();
|
|
|
string userSchool = school;
|
|
|
string _partition = $"HomeworkRecord-{__userid}";
|
|
|
if ($"{__userType}".Equals("student"))
|
|
@@ -819,10 +820,10 @@ namespace TEAMModelOS.Controllers.Learn
|
|
|
};
|
|
|
await client.GetContainer(Constant.TEAMModelOS, debateTbname).CreateItemAsync<Debate>(debate, new PartitionKey(debateCode));
|
|
|
}
|
|
|
- string identity = "student";
|
|
|
- if (userid.Equals($"{homework.creatorId}"))
|
|
|
+ string identity = $"{__identity}";
|
|
|
+ if (string.IsNullOrEmpty(identity))
|
|
|
{
|
|
|
- identity = "teacher";
|
|
|
+ identity = "student";
|
|
|
}
|
|
|
HomeworkComment homeworkComment = record.comments.Find(x => x.userid.Equals(userid));
|
|
|
if (homeworkComment != null)
|
|
@@ -864,6 +865,8 @@ namespace TEAMModelOS.Controllers.Learn
|
|
|
if (!request.TryGetProperty("userid", out JsonElement __userid)) return BadRequest();
|
|
|
if (!request.TryGetProperty("userName", out JsonElement __userName)) return BadRequest();
|
|
|
if (!request.TryGetProperty("userType", out JsonElement __userType)) return BadRequest();
|
|
|
+ if (!request.TryGetProperty("identity", out JsonElement __identity)) return BadRequest();
|
|
|
+
|
|
|
string userSchool = school;
|
|
|
string _partition = $"HomeworkRecord-{__userid}";
|
|
|
if ($"{__userType}".Equals("student"))
|
|
@@ -935,8 +938,8 @@ namespace TEAMModelOS.Controllers.Learn
|
|
|
};
|
|
|
await client.GetContainer(Constant.TEAMModelOS, debateTbname).CreateItemAsync<Debate>(debate, new PartitionKey(debateCode));
|
|
|
}
|
|
|
- string identity = "student";
|
|
|
- if (userid.Equals($"{homework.creatorId}"))
|
|
|
+ string identity = $"{__identity}";
|
|
|
+ if (string.IsNullOrEmpty(identity))
|
|
|
{
|
|
|
identity = "teacher";
|
|
|
}
|