<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Cynthiamartin</title>
    <description>The latest articles on DEV Community by Cynthiamartin (@alfhauck).</description>
    <link>https://dev.to/alfhauck</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3502090%2F4f39121d-edd8-4a92-8da5-5edec8b1bf48.png</url>
      <title>DEV Community: Cynthiamartin</title>
      <link>https://dev.to/alfhauck</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/alfhauck"/>
    <language>en</language>
    <item>
      <title>Built a Modern Rice Purity Test Website. Here's My Tech Stack and the Challenges I Faced.</title>
      <dc:creator>Cynthiamartin</dc:creator>
      <pubDate>Sun, 14 Sep 2025 20:22:47 +0000</pubDate>
      <link>https://dev.to/alfhauck/built-a-modern-rice-purity-test-website-heres-my-tech-stack-and-the-challenges-i-faced-182e</link>
      <guid>https://dev.to/alfhauck/built-a-modern-rice-purity-test-website-heres-my-tech-stack-and-the-challenges-i-faced-182e</guid>
      <description>&lt;p&gt;You've probably heard of the Rice Purity Test — it's a self-graded survey that originated at Rice University to gauge a person's level of "innocence" or life experience. I noticed that many existing versions online were full of intrusive ads and had clunky user experiences from the early 2000s.&lt;/p&gt;

&lt;p&gt;So, I decided to build a modern, clean, and ad-free version: Rice Purity Test.&lt;/p&gt;

&lt;p&gt;I wanted to share my process, the tech stack I used, and a few interesting challenges I ran into. I hope this can be useful, especially for newer developers thinking about their own projects.&lt;/p&gt;

&lt;p&gt;🛠️ The Tech Stack&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Frontend: Vanilla HTML, CSS, and JavaScript. For a simple, mostly static site like this, a framework felt like overkill. I wanted it to be incredibly lightweight and fast.&lt;/li&gt;
&lt;li&gt;Styling: Custom CSS with a mobile-first approach. I used CSS Grid and Flexbox for the layout to make it fully responsive on all devices.&lt;/li&gt;
&lt;li&gt;Hosting: GitHub Pages. It's free, simple, and perfect for static sites. The connection is served over HTTPS, which is a must-have.&lt;/li&gt;
&lt;li&gt;Domain: Namecheap for the d
domain (ricepurity.info).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;⚡ Challenges &amp;amp; Solutions&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Persisting the Score State:
The test has 100 questions. I needed a way to save the user's answers so that if they refreshed the page or left and came back, their progress wouldn't be lost.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Solution: I used the localStorage API. Every time a checkbox is checked or unchecked, the state of all answers is saved to localStorage. On page load, the script checks for saved data and re-populates the test.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Calculating the Score Dynamically:
The score (a number from 0-100) needed to update in real-time without refreshing the page.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Solution: This was a fun JavaScript logic problem. I attached an event listener to the entire form. Any time a click event happens, the function calculates the score by counting all the checked checkboxes (each "yes" subtracts a point from 100) and updates the displayed score instantly.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;// Simplified version of the calculateScore function&lt;br&gt;
function calculateScore() {&lt;br&gt;
    const checkboxes = document.querySelectorAll('input[type=checkbox]');&lt;br&gt;
    let score = 100;&lt;br&gt;
    checkboxes.forEach(checkbox =&amp;gt; {&lt;br&gt;
        if (checkbox.checked) {&lt;br&gt;
            score--;&lt;br&gt;
        }&lt;br&gt;
    });&lt;br&gt;
    document.getElementById('score-value').textContent = score;&lt;br&gt;
}&lt;/code&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Creating a Shareable Result:
I wanted users to be able to share their final score easily.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Solution: I implemented a simple "Share Your Score" button that copies a pre-formatted message (e.g., "I scored a 92/100 on the Rice Purity Test! 🎯 &lt;a href="https://ricepurity.info" rel="noopener noreferrer"&gt;ricepurity.info&lt;/a&gt;") to the user's clipboard using the navigator.clipboard.writeText() API.&lt;/p&gt;

&lt;p&gt;🚀 What's Next?&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;This was a super fun weekend project. Future ideas might include:&lt;/li&gt;
&lt;li&gt;Creating data visualizations of anonymous aggregate score data.&lt;/li&gt;
&lt;li&gt;Adding a "dark mode" toggle (because what modern app doesn't have one?).&lt;/li&gt;
&lt;li&gt;Allowing users to create custom test lists.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Check out the final product here: ricepurity.info&lt;/p&gt;

&lt;p&gt;I'd love to hear your feedback! Have you taken the test? What would you have done differently in the tech stack? Let me know in the comments!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>webdev</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
