wordpress theme
JavaScript CSS PHP
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
bootstrap
css
images
img
inc
js
languages
not-using
verifier
.gitignore
404.php
README.md
TODO.md
archive.php
category.php
content.php
copy-categories.php
editor-style-rtl.css
editor-style.css
file.txt
footer.php
functions.php
header.php
home-vv.php
image.php
importer.php
importer.png
index.php
license.txt
page-content.php
page.php
right-sidebar-single.php
rtl.css
screenshot.png
searchform.php
sidebar-footer.php
sidebar.php
single.php
slideshow.php
solr_search.php
style.css
tag.php
transform-pages.php
verifier-tests.php
verifier-views.png
verifier.php
verifiersearch-form.html
voting_news.php
vv_blog_loop.php

README.md

Verifier Documentation

API

Location: /verified_voting/verifier/api/api.php

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.

DB structure

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

JSON Structure

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
  • state_fips
  • county_fips
  • division_fips
  • state_name
  • county_name
  • division_name
  • 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

Regular Queries

/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.

VERIFIER UI

Location: /verified_voting/js/verifier/

verifier views

The verifier is a set of javascript objects that are controlled top down from verifier.js. Backbone.js is used for browser history modification.

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.

Map

SVG rendering is accomplished through the D3 library using Albers projection for the national map and custom scaling for states.

IMPORTER

Location: /verified_voting/importer.php

verifier importer

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.

SETUP

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.

DEFINITIONS

  • 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