Skip to content

Commit ab89bb5

Browse files
authored
Change instances of Teacher to Instructor (#4)
1 parent c344cc0 commit ab89bb5

11 files changed

Lines changed: 53 additions & 53 deletions

File tree

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ All data stays in your own Firebase project.
1515
- View poll history and attendance, grouped by poll set and session
1616
- CSV export of poll results (per-poll and per-session)
1717
- Delete individual polls from history
18-
- Password-protected teacher and history access
18+
- Password-protected instructor and history access
1919

2020
### For students
2121
- Join with just a name — no account needed
@@ -137,7 +137,7 @@ Copy the example file and fill in your values:
137137
cp .env.example .env.local
138138
```
139139

140-
Edit `.env.local` with your Firebase config values and a teacher password of your choice:
140+
Edit `.env.local` with your Firebase config values and an instructor password of your choice:
141141

142142
```
143143
VITE_FIREBASE_API_KEY=your_api_key
@@ -148,7 +148,7 @@ VITE_FIREBASE_STORAGE_BUCKET=your_project.firebasestorage.app
148148
VITE_FIREBASE_MESSAGING_SENDER_ID=your_sender_id
149149
VITE_FIREBASE_APP_ID=your_app_id
150150
151-
VITE_TEACHER_PASSWORD=your_password_here
151+
VITE_INSTRUCTOR_PASSWORD=your_password_here
152152
```
153153

154154
**Never commit `.env.local` to git.** It is already listed in `.gitignore`.
@@ -166,7 +166,7 @@ npm run dev
166166
```
167167

168168
Open [http://localhost:5173/classroom-polling/](http://localhost:5173/classroom-polling/).
169-
Open two browser tabs — one as teacher, one as student — to verify everything works.
169+
Open two browser tabs — one as instructor, one as student — to verify everything works.
170170

171171
### Step 9 — Set your repo name in vite.config.js
172172

@@ -223,7 +223,7 @@ git merge upstream/main
223223

224224
### Running a poll
225225

226-
1. Open the app → **I'm the Teacher** → enter your password
226+
1. Open the app → **I'm the Instructor** → enter your password
227227
2. Click **New Poll** → enter question and options → click **Start Poll**
228228
3. Share your app URL with students — they click **I'm a Student**, enter their name, and wait
229229
4. Students see the poll instantly; results update live on your dashboard
@@ -239,15 +239,15 @@ git merge upstream/main
239239

240240
### Viewing history and attendance
241241

242-
1. Click **History** → enter teacher password
242+
1. Click **History** → enter instructor password
243243
2. **Polls tab**: past polls grouped by set, expandable with per-option results
244244
3. **Attendance tab**: students who joined, grouped by date
245245

246246
## Customization
247247

248248
| File | What to change |
249249
|------|---------------|
250-
| `.env.local` | Teacher password, Firebase config |
250+
| `.env.local` | Instructor password, Firebase config |
251251
| `firebase-rules.json` | Database security rules |
252252
| `vite.config.js` | Repository name for GitHub Pages base path |
253253
| `src/index.css` | Colors, fonts, visual design |
@@ -264,7 +264,7 @@ classroom-polling/
264264
│ │ └── csvExport.js CSV export utilities
265265
│ ├── pages/
266266
│ │ ├── RoleSelector.jsx Landing page
267-
│ │ ├── TeacherPage.jsx Teacher dashboard
267+
│ │ ├── InstructorPage.jsx Instructor dashboard
268268
│ │ ├── StudentPage.jsx Student poll experience
269269
│ │ ├── PollHistory.jsx History and attendance
270270
│ │ ├── PollSets.jsx Poll set list and creation
@@ -290,7 +290,7 @@ The Firebase Spark (free) plan is sufficient for typical classroom use:
290290

291291
## Known limitations
292292

293-
- Teacher password is a single shared secret; not suitable for multiple instructors sharing one instance
293+
- Instructor password is a single shared secret; not suitable for multiple instructors sharing one instance
294294
- Code formatting in questions is plain text only (markdown support planned)
295295
- Student names are self-reported and not authenticated
296296

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<link rel="preconnect" href="https://fonts.googleapis.com">
99
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
1010
<link href="https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:ital,wght@0,300;0,400;0,500;1,300&display=swap" rel="stylesheet">
11-
<script type="module" crossorigin src="/classroom-polling/assets/index-BEzP6REc.js"></script>
11+
<script type="module" crossorigin src="/classroom-polling/assets/index-CLC7Q4lX.js"></script>
1212
<link rel="stylesheet" crossorigin href="/classroom-polling/assets/index-DZ0sPA0V.css">
1313
</head>
1414
<body>

node_modules/.vite/deps/_metadata.json

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/App.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*/
1111
import { BrowserRouter, Routes, Route, Navigate } from 'react-router-dom';
1212
import RoleSelector from './pages/RoleSelector';
13-
import TeacherPage from './pages/TeacherPage';
13+
import InstructorPage from './pages/InstructorPage';
1414
import StudentPage from './pages/StudentPage';
1515
import PollSetDetail from './pages/PollSetDetail';
1616
import PollSets from './pages/PollSets';
@@ -21,7 +21,7 @@ export default function App() {
2121
<BrowserRouter basename="/classroom-polling">
2222
<Routes>
2323
<Route path="/" element={<RoleSelector />} />
24-
<Route path="/teacher" element={<TeacherPage />} />
24+
<Route path="/instructor" element={<InstructorPage />} />
2525
<Route path="/student" element={<StudentPage />} />
2626
<Route path="/pollsets/:id" element={<PollSetDetail />} />
2727
<Route path="/pollsets" element={<PollSets />} />
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const CORRECT_OPTIONS = [
2828
{ value: 'never', label: 'Never' },
2929
];
3030

31-
export default function TeacherPage() {
31+
export default function InstructorPage() {
3232
const navigate = useNavigate();
3333
const [students, setStudents] = useState([]);
3434
const [activePoll, setActivePoll] = useState(null);
@@ -48,7 +48,7 @@ export default function TeacherPage() {
4848
const [correctPolicy, setCorrectPolicy] = useState('with_results');
4949

5050
useEffect(() => {
51-
if (localStorage.getItem("role") !== 'teacher') navigate('/');
51+
if (localStorage.getItem("role") !== 'instructor') navigate('/');
5252
}, []);
5353

5454
useEffect(() => {

src/pages/PollHistory.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { db } from '../firebase';
1515
import { ref, onValue, remove } from 'firebase/database';
1616
import { pollToCsv, sessionToCsv, downloadCsv } from '../utils/csvExport';
1717

18-
const HISTORY_PASSWORD = import.meta.env.VITE_TEACHER_PASSWORD || 'changeme';
18+
const HISTORY_PASSWORD = import.meta.env.VITE_INSTRUCTOR_PASSWORD || 'changeme';
1919

2020
export default function PollHistory() {
2121
const navigate = useNavigate();
@@ -33,7 +33,7 @@ export default function PollHistory() {
3333
const [copyFeedback, setCopyFeedback] = useState({}); // key -> true
3434

3535
useEffect(() => {
36-
if (localStorage.getItem("historyAuth") === 'true' || localStorage.getItem("role") === 'teacher') setAuth(true);
36+
if (localStorage.getItem("historyAuth") === 'true' || localStorage.getItem("role") === 'instructor') setAuth(true);
3737
}, []);
3838

3939
useEffect(() => {
@@ -153,11 +153,11 @@ export default function PollHistory() {
153153
</div>
154154
<h2 style={{fontSize:'1.4rem', marginBottom:'0.25rem'}}>Poll History</h2>
155155
<p style={{color:'var(--muted)', marginBottom:'1.5rem', fontSize:'0.9rem'}}>
156-
Enter the teacher password to view history and attendance.
156+
Enter the instructor password to view history and attendance.
157157
</p>
158158
<form onSubmit={handleLogin}
159159
style={{display:'flex', flexDirection:'column', gap:'0.75rem'}}>
160-
<input className="input" type="password" placeholder="Teacher password"
160+
<input className="input" type="password" placeholder="Instructor password"
161161
value={pw} onChange={e => { setPw(e.target.value); setErr(''); }}
162162
autoFocus style={{textAlign:'center'}} />
163163
{err && <span style={styles.err}>{err}</span>}

src/pages/PollSetDetail.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export default function PollSetDetail() {
3939
const [nameValue, setNameValue] = useState('');
4040

4141
useEffect(() => {
42-
if (localStorage.getItem('role') !== 'teacher') navigate('/');
42+
if (localStorage.getItem('role') !== 'instructor') navigate('/');
4343
return watchPollSet(id, s => {
4444
if (!s) return;
4545
setPollSet(s);
@@ -155,7 +155,7 @@ export default function PollSetDetail() {
155155
resultPolicy: first.resultPolicy ?? d.resultPolicy ?? 'on_submit',
156156
correctPolicy: first.correctPolicy ?? d.correctPolicy ?? 'with_results',
157157
});
158-
navigate('/teacher');
158+
navigate('/instructor');
159159
}
160160

161161
if (!pollSet) return (

src/pages/PollSets.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export default function PollSets() {
4949
const [parseErr, setParseErr] = useState('');
5050

5151
useEffect(() => {
52-
if (localStorage.getItem('role') !== 'teacher') navigate('/');
52+
if (localStorage.getItem('role') !== 'instructor') navigate('/');
5353
return watchPollSets(setSets);
5454
}, []);
5555

@@ -113,7 +113,7 @@ export default function PollSets() {
113113
return (
114114
<div style={styles.page}>
115115
<header style={styles.header}>
116-
<button style={styles.back} onClick={() => navigate('/teacher')}>← Dashboard</button>
116+
<button style={styles.back} onClick={() => navigate('/instructor')}>← Dashboard</button>
117117
<span style={styles.title}>Poll Sets</span>
118118
{view === 'list' && (
119119
<button className="btn btn-primary" onClick={() => setView('create')}>

src/pages/RoleSelector.jsx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,19 @@
1111
import { useState } from 'react';
1212
import { useNavigate } from 'react-router-dom';
1313

14-
const TEACHER_PASSWORD = import.meta.env.VITE_TEACHER_PASSWORD || 'changeme';
14+
const INSTRUCTOR_PASSWORD = import.meta.env.VITE_INSTRUCTOR_PASSWORD || 'changeme';
1515

1616
export default function RoleSelector() {
1717
const navigate = useNavigate();
18-
const [showTeacherLogin, setShowTeacherLogin] = useState(false);
18+
const [showInstructorLogin, setShowInstructorLogin] = useState(false);
1919
const [pw, setPw] = useState('');
2020
const [err, setErr] = useState('');
2121

22-
function handleTeacherSubmit(e) {
22+
function handleInstructorSubmit(e) {
2323
e.preventDefault();
24-
if (pw === TEACHER_PASSWORD) {
25-
localStorage.setItem("role", "teacher");
26-
navigate('/teacher');
24+
if (pw === INSTRUCTOR_PASSWORD) {
25+
localStorage.setItem("role", "instructor");
26+
navigate('/instructor');
2727
} else {
2828
setErr('Incorrect password.');
2929
setPw('');
@@ -46,16 +46,16 @@ export default function RoleSelector() {
4646
<span style={styles.roleLabel}>I'm a Student</span>
4747
<span style={styles.roleHint}>Join and answer polls</span>
4848
</button>
49-
{!showTeacherLogin ? (
50-
<button style={styles.roleCard} onClick={() => setShowTeacherLogin(true)}>
49+
{!showInstructorLogin ? (
50+
<button style={styles.roleCard} onClick={() => setShowInstructorLogin(true)}>
5151
<span style={styles.roleIcon}>📋</span>
52-
<span style={styles.roleLabel}>I'm the Teacher</span>
52+
<span style={styles.roleLabel}>I'm the Instructor</span>
5353
<span style={styles.roleHint}>Create and manage polls</span>
5454
</button>
5555
) : (
56-
<form style={{...styles.roleCard, gap:'0.75rem'}} onSubmit={handleTeacherSubmit}>
56+
<form style={{...styles.roleCard, gap:'0.75rem'}} onSubmit={handleInstructorSubmit}>
5757
<span style={styles.roleIcon}>🔑</span>
58-
<span style={styles.roleLabel}>Teacher Password</span>
58+
<span style={styles.roleLabel}>Instructor Password</span>
5959
<input
6060
className="input"
6161
type="password"
@@ -72,7 +72,7 @@ export default function RoleSelector() {
7272
</button>
7373
<button type="button" className="btn btn-secondary"
7474
style={{width:'100%', justifyContent:'center', fontSize:'0.85rem'}}
75-
onClick={() => { setShowTeacherLogin(false); setErr(''); setPw(''); }}>
75+
onClick={() => { setShowInstructorLogin(false); setErr(''); setPw(''); }}>
7676
Cancel
7777
</button>
7878
</form>

0 commit comments

Comments
 (0)