Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let cp3partner = [
- { 1: "e", 2: "i" },
- { 1: "s", 2: "n" },
- { 1: "t", 2: "f" },
- { 1: "j", 2: "p" }];
- let cp3partner_e = [4, 62, 14, 23, 8, 67, 19, 77];
- let cp3partner_i = [60, 12, 72, 22, 66, 18, 36, 27, 35, 42, 48, 54];
- let cp3partner_s = [3, 61, 13, 73, 32, 82, 40, 86, 47, 90, 53, 93, 58];
- let cp3partner_n = [5, 63, 15, 74, 24, 29, 79, 37, 83, 44, 87, 50, 55];
- let cp3partner_t = [69, 78, 31, 81, 39, 85, 46, 89, 52, 92, 57];
- let cp3partner_f = [6, 64, 16, 75, 30, 80, 38, 84, 45, 88, 51, 91, 56];
- let cp3partner_j = [1, 59, 10, 20, 70, 9, 68, 28, 36, 43, 49];
- let cp3partner_p = [2, 11, 71, 21, 7, 65, 17, 76, 25, 33, 41];
- let cp3_e, cp3_i, cp3_s, cp3_n, cp3_t, cp3_f, cp3_j, cp3_p = 0;
- $(document).on("click", "#submit_cp3", function () {
- for (let i = 0; i < cp3partner.length; i++) {
- let first = cp3partner[i][1];
- if (first == "e") {
- console.log("this e");
- for (let j = 0; j < cp3partner_e.length; j++) {
- if ($("[name=cp3_" + j + "]").val() == "1") {
- cp3_e++;
- }
- else {
- cp3_i++;
- }
- }
- }
- if (first == "s") {
- for (let j = 0; j < cp3partner_e.length; j++) {
- if ($("[name=cp3_" + j + "]").val() == "1") {
- cp3_s++;
- }
- else {
- cp3_n++;
- }
- }
- }
- if (first == "t") {
- for (let j = 0; j < cp3partner_e.length; j++) {
- if ($("[name=cp3_" + j + "]").val() == "1") {
- cp3_t++;
- }
- else {
- cp3_f++;
- }
- }
- }
- if (first == "j") {
- for (let j = 0; j < cp3partner_e.length; j++) {
- if ($("[name=cp3_" + j + "]").val() == "1") {
- cp3_j++;
- }
- else {
- cp3_p++;
- }
- }
- }
- let second = cp3partner[i][2];
- if (second == "i") {
- for (let j = 0; j < cp3partner_e.length; j++) {
- if ($("[name=cp3_" + j + "]").val() == "2") {
- cp3_i++;
- }
- else {
- cp3_e++;
- }
- }
- }
- if (second == "n") {
- for (let j = 0; j < cp3partner_e.length; j++) {
- if ($("[name=cp3_" + j + "]").val() == "2") {
- cp3_n++;
- }
- else {
- cp3_s++;
- }
- }
- }
- if (first == "f") {
- for (let j = 0; j < cp3partner_e.length; j++) {
- if ($("[name=cp3_" + j + "]").val() == "2") {
- cp3_f++;
- }
- else {
- cp3_t++;
- }
- }
- }
- if (first == "p") {
- for (let j = 0; j < cp3partner_e.length; j++) {
- if ($("[name=cp3_" + j + "]").val() == "2") {
- cp3_p++;
- }
- else {
- cp3_j++;
- }
- }
- }
- }
- let ei = "";
- let sn = "";
- let tf = "";
- let jp = "";
- if (e == i) {
- ei = "I";
- }
- else if (e > i) {
- ei = "E";
- }
- else {
- ei = "I";
- }
- if (s == n) {
- sn = "N";
- }
- else if (s > n) {
- sn = "S";
- }
- else {
- ei = "N";
- }
- if (t == f) {
- tf = "F";
- }
- else if (t > f) {
- tf = "T";
- }
- else {
- tf = "F";
- }
- if (j == p) {
- jp = "P";
- }
- else if (j > p) {
- jp = "J";
- }
- else {
- jp = "P";
- }
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement