Unofficial guide · not affiliated with the AAMC, NBME, USMLE, LCME, or NRMP ← SI MedSchool · Exam Admin

Grades export

Analysis-ready data, one row per attempt — built for real assessment workflows (gradebooks, psychometrics, accreditation evidence). Not a PDF summary. Every export is permission-gated and written to the audit trail.

Loading…

"; } // Access resolution. mode: 'login' | 'student' | 'faculty' | 'locked' | 'blocked' function resolveAccess() { var T = window.SITiers, S = window.SISchools; if (!T || !S) return { mode: "login" }; var st = T.getState(); if (!st.loggedIn) return { mode: "login" }; if (st.role === "student") return { mode: "student", studentId: S.getStudentId() }; if (st.role === "faculty") { if (!S.hasInsightsAccess()) return { mode: "locked" }; if (!S.canSeeIndividualRecords()) return { mode: "blocked" }; return { mode: "faculty", schoolId: S.getSchoolId() }; } return { mode: "login" }; } function filterRows(rows, access) { if (access.mode === "student") { if (!access.studentId) return []; return rows.filter(function (r) { return r.student_id === access.studentId; }); } if (access.mode === "faculty") { return rows.filter(function (r) { return r.school_id === access.schoolId; }); } return []; } function stamp() { var d = new Date(); function p(n) { return String(n).padStart(2, "0"); } return d.getFullYear() + p(d.getMonth() + 1) + p(d.getDate()) + "-" + p(d.getHours()) + p(d.getMinutes()); } function download(filename, mime, content) { var blob = new Blob([content], { type: mime + ";charset=utf-8" }); var a = document.createElement("a"); a.href = URL.createObjectURL(blob); a.download = filename; document.body.appendChild(a); a.click(); setTimeout(function () { URL.revokeObjectURL(a.href); a.remove(); }, 500); } function doExport(rows, access, format) { var content, filename, mime, label; if (format === "xls") { content = buildXls(rows); filename = "grades-export-" + stamp() + ".xls"; mime = "application/vnd.ms-excel"; label = "excel"; } else { content = buildCsv(rows); filename = "grades-export-" + stamp() + ".csv"; mime = "text/csv"; label = "csv"; } var scope = access.mode === "student" ? "own:" + (access.studentId || "none") : "school:" + (access.schoolId || "none"); var st = window.SITiers.getState(); window.SISchools.audit("grades.export", JSON.stringify({ by: st.role, scope: scope, rows: rows.length, format: label, at: new Date().toISOString() })); download(filename, mime, content); } function esc(s) { return String(s == null ? "" : s) .replace(/&/g, "&").replace(//g, ">").replace(/"/g, """); } function previewTable(rows) { var show = rows.slice(0, 25); var h = '
' + HEADERS.map(function (c) { return ""; }).join("") + ""; show.forEach(function (r) { h += "" + HEADERS.map(function (c) { return ""; }).join("") + ""; }); h += "
" + esc(c) + "
" + esc(r[c]) + "
"; if (rows.length > 25) h += '

Showing 25 of ' + rows.length + " rows — the download contains all rows.

"; return h; } function init() { var body = document.getElementById("ge-body"); var access = resolveAccess(); if (access.mode === "login") { body.innerHTML = '

Log in to export grades. ' + 'Students export their own rows; faculty at adopted schools export their school\u2019s rows.

' + '

'; document.getElementById("ge-login").addEventListener("click", function () { window.SIAuth.openModal("login", "Log in to export grades"); }); return; } if (access.mode === "locked") { body.innerHTML = '
School adoption
' + '
Student insights unlock with school adoption
' + '

Grades export is a student-insights surface: it unlocks when your school adopts the platform. ' + 'Individual faculty plans include the accreditation toolkit and authoring tools, but not student-level insights.

' + '
Request school adoption
' + '

Institutional pricing is set with your school \u2014 no card required to start the conversation.

'; return; } if (access.mode === "blocked") { window.SISchools.audit("grades.export_blocked", JSON.stringify({ by: "faculty", scope: "school:" + (window.SISchools.getSchoolId() || "none"), reason: "individual_records_not_granted", at: new Date().toISOString() })); body.innerHTML = '

Individual records not granted \u2014 contact your school admin.

' + '

Your school has adopted the platform, but your school admin has not granted individual-record access for your role. ' + 'Aggregates remain available on the analytics page. We never silently swap individual rows for aggregates in an export.

'; return; } // student | faculty — resolve school names, then render. window.SISchools.listSchools(function (schools) { var names = {}; schools.forEach(function (s) { names[s.id] = s.display || s.name; }); var events = []; try { events = JSON.parse(localStorage.getItem("si_learning_events") || "[]"); } catch (e) {} var rows = []; events.forEach(function (e) { var r = normalizeEvent(e, names); if (r) rows.push(r); }); rows = filterRows(rows, access); rows.sort(function (a, b) { return String(a.date_iso).localeCompare(String(b.date_iso)); }); var scopeLabel = access.mode === "student" ? "Your rows only \u00b7 student ID " + esc(access.studentId || "\u2014") : "Your school\u2019s rows \u00b7 " + esc(names[access.schoolId] || access.schoolId); if (!rows.length) { var hint = access.mode === "student" && !access.studentId ? " Add your school student ID in Settings so future activity links to you." : ""; body.innerHTML = '

' + scopeLabel + "

" + '

No recorded activity yet.' + esc(hint) + "

" + '

Exports reflect real recorded learning events only \u2014 nothing is fabricated to fill the table.

'; return; } body.innerHTML = '

' + scopeLabel + "

" + "

" + rows.length + " attempt" + (rows.length === 1 ? "" : "s") + " ready to export. Columns: " + HEADERS.join(", ") + "

" + '
' + '' + '' + "
" + '

CSV ships UTF-8 with BOM; headers are stable with no merged cells. ' + "Every download is written to the audit trail (who, when, scope, row count).

" + previewTable(rows); document.getElementById("ge-csv").addEventListener("click", function () { doExport(rows, access, "csv"); }); document.getElementById("ge-xls").addEventListener("click", function () { doExport(rows, access, "xls"); }); }); } // Pure, testable surface (node harness): CSV/XLS builders, normalizer, gating. window.SIGradesExport = { HEADERS: HEADERS, normalizeEvent: normalizeEvent, buildCsv: buildCsv, buildXls: buildXls, resolveAccess: resolveAccess, filterRows: filterRows }; if (typeof document !== "undefined" && document.getElementById("export-root")) { if (document.readyState === "loading") document.addEventListener("DOMContentLoaded", init); else init(); window.addEventListener("si-tier-change", function () { init(); }); } })();