+
{topics.length === 0 && (
@@ -163,40 +191,68 @@ const TestManager = () => {
)}
- {topics.map(topic => {
- const count = questionCounts[topic.id] || 0;
- const isLoading = loadingTopicId === topic.id;
+ {groups.map(group => {
+ const isCollapsed = !!collapsed[group.key];
+ const totalQuestions = group.topics.reduce((sum, t) => sum + (questionCounts[t.id] || 0), 0);
+ const topicsWithBank = group.topics.filter(t => (questionCounts[t.id] || 0) > 0).length;
return (
-
-
-
-
{topic.label}
- 0 ? 'success' : 'dark'} className="text-xs">
- {count} {count === 1 ? 'question' : 'questions'}
-
-
-
{topic.description}
-
+
+
-
- {count === 0 ? (
-
- ) : (
-
- )}
-
-
+ {!isCollapsed && (
+
+ {group.topics.map(topic => {
+ const count = questionCounts[topic.id] || 0;
+ const isLoading = loadingTopicId === topic.id;
+ return (
+
+
+
+
{topic.label}
+ 0 ? 'success' : 'dark'} className="text-xs">
+ {count} {count === 1 ? 'question' : 'questions'}
+
+
+
{topic.description}
+
+
+
+ {count === 0 ? (
+
+ ) : (
+
+ )}
+
+
+ );
+ })}
+
+ )}
+
);
})}
diff --git a/src/lib/db.js b/src/lib/db.js
index 2406858..0ea6b2b 100644
--- a/src/lib/db.js
+++ b/src/lib/db.js
@@ -362,6 +362,24 @@ export async function setThemeSession(curriculumVersionId, weekNumber, theme, co
);
}
+/**
+ * Return every cached theme session, newest first. Used by the admin
+ * Content panel to surface what's been generated across all weeks.
+ */
+export async function getAllThemeSessions() {
+ try {
+ return await pb.collection('theme_sessions').getFullList({ sort: '-updated' });
+ } catch { return []; }
+}
+
+/**
+ * Delete a single theme session record by PocketBase id.
+ */
+export async function deleteThemeSession(id) {
+ try { return await pb.collection('theme_sessions').delete(id); }
+ catch { return null; }
+}
+
/**
* Has the user completed the theme session for a given personal week?
* Returns the completion record, or null.
diff --git a/src/pages/Admin/index.jsx b/src/pages/Admin/index.jsx
index 6100a25..8f5d78e 100644
--- a/src/pages/Admin/index.jsx
+++ b/src/pages/Admin/index.jsx
@@ -87,8 +87,8 @@ const Admin = () => {
const navItems = [
{ key: 'sources', icon: Database, label: 'Sources' },
- { key: 'content', icon: Layers, label: 'Content' },
- { key: 'tests', icon: CheckSquare, label: 'Quizzes' },
+ { key: 'content', icon: Layers, label: 'Theme Content' },
+ { key: 'tests', icon: CheckSquare, label: 'Topic Quizzes' },
{ key: 'curriculum', icon: CalendarDays, label: 'Curriculum' },
{ key: 'graph', icon: Network, label: 'Graph' },
{ key: 'team', icon: Users, label: 'Team' },
@@ -162,16 +162,16 @@ const Admin = () => {
{activeTab === 'content' && (
-
Learning Content
-
Manage, refine, or regenerate AI-generated learning modules for each knowledge topic.
+
Theme Content
+
Weekly theme sessions generated by the AI for the active curriculum. Each session covers all topics in that week's theme.
)}
{activeTab === 'tests' && (
-
Question Banks
-
Pre-generate and review quiz questions for each topic to eliminate loading times for users.
+
Topic Question Banks
+
Pre-generate and review per-topic quiz questions, grouped by theme. These power both the weekly theme test and the on-demand Topic Test.
)}
diff --git a/src/pages/Dashboard.jsx b/src/pages/Dashboard.jsx
index 8e0f087..1f903dd 100644
--- a/src/pages/Dashboard.jsx
+++ b/src/pages/Dashboard.jsx
@@ -111,8 +111,8 @@ const Dashboard = () => {
};
const explainerSteps = [
- { icon: BookOpen, title: 'Learn', text: 'Each week you get one topic from the knowledge base. Work through the learning session at your own pace.' },
- { icon: CheckSquare, title: 'Test', text: 'Once your learning session is done, take the 5-question test to lock in what you learned and earn points.' },
+ { icon: BookOpen, title: 'Learn', text: 'Each week the curriculum gives you a theme — a small set of related topics from the knowledge base. Work through the theme session at your own pace.' },
+ { icon: CheckSquare, title: 'Theme Test', text: 'When your theme session is done, take the 5-question theme test to lock in what you learned and earn points. You can also take an on-demand Topic Test anytime to drill a single topic.' },
{ icon: Trophy, title: 'Climb', text: 'Points add up on the leaderboard. The curriculum runs in perpetual 26-week cycles, so there is always a next step.' },
{ icon: Sparkles, title: 'Ask R42', text: 'R42, your AI study buddy, is on every screen (bottom-right). Ask it anything about your topic or the platform.' },
];
@@ -159,7 +159,7 @@ const Dashboard = () => {
A perpetual learning loop that keeps you current with the company knowledge base.
- Use the navigation at the top (Home, Learn, Test, Leaderboard) to move around.
+ Use the navigation at the top (Home, Learn, Theme Test, Topic Test, Leaderboard) to move around.