# qingtian1927/coursera-quizex architecture

> Architecture diagram of the GitHub repository qingtian1927/coursera-quizex, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/qingtian1927/coursera-quizex
- Repository: https://github.com/qingtian1927/coursera-quizex

## Overview

Coursera QuizEX is a browser extension for extracting visible Coursera assignment questions and turning them into study exports. Its main workflow runs from the popup through the background worker to a content script that reads the assignment DOM; the worker stores collected question groups, and the popup formats and displays or downloads them. A separate auto-scrape workflow discovers courses and assignments, navigates pages, and collects feedback-visible questions. The excerpts show these message and storage responsibilities, but not every popup handler or download path; README-documented capabilities are included where implementation details were not shown.

Main entry points: [`background.js`](https://github.com/qingtian1927/coursera-quizex/blob/main/background.js) (Background worker), [`popup.html`](https://github.com/qingtian1927/coursera-quizex/blob/main/popup.html) (Extension popup), [`content.js`](https://github.com/qingtian1927/coursera-quizex/blob/main/content.js) (Question extraction), [`i18n.js`](https://github.com/qingtian1927/coursera-quizex/blob/main/i18n.js) (Localization runtime)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_popup["Popup and exports"]
  node_popup_ui["Extension popup<br/>[popup.html]"]
  node_formatting["Format and preview<br/>[popup.js]"]
  node_downloads["Export downloads<br/>[popup.js]"]
end

subgraph group_collection["Page extraction"]
  node_course_discovery["Course discovery<br/>[content.js]"]
  node_path_picker["Learning-path picker<br/>[content.js]"]
  node_assignment_discovery["Assignment discovery<br/>[content.js]"]
  node_question_extraction["Question extraction<br/>[content.js]"]
end

subgraph group_automation["Scrape orchestration"]
  node_worker["Background worker<br/>[background.js]"]
end

subgraph group_support["State and language"]
  node_question_store[("Scraped-data storage")]
  node_localization["Language messages<br/>[messages.json]"]
  node_i18n_runtime["Localization runtime<br/>[i18n.js]"]
end

node_learner(("Learner"))
node_coursera_page["Coursera page"]

node_learner -->|"opens"| node_popup_ui
node_popup_ui -->|"requests actions"| node_worker
node_worker -->|"messages scrape"| node_question_extraction
node_question_extraction -->|"reads visible DOM"| node_coursera_page
node_worker -->|"writes collected data"| node_question_store
node_popup_ui -.->|"loads saved data"| node_question_store
node_popup_ui -->|"selects format"| node_formatting
node_formatting -->|"generates export"| node_downloads
node_learner -->|"downloads output"| node_downloads
node_worker -->|"requests paths"| node_course_discovery
node_worker -->|"requests selection"| node_path_picker
node_worker -->|"requests assignments"| node_assignment_discovery
node_worker -->|"requests feedback questions"| node_question_extraction
node_course_discovery -->|"reads course details"| node_coursera_page
node_assignment_discovery -->|"reads assignment list"| node_coursera_page
node_path_picker -->|"offers path choice"| node_learner
node_worker -->|"reads and appends data"| node_question_store
node_worker -->|"loads messages"| node_i18n_runtime
node_i18n_runtime -->|"fetches locale files"| node_localization
node_popup_ui -->|"uses translated text"| node_i18n_runtime

click node_popup_ui "https://github.com/qingtian1927/coursera-quizex/blob/main/popup.html"
click node_formatting "https://github.com/qingtian1927/coursera-quizex/blob/main/popup.js"
click node_downloads "https://github.com/qingtian1927/coursera-quizex/blob/main/popup.js"
click node_worker "https://github.com/qingtian1927/coursera-quizex/blob/main/background.js"
click node_course_discovery "https://github.com/qingtian1927/coursera-quizex/blob/main/content.js"
click node_path_picker "https://github.com/qingtian1927/coursera-quizex/blob/main/content.js"
click node_assignment_discovery "https://github.com/qingtian1927/coursera-quizex/blob/main/content.js"
click node_question_extraction "https://github.com/qingtian1927/coursera-quizex/blob/main/content.js"
click node_localization "https://github.com/qingtian1927/coursera-quizex/blob/main/_locales/en/messages.json"
click node_i18n_runtime "https://github.com/qingtian1927/coursera-quizex/blob/main/i18n.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_popup_ui,node_formatting,node_downloads toneBlue
class node_course_discovery,node_path_picker,node_assignment_discovery,node_question_extraction toneAmber
class node_worker toneMint
class node_question_store,node_localization,node_i18n_runtime toneRose
class node_learner,node_coursera_page toneIndigo
```

## Components

### Popup and exports

- [Extension popup](https://github.com/qingtian1927/coursera-quizex/blob/main/popup.html): `popup.html`
- [Format and preview](https://github.com/qingtian1927/coursera-quizex/blob/main/popup.js): `popup.js`
- [Export downloads](https://github.com/qingtian1927/coursera-quizex/blob/main/popup.js): `popup.js`

### Page extraction

- [Course discovery](https://github.com/qingtian1927/coursera-quizex/blob/main/content.js): `content.js`
- [Learning-path picker](https://github.com/qingtian1927/coursera-quizex/blob/main/content.js): `content.js`
- [Assignment discovery](https://github.com/qingtian1927/coursera-quizex/blob/main/content.js): `content.js`
- [Question extraction](https://github.com/qingtian1927/coursera-quizex/blob/main/content.js): `content.js`

### Scrape orchestration

- [Background worker](https://github.com/qingtian1927/coursera-quizex/blob/main/background.js): `background.js`

### State and language

- **Scraped-data storage**
- [Language messages](https://github.com/qingtian1927/coursera-quizex/blob/main/_locales/en/messages.json): `_locales/en/messages.json`
- [Localization runtime](https://github.com/qingtian1927/coursera-quizex/blob/main/i18n.js): `i18n.js`

### Other components

- **Learner**
- **Coursera page**

## Connections

- Learner → Extension popup: opens (evidence: `README.md`)
- Extension popup → Background worker: requests actions
- Background worker → Question extraction: messages scrape (evidence: `background.js`)
- Question extraction → Coursera page: reads visible DOM (evidence: `content.js`)
- Background worker → Scraped-data storage: writes collected data (evidence: `background.js`)
- Extension popup → Scraped-data storage: loads saved data
- Extension popup → Format and preview: selects format (evidence: `popup.js`)
- Format and preview → Export downloads: generates export (evidence: `README.md`)
- Learner → Export downloads: downloads output (evidence: `README.md`)
- Background worker → Course discovery: requests paths (evidence: `background.js`)
- Background worker → Learning-path picker: requests selection (evidence: `background.js`)
- Background worker → Assignment discovery: requests assignments (evidence: `background.js`)
- Background worker → Question extraction: requests feedback questions (evidence: `background.js`)
- Course discovery → Coursera page: reads course details (evidence: `content.js`)
- Assignment discovery → Coursera page: reads assignment list (evidence: `content.js`)
- Learning-path picker → Learner: offers path choice (evidence: `content.js`)
- Background worker → Scraped-data storage: reads and appends data (evidence: `background.js`)
- Background worker → Localization runtime: loads messages (evidence: `background.js`)
- Localization runtime → Language messages: fetches locale files (evidence: `i18n.js`)
- Extension popup → Localization runtime: uses translated text
