Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

U.S. Naturalization Practice Test

A PHP practice application based on the official 128 Civics Questions and Answers (2025 version) published by U.S. Citizenship and Immigration Services (USCIS).

The application presents one question at a time and evaluates short written answers by looking for accepted key words and phrases instead of requiring an exact word-for-word match.

Features

  • Includes all 128 official 2025 civics questions
  • Standard practice mode: up to 20 questions, with 12 correct answers required to pass
  • 65/20 special-consideration mode: 10 starred questions, with 6 correct answers required to pass
  • Displays one question at a time
  • Selects questions without duplicates
  • Accepts partial answers based on important words and phrases
  • Supports questions that require two, three, or five distinct answers
  • Reviews missed questions and accepted USCIS answers
  • Refreshes current officeholder answers from official government websites
  • Uses cached and verified fallback answers if an official site is temporarily unavailable
  • Responsive interface that preserves the original patriotic background design

Technologies Used

  • PHP 8+
  • HTML5
  • CSS3
  • PHP sessions
  • cURL or allow_url_fopen for official answer updates

Project Structure

naturalization-practice-test/
├── index.php
├── quiz.php
├── results.php
├── config.php
├── README.md
├── .gitignore
├── assets/
│   ├── css/
│   │   └── main.css
│   └── img/
│       ├── citizenship.png
│       └── usabg.jpg
├── cache/
│   └── .gitkeep
├── data/
│   └── questions.php
└── includes/
    ├── current_answers.php
    └── functions.php

Local Setup

PHP is required. GitHub Pages cannot run this project because GitHub Pages only hosts static files.

From the project folder, start PHP's local development server:

php -S localhost:8000

Then open:

http://localhost:8000

Current Answers

The application attempts to refresh these changing answers from official websites:

  • President
  • Vice President
  • Speaker of the House
  • Chief Justice
  • Illinois U.S. senators
  • Illinois governor
  • U.S. representative, when a ZIP code returns one district

The fallback values are stored in config.php. Review them before publishing and periodically verify them against the official USCIS Civics Test Updates page.

ZIP codes that overlap multiple congressional districts may not identify one representative. The start page allows the user to enter the representative's name manually.

Hosting

Use a PHP-compatible host such as a cPanel or shared-hosting account. Upload the project files while preserving the folder structure.

The cache directory should be writable by PHP so the current-answer information can be cached. If it is not writable, the application will continue using fallback values.

Source and Disclaimer

Questions and accepted answers are based on the USCIS document:

128 Civics Questions and Answers (2025 version), Form M-1778 (09/25).

This is an independent educational practice project. It is not affiliated with, endorsed by, or certified by USCIS. Applicants should verify changing answers with USCIS before their naturalization interview.

Author

Eduardo Gonzalez

About

A PHP practice application based on the 2025 USCIS naturalization civics test.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages