listsAndCandidates.json 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. {
  2. "id": "fecde2c46d98468cb6b064eb5187b5cf",
  3. "defaultTitle": "OL_AB",
  4. "defaultDescription": "OL_AB",
  5. "alias": "OL_AB",
  6. "electionEvent": {
  7. "id": "6eb1403ab44d4fedb86a6f73adcf17fc"
  8. },
  9. "template": "listsAndCandidates",
  10. "fullBlank": "true",
  11. "options": [{
  12. "id": "3959786fd9744c2ca95d5b4a3fef4baa",
  13. "representation": "100109",
  14. "attribute": "571186adf4b844a4b8947bd3e9689945"
  15. }, {
  16. "id": "43907d4a08c8450bb772aa4caa161aff",
  17. "representation": "100183",
  18. "attribute": "b2b84721677249478ae06bde6418dd92"
  19. }, {
  20. "id": "c818d629c0254809b4b0449304b803e7",
  21. "representation": "100193",
  22. "attribute": "b2b84721677249478ae06bde6418dd92"
  23. }, {
  24. "id": "393258e8b74e4092adc6636b2f0dc1a1",
  25. "representation": "100169",
  26. "attribute": "3d11a8dbf02844a792ab906c8b031164"
  27. }, {
  28. "id": "466f6f6466854fa7b31eda994e6f2f47",
  29. "representation": "100129",
  30. "attribute": "941756f7ddd4411dbc5913454a0628c4"
  31. }, {
  32. "id": "601c88b5da4b475ab09cab03a569abfc",
  33. "representation": "100237",
  34. "attribute": "08d405cdac744cd183a527313d3d7888"
  35. }, {
  36. "id": "e7f525d885584361a6e6592b57e042e1",
  37. "representation": "100153",
  38. "attribute": "0f23cb764042407e9e8c8b419bb78629"
  39. }, {
  40. "id": "130e65934b614602aa6655e112b892d4",
  41. "representation": "100207",
  42. "attribute": "afce9b49bfed4bba9f740f9b9f423e47"
  43. }, {
  44. "id": "98f7ad66aea04903afa21ee0b715498c",
  45. "representation": "100267",
  46. "attribute": "cb0c6193f68048b2b376aca12f8c5a88"
  47. }],
  48. "attributes": [{
  49. "id": "b8e3ce7d16604b0792de03d32a0b2777",
  50. "alias": "lists",
  51. "correctness": true,
  52. "related": []
  53. }, {
  54. "id": "a5c990e77f7947f6b0a3306d77ad290a",
  55. "alias": "candidates",
  56. "correctness": true,
  57. "related": []
  58. }, {
  59. "id": "571186adf4b844a4b8947bd3e9689945",
  60. "alias": "BlankList",
  61. "correctness": false,
  62. "related": [
  63. "b8e3ce7d16604b0792de03d32a0b2777"
  64. ]
  65. }, {
  66. "id": "b2b84721677249478ae06bde6418dd92",
  67. "alias": "Blank Candidate",
  68. "related": [
  69. "a5c990e77f7947f6b0a3306d77ad290a"
  70. ],
  71. "correctness": false
  72. }, {
  73. "id": "3d11a8dbf02844a792ab906c8b031164",
  74. "alias": "list1id",
  75. "correctness": false,
  76. "related": [
  77. "b8e3ce7d16604b0792de03d32a0b2777"
  78. ]
  79. }, {
  80. "id": "941756f7ddd4411dbc5913454a0628c4",
  81. "alias": "list11id",
  82. "correctness": false,
  83. "related": [
  84. "3d11a8dbf02844a792ab906c8b031164",
  85. "a5c990e77f7947f6b0a3306d77ad290a"
  86. ]
  87. }, {
  88. "id": "08d405cdac744cd183a527313d3d7888",
  89. "alias": "list12id",
  90. "correctness": false,
  91. "related": [
  92. "3d11a8dbf02844a792ab906c8b031164",
  93. "a5c990e77f7947f6b0a3306d77ad290a"
  94. ]
  95. }, {
  96. "id": "0f23cb764042407e9e8c8b419bb78629",
  97. "alias": "list2id",
  98. "correctness": false,
  99. "related": [
  100. "b8e3ce7d16604b0792de03d32a0b2777"
  101. ]
  102. }, {
  103. "id": "afce9b49bfed4bba9f740f9b9f423e47",
  104. "alias": "list21id",
  105. "correctness": false,
  106. "related": [
  107. "0f23cb764042407e9e8c8b419bb78629",
  108. "a5c990e77f7947f6b0a3306d77ad290a"
  109. ]
  110. }, {
  111. "id": "cb0c6193f68048b2b376aca12f8c5a88",
  112. "alias": "list22id",
  113. "correctness": false,
  114. "related": [
  115. "0f23cb764042407e9e8c8b419bb78629",
  116. "a5c990e77f7947f6b0a3306d77ad290a"
  117. ]
  118. }],
  119. "questions": [{
  120. "id": "83f53d33093b424bbc6b8e2383265090",
  121. "max": "1",
  122. "min": "0",
  123. "cumul": "1",
  124. "writeIn": "false",
  125. "fusions": [],
  126. "blankAttribute": "571186adf4b844a4b8947bd3e9689945",
  127. "attribute": "b8e3ce7d16604b0792de03d32a0b2777"
  128. }, {
  129. "id": "ff91c9a82cc140a09efa435951571f77",
  130. "max": "2",
  131. "min": "0",
  132. "cumul": "1",
  133. "writeIn": "true",
  134. "fusions": [],
  135. "blankAttribute": "b2b84721677249478ae06bde6418dd92",
  136. "attribute": "a5c990e77f7947f6b0a3306d77ad290a"
  137. }],
  138. "encryptedCorrectnessRule": "function evaluateCorrectness(selection, callbackFunction){if (typeof(callbackFunction)==='undefined') { callbackFunction = function (type, reference, extra) {};};var result = true;result = function (subSelection, callbackFunction) {var partialResult = true;var selectionName = 'fecde2c46d98468cb6b064eb5187b5cf';var attributeName = 'b8e3ce7d16604b0792de03d32a0b2777';var min = 0;var max = 1;var count = 0;for (i = 0; i < subSelection.length; i++) {var submittedOption = subSelection[i];if (submittedOption.indexOf(attributeName) > -1) {count++;}}if (count < min) {callbackFunction('MIN_ERROR', selectionName);partialResult = false;}if (count > max) {callbackFunction('MAX_ERROR', selectionName);partialResult = false;}return partialResult;}(selection, callbackFunction) && result;result = function (subSelection, callbackFunction) {var partialResult = true;var selectionName = 'fecde2c46d98468cb6b064eb5187b5cf';var attributeName = 'a5c990e77f7947f6b0a3306d77ad290a';var min = 0;var max = 2;var count = 0;for (i = 0; i < subSelection.length; i++) {var submittedOption = subSelection[i];if (submittedOption.indexOf(attributeName) > -1) {count++;}}if (count < min) {callbackFunction('MIN_ERROR', selectionName);partialResult = false;}if (count > max) {callbackFunction('MAX_ERROR', selectionName);partialResult = false;}return partialResult;}(selection, callbackFunction) && result;return result;}",
  139. "decryptedCorrectnessRule": "function evaluateCorrectness(selection, callbackFunction){if (typeof(callbackFunction)==='undefined') { callbackFunction = function (type, reference, extra) {};};var B64 = {encode: function (r) {return r;},decode: function (r) {return r;}};var encodedSelection = [];for (i = 0; i < selection.length; i++) {encodedSelection.push(B64.encode(selection[i]));}var CorrectnessFunctions = {getRelevantVotingOptions : function (votingOptions, selection){var selectionRelevantVotingOptions = [];for (i = 0; i < selection.length; i++) {if (votingOptions.indexOf(selection[i]) > -1) {selectionRelevantVotingOptions.push(selection[i]);}}return selectionRelevantVotingOptions;},isMaxMatch : function (selectionRelevantVotingOptions, maxReq, selectionName, callbackFunction){var maxMatch = maxReq >= selectionRelevantVotingOptions.length;if (!maxMatch) {callbackFunction('MAX_ERROR', B64.decode(selectionName));}return maxMatch;},isMinMatch : function (selectionRelevantVotingOptions, minReq, selectionName, callbackFunction){var minMatch = minReq <= selectionRelevantVotingOptions.length;if (!minMatch) {callbackFunction('MIN_ERROR', B64.decode(selectionName));}return minMatch;},isMinWithBlankMatch: function (selectionRelevantVotingOptions, minReq, blankOption, selectionName, callbackFunction) {var minMatch = minReq <= selectionRelevantVotingOptions.length - 1;var blankMatch = (selectionRelevantVotingOptions.indexOf(blankOption) > -1) && selectionRelevantVotingOptions.length == 1;if (!(minMatch || blankMatch)) {callbackFunction('MIN_WITH_BLANK_ERROR', B64.decode(selectionName));}return (minMatch || blankMatch);},areAllSelectionsValid: function (globalVotingOptions, encodedSelection, callbackFunction) {var partialResult = true;for (i = 0; i < encodedSelection.length; i++) {var selectionIsValid = globalVotingOptions.indexOf(encodedSelection[i]) > -1;if (!selectionIsValid) {callbackFunction('SELECTION_ERROR', B64.decode(encodedSelection[i]));}partialResult = partialResult && selectionIsValid;}return partialResult;},areAllSelectionsUnique: function (encodedSelection, callbackFunction) {var partialResult = true;var duplicates = encodedSelection.reduce(function(acc, el, i, arr) {if (arr.indexOf(el) !== i && acc.indexOf(el) < 0) acc.push(el); return acc;}, []);if (duplicates.length != 0) {callbackFunction('MULTIPLE_SELECTION_ERROR', B64.decode(encodedSelection[duplicates[0]]));partialResult = false;}return partialResult;},checkAlliance: function (allianceVotingOptions, cumulNumber, encodedSelection, callbackFunction) {var partialResult = true;for (i = 0; i < encodedSelection.length; i++) {for (j = 0; j < allianceVotingOptions.length; j++) {if(allianceVotingOptions[j].indexOf(encodedSelection[i]) > -1){var count = 0;for (k = 0; k < allianceVotingOptions[j].length; k++) {if (encodedSelection.indexOf(allianceVotingOptions[j][k]) > -1) {count++;}}if (count > cumulNumber){callbackFunction('CUMULATION_ERROR', B64.decode(encodedSelection[i]));partialResult = false;}}}}return partialResult;}};var result = true;result = function (subSelection, callbackFunction){var partialResult = true;var selectionName = '83f53d33093b424bbc6b8e2383265090';var votingOptions = ['3959786fd9744c2ca95d5b4a3fef4baa', '43907d4a08c8450bb772aa4caa161aff', 'c818d629c0254809b4b0449304b803e7'];var selectionRelevantVotingOptions = CorrectnessFunctions.getRelevantVotingOptions(votingOptions, subSelection);partialResult = partialResult && CorrectnessFunctions.isMinMatch(selectionRelevantVotingOptions, 1, selectionName, callbackFunction);partialResult = partialResult && CorrectnessFunctions.isMaxMatch(selectionRelevantVotingOptions, 1, selectionName, callbackFunction);return partialResult;}(encodedSelection, callbackFunction) && result;result = function (subSelection, callbackFunction){var partialResult = true;var selectionName = 'ff91c9a82cc140a09efa435951571f77';var votingOptions = ['393258e8b74e4092adc6636b2f0dc1a1', '466f6f6466854fa7b31eda994e6f2f47', '601c88b5da4b475ab09cab03a569abfc', 'e7f525d885584361a6e6592b57e042e1', '130e65934b614602aa6655e112b892d4', '98f7ad66aea04903afa21ee0b715498c'];var selectionRelevantVotingOptions = CorrectnessFunctions.getRelevantVotingOptions(votingOptions, subSelection);partialResult = partialResult && CorrectnessFunctions.isMinMatch(selectionRelevantVotingOptions, 1, selectionName, callbackFunction);partialResult = partialResult && CorrectnessFunctions.isMaxMatch(selectionRelevantVotingOptions, 1, selectionName, callbackFunction);return partialResult;}(encodedSelection, callbackFunction) && result;;var globalVotingOptions = ['3959786fd9744c2ca95d5b4a3fef4baa', '43907d4a08c8450bb772aa4caa161aff', 'c818d629c0254809b4b0449304b803e7', '393258e8b74e4092adc6636b2f0dc1a1', '466f6f6466854fa7b31eda994e6f2f47', '601c88b5da4b475ab09cab03a569abfc', 'e7f525d885584361a6e6592b57e042e1', '130e65934b614602aa6655e112b892d4', '98f7ad66aea04903afa21ee0b715498c'];result = CorrectnessFunctions.areAllSelectionsValid(globalVotingOptions, encodedSelection, callbackFunction) && result;result = CorrectnessFunctions.areAllSelectionsUnique(encodedSelection, callbackFunction) && result;return result;}"
  140. }