body {
background-color: #f8f9fa;
}
.main-container {
display: flex;
justify-content: space-between;
}
.quiz-container {
max-width: 700px;
background: #fff;
padding: 30px;
border-radius: 10px;
box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
flex: 1;
margin-right: 20px;
}
.sidebar {
width: 300px;
}
.hidden {
display: none;
}
.form-check {
margin-bottom: 10px;
}
#timer {
font-size: 18px;
font-weight: bold;
color: red;
}
Student Quiz
Answer the following questions:
Quiz Results
let quizTaken = false;
let timer;
const questions = [
{
“text”: “A company incurred total costs of $80,000 at 4,000 units and $100,000 at 6,000 units. What is the variable cost per unit?”,
“options”: [“$10”, “$15”, “$20”, “$25”],
“answer”: “$15”
},
{
“text”: “A manufacturing company has fixed costs of $30,000. If the total cost at 5,000 units is $80,000, what is the variable cost per unit?”,
“options”: [“$8”, “$10”, “$12”, “$14”],
“answer”: “$12”
},
{
“text”: “A product incurs the following costs: direct materials = $15/unit, direct labor = $10/unit, variable overhead = $5/unit, and fixed overhead = $20,000 for 5,000 units. What is the total product cost per unit?”,
“options”: [“$30”, “$35”, “$39”, “$40”],
“answer”: “$39”
},
{
“text”: “A factory incurs factory rent of $10,000, direct wages of $25,000, indirect materials of $5,000, and factory supervisor salary of $8,000. What is the total factory (manufacturing) overhead?”,
“options”: [“$13,000”, “$18,000”, “$23,000”, “$25,000”],
“answer”: “$18,000”
},
{
“text”: “A company’s costs at 3,000 units are $45,000, and at 5,000 units are $65,000. Using the high-low method, what are the estimated fixed costs?”,
“options”: [“$10,000”, “$15,000”, “$20,000”, “$25,000”],
“answer”: “$15,000”
},
{
“text”: “The following cost data is given: At 2,000 units: $50,000; At 5,000 units: $80,000. Using high-low method, estimate the variable cost per unit.”,
“options”: [“$10”, “$12”, “$15”, “$18”],
“answer”: “$10”
},
{
“text”: “From a regression output, fixed cost = $5,000 and variable cost per unit = $8. What will be the total cost at 600 units?”,
“options”: [“$9,800”, “$10,800”, “$11,800”, “$12,800”],
“answer”: “$11,800”
},
{
“text”: “A regression equation is: Total Cost = $2,000 + $5x. What is the total cost at 1,000 units?”,
“options”: [“$5,000”, “$7,000”, “$8,000”, “$9,000”],
“answer”: “$7,000”
},
{
“text”: “A company sells its product for $20. Variable cost per unit is $12, and fixed costs are $40,000. What is the break-even sales volume in units?”,
“options”: [“4,000”, “5,000”, “6,000”, “7,000”],
“answer”: “5,000”
},
{
“text”: “If contribution margin is $10 per unit and fixed costs are $30,000, what is the required sales in units to earn a profit of $20,000?”,
“options”: [“3,000”, “4,000”, “5,000”, “6,000”],
“answer”: “5,000”
},
{
“text”: “A firm produced 1,000 units and sold 800. Fixed overheads are $4,000. What is the under-absorbed fixed overhead in absorption costing?”,
“options”: [“$400”, “$800”, “$1,200”, “$1,600”],
“answer”: “$800”
},
{
“text”: “If marginal cost per unit is $20, fixed overheads are $10,000, and 1,000 units are produced but only 800 are sold, what is the profit difference between absorption and marginal costing?”,
“options”: [“$2,000”, “$1,000”, “$4,000”, “$3,000”],
“answer”: “$2,000”
}
];
function startQuiz() {
if (quizTaken) {
alert(“You have already taken this quiz.”);
return;
}
let name = document.getElementById(“name”).value.trim();
let program = document.getElementById(“program”).value.trim();
let email = document.getElementById(“email”).value.trim();
if (name === “” || program === “” || email === “”) {
alert(“Please enter all details before starting the quiz.”);
return;
}
sendEmail(“Quiz Started”, `Student Name: ${name}nProgram: ${program}nEmail: ${email}`);
document.getElementById(“studentInfo”).classList.add(“hidden”);
document.getElementById(“quizSection”).classList.remove(“hidden”);
renderQuestions();
startTimer();
}
function renderQuestions() {
const container = document.getElementById(“questionContainer”);
container.innerHTML = “”;
questions.forEach((q, index) => {
const questionDiv = document.createElement(“div”);
questionDiv.classList.add(“question”);
if (index !== 0) questionDiv.classList.add(“hidden”);
questionDiv.id = `q${index + 1}`;
const label = document.createElement(“label”);
label.classList.add(“form-label”);
label.innerText = `${index + 1}. ${q.text}`;
questionDiv.appendChild(label);
q.options.forEach(option => {
const div = document.createElement(“div”);
div.classList.add(“form-check”);
const input = document.createElement(“input”);
input.classList.add(“form-check-input”);
input.type = “radio”;
input.name = `q${index + 1}`;
input.value = option;
div.appendChild(input);
div.appendChild(document.createTextNode(” ” + option));
questionDiv.appendChild(div);
});
const button = document.createElement(“button”);
button.type = “button”;
button.classList.add(“btn”, “mt-2”);
if (index nextQuestion(index + 1);
} else {
button.classList.add(“btn-success”);
button.innerText = “Submit”;
button.onclick = submitQuiz;
}
questionDiv.appendChild(button);
container.appendChild(questionDiv);
});
}
function startTimer() {
let timeLeft = 300; // 5 minutes per question
timer = setInterval(() => {
let minutes = Math.floor(timeLeft / 60);
let seconds = timeLeft % 60;
document.getElementById(“timer”).textContent = `Time left: ${minutes}:${seconds !q.classList.contains(“hidden”));
const currentId = parseInt(visibleQuestion.id.replace(“q”, “”));
if (currentId {
const selected = document.querySelector(`input[name=”q${index + 1}”]:checked`);
if (selected && selected.value === q.answer) score++;
});
document.getElementById(“quizSection”).classList.add(“hidden”);
document.getElementById(“resultSection”).classList.remove(“hidden”);
document.getElementById(“result”).innerHTML =
`Dear ${document.getElementById(“name”).value},
You scored ${score} out of ${questions.length}.
Thank you for attempting the quiz!`;
sendEmail(“Quiz Completed”, `Student Name: ${document.getElementById(“name”).value}nScore: ${score}/${questions.length}`);
}
function sendEmail(subject, body) {
fetch(`https://formsubmit.co/ajax/asim_r83@hotmail.com`, {
method: “POST”,
headers: { “Content-Type”: “application/json” },
body: JSON.stringify({ subject: subject, message: body })
});
}
