dr-exam-log
v0.1.0
Published
Cross-platform active-window state transition logger for exam monitoring
Maintainers
Readme
dr-exam-log
Cross-platform active window and browser tab transition logger.
Primary target: exam monitoring with one command.
Command
After publish, users run:
npx dr-exam-log
What Gets Logged
- App switches (VS Code, File Explorer, etc.)
- Browser tab switches by tab title
- Browser URL when available
- Timestamped transitions in this format:
timestamp | current_state ----> next_state
Default output file:
- Windows:
%USERPROFILE%\\Downloads\\proctor_state_transitions.log - Linux/macOS:
$HOME/Downloads/proctor_state_transitions.log(fallback if folder missing)
Usage
Basic:
npx dr-exam-log
Custom interval:
npx dr-exam-log --interval-seconds 0.5
Custom output path:
npx dr-exam-log --output "C:\Users\Public\Downloads\faculty_exam_log.log"
Help:
npx dr-exam-log --help
Local Development
From this folder:
npm install npm run check node ./bin/dr-exam-log.js --interval-seconds 1
Publish (One-Time)
- Create npm account and login: npm login
- Ensure package name is still free: npm view dr-exam-log
- Publish: npm publish --access public
After this, anyone can run:
npx dr-exam-log
Notes About Browser URL Detection
- Windows: URL capture uses active-window info plus foreground window automation fallback.
- Linux: active window detection works best on X11. Wayland often blocks active-window introspection.
- macOS: tab URL visibility depends on OS permissions and browser support.
When URL is blocked by OS/browser policy, tab title is still logged where available.
Faculty Quick Test Flow
- Open terminal.
- Run:
npx dr-exam-log - Switch between browser tabs (ChatGPT, Gemini, Google, YouTube, etc.) and other apps.
- Stop with Ctrl+C.
- Open Downloads and check
proctor_state_transitions.log.
