AP Score Reveal

Hides AP exam scores, allowing you to reveal your scores one-by-one.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name     AP Score Reveal
// @namespace   dev.josephgeis.apreveal
// @author      Joseph Geis
// @homepageURL https://josephgeis.dev/
// @description Hides AP exam scores, allowing you to reveal your scores one-by-one.
// @license     MIT
// @version     1.0.1
// @grant       none
// @include  https://apscore.collegeboard.org/scores/view-your-scores*
// @run-at      document-start
// ==/UserScript==

var preStyles = document.createElement("style")
preStyles.type = "text/css"
preStyles.appendChild(
  document.createTextNode(".row-fluid.item > .span5:nth-child(2) { opacity: 0; }")
)
document.head.appendChild(preStyles)

document.addEventListener("DOMContentLoaded", () => {
  let scoreFields = document.querySelectorAll(".row-fluid.item > .span5:nth-child(2) > span")

  for (field of scoreFields) {
    let scoreText = field.querySelector("em")

    scoreText.hidden = true

    let button = document.createElement("button")

    let unhide = () => {
      scoreText.hidden = !scoreText.hidden
      button.remove()
    }

    button.addEventListener("click", unhide)
    button.appendChild(
      document.createTextNode("Show")
    )

    field.appendChild(button)
  }
  
  preStyles.remove();
})