|
@@ -667,28 +667,37 @@ namespace IES.ExamServer.Controllers
|
|
|
[AuthToken("admin", "teacher", "visitor")]
|
|
|
public IActionResult ListLocalEvaluation(JsonNode json)
|
|
|
{
|
|
|
- IEnumerable<EvaluationClient>? evaluationClients = _liteDBFactory.GetLiteDatabase().GetCollection<EvaluationClient>().FindAll().OrderByDescending(x=>x.stime);
|
|
|
- if (evaluationClients != null)
|
|
|
+ if (!string.IsNullOrWhiteSpace($"{_connectionService.serverDevice?.school?.id}"))
|
|
|
{
|
|
|
- var result = evaluationClients.Select(client =>
|
|
|
+ IEnumerable<EvaluationClient>? evaluationClients = _liteDBFactory.GetLiteDatabase().GetCollection<EvaluationClient>().Find(x => x.ownerId!.Equals($"{_connectionService!.serverDevice!.school!.id}")).OrderByDescending(x => x.stime);
|
|
|
+ if (evaluationClients != null)
|
|
|
{
|
|
|
-
|
|
|
- var properties = client.GetType().GetProperties();
|
|
|
- var anonymousObject = new Dictionary<string, object?>();
|
|
|
- foreach (var property in properties)
|
|
|
+ var result = evaluationClients.Select(client =>
|
|
|
{
|
|
|
- if (!property.Name.Equals("openCode"))
|
|
|
+
|
|
|
+ var properties = client.GetType().GetProperties();
|
|
|
+ var anonymousObject = new Dictionary<string, object?>();
|
|
|
+ foreach (var property in properties)
|
|
|
{
|
|
|
- anonymousObject[property.Name] = property.GetValue(client);
|
|
|
+ if (!property.Name.Equals("openCode"))
|
|
|
+ {
|
|
|
+ anonymousObject[property.Name] = property.GetValue(client);
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- return anonymousObject;
|
|
|
- });
|
|
|
- return Ok(new { code = 200, evaluation = result });
|
|
|
+ return anonymousObject;
|
|
|
+ });
|
|
|
+ return Ok(new { code = 200, evaluation = result });
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return Ok(new { code = 200, evaluation = new List<EvaluationClient>() });
|
|
|
+ }
|
|
|
}
|
|
|
- else {
|
|
|
- return Ok(new { code = 200, evaluation = new List<EvaluationClient> ()});
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return Ok(new { code = 200, evaluation = new List<EvaluationClient>() });
|
|
|
}
|
|
|
+
|
|
|
|
|
|
}
|
|
|
/// <summary>
|