Writen Test For job preparation by infinite ilm | Test no 1

/* 3D Card Effect */
.test-container {
perspective: 1000px;
max-width: 800px;
margin: 20px auto;
font-family: ‘Segoe UI’, Tahoma, Geneva, Verdana, sans-serif;
}
.test-card {
position: relative;
transform-style: preserve-3d;
transition: all 0.5s ease;
box-shadow: 0 10px 30px rgba(0,0,0,0.2);
border-radius: 15px;
background: white;
padding: 20px;
}
/* Form styling */
.user-info-form {
background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
padding: 20px;
border-radius: 10px;
margin-bottom: 30px;
}
.form-group {
margin-bottom: 15px;
}
.form-group label {
display: block;
margin-bottom: 5px;
font-weight: bold;
}
.form-group input, .form-group select {
width: 100%;
padding: 10px;
border: 1px solid #ddd;
border-radius: 5px;
box-sizing: border-box;
}
/* Test styling */
.test-header {
text-align: center;
margin-bottom: 20px;
padding-bottom: 10px;
border-bottom: 2px solid #eee;
}
.test-timer {
position: sticky;
top: 10px;
background: #ff5722;
color: white;
padding: 10px;
border-radius: 5px;
text-align: center;
z-index: 100;
margin-bottom: 20px;
}
.test-section {
margin-bottom: 30px;
}
.section-title {
background: #3f51b5;
color: white;
padding: 10px;
border-radius: 5px;
margin-bottom: 15px;
}
.mcq-question {
margin-bottom: 20px;
padding: 15px;
border-radius: 8px;
background: #f9f9f9;
position: relative;
}
.mcq-question-text {
font-weight: bold;
margin-bottom: 10px;
}
.mcq-option {
display: block;
margin: 8px 0;
padding: 10px;
border-radius: 5px;
cursor: pointer;
transition: all 0.3s;
border: 1px solid #ddd;
}
.mcq-option:hover {
background: #e3f2fd;
}
.mcq-option.selected {
background: #bbdefb;
border-color: #2196f3;
}
.mcq-option input[type=”radio”] {
margin-right: 10px;
}
/* Result card styling */
.result-card {
display: none;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
padding: 30px;
border-radius: 15px;
box-shadow: 0 10px 30px rgba(0,0,0,0.3);
transform-style: preserve-3d;
margin-top: 30px;
}
.result-header {
text-align: center;
margin-bottom: 20px;
}
.result-title {
font-size: 28px;
margin-bottom: 5px;
text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}
.user-details {
background: rgba(255,255,255,0.1);
padding: 15px;
border-radius: 10px;
margin-bottom: 20px;
}
.result-section {
margin-bottom: 15px;
}
.result-section h3 {
border-bottom: 1px solid rgba(255,255,255,0.3);
padding-bottom: 5px;
}
.result-row {
display: flex;
justify-content: space-between;
margin-bottom: 5px;
}
/* Buttons */
.btn {
background: #4CAF50;
color: white;
border: none;
padding: 10px 20px;
border-radius: 5px;
cursor: pointer;
font-size: 16px;
transition: all 0.3s;
}
.btn:hover {
background: #45a049;
transform: translateY(-2px);
}
.btn-start {
background: #2196F3;
display: block;
margin: 20px auto;
padding: 12px 30px;
font-size: 18px;
}
.btn-start:hover {
background: #0b7dda;
}
.btn-submit {
background: #ff5722;
display: block;
margin: 30px auto;
padding: 12px 30px;
font-size: 18px;
}
.btn-submit:hover {
background: #e64a19;
}
.btn-download {
background: #9c27b0;
display: block;
margin: 20px auto;
}
.btn-download:hover {
background: #7b1fa2;
}
/* Ad space */
.ad-space {
width: 100%;
height: 250px;
background: #f1f1f1;
display: flex;
align-items: center;
justify-content: center;
margin: 20px 0;
border: 1px dashed #ccc;
}
.ad-space p {
color: #888;
}
/* Responsive */
@media (max-width: 768px) {
.test-container {
padding: 10px;
}
.mcq-option {
padding: 8px;
}
}
/* پرنٹ بٹن اسٹائل */
.btn-print {
background: #4CAF50;
color: white;
border: none;
padding: 12px 25px;
border-radius: 5px;
font-size: 16px;
cursor: pointer;
margin: 20px auto;
display: block;
}
@media print {
/* پرنٹ ہونے پر غیر ضروری عناصر چھپائیں */
body * {
visibility: hidden;
}
.result-card, .result-card * {
visibility: visible;
}
.result-card {
position: absolute;
left: 0;
top: 0;
width: 100%;
background: white;
box-shadow: none;
margin: 0;
padding: 20px;
}
/* پرنٹ بٹن خود بھی چھپائیں */
.btn-print, .btn-download {
display: none !important;
}
}
.result-card {
background: white;
color: black;
max-width: 800px;
margin: 20px auto;
padding: 20px;
box-shadow: 0 0 10px rgba(0,0,0,0.1);
}
@media print {
.result-card {
box-shadow: none;
border: 1px solid #ddd;
page-break-after: always; /* نیا صفحہ شروع کرے */
}
}
Infinite Ilm MCQ Test
Click the correct answer for each question
(adsbygoogle = window.adsbygoogle || []).push({});
(adsbygoogle = window.adsbygoogle || []).push({});
Infinite Ilm Result Card
Candidate Information
–
–
–
–
–
Test Results
0/20
0/20
0/20
0/20
0/20
0/100
// Correct answers (you should expand this for all 100 questions)
const correctAnswers = {
// English Section (1-20)
q1: “c”, // She doesn’t like coffee.
q2: “b”, // Joyful
q3: “c”, // Fox
q4: “c”, // Receive
q5: “b”, // Went
q6: “c”, // London
q7: “b”, // What’s your name?
q8: “b”, // Children
q9: “b”, // Red
q10: “c”, // End
q11: “c”, // Playing
q12: “b”, // The mouse was chased by the cat.
q13: “b”, // Better
q14: “b”, // Quickly
q15: “a”, // They’re
q16: “b”, // The dog barks loudly.
q17: “b”, // Mice
q18: “b”, // And
q19: “b”, // Separate
q20: “c”, // He said that he was happy.
// Islamiyat Section (21-40)
q21: “b”, // 5
q22: “c”, // Surah Yaseen
q23: “a”, // Cave of Hira
q24: “b”, // 4
q25: “c”, // Masjid Quba
q26: “a”, // Surah Al-Baqarah
q27: “a”, // Surah Al-Kawthar
q28: “a”, // Khadija (RA)
q29: “b”, // 2 AH
q30: “a”, // Abu Bakr (RA)
q31: “a”, // 2
q32: “a”, // Iqra
q33: “a”, // Bilal (RA)
q34: “a”, // Hijra
q35: “a”, // Sumayyah (RA)
q36: “b”, // 114
q37: “c”, // Ramadan
q38: “b”, // 2 AH
q39: “a”, // Muharram
q40: “c”, // Hamza (RA)
// Pakistan Studies Section (41-60)
q41: “b”, // 1947
q42: “c”, // Quaid-e-Azam Muhammad Ali Jinnah
q43: “b”, // 1940
q44: “a”, // Urdu
q45: “d”, // All of these
q46: “b”, // 1956
q47: “b”, // 2500 BC
q48: “d”, // Balochistan
q49: “b”, // Jasmine
q50: “c”, // 1998
q51: “b”, // 1906
q52: “b”, // Lahore
q53: “b”, // Hockey
q54: “c”, // Afghanistan
q55: “c”, // Quaid-e-Azam Muhammad Ali Jinnah
q56: “b”, // Nishan-e-Imtiaz
q57: “c”, // Markhor
q58: “c”, // Karachi
q59: “c”, // Indus
q60: “b”, // Radcliffe Line
// General Knowledge Section (61-80)
q61: “c”, // Pacific Ocean
q62: “c”, // 7
q63: “b”, // Japan
q64: “c”, // Canberra
q65: “b”, // Mars
q66: “b”, // Egypt
q67: “b”, // Nile River
q68: “a”, // Yen
q69: “b”, // Brazil
q70: “d”, // Antarctic Desert
q71: “c”, // Green
q72: “c”, // Leonardo da Vinci
q73: “c”, // Nitrogen
q74: “a”, // 206
q75: “b”, // Australia
q76: “c”, // Ottawa
q77: “c”, // Venus
q78: “b”, // France
q79: “d”, // Pancreas
q80: “c”, // China
// Current Affairs Section (81-100)
q81: “b”, // Shehbaz Sharif
q82: “c”, // Maryam Nawaz
q83: “a”, // Dr. Usman Anwar
q84: “b”, // Punjab Police
q85: “c”, // 15
q86: “b”, // Punjab
q87: “b”, // Asif Ali Zardari
q88: “c”, // India
q89: “a”, // e-Rupee
q90: “b”, // Lahore
q91: “d”, // 22%
q92: “a”, // Arshad Nadeem
q93: “d”, // Ministry of National Food Security
q94: “c”, // Metro Bus
q95: “d”, // NUST
q96: “d”, // 280-300
q97: “d”, // No summit held
q98: “a”, // PIA
q99: “b”, // Home Department
q100: “d” // Above 30%
};
// Timer variables
let timeLeft = 50 * 60; // 50 minutes in seconds
let timerInterval;
// DOM elements
const startTestBtn = document.getElementById(‘startTestBtn’);
const submitTestBtn = document.getElementById(‘submitTestBtn’);
const downloadResultBtn = document.getElementById(‘downloadResultBtn’);
const userInfoForm = document.getElementById(‘userInfoForm’);
const mcqTest = document.getElementById(‘mcqTest’);
const resultCard = document.getElementById(‘resultCard’);
const testTimer = document.getElementById(‘testTimer’);
// Start test button click handler
startTestBtn.addEventListener(‘click’, function() {
// Validate form
const userName = document.getElementById(‘userName’).value;
const userEducation = document.getElementById(‘userEducation’).value;
const userMobile = document.getElementById(‘userMobile’).value;
const userEmail = document.getElementById(‘userEmail’).value;
if (!userName || !userEducation || !userMobile || !userEmail) {
alert(‘Please fill in all fields’);
return;
}
// Hide form and show test
userInfoForm.style.display = ‘none’;
mcqTest.style.display = ‘block’;
// Start timer
startTimer();
// Set up option selection styling
setupOptionSelection();
});
// Submit test button click handler
submitTestBtn.addEventListener(‘click’, function() {
// Stop timer
clearInterval(timerInterval);
// Calculate results
const results = calculateResults();
// Show result card
showResultCard(results);
});
// Download result button click handler
downloadResultBtn.addEventListener(‘click’, function() {
// Send data to email
sendResultsToEmail();
// Generate and download PDF
downloadResultPDF();
});
// Function to start timer
function startTimer() {
updateTimerDisplay();
timerInterval = setInterval(function() {
timeLeft–;
updateTimerDisplay();
if (timeLeft <= 0) {
clearInterval(timerInterval);
// Auto-submit the test when time is up
const results = calculateResults();
showResultCard(results);
}
}, 1000);
}
// Function to update timer display
function updateTimerDisplay() {
const minutes = Math.floor(timeLeft / 60);
const seconds = timeLeft % 60;
testTimer.textContent = `Time Remaining: ${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`;
if (timeLeft {
const radio = option.querySelector(‘input[type=”radio”]’);
radio.addEventListener(‘change’, function() {
if (this.checked) {
// Remove selected class from siblings
const siblings = document.querySelectorAll(`input[name=”${this.name}”]`);
siblings.forEach(sib => {
sib.parentElement.classList.remove(‘selected’);
});
// Add selected class to current option
this.parentElement.classList.add(‘selected’);
}
});
});
}
// Function to calculate results
function calculateResults() {
let englishScore = 0;
let islamiyatScore = 0;
let pakStudyScore = 0;
let gkScore = 0;
let currentAffairsScore = 0;
// Check each question
for (let i = 1; i <= 100; i++) {
const questionName = `q${i}`;
const selectedOption = document.querySelector(`input[name="${questionName}"]:checked`);
if (selectedOption && correctAnswers[questionName] === selectedOption.value) {
// Add score based on section
if (i <= 20) englishScore++;
else if (i <= 40) islamiyatScore++;
else if (i <= 60) pakStudyScore++;
else if (i <= 80) gkScore++;
else currentAffairsScore++;
}
}
return {
english: englishScore,
islamiyat: islamiyatScore,
pakStudy: pakStudyScore,
gk: gkScore,
currentAffairs: currentAffairsScore,
total: englishScore + islamiyatScore + pakStudyScore + gkScore + currentAffairsScore
};
}
// Function to show result card
function showResultCard(results) {
// Hide test and show result card
mcqTest.style.display = 'none';
resultCard.style.display = 'block';
// Fill user details
document.getElementById('resultName').textContent = document.getElementById('userName').value;
document.getElementById('resultEducation').textContent = document.getElementById('userEducation').value;
document.getElementById('resultMobile').textContent = document.getElementById('userMobile').value;
document.getElementById('resultEmail').textContent = document.getElementById('userEmail').value;
document.getElementById('resultTestNo').textContent = 'TEST-' + Math.floor(1000 + Math.random() * 9000);
// Fill results
document.getElementById('resultEnglish').textContent = `${results.english}/20`;
document.getElementById('resultIslamiyat').textContent = `${results.islamiyat}/20`;
document.getElementById('resultPakStudy').textContent = `${results.pakStudy}/20`;
document.getElementById('resultGK').textContent = `${results.gk}/20`;
document.getElementById('resultCurrentAffairs').textContent = `${results.currentAffairs}/20`;
document.getElementById('resultTotal').textContent = `${results.total}/100`;
}
// Function to send results to email
function sendResultsToEmail() {
const userName = document.getElementById('userName').value;
const userEmail = document.getElementById('userEmail').value;
const testNo = document.getElementById('resultTestNo').textContent;
const totalScore = document.getElementById('resultTotal').textContent;
// In a real implementation, you would use a server-side script or email service
// This is just a simulation for the demo
console.log(`Sending results to infiniteilmofficial@gmail.com:
Name: ${userName}
Email: ${userEmail}
Test No: ${testNo}
Score: ${totalScore}
`);
// You would typically use an AJAX request to a server-side script here
// For example:
/*
fetch('https://your-server.com/send-email', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
to: 'infiniteilmofficial@gmail.com',
subject: `Test Result – ${testNo}`,
message: `Name: ${userName}nEmail: ${userEmail}nTest No: ${testNo}nScore: ${totalScore}`
})
});
*/
}
// Function to download result as PDF
function downloadResultPDF() {
// In a real implementation, you would use a library like jsPDF
// This is just a simulation for the demo
console.log('Generating PDF…');
// For actual implementation, you would use something like:
/*
const doc = new jsPDF();
doc.text('Infinite Ilm Result Card', 10, 10);
doc.text(`Name: ${document.getElementById('resultName').textContent}`, 10, 20);
// Add all other details
doc.save('Infinite-Ilm-Result.pdf');
*/
// For this demo, we'll just show an alert
alert('PDF download functionality would be implemented here with jsPDF library');
}
document.getElementById('printResultBtn').addEventListener('click', function() {
// پرنٹ سے پہلے ای میل بھیجیں (اگر چاہیں)
sendResultsToEmail();
// براوزر کا پرنٹ ڈائیلاگ کھولیں
window.print();
});
// پرنٹ سے پہلے کچھ تبدیلیاں کرنا
function beforePrint() {
document.body.style.fontSize = '12pt';
document.querySelector('.result-card').style.padding = '0';
}
function afterPrint() {
document.body.style.fontSize = '';
}
window.addEventListener('beforeprint', beforePrint);
window.addEventListener('afterprint', afterPrint);
<!–Add this to your template header if you want actual PDF generation:
–>

