- VERIFIER UI
The api responds to two modes: either a regular api call with optional state, county, and division fips or advanced search with parameters for make model and use.
The API represents three tables: machine, official and state. Officials represent the canonical names and machine codes for areas as well as the actual information about governance. Machines represent individual machines in an area. Machines also have a foreign key for the official's area in which they reside. This relationship is inferred on import by matching machine's FIPS against officials. The state table represents the JSON polygon data for individual states.
Note: the national map is loaded from usa.json in the filesystem and does not live in the database
The most up-to-date DB schema is saved in verifierschema.sql
The api returns a JSON object with the following fields
- header - error code [unused] and process time in seconds
- level - string of 'national','state','county','division' created in response to query
- area - JSON polygon data for rendering currently visible area
- official - row from official table that represents current area
- machines - machines found in this area
- codes - codes for colors necessary to render the currently visible area
- region_list - list of available areas below the current level
/api? [state_fips=int] [county_fips=int] [division_fips=int] [info_only=true]
Querying with no arguments returns national level data, combinations return obvious area. Setting info_only in the query will tell the API to not return JSON map data or color codes.
Advanced search mode
/api? advanced=true [equip_type=string]... [make=string]... [model=string]...
Query with 'advanced' and at least one make, model or equipment type.
Download search mode
/api? advanced=true [equip_type=string]... [make=string]... [model=string]... [download=json|excel|csv]
performing an advanced search with download=json|excel|csv will return a file of queried states in that format.
Elements with the 'navigate' class are watched for the click event and passed to the verifier.navigate() function. Elements are parsed for data-state-fips data-county-fips and data-division-fips attributes.
SVG rendering is accomplished through the D3 library using Albers projection for the national map and custom scaling for states.
The importer is a wordpress custom template that accepts CSV exports of verifier data. Current tables are backed up to .sql files when new data is imported. The importer must POST any request with a db_year to designate what particular DB it is taking action on.
The connection information for the databases is stored in /verified_voting/verifier/multi-connection.php and will select a DB based on $db_year being set.
Backups /verified_voting/verifier/importer_backups/ must be writeable by the web server.
verifier.js targets //verifiedvoting.org/api, you'll need to setup a redirect outside of wordpress to verified_voting/api/api.php
The verified_voting/verifier/importer_backups directory needs to be writable by the web server, the importer stores .sql dumps here.
- FIPS - Federal Information Processing Standard, in our case the numbers assigned to states, counties and divisions
- Voting Stage - The point at which the machine is used. Regular polling place, accessible use, early voting and absentee counting
- Equipment Usage flags (machine table)
- pp_std - polling place, standard use
- pp_acc - polling place, accessible use
- ev_std / ev_acc - early voting, standard use
- abs_ballots - counting for absentee ballots (vote by mail where applicable)
- Equipment Types (machine table)
- pbvs - paper ballot voting system
- dre - direct recording electronic, touchscreen to harddrive, no intermediate system for recording
- vvpat - voter verified paper trail, a printed ballot that the voter sees after voting
- bmd - ballot marking device