Contact
Events
Resources

Members Only

// Fit Matcher Logic - WPCode Snippet (function() { window.rawData = []; window.calculatedResults = []; const csvUrl = 'https://docs.google.com/spreadsheets/d/e/2PACX-1vQ5Zmi0AmQaYgvVI-00Gwzra2vA2TSb9k4ceqFjHHciGNwTTYCC3W-yViIGV7oHf-VsHziDMvbJUBAg/pub?gid=300748426&single=true&output=csv'; // Ensure PapaParse is loaded const script = document.createElement('script'); script.src = 'https://cdnjs.cloudflare.com/ajax/libs/PapaParse/5.4.1/papaparse.min.js'; script.onload = function() { Papa.parse(csvUrl, { download: true, header: true, skipEmptyLines: true, complete: function(results) { window.rawData = results.data; const select = document.getElementById('userMajor'); if (select) { const majors = Array.from(new Set(window.rawData.map(function(item) { return item['Major/Program'] ? item['Major/Program'].trim() : null; }))).filter(Boolean).sort(); majors.forEach(function(m) { select.add(new Option(m, m)); }); } } }); }; document.head.appendChild(script); window.toggleTestFields = function() { const type = document.getElementById('userTestType').value; document.getElementById('satScoreDiv').classList.toggle('hidden', type !== 'SAT'); document.getElementById('actScoreDiv').classList.toggle('hidden', type !== 'ACT'); }; window.toggleAPFields = function() { const count = parseInt(document.getElementById('userAPCount').value) || 0; document.getElementById('apScoreDiv').classList.toggle('hidden', count === 0); }; window.calculateFit = function() { const selectedMajor = document.getElementById('userMajor').value; const gpa = parseFloat(document.getElementById('userGPA').value) || 0; const testType = document.getElementById('userTestType').value; const sat = parseInt(document.getElementById('userSAT').value) || 0; const act = parseInt(document.getElementById('userACT').value) || 0; const apCount = parseInt(document.getElementById('userAPCount').value) || 0; const apScore = parseInt(document.getElementById('userAPScore').value) || 0; const weightMap = { 'Strong': 3, 'Typical': 2, 'Weak': 1, 'Not Required': 0 }; const essay = weightMap[document.getElementById('userEssay').value]; const ec = weightMap[document.getElementById('userEC').value]; const rec = weightMap[document.getElementById('userRec').value]; window.calculatedResults = window.rawData.filter(function(row) { return row['Major/Program']?.trim() === selectedMajor && row['Major Availability']?.trim() === 'Available'; }).map(function(row) { let score = 3; const minGpa = parseFloat(row['Min GPA']) || 0; const testReq = row['Test Requirement']?.trim(); if (gpa < minGpa) score = Math.min(score, 1); if (testReq === 'Required') { if (testType === 'None' || (testType === 'SAT' && sat < parseInt(row['Min SAT'])) || (testType === 'ACT' && act < parseInt(row['Min ACT']))) score = Math.min(score, 1); } if (apCount < (parseInt(row['Min APs Needed']) || 0) || (apCount > 0 && apScore < (parseInt(row['Min AP Score Needed']) || 0))) score = Math.min(score, 2); ['Essay Weight', 'EC Weight', 'Recommendation Letter Weight'].forEach(function(col, i) { if (weightMap[row[col]?.trim()] > [essay, ec, rec][i]) score = Math.min(score, 2); }); row.fitLabel = score === 3 ? 'Strong Fit' : (score === 2 ? 'Borderline' : 'Poor Fit'); return row; }); window.renderResults(); }; })();