SSC CGL Typing Test
Practice or take the SSC CGL typing test (English/Hindi). Measures gross WPM, net WPM, accuracy, errors, and provides a downloadable result.
0
Gross WPM
0
Net WPM
100%
Accuracy
0
Errors
10:00
Time Left
Click "Start Test" to begin. Your passage will appear here with real-time highlighting.
⚠️ Paste operation detected! This may invalidate your official test results.
Recent Test History
`;
const printWindow = window.open('', '_blank');
printWindow.document.write(certificateHTML);
printWindow.document.close();
printWindow.focus();
printWindow.print();
}
saveToHistory() {
const historyKey = 'sscTypingTestHistory';
let history = JSON.parse(localStorage.getItem(historyKey) || '[]');
const testResult = {
date: new Date().toISOString(),
mode: this.elements.testMode.value,
language: this.elements.language.value,
netWPM: this.stats.netWPM,
accuracy: this.stats.accuracy,
passed: this.stats.netWPM >= this.elements.targetWPM.value && this.stats.accuracy >= this.elements.accuracyThreshold.value,
duration: this.elements.duration.value
};
history.unshift(testResult);
// Keep only the last few results
if (history.length > CONFIG.maxHistoryEntries) {
history = history.slice(0, CONFIG.maxHistoryEntries);
}
localStorage.setItem(historyKey, JSON.stringify(history));
}
loadHistory() {
const historyKey = 'sscTypingTestHistory';
const history = JSON.parse(localStorage.getItem(historyKey) || '[]');
if (history.length > 0) {
this.elements.historyPanel.style.display = 'block';
}
}
showHistory() {
const historyKey = 'sscTypingTestHistory';
const history = JSON.parse(localStorage.getItem(historyKey) || '[]');
if (history.length === 0) {
this.elements.historyList.innerHTML = '
No test history available
';
return;
}
let historyHTML = '';
history.forEach((test, index) => {
const date = new Date(test.date).toLocaleDateString();
const statusColor = test.passed ? '#28a745' : '#d9534f';
const statusText = test.passed ? 'PASS' : 'FAIL';
historyHTML += `
${date}
${test.mode} - ${test.language}
${test.netWPM} WPM
${statusText} (${test.accuracy}%)
`;
});
this.elements.historyList.innerHTML = historyHTML;
this.elements.historyPanel.style.display = 'block';
}
clearHistory() {
localStorage.removeItem('sscTypingTestHistory');
this.elements.historyPanel.style.display = 'none';
this.showTempMessage('History cleared!');
}
showTempMessage(message) {
const messageDiv = document.createElement('div');
messageDiv.className = 'alert alert-info';
messageDiv.textContent = message;
messageDiv.style.position = 'fixed';
messageDiv.style.top = '20px';
messageDiv.style.right = '20px';
messageDiv.style.zIndex = '9999';
messageDiv.style.minWidth = '200px';
document.body.appendChild(messageDiv);
setTimeout(() => {
if (messageDiv.parentNode) {
messageDiv.parentNode.removeChild(messageDiv);
}
}, 3000);
}
announceToScreenReader(message) {
const announcement = document.createElement('div');
announcement.setAttribute('aria-live', 'polite');
announcement.setAttribute('aria-atomic', 'true');
announcement.style.position = 'absolute';
announcement.style.left = '-10000px';
announcement.style.width = '1px';
announcement.style.height = '1px';
announcement.style.overflow = 'hidden';
document.body.appendChild(announcement);
announcement.textContent = message;
setTimeout(() => {
if (announcement.parentNode) {
announcement.parentNode.removeChild(announcement);
}
}, 1000);
}
}// =====================================
// INITIALIZE APPLICATION
// =====================================document.addEventListener('DOMContentLoaded', function() {
new SSCTypingTest();
});