Right, so I decided to build this thing, a psychology score calculator. Wasn’t for any big project, just for myself. I kept bumping into these online quizzes, you know, the “how stressed are you?” or “what’s your personality type?” kind. Always Likert scales, 1 to 5 this, 1 to 5 that. Thought it’d be handy, maybe even quicker, to just have my own little tool to punch in numbers and see a total, instead of relying on some random website. Plus, it gave me something to do.

Didn’t overthink it. Grabbed some paper. Here’s what I mapped out:
- Goal: Simple calculator. Questions, multiple choice answers (1-5), calculates a total.
- Questions: Decided on maybe 10 generic questions. Stuff like “I feel calm” or “I worry easily”.
- Scoring: Needed to assign points. 1 for ‘Strongly Disagree’, 5 for ‘Strongly Agree’. Important: Some questions needed reverse scoring. Like, for “I feel calm”, a 5 is good, but for “I worry easily”, a 5 is… less good, so it should count less, maybe like a 1. Had to keep track of which ones.
- Tools: Just plain old HTML and a sprinkle of JavaScript. Keep it simple, run it right in my browser. No fancy stuff.
Getting Hands Dirty
Okay, opened up a basic text editor. Started writing the HTML structure. Used paragraph tags `
` for each question text to keep things neat. Made the questions stand out with ``. Then, for the answers, I used radio buttons. You know, the little circles you can only pick one of? Set them up in groups for each question, values 1 through 5.
Then came the JavaScript part. This bit does the actual work. I wrote a function. Tied it to a button labeled ‘Calculate Score’. When you click it, the script does this:

- It looks at all the question groups.
- It finds which radio button (which score) you picked for each one.
- It adds that score to a running total.
- Crucially, it checks if the question is one of those reverse-scored ones. If yes, it flips the score (5 becomes 1, 4 becomes 2, etc.) before adding. This took a bit of fiddling to get right.
- Finally, it takes the final total and sticks it onto the page so you can see it. Used a simple `
` tag for the output, like “Your score: [total]”.
Testing and Fixing
First time I loaded the page and hit calculate? Zip. Nada. Typical. Had to open the developer tools in the browser (usually F12). Found a typo in my JavaScript. Fixed it. Tried again. Okay, numbers appeared! But wait, the score seemed off. Ah, messed up the reverse scoring logic. Went back, tweaked the code that flips the scores. Tested with some obvious inputs (like all 1s, then all 5s). Yep, that looked correct now. Added a ‘Reset’ button too, just another simple function to clear all the selections.
Final Result
So, what I ended up with is just a single HTML file sitting on my computer. Open it in a browser, click the radio buttons for the questions, hit calculate, and boom, there’s a score. Nothing groundbreaking, it’s not some sophisticated psychological assessment. But it does the job I wanted it for: a quick, personal way to tally up scores from simple questionnaires without sending my answers off to who-knows-where online. It was a good little practical exercise. Simple tools you build yourself are sometimes the handiest.