AI・機械学習
ADHD検査のリバースエンジニアリング
Reverse engineering my ADHD test (nullpt.rs)
要約
著者は、ADHDの診断を受ける過程で、オンラインの評価テストをリバースエンジニアリングしました。このテストは、特定のカードが表示されたときにスペースキーを押すというシンプルなタスクでしたが、集中力、反応時間、注意散漫さなどを測定するために、様々な注意散漫要素(画像、音)や、ウィンドウからフォーカスが外れたかどうかの追跡が含まれていました。著者は、テストが子供と大人で異なるアセットを使用していることや、収集されるデータ(スペースキーのタイミング、誤ったキー入力、フォーカス喪失時間)を発見しました。
全文翻訳
Reverse Engineering My ADHD Test
Thu Aug 27 2026
authored by veritas
Stargazing
One night, while chatting with friends, I looked up and noticed the stars. Light pollution usually makes them difficult to see, so I was surprised by how clear it all was. I stared for several minutes before deciding, "I need a telescope." I ordered one on Amazon that same night. I've always picked up new hobbies this way. However, I could never stick with them.
Celestron NexStar 5SE telescope photographed from my roof.
I chalked it up to being a spontaneous person. It wasn't until a friend shared their recent autism diagnosis that I decided to get evaluated for ADHD. The psychiatrist explained that getting evaluated was a good idea. "Untreated ADHD can sometimes go hand in hand with depression and anxiety", she told me. She had me take an online assessment, warning me that once it began, she wouldn't be able to talk to me. Unsure of what I was about to experience, I clicked the "Begin Test" link sent to my email.
Taking the test
The link brought me to a blank page with what felt like an early-2000s Flash game. The task was simple: press Space whenever a card with three red hearts appeared, otherwise, do nothing. I sat there pressing the spacebar as instructed. There was no timer or score to keep track of, only flashing cards. Eventually, other pieces of clip art began appearing alongside them, seemingly as a way to distract me. Still, I followed the task of pressing my spacebar when the card with three red hearts appeared. This dragged on, eventually introducing audio of crying babies and police sirens into the mix. At one point, it felt like this would never end, so I would spam spacebar in the hope of finishing the seemingly endless examination.
Your browser does not support the video tag.
Screen recording of a portion of the ADHD exam
Curiousity struck, and I had the bright idea to capture the page source and any outbound requests. I opened DevTools, saved all page scripts, and continued the exam. Thankfully, the end came! The psychiatrist told me she would let me know my results the following week.
Looking under the hood
With all the scripts saved, I began digging. A quick grep for keyCode showed me how the test handled my spacebar presses:
$(document).keyup(function (evt) {
keyPressed = false;
Context.LastPressTime = Context.CurrentTime;
if (evt.keyCode == 32 || evt.which == 32) {
Context.spacePressArray.clickTimes.push(adjustedTime);
console.log('Pushing Space: ' + Context.CurrentTime + ', Adjsuted Time: ' + adjustedTime);
} else if (evt.keyCode != 32 && evt.keyCode != 13 ) {
Context.spacePressArray.badClickTimes.push(adjustedTime);
console.log('Pushing Bad Press: ' + ', Adjsuted Time: ' + adjustedTime);
}
}).keydown(function (evt) {
if (!keyPressed) {
adjustedTime = Context.CurrentTime - Context.Offset;
}
keyPressed = true;
})
They were clearly tracking every time I pressed space, along with every "bad" key I pressed (Anything other than Space or enter). They also had a few more hooks in place:
onBlur = function (present_message){
present_message = (typeof present_message !== 'undefined' ? present_message : true);
if (!Context.canLooseFocus) {
Context.LastinFocusTime = Date.now();
InnerLog.log('Last in Focus Time: ' + Context.LastinFocusTime + ', Last Test Time in Focus: ' + Context.CurrentTime);
Context.InFocus = false;
adhd.prototype.addBeep();
if (present_message) {
this.outOfFocusAlert.htmlElement.style.visibility = "visible";
}
}
};
$(window).focus(function () {
if (!Context.canLooseFocus) {
this.outOfFocusAlert.htmlElement.style.visibility = "hidden";
Context.LostFocusAggregateTime += (Date.now() - Context.LastinFocusTime);
Context.InFocus = true;
Context.spacePressArray.lostFocusAggregateTime = Context.LostFocusAggregateTime;
adhd.prototype.removeBeep();
InnerLog.log('Aggregate Not in Focus Time: ' + Context.LostFocusAggregateTime + ", at: " + Context.CurrentTime);
if (Context.LostFocusAggregateTime < 0 || Context.CurrentTime < 0 || Context.startTime < 0) {
alert(Context.MessageSomethingWentWrong);
}
}
});
They can tell when the test lost focus (If you open a new tab for example). Interestingly, I also discovered that it swapped the assets based on whether the subject was an adult or a child. Children were capped at 15 FPS, adults 24. Children heard sounds of birds, bowling, sabers, and planes. Adults heard babies crying, car crashes, and police sirens.
if (ageGroup == 'adults') {
properties = lib.properties_adults;
} else {
properties = lib.properties_children;
}
lib.properties_children = {
width: 800,
height: 600,
fps: 15,
color: "#666666",
manifest: [
{src:"/js/adhd-html5/sounds/Birds.mp3", id:"Birds"},
{src:"/js/adhd-html5/sounds/Jedi.mp3", id:"Jedi"},
{src:"/js/adhd-html5/sounds/Bowling.mp3", id:"Bowling"},
{src:"/js/adhd-html5/sounds/Gong.mp3", id:"Gong"},
{src:"/js/adhd-html5/sounds/Plane.mp3", id:"Plane"},
{src:"/js/adhd-html5/sounds/Plane68.mp3", id:"Plane68"},
{src:"/js/adhd-html5/sounds/SaberSmall.mp3", id:"SaberSmall"},
{src:"/js/adhd-html5/sounds/PlaneBoom105.mp3", id:"PlaneBoom105"},
{src:"/js/adhd-html5/sounds/SaberOff3.mp3", id:"SaberOff3"},
{src:"/js/adhd-html5/sounds/Saber111.mp3", id:"Saber111"},
{src:"/js/adhd-html5/sounds/Saber111copy.mp3", id:"Saber111copy"},
{src:"/js/adhd-html5/sounds/Saber211.mp3", id:"Saber211"},
{src:"/js/adhd-html5/sounds/Saber211copy.mp3", id:"Saber211copy"},
{src:"/js/adhd-html5/sounds/Saber33.mp3", id:"Saber33"},
{src:"/js/adhd-html5/sounds/Saber33copy.mp3", id:"Saber33copy"},
{src:"/js/adhd-html5/sounds/SaberOnLong3.mp3", id:"SaberOnLong3"},
{src:"/js/adhd-html5/sounds/SaberOnLong3copy.mp3", id:"SaberOnLong3copy"},
{src:"/js/adhd-html5/sounds/beep-01a.mp3", id:"Beep"}
]
};
lib.properties_adults = {
width: 800,
height: 600,
fps: 24,
color: "#999999",
manifest: [
{src:"/js/adhd-html5/sounds/arsp018wav.mp3", id:"arsp018wav"},
{src:"/js/adhd-html5/sounds/assp022wav.mp3", id:"assp022wav"},
{src:"/js/adhd-html5/sounds/assp023wav.mp3", id:"assp023wav"},
{src:"/js/adhd-html5/sounds/babyCry.mp3", id:"babyCry"},
{src:"/js/adhd-html5/sounds/car_brakes.mp3", id:"BIKE2WAV"},
{src:"/js/adhd-html5/sounds/bottle_pop_2.mp3", id:"bottle_pop_2"},
{src:"/js/adhd-html5/sounds/carbrake01wav.mp3", id:"carbrake01wav"},
{src:"/js/adhd-html5/sounds/chsp016wav.mp3", id:"chsp016wav"},
{src:"/js/adhd-html5/sounds/copcar.mp3", id:"copcar"},
{src:"/js/adhd-html5/sounds/DogBarking02wav.mp3", id:"DogBarking02wav"},
{src:"/js/adhd-html5/sounds/flasher_coat_mono.mp3", id:"flasher_coat_mono"},
{src:"/js/adhd-html5/sounds/pouringliquid1.mp3", id:"pouringliquid1"},
{src:"/js/adhd-html5/sounds/arguing_couple.mp3", id:"arguing_couple"},
{src:"/js/adhd-html5/sounds/barking_dog.mp3", id:"barking_dog"},
{src:"/js/adhd-html5/sounds/police_car.mp3", id:"police_car"},
{src:"/js/adhd-html5/sounds/baby_crying.mp3", id:"baby_crying"},
{src:"/js/adhd-html5/sounds/smoking.mp3", id:"smoking"},
{src:"/js/adhd-html5/sounds/beep-01a.mp3", id:"Beep"}
]
};
The final payload contained only the timing of my spacebar presses, the timing of my "bad" pressed, and the total time the window had been out of focus. I wondered how that alone could provide a diagnosis. I could make some guesses, but the scoring model wasn't apparent anywhere in the source code.
I poked around the test site's official page and learned more about how scoring is determined. A quote from the site: "Standardized Z-scores are offered for four different attention metrics: Attentiveness, Timeliness, Hyper-Reactivity and Impulsiveness. Scores are standardized based on an age and gender-matched norm group."
Score calculation
The four metrics are defined as follows:
Attentiveness (A)
Attentiveness reflects the patient’s ability to correctly evaluate and respond to a stimulus, according to instructions. Patients who experience difficulties in this area have problems paying attention to their environment, or to specific details when required to do so. To an onlooker, a person who appears not to be paying at