aboutsummaryrefslogtreecommitdiff
path: root/course.html
diff options
context:
space:
mode:
Diffstat (limited to 'course.html')
-rw-r--r--course.html6
1 files changed, 3 insertions, 3 deletions
diff --git a/course.html b/course.html
index c61a901..c14979c 100644
--- a/course.html
+++ b/course.html
@@ -132,9 +132,9 @@ async function renderChapters(){
}
const p2 = prog(); const all = (MANIFEST.chapters||[]).flatMap(c=>(c.lessons||[]).map(l=>({c,l})));
const first = all.find(x=>!p2.completed[x.l.id]) || all[0];
- if(first) openLesson(first.c.id, first.l.id);
+ if(first) openLesson(first.c.id, first.l.id, false);
}
-async function openLesson(chId, lessonId){
+async function openLesson(chId, lessonId, doTrack = true){
$('reader').innerHTML = '<p class="small">Loading lesson…</p>';
try{
const ch = await fetch(BASE+'chapters/'+chId+'.json?v='+V).then(r=>r.json());
@@ -171,7 +171,7 @@ async function openLesson(chId, lessonId){
$('quiz-msg').style.color = ok ? 'var(--green)' : 'var(--rose)';
if(ok) completeLesson(l.id, 5);
});
- track('lesson_open', {lesson:l.id});
+ if (doTrack) track('lesson_open', {lesson:l.id});
}catch(e){ $('reader').innerHTML = '<p style="color:var(--rose)">Failed: '+esc(e.message)+'</p>'; }
}
function completeLesson(id, xp){