Scoring.cs 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. }
  24. public class Item
  25. {
  26. public List<Info> scores { get; set; } = new List<Info>();
  27. //原题的配分
  28. public double ssc { get; set; }
  29. //public string tmdId { get; set; }
  30. public bool flag
  31. {
  32. get
  33. {
  34. if (scores.Count >= 2)
  35. {
  36. List<string> sc = scores.Select(s => s.tmdId).Where(c => string.IsNullOrEmpty(c)).ToList();
  37. if (sc.Count > 0) {
  38. return true;
  39. }
  40. double diff = Math.Abs(scores.Select(s => s.sc).ToList().Aggregate((i, j) => (i - j) * 6));
  41. if (diff > ssc)
  42. {
  43. return false;
  44. }
  45. else {
  46. return true;
  47. }
  48. }
  49. else
  50. {
  51. return true;
  52. }
  53. }
  54. }
  55. }
  56. public class Info {
  57. public double sc { get; set; }
  58. public string tmdId { get; set; }
  59. public int index { get;set; }
  60. }
  61. }