import { lessons } from './lessons.js'; import { sources } from './sources.js'; import { courseRegister, advancedArffPlan, radiotelephonyPlan } from './course-catalog.js'; import { readState, saveState, summary, storageAvailable, freshSession } from './state.js'; const $=id=>document.getElementById(id), esc=s=>String(s).replace(/[&<>"']/g,c=>({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c])); const shapes={home:'',book:'',plane:'',chart:'',folder:'',people:'',person:'',shield:'',play:'',arrow:'',spark:'',voice:'',stop:'',clock:'',check:'',radio:'',tower:'',bird:'',download:'',save:''}; const icon=(name)=>``; const fillIcons=()=>document.querySelectorAll('[data-icon]').forEach(e=>e.innerHTML=icon(e.dataset.icon)); const titles={home:'Overview',learning:'My learning',catalog:'Course register','advanced-arff':'Advanced ARFF',radiotelephony:'Radio & route trainer',node:'Local node',progress:'My progress',resources:'Resource library',instructor:'Instructor desk'}; let state=readState(), page='home', speechRun=0, speaking=false, toastTimer, speechTimer, pendingNotes=null; const speechOK='speechSynthesis' in window && 'SpeechSynthesisUtterance' in window; const route=i=>`simulator.html?lesson=${i}`; const status=s=>s.ended?'Completed':s.started?'In progress':'Ready to start'; const lessonDescriptions=['Separate what you can see from what you still need to confirm.','Keep the team’s shared picture current as new information arrives.','Bring facts, resource gaps and learning points into the handover.']; const pathways=[{title:'Aircraft marshalling',icon:'plane',subtitle:'Pathway preview',body:'A proposed pathway for ground movement awareness and aircraft marshalling.',items:['Local apron rules and authorised roles','Aircraft danger areas and communication arrangements','Instructor-led signal practice and assessment'],note:'Signal demonstrations and approved local procedures have not been added.'},{title:'AVOP & aerodrome familiarisation',icon:'tower',subtitle:'Pathway preview',body:'A proposed pathway for aerodrome vehicle operations and local familiarisation.',items:['Local airfield layout and access permissions','Radio procedures and runway incursion awareness','Supervised local driving and competence assessment'],note:'This preview does not issue a driving permit or authorise access.'},{title:'Wildlife hazard awareness',icon:'bird',subtitle:'Pathway preview',body:'A proposed pathway for recognising, reporting and recording wildlife hazards.',items:['Local species and observed activity','Reporting through the aerodrome’s approved arrangements','Site procedures, records and instructor-led scenarios'],note:'Site-specific wildlife plans and control methods have not been added.'}]; function toast(text){clearTimeout(toastTimer);$('toast').textContent=text;$('toast').hidden=false;toastTimer=setTimeout(()=>$('toast').hidden=true,4200);} function updateHeader(){state=readState();$('learner-name').textContent=state.learner||'Learner';$('save-status').textContent=storageAvailable()?'● Progress on this device':'Progress storage unavailable';} function openModal(label,html){stopSpeech();$('modal-label').textContent=label;$('modal-body').innerHTML=html;if(!$('academy-dialog').open)$('academy-dialog').showModal();fillIcons();} function stopSpeech(){speechRun++;clearTimeout(speechTimer);if(speechOK)window.speechSynthesis.cancel();speaking=false;document.querySelector('.prof-card')?.classList.remove('prof-active');const s=$('prof-status');if(s)s.textContent='Portrait with device narration';const b=$('guide-read');if(b)b.textContent='Read answer aloud';} function narrate(text){stopSpeech();if(!speechOK){toast('Voice is unavailable in this browser. The guidance remains on screen.');return;}const run=speechRun,u=new SpeechSynthesisUtterance(text),voices=window.speechSynthesis.getVoices();u.voice=voices.find(v=>/^en[-_]ZA/i.test(v.lang))||voices.find(v=>/^en[-_]GB/i.test(v.lang))||voices.find(v=>/^en/i.test(v.lang))||null;u.lang=u.voice?.lang||'en-GB';u.rate=.94;u.onstart=()=>{if(run!==speechRun)return;speaking=true;document.querySelector('.prof-card')?.classList.add('prof-active');if($('prof-status'))$('prof-status').textContent='Prof’s guidance is being read aloud';if($('guide-read'))$('guide-read').textContent='Stop narration';};u.onend=()=>{if(run===speechRun)stopSpeech();};u.onerror=()=>{if(run!==speechRun)return;stopSpeech();toast('Device voice is unavailable. Read the guidance on screen.');};window.speechSynthesis.speak(u);speechTimer=setTimeout(()=>{if(run===speechRun&&!speaking){stopSpeech();toast('Voice did not start. All guidance is also available as text.');}},4500);} function courseCards(){return ``;} function heading(eyebrow,title,body){return `

${eyebrow}

${title}

${body}

`;} function outlines(){return `
${pathways.map((x,i)=>``).join('')}
`;} function catalogRows(query=''){const q=query.trim().toLowerCase(),rows=courseRegister.courses.filter(c=>!q||`${c.sequence} ${c.officialName} ${c.approvalDate}`.toLowerCase().includes(q));return rows.length?rows.map(c=>{const tag=c.sequence===6?'a':'article',link=c.sequence===6?' href="#advanced-arff"':'';return `<${tag} class="register-card${c.sequence===6?' featured-register':''}"${link}>${String(c.sequence).padStart(2,'0')}

${esc(c.officialName)}${c.sequence===6?' OPEN BUILD →':''}

Official Opspec name · approved ${esc(c.approvalDate)}

✓ Scope entry verifiedDigital profile draft
`;}).join(''):`
${icon('book')}

No matching scope entry.

Try another course name or sequence number.

`;} function catalog(){return heading('CONTROLLED COURSE REGISTER','The real AM Risk training scope.','A read-only academy view of the official SACAA Opspec course names. It shows what is in the approved scope and what still needs to be built for digital delivery.')+`
ATO NUMBER${esc(courseRegister.atoNumber)}${esc(courseRegister.organisation)}
VERIFIED SCOPE ENTRIES25Current Opspec source snapshot
DIGITALLY RELEASED0Profiles still require controlled mapping
${icon('shield')}Two different truths are shown. “Scope entry verified” confirms the course name appears in the controlled Opspec source. “Digital profile draft” means the online curriculum is not yet approved or released.
Source effective ${esc(courseRegister.effectiveDate)} · expires ${esc(courseRegister.expiryDate)} · register verified ${esc(courseRegister.verifiedDate)}

25 official scope entries

Official source spelling is preserved.

${catalogRows()}

Register status: human ATO review required. ${esc(courseRegister.reconciliation)}. The three scenario-lab exercises remain demonstrations and are not listed here as released courses.

`;} function bindCatalog(){if(!$('catalog-search'))return;$('catalog-search').addEventListener('input',e=>{$('catalog-results').innerHTML=catalogRows(e.target.value);fillIcons();});} function advancedArff(){const p=advancedArffPlan;return heading('COURSE BUILD / '+p.courseId,'Advanced Aircraft Firefighting.','The first controlled digital course build. Its training journey is designed; formal release remains locked until authorised humans approve every source, assessment and practical definition.')+`
COURSE VERSION${esc(p.versionId)}
ATO SCOPE✓ VERIFIED
DIGITAL RELEASELOCKED · DRAFT

Six-module learner journey

CONTROLLED BUILD
${p.modules.map(m=>`
${m[0]}

${esc(m[1])}

${esc(m[2])}

${m[0]==='04'?'SCENARIOS READY':'DRAFT'}
`).join('')}

Assessment pathway

NO AUTOMATIC COMPETENCY
${p.assessments.map((x,i)=>`
0${i+1}${esc(x)}Authorised review required
`).join('')}
`;} function radiotelephony(){const p=radiotelephonyPlan,s=p.scenario,pts=s.points;const point=(id)=>pts.find(x=>x.id===id);const routeLines=s.route.slice(0,-1).map((id,i)=>{const a=point(id),b=point(s.route[i+1]);return ``;}).join('');return heading('NOTION-BACKED PRACTICAL / '+p.courseId,'Radio & route trainer.','Learn the call, say the readback, then move the vehicle marker through a training airport layout. The simulator is practice evidence only; PARTAC and instructor sign-off remain human controlled.')+`
CONTROLLED CORENOTION · v1.1
COURSE STATUS${esc(p.status)}
VATSIM BRIDGEOPTIONAL HANDOFF

1 · Hear and speak

DEVICE VOICE
${esc(s.calls[0].from)}

${esc(s.calls[0].text)}

The check looks for key phrases only. It does not grade competence.

2 · Move the vehicle

GENERIC TRAINING LAYOUT

${esc(s.title)}

${esc(s.airport)}

0 / ${pts.length-1} points
${routeLines}${pts.map((x,i)=>`${esc(x.label)}`).join('')}

Start at the RFFS station. Follow the marked route and stop when instructed.

`;} function nodePage(){return heading('AM RISK TRAINING NODE','Your academy, inside the client site.','The same academy can run from one local computer and serve approved tablets and laptops over the site network—even when the internet is disconnected.')+`
${icon('shield')}

AM Risk Training Node

Academy · records · controlled content

CHECKING THIS HOST…
${icon('folder')}

Local content drive

Videos, manuals and site overlays

${icon('spark')}

Local Prof model

Optional Ollama model

${icon('radio')}

MCP tools

Five read-only training tools

${icon('people')}

Client-site network

Approved devices use the node IP

ACADEMYPORT 8080
MCPPORT 8000
LOCAL AIPORT 11434
INTERNETOPTIONAL AFTER SETUP

HOW THE CLIENT SITE WORKS

One appliance. Many approved devices.

The server and training drive stay at the client site. Learners open the academy in a browser. Videos stream from the local SSD, Prof uses the local model and approved retrieval library, and records remain on the controlled runtime volume.

01 Content volume is read-only02 Learner records use a separate protected volume03 AI cannot approve competence or certificates04 Updates arrive as signed controlled packs

On the public Hugging Face preview this page shows the architecture. When served by the local Training Node, it reads live storage, model and course-pack status from the same machine.

`;} async function bindNode(){if(!$('node-live'))return;try{const r=await fetch('/api/node/status',{cache:'no-store'});if(!r.ok)throw new Error('preview');const s=await r.json();$('node-live').textContent='● LOCAL NODE ONLINE';$('node-live').classList.add('online');$('node-content').textContent=`${s.content.videos} videos · ${s.content.documents} documents · ${s.content.images} images`;$('node-ai').textContent=s.local_ai.available?`${s.local_ai.model} ready`:`${s.local_ai.model} configured · model offline`;$('node-note').textContent=`Live node: ${s.node_name}. Content root ${s.content_root_available?'available':'missing'}. Course release: ${s.course_pack.release_status}.`; }catch{$('node-live').textContent='PUBLIC CLOUD PREVIEW';}} function bindRadioTrainer(){if(!$('radio-play'))return;const p=radiotelephonyPlan,s=p.scenario,points=s.points;let callIndex=0,routeIndex=0;const speak=text=>{if(!speechOK){toast('Device voice is unavailable. Read the call on screen.');return;}stopSpeech();const u=new SpeechSynthesisUtterance(text);u.lang='en-GB';u.rate=.9;window.speechSynthesis.speak(u);};const updateCall=()=>{$('radio-instruction').textContent=s.calls[callIndex].text;$('radio-feedback').textContent='The check looks for key phrases only. It does not grade competence.';$('radio-readback').value='';};$('radio-play').onclick=()=>speak(s.calls[callIndex].text);$('radio-next').onclick=()=>{callIndex=(callIndex+1)%s.calls.length;updateCall();};$('radio-check').onclick=()=>{const answer=$('radio-readback').value.toLowerCase();const missing=s.calls[callIndex].expected.filter(term=>!answer.includes(term));$('radio-feedback').textContent=missing.length?`Keep practising. Key words not found: ${missing.join(', ')}. Ask your instructor to review the complete call.`:'Key phrases found for this practice attempt. An instructor must review the full transmission and context.';$('radio-feedback').classList.toggle('good',!missing.length);};const updateRoute=()=>{$('route-progress').textContent=`${routeIndex} / ${points.length-1} points`;const marker=$('vehicle-marker'),current=points[routeIndex];marker.setAttribute('cx',current.x);marker.setAttribute('cy',current.y);document.querySelectorAll('.route-point').forEach((el,i)=>el.classList.toggle('active',i<=routeIndex));$('route-note').textContent=routeIndex===points.length-1?'Route complete for this practice run. Record it for instructor review; it is not a driving authorisation.':`Vehicle marker at ${current.label}. Follow the next instruction before moving.`;};$('route-move').onclick=()=>{if(routeIndex{routeIndex=0;updateRoute();};updateCall();updateRoute();} function home(){const s=summary(state),all=s.complete===3;return `

Your next step towards readiness.

A place to learn, practise and build clearer decisions.

PEOPLE · PREPARE · PROTECT
AM Risk rescue vehicle at an airport at sunset
AM RISK & TRAINING / ARFF ACADEMY

Train today.
Be ready tomorrow.

Step into the scenario. Read the scene.
Build your reasoning with Prof.

${icon('play')} ${all?'Revisit the training lab':s.decisions?'Continue learning':'Start your first scenario'} ${icon('arrow')}
REAL TRAINING STARTS WITH A CLEARER PICTURE
${icon('book')}
03Guided exercises
${icon('check')}
${String(s.complete).padStart(2,'0')} / 03Exercises completed
${icon('chart')}
${String(s.decisions).padStart(2,'0')} / 09Decisions practised

Your training ground

View my learning ↗
${courseCards()}

Where the academy can go next

PATHWAY PREVIEWS
${outlines()}
${icon('shield')} LEARN WITH PURPOSE${icon('plane')} THINK THROUGH THE SCENE${icon('people')} REFLECT WITH YOUR INSTRUCTOR
`;} function learning(){return heading('YOUR LEARNING JOURNEY','Small steps. Stronger understanding.','Work through three guided ARFF practice exercises, then discuss your decisions with an instructor.')+`
Advanced ARFF course concept artwork

ARFF / PRACTICE PATHWAY

Read. Decide. Reflect.

Explore an illustrative aircraft scene, choose a response and see why it matters. Each exercise ends with your own debrief.

01 Observe the scene and identify missing information02 Make three decisions and review the feedback03 Keep a practice record for an instructor discussion

Available exercises

${summary(state).complete} OF 3 COMPLETED
${courseCards()}

Future learning pathways

OUTLINES FOR REVIEW
${outlines()}

The supplied Advanced ARFF artwork shows the academy’s intended direction. This version contains the three practice exercises above; it is not the complete Advanced ARFF course.

`;} function progress(){const s=summary(state);return heading('YOUR PRACTICE RECORD','See how far you’ve come.','Your actual exercise activity, saved in this browser. These are practice records, not competence certificates.')+`
PATHWAY COMPLETION${s.percent}%Completed exercises
EXERCISES COMPLETED${s.complete} / 3Current practice attempts
DECISIONS PRACTISED${s.decisions} / 9Across current attempts
STRONGEST RESPONSES${s.correct} / ${s.decisions}First choices in these exercises

Your exercises

SAVED ON THIS DEVICE
${lessons.map((l,i)=>{const a=state.sessions[i];return ``;}).join('')}
EXERCISESTATUSFIRST CHOICES
0${i+1} · ${l.title}${status(a)}${a.answers.length?a.answers.filter(x=>x.correct).length+' / '+a.answers.length:'—'}${a.ended?'Review':a.started?'Continue':'Start'} ↗

Progress stays in this browser and is not synced to other devices. Clearing browser data removes it. Restarting an exercise replaces that attempt; completed attempts also appear below.

Completed attempt history

LATEST 40 ATTEMPTS
${state.history.length?`
${[...state.history].reverse().map(x=>``).join('')}
EXERCISECOMPLETEDFIRST CHOICES
${lessons[x.lesson].title}${esc(formatDate(x.date))}${x.score} / 3
`:'
'+icon('chart')+'

Your first completion will appear here.

Complete all three decisions and open the debrief in an exercise.

Start practising →
'}
`;} function resources(){return heading('THE RESOURCE LIBRARY','Know where your learning comes from.','Start with the official organisations. Applicable editions and local procedures must be selected for your approved training programme.')+`
${sources.map(s=>`
${s.name}

${s.title}

${s.scope}

${s.status}
↗
`).join('')}

Your organisation’s manuals

${icon('folder')}

A place for your approved material.

No AM Risk manuals, aerodrome emergency plans or local SOPs have been added to this demonstration. The instructor desk includes a space to record the documents and editions you want to use.

Open instructor desk →

These links are source directories and publication pages. The academy does not claim approval, accreditation or full alignment with ICAO, NFPA, EASA, SACAA or UK CAA.

`;} function instructor(){return heading('INSTRUCTOR DESK','Put your expertise into the academy.','Review the authored exercises, record local context and export your review notes. This desk is a demonstration workspace on this device.')+`

Curriculum review

3 exercises · 9 decisions · authored feedback

Awaiting qualified instructor review
${lessons.map((l,i)=>`
0${i+1} · ${l.title} — ${l.aim}

${l.intro}

${l.steps.map((q,j)=>`

${j+1}. ${q.title}

${q.prompt}

    ${q.options.map(o=>`
  1. ${o.correct?'✓ ':''}${o.text}
  2. `).join('')}

Feedback for the strongest response: ${q.options.find(o=>o.correct).feedback}

`).join('')}
`).join('')}

Review the applicable authority, adopted editions, learning outcomes and assessment arrangements before using content in formal training.

YOUR LOCAL CONTEXT

Instructor review notes

Saved only in this browser. This is not a shared approval workflow. Avoid entering sensitive operational or learner information.

${state.reviewNotes?'Saved notes loaded from this device.':'Your notes will appear here when saved.'}

Before a formal course launches

01 Confirm authority, syllabus and editions02 Add approved local procedures and scenarios03 Validate questions and practical assessments04 Establish learner records and instructor sign-off
`;} function formatDate(value){const d=new Date(value);return Number.isNaN(d.getTime())?'Date unavailable':d.toLocaleString('en-ZA',{dateStyle:'medium',timeStyle:'short'});} function render(){stopSpeech();state=readState();page=location.hash.slice(1);if(!titles[page])page='home';$('page-name').textContent=titles[page].toUpperCase();document.title=`${titles[page]} | AM Risk & Training`;$('page-content').innerHTML=({home,learning,catalog,'advanced-arff':advancedArff,radiotelephony,node:nodePage,progress,resources,instructor}[page])();document.querySelectorAll('[data-page]').forEach(a=>{a.classList.toggle('selected',a.dataset.page===page);if(a.dataset.page===page)a.setAttribute('aria-current','page');else a.removeAttribute('aria-current');});updateHeader();fillIcons();bindPage();bindCatalog();bindNode();bindRadioTrainer();} function bindPage(){document.querySelectorAll('[data-pathway]').forEach(b=>b.addEventListener('click',()=>{const p=pathways[Number(b.dataset.pathway)];openModal('PATHWAY PREVIEW',`

${p.title}

${p.body}

Suggested learning areas

    ${p.items.map(x=>`
  • ${x}
  • `).join('')}

${p.note} This outline is for curriculum planning, not a completed course.

`);$('outline-instructor').onclick=()=>$('academy-dialog').close();}));document.querySelectorAll('[data-guide]').forEach(b=>b.onclick=openGuide);if($('prof-welcome'))$('prof-welcome').onclick=()=>speaking?stopSpeech():narrate('Hi, I’m Prof, your AM Risk learning guide. Start with Smoke at stand four. Explore the three observation points, then make your decisions. We will reflect on what you knew, what was missing, and what you should discuss with your instructor. Your progress is saved on this device.');if($('export-progress'))$('export-progress').onclick=()=>showReport('YOUR PRACTICE RECORD',practiceReport(),'AM-Risk-practice-record.txt');if($('reset-practice'))$('reset-practice').onclick=()=>{openModal('RESET PRACTICE PROGRESS','

Start a fresh practice pathway?

This clears the three exercise attempts and their completion history on this device. Your display name and instructor notes stay saved. Export a practice record first if you want to keep your results.

');$('cancel-reset').onclick=()=>$('academy-dialog').close();$('confirm-reset').onclick=()=>{const s=readState();s.sessions=lessons.map(freshSession);s.history=[];if(saveState(s)){$('academy-dialog').close();render();toast('Practice progress reset on this device.');}else toast('Browser storage unavailable. Progress was not reset.');};};if($('review-notes')){const input=$('review-notes');input.value=pendingNotes??state.reviewNotes;input.oninput=()=>{pendingNotes=input.value;$('notes-status').textContent='Unsaved changes — use Save notes.';};$('save-notes').onclick=saveNotes;$('export-review').onclick=()=>{saveNotes();showReport('INSTRUCTOR REVIEW',reviewReport(),'AM-Risk-curriculum-review.txt');};}} function saveNotes(){const s=readState();s.reviewNotes=$('review-notes').value;const ok=saveState(s);pendingNotes=ok?null:s.reviewNotes;$('notes-status').textContent=ok?'Notes saved on this device.':'Notes could not be saved. Export or copy them before leaving.';toast(ok?'Instructor notes saved.':'Browser storage unavailable. Copy your notes.');} const guideTopics=[{label:'Where do I start?',keys:/start|begin|first|course|learn/i,text:'Start with “Smoke at stand 04”. Explore the three observation points, choose Start briefing, and work through three decisions. You can return later: this browser keeps your current attempt.',href:route(0),link:'Start the first exercise'}, {label:'What is ARFF?',keys:/arff|rescue|fire|purpose|life/i,text:'ARFF means aircraft rescue and firefighting. The high-level purpose centres on saving lives, supporting survivable conditions and escape. This demo practises observation, communication and reflection; operational methods belong to your approved training and local procedures.',href:'#resources',link:'Explore the official references'}, {label:'What can I ask you?',keys:/prof|avatar|ai|talk|voice|question/i,text:'I’m a guided learning character in this version. These answers are written learning notes, and the audio uses a voice on your device. My photograph is a still portrait. For now I can explain the exercises, progress and reference library; I am not an open-ended AI instructor.',href:'#learning',link:'Explore your learning pathway'}, {label:'Where are the standards?',keys:/icao|nfpa|easa|sacaa|caa|standard|regulation|certif|qualif/i,text:'The resource library links to ICAO, NFPA, EASA, SACAA and UK CAA. Full standards and licensed publications have not been loaded. A qualified instructor must confirm the applicable editions and map the curriculum before this becomes formal standards-based training.',href:'#resources',link:'Open the reference library'}, {label:'How is progress saved?',keys:/progress|score|save|record|result/i,text:'Completing an exercise adds one of three completions. The score counts your first choices against the authored responses. Both your current attempts and up to 40 completed attempts stay in this browser. Clearing its data removes them; records do not sync to another device.',href:'#progress',link:'View your actual progress'}]; function openGuide(){openModal('MEET YOUR LEARNING GUIDE',`
Prof

Let’s find your next step.

Guided answers · Portrait with device narration

Choose a topic, or search these learning notes.

${guideTopics.map((t,i)=>``).join('')}

These are authored answers, not a live AI conversation. No model token or login is required.

`);let answer='';const choose=t=>{stopSpeech();answer=t.text;$('guide-answer').replaceChildren();const p=document.createElement('p');p.textContent=t.text;const a=document.createElement('a');a.href=t.href;a.textContent=t.link+' →';a.onclick=()=>$('academy-dialog').close();$('guide-answer').append(p,a);};document.querySelectorAll('[data-topic]').forEach(b=>b.onclick=()=>choose(guideTopics[Number(b.dataset.topic)]));$('guide-form').onsubmit=e=>{e.preventDefault();const q=$('guide-query').value.trim();choose(guideTopics.find(t=>t.keys.test(q))||{text:'That topic is not in these guided notes yet. For a technical or operational question, record it for your instructor and check the applicable approved source. I can help you find the current practice exercises and reference library.',href:'#instructor',link:'Record a question for your instructor'});};$('guide-read').onclick=()=>speaking?stopSpeech():narrate(answer);choose(guideTopics[0]);} function practiceReport(){const s=readState(),p=summary(s);return ['AM RISK & TRAINING — PRACTICE RECORD','Not a certificate or assessment of operational competence.',`Learner label: ${s.learner}`,`Exported: ${new Date().toISOString()}`,`Completed: ${p.complete}/3 | Decisions answered: ${p.decisions}/9 | Strongest first choices: ${p.correct}/${p.decisions}`,'',...lessons.flatMap((l,i)=>{const a=s.sessions[i];return [`${i+1}. ${l.title} — ${status(a)}`,...a.answers.flatMap((v,j)=>[`${j+1}. ${l.steps[j].title}`,`Your first choice: ${l.steps[j].options[v.choice].text}`,`Feedback: ${l.steps[j].options[v.choice].feedback}`]),''];}),'COMPLETED ATTEMPT HISTORY',...s.history.map(x=>`${x.date} | ${lessons[x.lesson].title} | ${x.score}/3`),'','Records are editable browser data, not verified learner evidence.','Instructor discussion: Which information was missing? Which local procedures apply? What practical assessment should follow?'].join('\n');} function reviewReport(){return ['AM RISK & TRAINING — CURRICULUM REVIEW','Draft demonstration content — instructor validation pending',`Exported: ${new Date().toISOString()}`,'','INSTRUCTOR NOTES',readState().reviewNotes||'(No saved notes.)','',...lessons.flatMap((l,i)=>[`${i+1}. ${l.title} — ${l.aim}`,l.intro,...l.steps.flatMap((q,j)=>[`${j+1}. ${q.title}`,q.prompt,...q.options.map((o,k)=>`${String.fromCharCode(65+k)}. ${o.text}${o.correct?' [Strongest authored response]':''}\nFeedback: ${o.feedback}`)]),'']),'OFFICIAL REFERENCES',...sources.map(s=>`${s.name}: ${s.url}\n${s.status}`)].join('\n');} function showReport(label,text,filename){openModal(label,'

Keep a copy of your record.

Copy the text below, or save a text file. Some embedded browsers may not support downloads.

');$('record-text').value=text;$('copy-record').onclick=async()=>{try{await navigator.clipboard.writeText(text);$('copy-record').textContent='Copied ✓';}catch{$('record-text').focus();$('record-text').select();$('copy-record').textContent='Text selected — copy now';}};$('download-record').onclick=()=>{const url=URL.createObjectURL(new Blob([text],{type:'text/plain;charset=utf-8'})),a=document.createElement('a');a.href=url;a.download=filename;document.body.append(a);a.click();a.remove();setTimeout(()=>URL.revokeObjectURL(url),30000);};} $('profile-button').onclick=()=>{openModal('YOUR DEVICE PROFILE','

Make this your learning space.

This is a display name on this device, not a login or verified learner record.

');$('profile-name').value=readState().learner;$('profile-form').onsubmit=e=>{e.preventDefault();const s=readState();s.learner=$('profile-name').value.trim()||'Learner';if(saveState(s)){updateHeader();$('academy-dialog').close();toast('Display name saved on this device.');}else toast('Browser storage is unavailable. The name could not be saved.');};}; $('about-academy').onclick=()=>openModal('ABOUT THIS ACADEMY','

AM Risk. Your training ground.

This working demonstration combines your supplied AM Risk artwork with a 3D aircraft scene, three authored practice exercises, device narration, saved browser progress and an instructor review desk.

About Prof

The academy uses your supplied still portrait. Narration uses the device’s voice. The scenario lab also offers a stylised animated 3D guide. A realistic video avatar and open-ended AI conversation are not connected.

Training scope

These practice scenarios are illustrative. Full standards, approved local manuals and formal assessment have not been added. The source library explains the role of each authority.

Your data

Progress, display name and notes are saved in this browser, not sent to a learner database. There is no account sync. The hosting service and font provider receive normal page requests; your browser or operating system determines how device narration is processed.

'); document.querySelector('.skip').onclick=e=>{e.preventDefault();$('page-content').focus();}; $('close-modal').onclick=()=>$('academy-dialog').close();$('academy-dialog').addEventListener('close',stopSpeech);$('academy-dialog').addEventListener('click',e=>{if(e.target!==$('academy-dialog'))return;const r=e.target.getBoundingClientRect();if(e.clientXr.right||e.clientYr.bottom)e.target.close();}); window.addEventListener('hashchange',()=>{render();window.scrollTo({top:0});$('page-content').focus({preventScroll:true});});window.addEventListener('storage',()=>{if(page==='instructor'&&pendingNotes!==null){updateHeader();return;}render();});window.addEventListener('pagehide',stopSpeech);window.addEventListener('beforeunload',e=>{if(pendingNotes!==null){e.preventDefault();e.returnValue='';}});document.addEventListener('visibilitychange',()=>{if(document.hidden)stopSpeech();});render();