Open the runnable lablab.js
Download lab.js(()=>{
if(location.protocol==='file:')document.querySelectorAll('[data-course-return]').forEach(a=>a.hidden=true);
const form=document.querySelector('#chooser-form');if(!form)return;
const summary=document.querySelector('#error-summary'),result=document.querySelector('#recommendation'),demo=document.querySelector('#demo-lesson');
const choices={starting:{title:'Problem Solving',reason:'A step-by-step coding-problem lesson. Basic programming helps you follow the examples.'},reviewing:{title:'Code Quality',reason:'A lesson for people who can already write code and want to make it readable and reviewable.'},design:{title:'Product Eye',reason:'A product-review lesson. No coding prerequisite is needed for the review exercises.'}};
form.addEventListener('submit',event=>{
event.preventDefault();const selected=form.querySelector('input[name=goal]:checked');
if(!selected){summary.hidden=false;result.hidden=true;demo.hidden=true;form.querySelector('fieldset').setAttribute('aria-describedby','error-summary');form.querySelector('input').focus();return;}
const choice=choices[selected.value];summary.hidden=true;form.querySelector('fieldset').removeAttribute('aria-describedby');demo.hidden=true;
document.querySelector('#result-heading').textContent='Suggested start: '+choice.title;document.querySelector('#result-reason').textContent=choice.reason;document.querySelector('#open-demo').textContent='Open the '+choice.title+' teaching destination';document.querySelector('#demo-heading').textContent='Teaching destination: '+choice.title;result.hidden=false;document.querySelector('#result-heading').focus();
});
document.querySelector('#open-demo').addEventListener('click',()=>{demo.hidden=false;document.querySelector('#demo-heading').focus();});
document.querySelector('[data-reset]').addEventListener('click',()=>{form.reset();summary.hidden=true;result.hidden=true;demo.hidden=true;form.querySelector('fieldset').removeAttribute('aria-describedby');form.querySelector('input').focus();});
})();