Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -444,8 +444,9 @@ staying local is a property of its design rather than a promise about a server.

A test asserts it, on the built output rather than on the source: any host in a
fetch position — in the HTML, in the stylesheet, or in any emitted script — fails
the suite. Inter and Merriweather are served from this site under their SIL Open
Font Licences, which the build emits alongside them.
the suite. Figtree (the free face closest to UC Davis's licensed Proxima Nova)
is served from this site under its SIL Open Font Licence, which the build emits
alongside it.

- **Export your JSON regularly** — data is lost if browser cache is cleared
- **The export ZIP is instructor-only and MUST NOT be given to students.** Four files in its `instructor/` folder contain answers: `{stem}_grader_document.html`, `{stem}_grading_rubric.json`, `{stem}_authoring_backup.json` and `{stem}.md`. Students receive only `{stem}_FOR_STUDENTS.zip`, the one entry at the archive root that is not in a folder. The ZIP carries a generated `00_INSTRUCTOR_ONLY_DO_NOT_DISTRIBUTE.txt` at its root naming every file.
Expand Down
2 changes: 1 addition & 1 deletion components/ChoicePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const ChoicePanel: React.FC<{
>
<div className="bg-white w-full max-w-lg max-h-full overflow-y-auto rounded-lg shadow-xl p-5 sm:p-6">
<div className="flex items-start justify-between gap-3">
<h2 id="choice-panel-heading" className="text-lg font-bold font-serif text-academic-900">
<h2 id="choice-panel-heading" className="text-lg font-bold text-academic-900">
{question.title}
</h2>
<button
Expand Down
45 changes: 28 additions & 17 deletions components/Common.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@ import { hasFigure } from '../services/figureBlocks';
import { useOpenHelp } from './HelpGuide';
import { hasFigureRef } from '../services/figureRefs';

export const Button: React.FC<React.ButtonHTMLAttributes<HTMLButtonElement> & { variant?: 'primary' | 'secondary' | 'danger' | 'ghost' }> = ({ variant = 'primary', className = '', ...props }) => {
const baseStyle = "inline-flex items-center justify-center px-4 py-2 text-sm font-medium rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-offset-2 transition-colors";
export const Button: React.FC<React.ButtonHTMLAttributes<HTMLButtonElement> & { variant?: 'primary' | 'secondary' | 'danger' | 'ghost' | 'accent' }> = ({ variant = 'primary', className = '', ...props }) => {
// ucdavis.edu buttons: 5px corners, bold. Navy (its btn--alt) is the
// ordinary action; gold (its btn--primary) is the one that finishes the job.
const baseStyle = "inline-flex items-center justify-center px-4 py-2 text-sm font-bold rounded-[5px] focus:outline-none focus:ring-2 focus:ring-offset-2 transition-colors";
const variants = {
primary: "bg-academic-800 text-white hover:bg-academic-900 focus:ring-academic-700",
secondary: "bg-white text-academic-700 border border-academic-300 hover:bg-academic-50 focus:ring-academic-500",
danger: "bg-red-600 text-white hover:bg-red-700 focus:ring-red-500",
ghost: "text-academic-600 hover:text-academic-900 hover:bg-academic-100 shadow-none"
ghost: "text-academic-600 hover:text-academic-900 hover:bg-academic-100 shadow-none",
// Aggie Gold, for the one action that finishes the job on a screen.
accent: "bg-gold-500 text-academic-800 hover:bg-gold-400 focus:ring-gold-500"
};

return (
Expand Down Expand Up @@ -44,7 +48,7 @@ export const Select: React.FC<React.SelectHTMLAttributes<HTMLSelectElement> & {
);

export const Card: React.FC<{ children: React.ReactNode; className?: string }> = ({ children, className = '' }) => (
<div className={`bg-white shadow rounded-lg p-6 border border-academic-200 ${className}`}>
<div className={`bg-white shadow-sm rounded-xl p-6 border border-academic-200 ${className}`}>
{children}
</div>
);
Expand All @@ -70,13 +74,13 @@ export const Layout: React.FC<{ children: React.ReactNode; title?: string; actio

return (
<div className="min-h-screen bg-academic-50 flex flex-col">
<header className="bg-white border-b border-academic-200 sticky top-0 z-10">
<header className="bg-aggie-500 text-white shadow sticky top-0 z-10">
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-4 flex justify-between items-center">
<div className="flex items-center gap-4">
<Link to="/" className="flex items-center gap-3" title={`Go to the ${HOME_SCREEN_NAME}`}>
<div className="flex flex-col">
<h1 className="text-lg font-bold text-academic-900"><span className="text-[#00A4E4]">B</span>ridgeSuite</h1>
<span className="text-xs text-academic-500">Assignment Manager</span>
<h1 className="text-lg font-extrabold text-gold-500">BridgeSuite</h1>
<span className="text-xs text-white/80">Assignment Manager</span>
</div>
</Link>
{/* ONE PLACE TO LOOK. This was "LaTeX Help", which is the only
Expand All @@ -85,7 +89,7 @@ export const Layout: React.FC<{ children: React.ReactNode; title?: string; actio
guide rather than the whole of the help. */}
<button
onClick={() => openHelp()}
className="hidden sm:flex items-center gap-1.5 px-3 py-1.5 text-sm text-academic-600 hover:text-academic-900 hover:bg-academic-100 rounded-md transition-colors"
className="hidden sm:flex items-center gap-1.5 px-3 py-1.5 text-sm font-semibold text-white hover:bg-white/15 rounded-[5px] transition-colors"
title="How to use the Assignment Maker"
>
<HelpCircle className="w-4 h-4" />
Expand All @@ -97,8 +101,8 @@ export const Layout: React.FC<{ children: React.ReactNode; title?: string; actio
data-home-link
aria-label={`Go to the ${HOME_SCREEN_NAME}`}
title={`Go to the ${HOME_SCREEN_NAME}, where assignments are exported`}
className="flex items-center gap-1.5 px-3 py-1.5 text-sm font-medium text-academic-700 whitespace-nowrap
border border-academic-300 rounded-md hover:bg-academic-50 hover:text-academic-900
className="flex items-center gap-1.5 px-3 py-1.5 text-sm font-bold text-white whitespace-nowrap
bg-academic-800 rounded-[5px] hover:bg-academic-900
transition-colors"
>
<Home className="w-4 h-4" />
Expand All @@ -110,7 +114,7 @@ export const Layout: React.FC<{ children: React.ReactNode; title?: string; actio
{/* The same button on a narrow window, where the label will not fit. */}
<button
onClick={() => openHelp()}
className="sm:hidden p-2 text-academic-600 hover:text-academic-900 hover:bg-academic-100 rounded-md transition-colors"
className="sm:hidden p-2 text-white hover:bg-white/15 rounded-[5px] transition-colors"
title="How to use the Assignment Maker"
aria-label="Help"
>
Expand All @@ -121,10 +125,17 @@ export const Layout: React.FC<{ children: React.ReactNode; title?: string; actio
</div>
</header>
<main className="flex-1 max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8 w-full">
{title && <h2 className="text-2xl font-bold text-academic-900 mb-6 font-serif">{title}</h2>}
{title && (
<div className="mb-6">
<h2 className="text-3xl font-extrabold text-aggie-500">{title}</h2>
<div className="mt-2 flex gap-1.5" aria-hidden="true">
{[0, 1, 2, 3, 4].map(i => <span key={i} className="w-1.5 h-1.5 rounded-full bg-gold-500" />)}
</div>
</div>
)}
{children}
</main>
<footer className="bg-academic-800 text-academic-300 py-8 border-t border-academic-700">
<footer className="bg-academic-700 text-white/80 py-8">
{/* ATTRIBUTION, on every screen (WORKORDER_ATTRIBUTION_AND_THIRD_PARTY_NOTICES_2026-09-27).
It used to read "© {current year} GradeBridge AI", which named the
wrong copyright holder with a year that changed by itself; the
Expand Down Expand Up @@ -160,8 +171,8 @@ export const TextAreaWithPreview: React.FC<React.TextareaHTMLAttributes<HTMLText
{label && <label className="block text-sm font-medium text-academic-700 mb-1">{label}</label>}
<textarea className={`w-full bg-white text-academic-900 rounded-md border-academic-300 shadow-sm focus:border-academic-500 focus:ring-academic-500 sm:text-sm py-2 px-3 border resize-y ${className}`} value={value} {...props} />
{showPreview && (
<div className="mt-2 p-3 bg-blue-50 border border-blue-200 rounded-md">
<p className="text-xs text-blue-600 mb-1 font-bold uppercase">LaTeX Preview:</p>
<div className="mt-1.5 pl-3 pr-2 py-1 border-l-2 border-gold-500 text-academic-900" data-latex-preview>
<span className="sr-only">Preview: </span>
<div className="prose prose-sm max-w-none">
<FormattedText text={textVal} />
</div>
Expand All @@ -181,8 +192,8 @@ export const InputWithPreview: React.FC<React.InputHTMLAttributes<HTMLInputEleme
{label && <label className="block text-sm font-medium text-academic-700 mb-1">{label}</label>}
<input className={`w-full bg-white text-academic-900 rounded-md border-academic-300 shadow-sm focus:border-academic-500 focus:ring-academic-500 sm:text-sm py-2 px-3 border ${className}`} value={value} {...props} />
{showPreview && (
<div className="mt-2 p-2 bg-blue-50 border border-blue-200 rounded-md">
<p className="text-xs text-blue-600 mb-1 font-bold uppercase">LaTeX Preview:</p>
<div className="mt-1.5 pl-3 pr-2 py-1 border-l-2 border-gold-500 text-academic-900" data-latex-preview>
<span className="sr-only">Preview: </span>
<div className="prose prose-sm max-w-none">
<FormattedText text={textVal} />
</div>
Expand Down
4 changes: 2 additions & 2 deletions components/HelpGuide.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const renderGuide = (md: string): string => {
const text = h[2];
const id = slugFor(text);
const size = level === 1 ? 'text-2xl mt-2' : level === 2 ? 'text-xl mt-8' : 'text-base mt-6';
out.push(`<h${level} id="${id}" class="${size} font-bold font-serif text-academic-900 mb-2 scroll-mt-24">${inline(text)}</h${level}>`);
out.push(`<h${level} id="${id}" class="${size} font-bold text-academic-900 mb-2 scroll-mt-24">${inline(text)}</h${level}>`);
continue;
}

Expand Down Expand Up @@ -177,7 +177,7 @@ export const HelpGuide: React.FC<{
onClick={e => e.stopPropagation()}
>
<div className="flex items-center justify-between border-b border-academic-200 px-4 sm:px-6 py-3">
<h2 className="text-base sm:text-lg font-bold font-serif text-academic-900">
<h2 className="text-base sm:text-lg font-bold text-academic-900">
Using the Assignment Maker
</h2>
<button
Expand Down
2 changes: 1 addition & 1 deletion components/Preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const Preview: React.FC = () => {
<Card className="prose max-w-none">
<div className="flex justify-between items-end border-b pb-4 mb-6">
<div>
<h2 className="text-3xl font-serif font-bold text-academic-900 m-0">{assignment.title}</h2>
<h2 className="text-3xl font-bold text-academic-900 m-0">{assignment.title}</h2>
<p className="text-academic-600 m-0 font-medium">{assignment.courseCode}</p>
</div>
<div className="text-right text-sm text-academic-500">
Expand Down
4 changes: 2 additions & 2 deletions components/RescaleChoice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const RescaleChoicePanel: React.FC<{
aria-labelledby="rescale-choice-heading"
>
<div className="bg-white w-full max-w-lg rounded-lg shadow-xl p-5 sm:p-6">
<h2 id="rescale-choice-heading" className="text-lg font-bold font-serif text-academic-900">
<h2 id="rescale-choice-heading" className="text-lg font-bold text-academic-900">
Rescale the points before exporting?
</h2>
<p className="mt-3 text-sm text-academic-700 leading-relaxed">
Expand Down Expand Up @@ -95,7 +95,7 @@ export const RescalePreviewPanel: React.FC<{
aria-labelledby="rescale-preview-heading"
>
<div className="bg-white w-full max-w-lg rounded-lg shadow-xl p-5 sm:p-6 max-h-[90vh] flex flex-col">
<h2 id="rescale-preview-heading" className="text-lg font-bold font-serif text-academic-900">
<h2 id="rescale-preview-heading" className="text-lg font-bold text-academic-900">
{plan.ok ? `Rescale from ${fromTotal} to ${target} points?` : `Cannot rescale to ${target}`}
</h2>
{plan.ok ? (
Expand Down
22 changes: 10 additions & 12 deletions index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,16 @@ import 'katex/dist/katex.min.css';
// cdn.tailwindcss.com, which shipped executable JavaScript from a third party
// with full page privileges and no Subresource Integrity attribute.
import './index.css';
// The two typefaces, self-hosted for the same reason and emitted same-origin by
// Vite. @fontsource ships Inter v20 and Merriweather v33 — the same upstream
// versions fonts.gstatic.com was serving — with their SIL Open Font Licences.
// Weights are exactly those the old Google Fonts <link> requested, and no more.
import '@fontsource/inter/300.css';
import '@fontsource/inter/400.css';
import '@fontsource/inter/500.css';
import '@fontsource/inter/600.css';
import '@fontsource/inter/700.css';
import '@fontsource/merriweather/300.css';
import '@fontsource/merriweather/400.css';
import '@fontsource/merriweather/700.css';
// The typeface, self-hosted and emitted same-origin by Vite. UC Davis sets its
// sites in Proxima Nova, which is licensed and cannot be bundled; Figtree is
// the free (SIL Open Font Licence) face closest to it, and tailwind.config.js
// names proxima-nova first so a computer that has it uses it.
import '@fontsource/figtree/300.css';
import '@fontsource/figtree/400.css';
import '@fontsource/figtree/500.css';
import '@fontsource/figtree/600.css';
import '@fontsource/figtree/700.css';
import '@fontsource/figtree/800.css';
import App from './App';

const rootElement = document.getElementById('root');
Expand Down
19 changes: 4 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
"uuid": "^9.0.1"
},
"devDependencies": {
"@fontsource/inter": "5.3.0",
"@fontsource/merriweather": "5.3.0",
"@fontsource/figtree": "5.3.0",
"@types/file-saver": "^2.0.7",
"@types/node": "^20.11.24",
"@types/react": "^18.2.61",
Expand Down
1 change: 1 addition & 0 deletions pages/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,7 @@ const Dashboard: React.FC<{ view?: 'list' | 'import' }> = ({ view = 'list' }) =>
<span className="hidden sm:inline">Copy</span>
</Button>
<Button
variant="accent"
onClick={() => handleExport(assignment)}
title="One download: the file to post, plus your grading material — never give the whole archive to students"
>
Expand Down
Loading