IQ
LLOS Exam Engine Entrance Exam Mock Test Platform

Syllabus Explorer

Navigate the NCERT/CBSE hierarchy structure

Hierarchy

Select an Item

Click on a class, subject, or chapter to view details and drill down.

owLoading() { treeBody.innerHTML = `

Loading...

`; } function showEmpty(message) { treeBody.innerHTML = `

${message}

`; } function render(items, level) { treeBody.innerHTML = ''; currentItems = items; if (items.length === 0) { showEmpty('No items found'); return; } items.forEach(text => { const item = document.createElement('div'); item.className = 'tree-item'; item.innerHTML = `
${getIcon(level)}
${text}
`; item.addEventListener('click', () => onSelect(text)); treeBody.appendChild(item); }); } function updateBreadcrumb() { if (state.level === 'class') { breadcrumb.style.display = 'none'; backBtn.style.display = 'none'; return; } breadcrumb.style.display = 'flex'; backBtn.style.display = 'flex'; let html = 'Classes'; if (state.class) { html += ''; if (state.level === 'subject') { html += `Class ${state.class}`; } else { html += `Class ${state.class}`; } } if (state.subject) { html += ''; if (state.level === 'chapter') { html += `${state.subject}`; } else { html += `${state.subject}`; } } if (state.chapter && state.level === 'topic') { html += ''; html += `${state.chapter}`; } breadcrumb.innerHTML = html; breadcrumb.querySelectorAll('.breadcrumb-item').forEach(el => { el.addEventListener('click', () => { const level = el.dataset.level; goToLevel(level); }); }); } function goToLevel(level) { if (level === 'class') { state = { level: 'class', class: null, subject: null, chapter: null }; loadClasses(); } else if (level === 'subject') { state.level = 'subject'; state.subject = null; state.chapter = null; loadSubjects(); } else if (level === 'chapter') { state.level = 'chapter'; state.chapter = null; loadChapters(); } } function onSelect(value) { if (state.level === 'class') { state.class = value.replace('Class ', ''); loadSubjects(); } else if (state.level === 'subject') { state.subject = value; loadChapters(); } else if (state.level === 'chapter') { state.chapter = value; loadTopics(); } } function loadClasses() { state.level = 'class'; searchInput.value = ''; render(CLASSES, 'class'); updateBreadcrumb(); hideDetail(); } async function loadSubjects() { state.level = 'subject'; searchInput.value = ''; updateBreadcrumb(); if (cache.subjects[state.class]) { render(cache.subjects[state.class], 'subject'); return; } showLoading(); try { const fd = new FormData(); fd.append('class', state.class); const res = await fetch(`${API_BASE}/subjects`, { method: 'POST', body: fd }); const data = await res.json(); cache.subjects[state.class] = data.items || []; render(cache.subjects[state.class], 'subject'); } catch (err) { console.error('Error loading subjects:', err); showEmpty('Failed to load subjects'); } } async function loadChapters() { state.level = 'chapter'; searchInput.value = ''; updateBreadcrumb(); const key = `${state.class}|${state.subject}`; if (cache.chapters[key]) { render(cache.chapters[key], 'chapter'); return; } showLoading(); try { const fd = new FormData(); fd.append('class', state.class); fd.append('subject', state.subject); const res = await fetch(`${API_BASE}/chapters`, { method: 'POST', body: fd }); const data = await res.json(); cache.chapters[key] = data.items || []; render(cache.chapters[key], 'chapter'); } catch (err) { console.error('Error loading chapters:', err); showEmpty('Failed to load chapters'); } } async function loadTopics() { state.level = 'topic'; searchInput.value = ''; updateBreadcrumb(); const key = `${state.class}|${state.subject}|${state.chapter}`; if (cache.topics[key]) { render(cache.topics[key], 'topic'); showDetail(); return; } showLoading(); try { const fd = new FormData(); fd.append('class', state.class); fd.append('subject', state.subject); fd.append('chapter', state.chapter); const res = await fetch(`${API_BASE}/topics`, { method: 'POST', body: fd }); const data = await res.json(); cache.topics[key] = data.items || []; render(cache.topics[key], 'topic'); showDetail(); } catch (err) { console.error('Error loading topics:', err); showEmpty('Failed to load topics'); } } function hideDetail() { detailEmpty.style.display = 'block'; detailContent.style.display = 'none'; } function showDetail() { detailEmpty.style.display = 'none'; detailContent.style.display = 'block'; detailTitle.textContent = state.chapter; detailMeta.textContent = `Class ${state.class} • ${state.subject}`; const key = `${state.class}|${state.subject}|${state.chapter}`; const topics = cache.topics[key] || []; detailBody.innerHTML = `
Topics (${topics.length})
${topics.map(t => `
${t}
`).join('')}
`; } // Search searchInput.addEventListener('input', (e) => { const q = e.target.value.toLowerCase(); const filtered = currentItems.filter(item => item.toLowerCase().includes(q)); render(filtered, state.level); }); // Back button backBtn.addEventListener('click', () => { if (state.level === 'subject') { goToLevel('class'); } else if (state.level === 'chapter') { goToLevel('subject'); } else if (state.level === 'topic') { goToLevel('chapter'); } }); // Initialize loadClasses();