Skip to content
Permalink
main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
var i = 0;
var count=1;
let econScore=0;
let authScore=0;
let cultureScore=0;
function startButton(){
const oHeader=document.getElementById('orderHeader');
const start=document.getElementById('startButton');
const rStart=document.getElementById('randomStartButton');
const questionContainer=document.getElementById('question-container');
questionContainer.classList.remove('hide');
oHeader.classList.add('hide');
start.classList.add('hide');
rStart.classList.add('hide');
console.log("working");
var q = document.getElementById("question");
var num = document.getElementById("questionHeader");
q.textContent=question[i].text;
num.textContent="Question "+count+"/"+question.length;
//console.log(i);
}
function randomStartButton(){
const oHeader=document.getElementById('orderHeader');
const start=document.getElementById('startButton');
const rStart=document.getElementById('randomStartButton');
const questionContainer=document.getElementById('question-container');
questionContainer.classList.remove('hide');
start.classList.add('hide');
oHeader.classList.add('hide');
rStart.classList.add('hide');
console.log("working");
question=question
.map(value => ({ value,sort:Math.random() }))
.sort(((a, b) => a.sort - b.sort))
.map(({ value }) => value)
var q = document.getElementById("question");
var num = document.getElementById("questionHeader");
q.textContent=question[i].text;
num.textContent="Question "+count+"/"+question.length;
console.log(i);
}
function scoreSave(){
var econMax=0;
var authMax=0;
var cultureMax=0;
for(let i=0; i<question.length;++i){
econMax+= Math.abs(question[i].qEffects.Econ);
authMax+= Math.abs(question[i].qEffects.Auth);
cultureMax+= Math.abs(question[i].qEffects.Culture);
}
econScore=10*(econScore/econMax);
authScore=10*(authScore/authMax);
cultureScore=10*(cultureScore/cultureMax);
localStorage.setItem("econSave",econScore);
localStorage.setItem("authSave",authScore);
localStorage.setItem("cultureSave",cultureScore);
}
function buttonClickStrongAgree(){//At some point divide this function up!
//questionProgression();
var q = document.getElementById("question");
var num = document.getElementById("questionHeader");
var score = document.getElementById("scorebox");
num.textContent="Question "+count+"/"+question.length;
econScore+=(((question[i].qEffects.Econ)*question[i].qEffects.agreeAdjustIndex)*1.5);
authScore+=(((question[i].qEffects.Auth)*question[i].qEffects.agreeAdjustIndex)*1.5);
cultureScore+=(((question[i].qEffects.Culture)*question[i].qEffects.agreeAdjustIndex)*1.5);
//score.textContent="working"+econScore+" "+authScore+" "+cultureScore;
i++;
q.textContent=question[i].text;
count++;
}
function buttonClickAgree(){//At some point divide this function up!
var q = document.getElementById("question");
var num = document.getElementById("questionHeader");
var score = document.getElementById("scorebox");
num.textContent="Question "+count+"/"+question.length;
econScore+=((question[i].qEffects.Econ)*question[i].qEffects.agreeAdjustIndex);
authScore+=((question[i].qEffects.Auth)*question[i].qEffects.agreeAdjustIndex);
cultureScore+=((question[i].qEffects.Culture)*question[i].qEffects.agreeAdjustIndex);
//score.textContent="working"+econScore+" "+authScore+" "+cultureScore;
i++;
q.textContent=question[i].text;
count++;
}
function buttonClickNeutral(){//At some point divide this function up!
var q = document.getElementById("question");
var num = document.getElementById("questionHeader");
var score = document.getElementById("scorebox");
num.textContent="Question "+count+"/"+question.length;
//score.textContent="working"+econScore+" "+authScore+" "+cultureScore;
i++;
q.textContent=question[i].text;
count++;
}
function buttonClickDisagree(){//At some point divide this function up!
var q = document.getElementById("question");
var num = document.getElementById("questionHeader");
var score = document.getElementById("scorebox");
num.textContent="Question "+count+"/"+question.length;
econScore+=(((question[i].qEffects.Econ)*question[i].qEffects.disagreeAdjustIndex)*-1);
authScore+=(((question[i].qEffects.Auth)*question[i].qEffects.disagreeAdjustIndex)*-1);
cultureScore+=(((question[i].qEffects.Culture)*question[i].qEffects.disagreeAdjustIndex)*-1);
//score.textContent="working"+econScore+" "+authScore+" "+cultureScore;
i++;
q.textContent=question[i].text;
count++;
}
function buttonClickStrongDisagree(){
var q = document.getElementById("question");
var num = document.getElementById("questionHeader");
var score = document.getElementById("scorebox");
num.textContent="Question "+count+"/"+question.length;
econScore+=(((question[i].qEffects.Econ)*question[i].qEffects.disagreeAdjustIndex)*-1.5);
authScore+=(((question[i].qEffects.Auth)*question[i].qEffects.disagreeAdjustIndex)*-1.5);
cultureScore+=(((question[i].qEffects.Culture)*question[i].qEffects.disagreeAdjustIndex)*-1.5);
//score.textContent="working"+" "+econScore+" "+authScore+" "+cultureScore+" ";
i++;
q.textContent=question[i].text;
count++;
}
scores=[]
//class Question
question=[// values are based on what the effect will be if "agree" is selected.
//
//Economic axis
{
text: "I support a flat tax; regardless of income, all citizens should pay the same tax percent. ",
questionId:0,
qEffects:
{
Econ:1,
Auth:0,
Culture:0,
agreeAdjustIndex:1,
disagreeAdjustIndex:1
}
},
{
text: "The government should provide health insurance to all, but let hospitals and other care providers stay private.",
questionId:3,
qEffects:
{
Econ: -1,
Auth:.5,
Culture:0,
agreeAdjustIndex:1,
disagreeAdjustIndex:1
}
},
{
text: "The government should provide health insurance, and should nationalize the entire healthcare industry.",
questionId:3,
qEffects:
{
Econ: -1,
Auth:.5,
Culture:0,
agreeAdjustIndex:1,
disagreeAdjustIndex:.5
}
},
{
text: "Houses should not be a commodity to be bought and sold. Housing should be availible to all, the free market would never acheive that.",
questionId:4,
qEffects:
{
Econ:-1.5,
Auth:.5,
Culture:0,
agreeAdjustIndex:1,
disagreeAdjustIndex:.25
}
},
{
text: "I support a progressive tax system. Those who make more should pay a higher percentage in taxes.",
questionId:5,
qEffects:
{
Econ:-1,
Auth:0,
Culture:0,
agreeAdjustIndex:1,
disagreeAdjustIndex:1
}
},
{
text: "Welfare has gone too far. The government needs to decrease welfare benifits and make them harder to qualify for. ",
questionId:6,
qEffects:
{
Econ:1,
Auth:0,
Culture:0,
agreeAdjustIndex:1,
disagreeAdjustIndex:1
}
},
{
text: "Means-testing our social programs does more harm than good. Preventing abuse of welfare at the cost of some in need not recieving help is not worthwhile.",
questionId:7,
qEffects:
{
Econ:-1,
Auth:0,
Culture:0,
agreeAdjustIndex:1,
disagreeAdjustIndex:1
}
},
{
text: "I do not support taxes, because no state has a right to my wealth.",
questionId:8,
qEffects:
{
Econ:1.5,
Auth:-1,
Culture:0,
agreeAdjustIndex:1,
disagreeAdjustIndex:.25
}
},
{
text: "I support the expansion of global trade. By utilising each countries advantages, we all can recieve cheaper goods.",
questionId:1,
qEffects:
{
Econ:.5,
Auth:0,
Culture:0,
agreeAdjustIndex:1,
disagreeAdjustIndex:1
}
},
{
text: "Global trade has largely ended in the exploitation of the global poor. If a safe workplace that provides a livable wage cannot produce something cheap enough for mass consumption, we can't ethically consume it. ",
questionId:1,
qEffects:
{
Econ:-1,
Auth:0,
Culture:0,
agreeAdjustIndex:1,
disagreeAdjustIndex:1
}
},
{
text: "Tariffs are neccesary to keep goods made in our country viable, and are good for our economy overall. ",
questionId:1,
qEffects:
{
Econ:1,
Auth:0,
Culture:0,
agreeAdjustIndex:1,
disagreeAdjustIndex:1
}
},
{
text: "A tax on total assets of the wealthiest is a good idea.",
questionId:1,
qEffects:
{
Econ:-1,
Auth:0,
Culture:0,
agreeAdjustIndex:1,
disagreeAdjustIndex:.75
}
},
//Cultural and authoritarian axis
{
text: "Abortion should be illegal in all cases.",
questionId:3,
qEffects:
{
Econ: 0,
Auth:1.25,
Culture:-1.25,
agreeAdjustIndex:1,
disagreeAdjustIndex:.25
}
},
{
text: "In all but select cases, abortion is ethically wrong.",
questionId:4,
qEffects:
{
Econ: 0,
Auth:0,
Culture:-.75,
agreeAdjustIndex:1,
disagreeAdjustIndex:.75
}
},
{
text: "Gay marriage should be legal.",
questionId:5,
qEffects:
{
Econ: 0,
Auth:-1.25,
Culture:+1,
agreeAdjustIndex:.5,
disagreeAdjustIndex:1
}
},
{
text: "The state has no right to regulate the weapons citizens can own.",
questionId:6,
qEffects:
{
Econ: 0,
Auth: -1.5,
Culture:0,
agreeAdjustIndex:1,
disagreeAdjustIndex:.5
}
},
{
text: "The government should criminalize all recreational drugs including alchohol, tobacco, and weed, and harshly punish possessors.",
questionId:7,
qEffects:
{
Econ: 0,
Auth: 1,
Culture:-1.5,
agreeAdjustIndex:1,
disagreeAdjustIndex:.5
}
},
{
text: "While I support background checks and some regulation, I believe most citizens should be able to own guns.",
questionId:8,
qEffects:
{
Econ: 0,
Auth: -.5,
Culture:0,
agreeAdjustIndex:1,
disagreeAdjustIndex:1
}
},
{
text: "You cannot have a just moral system without being religious.",
questionId:9,
qEffects:
{
Econ: 0,
Auth: .25,
Culture:-1.5,
agreeAdjustIndex:1,
disagreeAdjustIndex:.5
}
},
{
text: "Gender is a social construct; what makes a man and a woman differ among cultures",
questionId:10,
qEffects:
{
Econ: 0,
Auth: 0,
Culture:1.25,
agreeAdjustIndex:1,
disagreeAdjustIndex:1
}
},
{
text: "All races are created equal",
questionId:11,
qEffects:
{
Econ: 0,
Auth: 0,
Culture:1.5,
agreeAdjustIndex:1,
disagreeAdjustIndex:.15
}
},
{
text: "Nudism should be socially normalised, and nudity should be made legal in public. The state cannot make one wear pants.",
questionId:12,
qEffects:
{
Econ: 0,
Auth: -1,
Culture:1,
agreeAdjustIndex:1,
disagreeAdjustIndex:.5
}
},
{
text: "Transgender men/women are men/women as any other. Like being tall or short, being “trans or cis” makes them no less men/women.",
questionId:13,
qEffects:
{
Econ: 0,
Auth: 0,
Culture:.75,
agreeAdjustIndex:1,
disagreeAdjustIndex:1
},
},
{
text: "Trans women should be able to compete with other women in sports, so long as they have undergone hormone replacement therapy.",
questionId:14,
qEffects:
{
Econ: 0,
Auth: -.25,
Culture:.75,
agreeAdjustIndex:1,
disagreeAdjustIndex:1
},
},
{
text: "My culture is superior to other cultures.",
questionId:1,
qEffects:
{
Econ:0,
Auth:0,
Culture:-.5,
agreeAdjustIndex:1,
disagreeAdjustIndex:1
}
},
{
text: "My countries culture needs to be protected and perserved. Immigrants must come from countries that share my countries value, others should be turned away.",
questionId:1,
qEffects:
{
Econ:0,
Auth:1.5,
Culture:-1,
agreeAdjustIndex:1,
disagreeAdjustIndex:.5
}
},
{
text: "The right to self defense and defense of one's home should be absolute. If an intruder enters my home, they have forfeit their right to life",
questionId:1,
qEffects:
{
Econ:0,
Auth:-.5,
Culture:-.5,
agreeAdjustIndex:1,
disagreeAdjustIndex:1
}
},
{
text: "EU, the UN, and other international governing bodies should have more power and a greater sphere of influence.",
questionId:1,
qEffects:
{
Econ:0,
Auth:.5,
Culture:.25,
agreeAdjustIndex:1,
disagreeAdjustIndex:1
}
},
{
text: "The world would be a better place if it was under one EU-like governing body.",
questionId:1,
qEffects:
{
Econ:0,
Auth:1,
Culture:.5,
agreeAdjustIndex:1,
disagreeAdjustIndex:1
}
},
]