1(function(){ 2 var _step = 1; 3 var _admin = false; 4 var _fd = {fullName:'',jobTitle:'',institution:'',email:'',phone:''}; 5 var _sc = {p1q1:3,p1q2:3,p1q3:3,p2q1:3,p2q2:3,p2q3:3,p3q1:3,p3q2:3,p3q3:3,p4q1:3,p4q2:3,p4q3:3}; 6 7 var pillars = [ 8 { id:'p1', title:'Pillar 1: Data Governance & Vendor Compliance', qs:[ 9 {id:'p1q1',q:'If a teacher signs up for a free, unvetted AI platform using student names and emails tonight, does your current infrastructure flag, block, or govern that data leak?'}, 10 {id:'p1q2',q:'Do you have a clear, enforceable Data Processing Agreement (DPA) mapped out for every AI vendor accessed on school networks?'}, 11 {id:'p1q3',q:'How effectively does your IT department audit and monitor shadow AI (unauthorized AI tool usage) among staff and students?'} 12 ]}, 13 { id:'p2', title:'Pillar 2: Pedagogical Alignment & Workflow Optimization', qs:[ 14 {id:'p2q1',q:'Are your teachers using AI to deeply optimize their preparation workflows, or are they just using it to generate raw text that adds more clutter?'}, 15 {id:'p2q2',q:'Is AI integration mapped directly to your specific pedagogical frameworks (e.g., PBL, IB, UDL) rather than being treated as a generic add-on?'}, 16 {id:'p2q3',q:'How consistently are educators trained to design AI prompts that foster critical thinking in students rather than bypassing the learning process?'} 17 ]}, 18 { id:'p3', title:'Pillar 3: Institutional Risk & AI Literacy Policy', qs:[ 19 {id:'p3q1',q:'Is your AI policy a static 20-page manual sitting unread in a shared folder, or is it an active operational workflow built into your daily curriculum?'}, 20 {id:'p3q2',q:'Do you have an established incident response protocol for AI-generated plagiarism, deepfakes, or algorithmic bias?'}, 21 {id:'p3q3',q:'How frequently is your Acceptable Use Policy (AUP) updated to reflect the rapid iterations of generative AI capabilities?'} 22 ]}, 23 { id:'p4', title:'Pillar 4: Digital Resilience & Visionary Leadership', qs:[ 24 {id:'p4q1',q:'When structural shifts alter the educational landscape over the next three years, will your school be reacting to the chaos, or executing from a prepared blueprint?'}, 25 {id:'p4q2',q:'Is there a dedicated AI task force or leadership committee actively budgeting and forecasting for long-term AI infrastructure?'}, 26 {id:'p4q3',q:"How confident is your leadership team in communicating the school's AI strategy to parents, stakeholders, and accreditation boards?"} 27 ]} 28 ]; 29 30 function avg(a,b,c){ return (_sc[a]+_sc[b]+_sc[c])/3; } 31 function calcR(){ 32 var p1=avg('p1q1','p1q2','p1q3'), p2=avg('p2q1','p2q2','p2q3'), 33 p3=avg('p3q1','p3q2','p3q3'), p4=avg('p4q1','p4q2','p4q3'); 34 var pct=Math.round(((p1+p2+p3+p4)/20)*100); 35 var tier,tc; 36 if(pct<40){tier='Tier 1: Systemic Risk';tc='t-red';} 37 else if(pct<=75){tier='Tier 2: Fragmented Integration';tc='t-amber';} 38 else{tier='Tier 3: Strategic Excellence';tc='t-green';} 39 return {p1:p1,p2:p2,p3:p3,p4:p4,pct:pct,tier:tier,tc:tc}; 40 } 41 42 function show(id){ 43 ['audit-step1','audit-step2','audit-step3','audit-admin'].forEach(function(s){ 44 var el=document.getElementById(s); 45 if(el) el.style.display=(s===id)?'block':'none'; 46 }); 47 } 48
49 function renderStep1(){ 50 var el=document.getElementById('audit-step1'); 51 if(!el) return; 52 el.innerHTML= 53 '<div class="a-card a-fade">'+ 54 '<span class="a-badge">Step 1 of 2</span>'+ 55 '<div class="a-h2">Discovery Profile</div>'+ 56 '<div class="a-sub">Please provide your professional details to generate a personalised diagnostic report.</div>'+ 57 '<div class="a-grid">'+ 58 '<div><label class="a-lbl">Full Name</label><input class="a-inp" id="af-name" type="text" placeholder="Dr. Jane Smith" value="'+_fd.fullName+'"></div>'+ 59 '<div><label class="a-lbl">Job Title / Role</label>'+ 60 '<select class="a-inp" id="af-job">'+ 61 '<option value="" '+((!_fd.jobTitle)?'selected':'')+' disabled>Select your role...</option>'+ 62 '<option value="School Leader/Principal" '+((_fd.jobTitle==='School Leader/Principal')?'selected':'')+'>School Leader / Principal</option>'+ 63 '<option value="IT Director" '+((_fd.jobTitle==='IT Director')?'selected':'')+'>IT Director</option>'+ 64 '<option value="Teacher" '+((_fd.jobTitle==='Teacher')?'selected':'')+'>Teacher</option>'+ 65 '<option value="Consultant" '+((_fd.jobTitle==='Consultant')?'selected':'')+'>Consultant</option>'+ 66 '<option value="Other" '+((_fd.jobTitle==='Other')?'selected':'')+'>Other</option>'+ 67 '</select></div>'+ 68 '<div class="a-full"><label class="a-lbl">Institution / School Name</label><input class="a-inp" id="af-inst" type="text" placeholder="Global Academy Intl." value="'+_fd.institution+'"></div>'+ 69 '<div><label class="a-lbl">Professional Email</label><input class="a-inp" id="af-email" type="email" placeholder="[email protected]" value="'+_fd.email+'"></div>'+ 70 '<div><label class="a-lbl">Phone / WhatsApp</label><input class="a-inp" id="af-phone" type="tel" placeholder="+966 5X XXX XXXX" value="'+_fd.phone+'"></div>'+ 71 '</div>'+ 72 '<div class="a-footer"><button class="a-btn-primary" onclick="auditGoStep2()">Proceed to Audit →</button></div>'+ 73 '</div>'; 74 show('audit-step1'); 75 } 76
77 function renderStep2(){ 78 var html='<div class="a-fade"><div style="text-align:center;margin-bottom:22px"><span class="a-badge">Step 2 of 2</span><div class="a-h2" style="margin-top:6px">Institutional Diagnostics</div><div class="a-sub">Rate each question from 1 (Critical Risk) to 5 (Fully Optimized).</div></div>'; 79 pillars.forEach(function(p){ 80 html+='<div class="a-pillar"><div class="a-pillar-title">'+p.title+'</div>'; 81 p.qs.forEach(function(q,i){ 82 html+='<div class="a-q"><div class="a-q-text"><span class="a-q-num">Q'+(i+1)+'.</span>'+q.q+'</div>'; 83 html+='<div class="a-scale-wrap"><div class="a-scale-lbls"><span>1: Critical</span><span>3: Partial</span><span>5: Optimal</span></div><div class="a-scale-btns" id="sb-'+q.id+'">'; 84 for(var v=1;v<=5;v++){ 85 html+='<button class="a-scale-btn'+(_sc[q.id]===v?' sel':'')+'" onclick="auditSetScore(\''+q.id+'\','+v+')">'+v+'</button>'; 86 } 87 html+='</div></div></div>'; 88 }); 89 html+='</div>'; 90 }); 91 html+='<div class="a-bar"><button class="a-btn-back" onclick="auditGoStep1()">← Back</button><button class="a-btn-submit" id="a-sub-btn" onclick="auditSubmit()">Submit & Generate Report ▶</button></div></div>'; 92 document.getElementById('audit-step2').innerHTML=html; 93 show('audit-step2'); 94 } 95
96 function renderStep3(){ 97 var r=calcR(); 98 var diags=[ 99 r.p1<3.5 100 ?'<div class="a-diag d-red"><div><div class="a-diag-title">⚠ Urgent Action (Pillar 1)</div><div class="a-diag-msg">Prioritize establishing a secure Vendor Compliance Layer to govern unvetted AI tools.</div></div></div>' 101 :'<div class="a-diag d-green"><div><div class="a-diag-title">✓ Strong Foundation (Pillar 1)</div><div class="a-diag-msg">Your data governance demonstrates healthy vendor compliance management.</div></div></div>', 102 r.p2<3.5 103 ?'<div class="a-diag d-amber"><div><div class="a-diag-title">⚠ Operational Warning (Pillar 2)</div><div class="a-diag-msg">Focus on designing repeatable, time-saving teacher workflows rather than arbitrary text generation.</div></div></div>' 104 :'<div class="a-diag d-green"><div><div class="a-diag-title">✓ Optimized Workflows (Pillar 2)</div><div class="a-diag-msg">Teachers are effectively leveraging AI for deep pedagogical alignment.</div></div></div>', 105 r.p3<3.5 106 ?'<div class="a-diag d-amber"><div><div class="a-diag-title">⚠ Policy Deficit (Pillar 3)</div><div class="a-diag-msg">Transform static policy manuals into live operational guidelines integrated into daily curriculum.</div></div></div>' 107 :'<div class="a-diag d-green"><div><div class="a-diag-title">✓ Active Policy (Pillar 3)</div><div class="a-diag-msg">Your AI literacy policy acts as a living, operational framework.</div></div></div>', 108 r.p4<3.5 109 ?'<div class="a-diag d-red"><div><div class="a-diag-title">⚠ Strategic Risk (Pillar 4)</div><div class="a-diag-msg">Shift from short-term crisis handling to establishing a long-term architectural blueprint.</div></div></div>' 110 :'<div class="a-diag d-green"><div><div class="a-diag-title">✓ Visionary Leadership (Pillar 4)</div><div class="a-diag-msg">Your leadership is well-positioned to proactively execute structural shifts.</div></div></div>' 111 ]; 112 document.getElementById('audit-step3').innerHTML= 113 '<div class="a-fade">'+ 114 '<div class="a-hero '+r.tc+'">'+ 115 '<div style="font-size:13px;font-weight:700;opacity:.7;margin-bottom:6px">Overall Digital Trust Score</div>'+ 116 '<div class="a-hero-pct">'+r.pct+'%</div>'+ 117 '<div class="a-hero-tier">'+r.tier+'</div>'+ 118 '</div>'+ 119 '<div style="font-size:16px;font-weight:800;color:#1e293b;margin-bottom:12px">Targeted Diagnostics</div>'+ 120 '<div class="a-diag-grid">'+diags.join('')+'</div>'+ 121 '<div class="a-cta">'+ 122 '<h3>Ready to close the gap?</h3>'+ 123 '<p>Based on your results, a targeted strategic intervention is highly recommended. Book an executive consultation to review your custom blueprint.</p>'+ 124 '<a href="https://mohamadmchatila.netlify.app" class="a-cta-btn">Schedule Architecture Review</a>'+ 125 '</div></div>'; 126 show('audit-step3'); 127 } 128 129 function renderAdmin(){ 130 var leads=JSON.parse(localStorage.getItem('audit_leads')||'[]'); 131 var rows=leads.length===0 132 ?'<tr><td colspan="6" class="a-empty">No submissions yet.</td></tr>' 133 :leads.map(function(l){ 134 return '<tr>'+ 135 '<td>'+new Date(l.ts).toLocaleDateString()+'</td>'+ 136 '<td><strong>'+l.name+'</strong><br><span style="font-size:11px;color:#94a3b8">'+l.job+'</span></td>'+ 137 '<td>'+l.inst+'</td>'+ 138 '<td style="color:#2563eb">'+l.email+'<br><span style="color:#64748b">'+l.phone+'</span></td>'+ 139 '<td style="text-align:center;font-weight:800">'+l.pct+'%</td>'+ 140 '<td>'+l.tier.split(':')[0]+'</td>'+ 141 '</tr>'; 142 }).join(''); 143 document.getElementById('audit-admin').innerHTML= 144 '<div class="a-admin a-fade">'+ 145 '<h2>📊 Audit Submissions</h2>'+ 146 '<p>All data collected from visitors who completed the audit. Stored locally in this browser.</p>'+ 147 '<div class="a-tbl-wrap"><table class="a-tbl">'+ 148 '<thead><tr><th>Date</th><th>Name & Role</th><th>Institution</th><th>Contact</th><th style="text-align:center">Score</th><th>Tier</th></tr></thead>'+ 149 '<tbody>'+rows+'</tbody></table></div>'+ 150 '<button class="a-export-btn" onclick="auditExportCSV()">↓ Export CSV</button>'+ 151 '<button class="a-export-btn" style="margin-left:8px;background:#dc2626" onclick="auditClearData()">🗑 Clear All</button>'+ 152 '</div>'; 153 show('audit-admin'); 154 } 155 156 // Global functions 157 window.auditGoStep2=function(){ 158 var n=document.getElementById('af-name').value.trim(); 159 var j=document.getElementById('af-job').value; 160 var ins=document.getElementById('af-inst').value.trim(); 161 var e=document.getElementById('af-email').value.trim(); 162 var ph=document.getElementById('af-phone').value.trim(); 163 if(!n||!j||!ins||!e||!ph){alert('Please fill in all fields.');return;}
164 _fd={fullName:n,jobTitle:j,institution:ins,email:e,phone:ph}; 165 renderStep2(); 166 window.scrollTo({top:0,behavior:'smooth'}); 167 }; 168 window.auditGoStep1=function(){ 169 renderStep1(); 170 window.scrollTo({top:0,behavior:'smooth'}); 171 }; 172 window.auditSetScore=function(id,val){ 173 _sc[id]=val; 174 var c=document.getElementById('sb-'+id); 175 if(c) c.querySelectorAll('.a-scale-btn').forEach(function(b,i){b.classList.toggle('sel',i+1===val);}); 176 }; 177 window.auditSubmit=function(){ 178 var btn=document.getElementById('a-sub-btn'); 179 if(btn){btn.disabled=true;btn.textContent='Saving...';} 180 var r=calcR(); 181 var lead={ts:new Date().toISOString(),name:_fd.fullName,job:_fd.jobTitle,inst:_fd.institution,email:_fd.email,phone:_fd.phone,pct:r.pct,tier:r.tier,scores:JSON.parse(JSON.stringify(_sc))}; 182 // Save to localStorage as backup 183 var leads=JSON.parse(localStorage.getItem('audit_leads')||'[]'); 184 leads.unshift(lead); 185 localStorage.setItem('audit_leads',JSON.stringify(leads)); 186 // Submit to Netlify Forms for central collection 187 var formData=new FormData(); 188 formData.append('form-name','audit-submission'); 189 formData.append('full_name',_fd.fullName); 190 formData.append('job_title',_fd.jobTitle); 191 formData.append('institution',_fd.institution); 192 formData.append('email',_fd.email); 193 formData.append('phone',_fd.phone); 194 formData.append('score',r.pct+'%'); 195 formData.append('tier',r.tier); 196 formData.append('pillar1_score',r.p1.toFixed(1)); 197 formData.append('pillar2_score',r.p2.toFixed(1)); 198 formData.append('pillar3_score',r.p3.toFixed(1)); 199 formData.append('pillar4_score',r.p4.toFixed(1)); 200 fetch('/',{method:'POST',body:formData}).catch(function(err){console.warn('Netlify form submit error:',err);}); 201 renderStep3(); 202 window.scrollTo({top:0,behavior:'smooth'}); 203 }; 204 window.auditExportCSV=function(){ 205 var leads=JSON.parse(localStorage.getItem('audit_leads')||'[]'); 206 if(!leads.length){alert('No data to export.');return;} 207 var hdr='Date,Name,Job Title,Institution,Email,Phone,Score,Tier\n'; 208 var rows=leads.map(function(l){ 209 return '"'+new Date(l.ts).toLocaleDateString()+'","'+l.name+'","'+l.job+'","'+l.inst+'","'+l.email+'","'+l.phone+'",'+l.pct+'%,"'+l.tier+'"'; 210 }).join('\n'); 211 var blob=new Blob([hdr+rows],{type:'text/csv'}); 212 var a=document.createElement('a'); 213 a.href=URL.createObjectURL(blob); 214 a.download='audit_submissions.csv'; 215 a.click(); 216 }; 217 window.auditClearData=function(){ 218 if(confirm('Delete all audit submissions?')){localStorage.removeItem('audit_leads');renderAdmin();} 219 }; 220 window.auditShowAdmin=function(){ 221 _admin=true; 222 if(typeof switchTab==='function') switchTab('audit'); 223 renderAdmin(); 224 }; 225 window.auditHideAdmin=function(){ 226 _admin=false; 227 renderStep1(); 228 }; 229 230 // Expose init so switchTab can call it 231 window.auditInit = function() { renderStep1(); }; 232 233 // Secret admin: click the shield tab icon 5 times quickly 234 var _clicks=0,_timer=null; 235 var tabBtn = document.getElementById('tab-audit'); 236 if(tabBtn) { 237 tabBtn.addEventListener('click',function(){ 238 _clicks++; 239 clearTimeout(_timer); 240 _timer=setTimeout(function(){_clicks=0;},2000); 241 if(_clicks>=5){_clicks=0;window.auditShowAdmin();} 242 }); 243 } 244 245})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.