mcp-quiz-server
Version:
๐ง AI-Powered Quiz Management via Model Context Protocol (MCP) - Create, manage, and take quizzes directly from VS Code, Claude, and other AI agents.
46 lines (37 loc) โข 1.77 kB
JavaScript
/**
* Test Auto-Start Timer Settings Update
* Quick browser console test to verify checkbox updates
*/
// Test auto-start timer checkbox updating
console.log('๐งช Testing auto-start timer checkbox updates...');
// Get elements
const autoStartCheckbox = document.querySelector('#auto-start-timer');
const settingsService = SettingsService.getInstance();
if (!autoStartCheckbox) {
console.error('โ Auto-start timer checkbox not found!');
} else {
console.log('โ
Auto-start timer checkbox found:', autoStartCheckbox);
// Check current state
const currentSettings = settingsService.getSettings();
console.log('๐ง Current autoStartTimer setting:', currentSettings.quiz.autoStartTimer);
console.log('๐๏ธ Current checkbox state:', autoStartCheckbox.checked);
// Test programmatic update
console.log('๐ Testing programmatic setting update...');
settingsService.updateQuizSettings({ autoStartTimer: true });
setTimeout(() => {
const newSettings = settingsService.getSettings();
console.log('๐ Updated autoStartTimer setting:', newSettings.quiz.autoStartTimer);
console.log('๐ Updated checkbox state:', autoStartCheckbox.checked);
if (autoStartCheckbox.checked === newSettings.quiz.autoStartTimer) {
console.log('โ
Settings sync working correctly!');
} else {
console.error('โ Settings sync NOT working - checkbox not updated');
}
// Test reverse
settingsService.updateQuizSettings({ autoStartTimer: false });
setTimeout(() => {
console.log('๐ Final checkbox state:', autoStartCheckbox.checked);
console.log('๐ Final setting state:', settingsService.getSettings().quiz.autoStartTimer);
}, 100);
}, 100);
}