Scoring.cs 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. namespace TEAMModelOS.SDK.Models.Cosmos.Common
  6. {
  7. public class Scoring : CosmosEntity
  8. {
  9. public Scoring()
  10. {
  11. pk = "Scoring";
  12. }
  13. public string stuId { get; set; }
  14. public string examId { get; set; }
  15. public string subjectId { get; set; }
  16. public List<Item> items { get; set; } = new List<Item>();
  17. public string blob { get; set; }
  18. public List<string> tIds { get; set; } = new List<string>();
  19. public List<string> marks { get; set; } = new List<string>();
  20. public List<double> scores { get; set; } = new List<double>();
  21. public int model { get; set; }
  22. public string mode { get; set; }
  23. //阅卷类型1 正常卷 2 异常卷 3 仲裁卷
  24. public int type { get; set; }
  25. public string err { get; set; }
  26. }
  27. public class Item
  28. {
  29. public List<Info> scores { get; set; } = new List<Info>();
  30. //原题的配分
  31. public double ssc { get; set; }
  32. //public string tmdId { get; set; }
  33. public bool flag
  34. {
  35. get
  36. {
  37. if (scores.Count >= 2)
  38. {
  39. List<string> sc = scores.Select(s => s.tmdId).Where(c => string.IsNullOrEmpty(c)).ToList();
  40. if (sc.Count > 0) {
  41. return true;
  42. }
  43. double diff = Math.Abs(scores.Select(s => s.sc).ToList().Aggregate((i, j) => (i - j) * 6));
  44. if (diff > ssc)
  45. {
  46. return false;
  47. }
  48. else {
  49. return true;
  50. }
  51. }
  52. else
  53. {
  54. return true;
  55. }
  56. }
  57. }
  58. }
  59. public class Info {
  60. public double sc { get; set; }
  61. public string tmdId { get; set; }
  62. public int index { get;set; }
  63. }
  64. }