Skip to content

Commit e9b30d3

Browse files
caswelltomclaude
andcommitted
Enhanced Quick Study + personalised welcome-back (v1.0.17)
- Quick Study: add objectives/modules sub-selector matching Quiz Me panel - Quick Study: show last 3 sessions with Resume buttons at top of panel - checkWelcomeBack: show proper assistant message (name, topic, days ago, study stats, quiz score) instead of bare chip; chips: Continue/Show my progress/Start something new - handleSuggestionClick: intercept Continue/Show my progress/Start something new chips as special actions instead of sending as messages - handleShowProgress: new dedicated progress panel (study sessions + quiz history + clear button) opened via chip or from suggestions - Settings panel: new My Progress section showing recent sessions and quiz history with optional clear button Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent bf55fff commit e9b30d3

File tree

9 files changed

+415
-29
lines changed

9 files changed

+415
-29
lines changed

amd/build/chat.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

amd/build/chat.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

amd/build/ui.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

amd/build/ui.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

amd/src/chat.js

Lines changed: 283 additions & 23 deletions
Large diffs are not rendered by default.

amd/src/ui.js

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2308,6 +2308,77 @@ define([
23082308
}
23092309
content.appendChild(savedSection);
23102310

2311+
// ── My Progress ──
2312+
if (config.studySessions !== undefined || config.quizHistory !== undefined) {
2313+
const progSection = document.createElement('div');
2314+
progSection.className = 'aica-settings-panel__section';
2315+
const progHead = document.createElement('h3');
2316+
progHead.className = 'aica-settings-panel__section-title';
2317+
progHead.textContent = 'My Progress';
2318+
progSection.appendChild(progHead);
2319+
2320+
const studySessions = config.studySessions || [];
2321+
const quizHistory = config.quizHistory || [];
2322+
2323+
if (studySessions.length === 0 && quizHistory.length === 0) {
2324+
const p = document.createElement('p');
2325+
p.className = 'aica-settings-panel__empty-note';
2326+
p.textContent = 'No study activity yet for this course.';
2327+
progSection.appendChild(p);
2328+
} else {
2329+
if (studySessions.length > 0) {
2330+
const totalMins = studySessions.reduce(function(s, x) { return s + (x.minutes || 0); }, 0);
2331+
const studyPara = document.createElement('p');
2332+
studyPara.className = 'aica-settings-panel__empty-note';
2333+
studyPara.textContent = studySessions.length + ' study session' +
2334+
(studySessions.length !== 1 ? 's' : '') + ' \u00b7 ' + totalMins + ' min total';
2335+
progSection.appendChild(studyPara);
2336+
studySessions.slice().reverse().slice(0, 5).forEach(function(sess) {
2337+
const item = document.createElement('div');
2338+
item.className = 'aica-settings-panel__bookmark-item';
2339+
const txt = document.createElement('p');
2340+
txt.className = 'aica-settings-panel__bookmark-text';
2341+
const dateStr = new Date(sess.ts).toLocaleDateString(undefined, {month: 'short', day: 'numeric'});
2342+
txt.textContent = sess.topic + ' \u00b7 ' + sess.minutes + ' min \u00b7 ' + dateStr;
2343+
item.appendChild(txt);
2344+
progSection.appendChild(item);
2345+
});
2346+
}
2347+
if (quizHistory.length > 0) {
2348+
const quizLabel = document.createElement('p');
2349+
quizLabel.className = 'aica-settings-panel__empty-note';
2350+
quizLabel.style.marginTop = '8px';
2351+
quizLabel.textContent = quizHistory.length + ' quiz' + (quizHistory.length !== 1 ? 'zes' : '') + ' taken';
2352+
progSection.appendChild(quizLabel);
2353+
quizHistory.slice().reverse().slice(0, 5).forEach(function(q) {
2354+
const item = document.createElement('div');
2355+
item.className = 'aica-settings-panel__bookmark-item';
2356+
const txt = document.createElement('p');
2357+
txt.className = 'aica-settings-panel__bookmark-text';
2358+
const pct = q.total > 0 ? Math.round((q.score / q.total) * 100) : 0;
2359+
const dateStr = q.date ? new Date(q.date).toLocaleDateString(undefined, {month: 'short', day: 'numeric'}) : '';
2360+
txt.textContent = q.topic + ' \u00b7 ' + pct + '% \u00b7 ' + dateStr;
2361+
item.appendChild(txt);
2362+
progSection.appendChild(item);
2363+
});
2364+
}
2365+
if (callbacks.onClearProgress) {
2366+
const clearBtn = document.createElement('button');
2367+
clearBtn.type = 'button';
2368+
clearBtn.className = 'aica-quiz-setup__cancel';
2369+
clearBtn.style.cssText = 'display:block;width:100%;padding:8px;font-size:0.8em;margin-top:6px;';
2370+
clearBtn.textContent = 'Clear progress data';
2371+
clearBtn.addEventListener('click', function() {
2372+
if (!window.confirm('Clear all study sessions and quiz history for this course?')) { return; }
2373+
callbacks.onClearProgress();
2374+
panel.remove();
2375+
});
2376+
progSection.appendChild(clearBtn);
2377+
}
2378+
}
2379+
content.appendChild(progSection);
2380+
}
2381+
23112382
// Avatar section appended last so it appears at the bottom of settings.
23122383
if (avatarSection) {
23132384
content.appendChild(avatarSection);

db/upgrade.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,5 +195,12 @@ function xmldb_local_ai_course_assistant_upgrade($oldversion) {
195195
upgrade_plugin_savepoint(true, 2026030701, 'local', 'ai_course_assistant');
196196
}
197197

198+
if ($oldversion < 2026030800) {
199+
// v1.0.17: Enhanced Quick Study (objectives/modules sub-select, recent sessions),
200+
// personalised welcome-back message, progress panel, Settings progress section.
201+
// No schema changes needed.
202+
upgrade_plugin_savepoint(true, 2026030800, 'local', 'ai_course_assistant');
203+
}
204+
198205
return true;
199206
}

styles.css

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -953,6 +953,54 @@
953953
}
954954
}
955955

956+
/* Quick Study — recent sessions list */
957+
.aica-study-setup__recent-list {
958+
display: flex;
959+
flex-direction: column;
960+
gap: 6px;
961+
margin-bottom: 4px;
962+
}
963+
964+
.aica-study-setup__recent-item {
965+
display: flex;
966+
align-items: center;
967+
justify-content: space-between;
968+
gap: 8px;
969+
padding: 7px 10px;
970+
background: #f9fafb;
971+
border: 1px solid #e5e7eb;
972+
border-radius: 8px;
973+
font-size: 12px;
974+
}
975+
976+
.aica-study-setup__recent-info {
977+
color: #374151;
978+
flex: 1;
979+
min-width: 0;
980+
overflow: hidden;
981+
text-overflow: ellipsis;
982+
white-space: nowrap;
983+
}
984+
985+
.aica-study-setup__resume-btn {
986+
flex-shrink: 0;
987+
background: #4a6cf7;
988+
color: #fff;
989+
border: none;
990+
border-radius: 6px;
991+
padding: 4px 10px;
992+
font-size: 11px;
993+
font-weight: 600;
994+
cursor: pointer;
995+
line-height: 1.4;
996+
}
997+
998+
@media (hover: hover) {
999+
.aica-study-setup__resume-btn:hover {
1000+
background: #3a5ce4;
1001+
}
1002+
}
1003+
9561004
/* =========================================================
9571005
Quiz card (interactive questions)
9581006
========================================================= */

version.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
defined('MOODLE_INTERNAL') || die();
2626

2727
$plugin->component = 'local_ai_course_assistant';
28-
$plugin->version = 2026030701;
28+
$plugin->version = 2026030800;
2929
$plugin->requires = 2024100700; // Moodle 4.5+.
3030
$plugin->maturity = MATURITY_STABLE;
31-
$plugin->release = '1.0.16';
31+
$plugin->release = '1.0.17';

0 commit comments

Comments
 (0)