{
  "id": "dfb0059f3e45411d973951e122ddf1be",
  "defaultTitle": "PR_AB",
  "defaultDescription": "PR_AB",
  "alias": "PR_AB",
  "electionEvent": {
    "id": "6eb1403ab44d4fedb86a6f73adcf17fc"
  },
  "template": "listsAndCandidates",
  "fullBlank": "true",
  "options": [
    {
      "id": "84106a8b84104ef8a5bea3a9f748fd2c",
      "representation": "100673",
      "attribute": "7defa20679bc4582a1efcc7b33aed45a"
    },
    {
      "id": "670db19029274b99a8a6795fab43c476",
      "representation": "10069",
      "attribute": "e009fda34d674273bfd187b43c409a44"
    },
    {
      "id": "222a4ad2f1f846ad85b13ec6e894a71e",
      "representation": "5",
      "attribute": "5cabbcddeb814f9b95e84b76d3fc023b"
    },
    {
      "id": "e10518b168214f779736bef5d5a7ab9d",
      "representation": "100613",
      "attribute": "b09d8da03cbb49b785207080e66e338b"
    },
    {
      "id": "3449e8e4a0ca4904bf9e05b248c73301",
      "representation": "100559",
      "attribute": "85bb39c30ba14d29999bd272da0412dd"
    },
    {
      "id": "8ffd9fc3c1544e4cbb80b2bb265eaf11",
      "representation": "100549",
      "attribute": "6d735c50a81e4b24b9fc721c6b18f82c"
    }
  ],
  "attributes": [
    {
      "id": "3e4cd5337e204f5591808887fa2cea02",
      "alias": "candidates",
      "correctness": true,
      "related": []
    },
    {
      "id": "7defa20679bc4582a1efcc7b33aed45a",
      "alias": "Blank Candidate",
      "correctness": false,
      "related": [
        "3e4cd5337e204f5591808887fa2cea02"
      ]
    },
    {
      "id": "9053f1203ecf4281b220b9c385c3c18e",
      "alias": "PR_AB1",
      "correctness": false,
      "related": []
    },
    {
      "id": "e009fda34d674273bfd187b43c409a44",
      "alias": "PR_AB11id",
      "correctness": false,
      "related": [
        "9053f1203ecf4281b220b9c385c3c18e",
        "3e4cd5337e204f5591808887fa2cea02"
      ]
    },
    {
      "id": "b09d8da03cbb49b785207080e66e338b",
      "alias": "PR_AB12id",
      "correctness": false,
      "related": [
        "9053f1203ecf4281b220b9c385c3c18e",
        "3e4cd5337e204f5591808887fa2cea02"
      ]
    },
    {
      "id": "980cd86438a048e78737405f34687c05",
      "alias": "PR_AB2",
      "correctness": false,
      "related": []
    },
    {
      "id": "85bb39c30ba14d29999bd272da0412dd",
      "alias": "PR_AB21id",
      "correctness": false,
      "related": [
        "980cd86438a048e78737405f34687c05",
        "3e4cd5337e204f5591808887fa2cea02"
      ]
    },
    {
      "id": "6d735c50a81e4b24b9fc721c6b18f82c",
      "alias": "PR_AB22id",
      "correctness": false,
      "related": [
        "980cd86438a048e78737405f34687c05",
        "3e4cd5337e204f5591808887fa2cea02"
      ]
    },
    {
      "id": "5cabbcddeb814f9b95e84b76d3fc023b",
      "alias": "WRITE_IN_7af8f6e43e134556a8935d53404b89b2",
      "correctness": "false",
      "related": [
        "3e4cd5337e204f5591808887fa2cea02"
      ]
    }
  ],
  "questions": [
    {
      "id": "5178a35e29cc4874ab817d2653f5a732",
      "max": "1",
      "min": "0",
      "cumul": "1",
      "writeIn": "true",
      "fusions": [],
      "blankAttribute": "7defa20679bc4582a1efcc7b33aed45a",
      "writeInAttribute": "5cabbcddeb814f9b95e84b76d3fc023b",
      "attribute": "3e4cd5337e204f5591808887fa2cea02"
    }
  ],
  "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 = 'dfb0059f3e45411d973951e122ddf1be';var attributeName = '3e4cd5337e204f5591808887fa2cea02';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;return result;}",
  "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 = '7567ab251a51459794b69cd9f517fe17';var votingOptions = ['84106a8b84104ef8a5bea3a9f748fd2c', '670db19029274b99a8a6795fab43c476', 'e10518b168214f779736bef5d5a7ab9d', '3449e8e4a0ca4904bf9e05b248c73301', '8ffd9fc3c1544e4cbb80b2bb265eaf11'];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 = ['84106a8b84104ef8a5bea3a9f748fd2c', '670db19029274b99a8a6795fab43c476', 'e10518b168214f779736bef5d5a7ab9d', '3449e8e4a0ca4904bf9e05b248c73301', '8ffd9fc3c1544e4cbb80b2bb265eaf11'];result = CorrectnessFunctions.areAllSelectionsValid(globalVotingOptions, encodedSelection, callbackFunction) && result;result = CorrectnessFunctions.areAllSelectionsUnique(encodedSelection, callbackFunction) && result;return result;}"
}
