listsAndCandidates.json 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  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. {
  13. "id": "3959786fd9744c2ca95d5b4a3fef4baa",
  14. "representation": "100109",
  15. "attribute": "571186adf4b844a4b8947bd3e9689945"
  16. },
  17. {
  18. "id": "43907d4a08c8450bb772aa4caa161aff",
  19. "representation": "100183",
  20. "attribute": "b2b84721677249478ae06bde6418dd92"
  21. },
  22. {
  23. "id": "c818d629c0254809b4b0449304b803e7",
  24. "representation": "100193",
  25. "attribute": "b2b84721677249478ae06bde6418dd92"
  26. },
  27. {
  28. "id": "393258e8b74e4092adc6636b2f0dc1a1",
  29. "representation": "100169",
  30. "attribute": "3d11a8dbf02844a792ab906c8b031164"
  31. },
  32. {
  33. "id": "466f6f6466854fa7b31eda994e6f2f47",
  34. "representation": "100129",
  35. "attribute": "941756f7ddd4411dbc5913454a0628c4"
  36. },
  37. {
  38. "id": "601c88b5da4b475ab09cab03a569abfc",
  39. "representation": "100237",
  40. "attribute": "08d405cdac744cd183a527313d3d7888"
  41. },
  42. {
  43. "id": "e7f525d885584361a6e6592b57e042e1",
  44. "representation": "100153",
  45. "attribute": "0f23cb764042407e9e8c8b419bb78629"
  46. },
  47. {
  48. "id": "130e65934b614602aa6655e112b892d4",
  49. "representation": "100207",
  50. "attribute": "afce9b49bfed4bba9f740f9b9f423e47"
  51. },
  52. {
  53. "id": "98f7ad66aea04903afa21ee0b715498c",
  54. "representation": "100267",
  55. "attribute": "cb0c6193f68048b2b376aca12f8c5a88"
  56. }
  57. ],
  58. "attributes": [
  59. {
  60. "id": "b8e3ce7d16604b0792de03d32a0b2777",
  61. "alias": "lists",
  62. "correctness": true,
  63. "related": []
  64. },
  65. {
  66. "id": "a5c990e77f7947f6b0a3306d77ad290a",
  67. "alias": "candidates",
  68. "correctness": true,
  69. "related": []
  70. },
  71. {
  72. "id": "571186adf4b844a4b8947bd3e9689945",
  73. "alias": "BlankList",
  74. "correctness": false,
  75. "related": [
  76. "b8e3ce7d16604b0792de03d32a0b2777"
  77. ]
  78. },
  79. {
  80. "id": "b2b84721677249478ae06bde6418dd92",
  81. "alias": "Blank Candidate",
  82. "related": [
  83. "a5c990e77f7947f6b0a3306d77ad290a"
  84. ],
  85. "correctness": false
  86. },
  87. {
  88. "id": "3d11a8dbf02844a792ab906c8b031164",
  89. "alias": "list1id",
  90. "correctness": false,
  91. "related": [
  92. "b8e3ce7d16604b0792de03d32a0b2777"
  93. ]
  94. },
  95. {
  96. "id": "941756f7ddd4411dbc5913454a0628c4",
  97. "alias": "list11id",
  98. "correctness": false,
  99. "related": [
  100. "3d11a8dbf02844a792ab906c8b031164",
  101. "a5c990e77f7947f6b0a3306d77ad290a"
  102. ]
  103. },
  104. {
  105. "id": "08d405cdac744cd183a527313d3d7888",
  106. "alias": "list12id",
  107. "correctness": false,
  108. "related": [
  109. "3d11a8dbf02844a792ab906c8b031164",
  110. "a5c990e77f7947f6b0a3306d77ad290a"
  111. ]
  112. },
  113. {
  114. "id": "0f23cb764042407e9e8c8b419bb78629",
  115. "alias": "list2id",
  116. "correctness": false,
  117. "related": [
  118. "b8e3ce7d16604b0792de03d32a0b2777"
  119. ]
  120. },
  121. {
  122. "id": "afce9b49bfed4bba9f740f9b9f423e47",
  123. "alias": "list21id",
  124. "correctness": false,
  125. "related": [
  126. "0f23cb764042407e9e8c8b419bb78629",
  127. "a5c990e77f7947f6b0a3306d77ad290a"
  128. ]
  129. },
  130. {
  131. "id": "cb0c6193f68048b2b376aca12f8c5a88",
  132. "alias": "list22id",
  133. "correctness": false,
  134. "related": [
  135. "0f23cb764042407e9e8c8b419bb78629",
  136. "a5c990e77f7947f6b0a3306d77ad290a"
  137. ]
  138. }
  139. ],
  140. "questions": [
  141. {
  142. "id": "83f53d33093b424bbc6b8e2383265090",
  143. "max": "1",
  144. "min": "0",
  145. "cumul": "1",
  146. "writeIn": "false",
  147. "fusions": [],
  148. "blankAttribute": "571186adf4b844a4b8947bd3e9689945",
  149. "attribute": "b8e3ce7d16604b0792de03d32a0b2777"
  150. },
  151. {
  152. "id": "ff91c9a82cc140a09efa435951571f77",
  153. "max": "2",
  154. "min": "0",
  155. "cumul": "1",
  156. "writeIn": "true",
  157. "fusions": [],
  158. "blankAttribute": "b2b84721677249478ae06bde6418dd92",
  159. "attribute": "a5c990e77f7947f6b0a3306d77ad290a"
  160. }
  161. ],
  162. "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;}",
  163. "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;}"
  164. }