Tag: test review

  • An HTML Flashcard Tool for Repeating Difficult Study Material

    An HTML Flashcard Tool for Repeating Difficult Study Material

    Flashcard example

    Helping a child review for a test can become surprisingly complicated. Notes may be in Google Classroom, worksheets may be in a backpack, and important vocabulary may be spread across several assignments. In our home, one of the hardest parts was not finding the material—it was getting through the same material more than once. After reviewing a question one time, it was easy to move on even when the answer was not fully remembered.

    Keeping track of the results was inconvenient too. We could use paper flashcards, but then we had to make separate piles or marks to remember which questions needed another try. I wanted a simple tool that could show one question at a time, reveal the answer, and record whether the answer was correct.

    The solution below is a small flashcard program that runs in a web browser. It does not require an account, a subscription, or an internet connection after the file has been saved. A parent only needs to replace the sample questions and answers.

    1. What This Flashcard Tool Does

    The program includes several useful study features:

    • Shows one question at a time
    • Reveals the answer when the card is clicked
    • Provides Previous and Next buttons
    • Records I Got It and Review Again responses
    • Displays the score and remaining cards
    • Offers a Restart button for another study round
    • Runs locally on a Windows computer

    This is useful for vocabulary, science terms, history facts, math formulas, spelling, and short-answer test review.

    2. What You Need

    You only need:

    1. A Windows computer
    2. Notepad
    3. A web browser such as Chrome, Edge, or Firefox
    4. A list of questions and answers

    No programming software needs to be installed.

    3. Copy the Flashcard Template

    Open Notepad and copy all of the following code into a new blank file:

    <!DOCTYPE html>
    <html lang="en">
    <head>
      <meta charset="UTF-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <title>Family Study Flashcards</title>
      <style>
        * { box-sizing: border-box; }
    
        body {
          margin: 0;
          min-height: 100vh;
          display: flex;
          align-items: center;
          justify-content: center;
          padding: 24px;
          font-family: Arial, sans-serif;
          color: #1f2937;
          background: linear-gradient(135deg, #e0f2fe, #ede9fe);
        }
    
        .app {
          width: min(680px, 100%);
          padding: 28px;
          background: white;
          border-radius: 22px;
          box-shadow: 0 16px 40px rgba(31, 41, 55, 0.15);
        }
    
        h1 {
          margin: 0 0 8px;
          text-align: center;
          color: #312e81;
        }
    
        .instructions, .status {
          text-align: center;
          color: #4b5563;
        }
    
        .progress-track {
          height: 10px;
          margin: 18px 0;
          overflow: hidden;
          background: #e5e7eb;
          border-radius: 999px;
        }
    
        .progress-bar {
          height: 100%;
          width: 0;
          background: #4f46e5;
          transition: width 0.25s ease;
        }
    
        .card {
          min-height: 260px;
          display: flex;
          flex-direction: column;
          align-items: center;
          justify-content: center;
          padding: 34px;
          border: 3px solid #c7d2fe;
          border-radius: 18px;
          text-align: center;
          cursor: pointer;
          background: #f8fafc;
          transition: transform 0.2s, background 0.2s;
          user-select: none;
        }
    
        .card:hover { transform: translateY(-2px); }
        .card.answer { background: #ecfdf5; border-color: #6ee7b7; }
    
        .label {
          margin-bottom: 16px;
          font-size: 0.85rem;
          font-weight: bold;
          letter-spacing: 0.12em;
          color: #6366f1;
        }
    
        .card.answer .label { color: #047857; }
    
        .card-text {
          font-size: clamp(1.35rem, 4vw, 2rem);
          line-height: 1.4;
          font-weight: bold;
        }
    
        .controls, .rating-controls {
          display: flex;
          flex-wrap: wrap;
          gap: 10px;
          justify-content: center;
          margin-top: 18px;
        }
    
        button {
          padding: 12px 18px;
          border: 0;
          border-radius: 10px;
          font-size: 1rem;
          font-weight: bold;
          cursor: pointer;
          color: white;
          background: #4f46e5;
        }
    
        button:hover { filter: brightness(0.93); }
        button:disabled { opacity: 0.45; cursor: not-allowed; }
        .correct { background: #059669; }
        .review { background: #d97706; }
        .secondary { background: #64748b; }
        .hidden { display: none; }
    
        .results {
          padding: 32px 10px;
          text-align: center;
        }
    
        .score {
          margin: 16px 0;
          font-size: 2.2rem;
          font-weight: bold;
          color: #4f46e5;
        }
      </style>
    </head>
    <body>
      <main class="app">
        <section id="studyScreen">
          <h1>Family Study Flashcards</h1>
          <p class="instructions">Click the card to show the answer.</p>
          <p class="status" id="status"></p>
    
          <div class="progress-track">
            <div class="progress-bar" id="progressBar"></div>
          </div>
    
          <div class="card" id="card" tabindex="0" role="button">
            <div class="label" id="cardLabel">QUESTION</div>
            <div class="card-text" id="cardText"></div>
          </div>
    
          <div class="controls">
            <button class="secondary" id="previousButton">Previous</button>
            <button id="flipButton">Show Answer</button>
            <button class="secondary" id="nextButton">Next</button>
          </div>
    
          <div class="rating-controls hidden" id="ratingControls">
            <button class="correct" id="correctButton">I Got It</button>
            <button class="review" id="reviewButton">Review Again</button>
          </div>
        </section>
    
        <section class="results hidden" id="resultsScreen">
          <h1>Study Round Complete!</h1>
          <p>Your score is:</p>
          <div class="score" id="finalScore"></div>
          <p id="resultMessage"></p>
          <button id="restartButton">Study Again</button>
        </section>
      </main>
    
      <script>
        // EDIT ONLY THIS LIST TO ADD YOUR OWN FLASHCARDS.
        const flashcards = [
          { question: "What is photosynthesis?", answer: "The process plants use to turn light energy into food." },
          { question: "What is the capital of Washington State?", answer: "Olympia" },
          { question: "What is 8 × 7?", answer: "56" },
          { question: "What does 'analyze' mean?", answer: "To examine something carefully and in detail." },
          { question: "What is the formula for the area of a rectangle?", answer: "Length × width" }
        ];
    
        let currentIndex = 0;
        let showingAnswer = false;
        let correctCount = 0;
        let ratedCards = new Array(flashcards.length).fill(null);
    
        const card = document.getElementById("card");
        const cardLabel = document.getElementById("cardLabel");
        const cardText = document.getElementById("cardText");
        const status = document.getElementById("status");
        const progressBar = document.getElementById("progressBar");
        const flipButton = document.getElementById("flipButton");
        const previousButton = document.getElementById("previousButton");
        const nextButton = document.getElementById("nextButton");
        const ratingControls = document.getElementById("ratingControls");
    
        function displayCard() {
          showingAnswer = false;
          card.classList.remove("answer");
          cardLabel.textContent = "QUESTION";
          cardText.textContent = flashcards[currentIndex].question;
          flipButton.textContent = "Show Answer";
          ratingControls.classList.add("hidden");
          status.textContent = `Card ${currentIndex + 1} of ${flashcards.length} • Correct: ${correctCount}`;
          progressBar.style.width = `${((currentIndex + 1) / flashcards.length) * 100}%`;
          previousButton.disabled = currentIndex === 0;
          nextButton.disabled = currentIndex === flashcards.length - 1;
        }
    
        function flipCard() {
          showingAnswer = !showingAnswer;
    
          if (showingAnswer) {
            card.classList.add("answer");
            cardLabel.textContent = "ANSWER";
            cardText.textContent = flashcards[currentIndex].answer;
            flipButton.textContent = "Show Question";
            ratingControls.classList.remove("hidden");
          } else {
            card.classList.remove("answer");
            cardLabel.textContent = "QUESTION";
            cardText.textContent = flashcards[currentIndex].question;
            flipButton.textContent = "Show Answer";
            ratingControls.classList.add("hidden");
          }
        }
    
        function moveCard(direction) {
          currentIndex += direction;
          displayCard();
        }
    
        function rateCard(isCorrect) {
          if (ratedCards[currentIndex] === true) correctCount--;
          ratedCards[currentIndex] = isCorrect;
          if (isCorrect) correctCount++;
    
          if (currentIndex < flashcards.length - 1) {
            currentIndex++;
            displayCard();
          } else {
            showResults();
          }
        }
    
        function showResults() {
          document.getElementById("studyScreen").classList.add("hidden");
          document.getElementById("resultsScreen").classList.remove("hidden");
          document.getElementById("finalScore").textContent = `${correctCount} / ${flashcards.length}`;
    
          const reviewCount = flashcards.length - correctCount;
          document.getElementById("resultMessage").textContent = reviewCount === 0
            ? "Excellent work! Every card was answered correctly."
            : `${reviewCount} card${reviewCount === 1 ? "" : "s"} may need another review.`;
        }
    
        function restartStudy() {
          currentIndex = 0;
          correctCount = 0;
          ratedCards = new Array(flashcards.length).fill(null);
          document.getElementById("resultsScreen").classList.add("hidden");
          document.getElementById("studyScreen").classList.remove("hidden");
          displayCard();
        }
    
        card.addEventListener("click", flipCard);
        card.addEventListener("keydown", event => {
          if (event.key === "Enter" || event.key === " ") flipCard();
        });
        flipButton.addEventListener("click", flipCard);
        previousButton.addEventListener("click", () => moveCard(-1));
        nextButton.addEventListener("click", () => moveCard(1));
        document.getElementById("correctButton").addEventListener("click", () => rateCard(true));
        document.getElementById("reviewButton").addEventListener("click", () => rateCard(false));
        document.getElementById("restartButton").addEventListener("click", restartStudy);
    
        displayCard();
      </script>
    </body>
    </html>

    4. Add Your Own Questions and Answers

    Near the bottom of the code, find this section:

    const flashcards = [
      { question: "What is photosynthesis?", answer: "The process plants use to turn light energy into food." },
      { question: "What is the capital of Washington State?", answer: "Olympia" }
    ];

    Replace the sample text inside the quotation marks with your own study material. Each flashcard follows this pattern:

    { question: "Type the question here", answer: "Type the answer here" },

    For example, a vocabulary card could look like this:

    { question: "What does 'contrast' mean?", answer: "To identify differences between two or more things." },

    Be careful not to delete the quotation marks, braces, or comma. The final card in the list does not need a comma after it.

    5. Save the File Correctly in Windows

    In Notepad:

    1. Select File → Save As.
    2. Enter family-flashcards.html as the file name.
    3. Change Save as type to All Files.
    4. Select UTF-8 for the encoding.
    5. Save the file somewhere easy to find, such as the Desktop.

    The .html ending is important. If the file is saved as family-flashcards.html.txt, Windows will treat it as a text document instead of a web page.

    6. Open and Use the Flashcards

    Double-click family-flashcards.html. It should open in your default web browser.

    Read the question first and let your child answer without looking at the back. Click the card or select Show Answer. Then choose:

    • I Got It when the answer was correct
    • Review Again when the answer was incorrect or incomplete

    At the end, the program shows the number of correctly answered cards. Select Study Again to restart the complete set.

    7. A Simple Way to Use the Score

    The score is not meant to replace a school grade. I use it as a quick guide for deciding what needs more attention.

    For example:

    • 90–100%: Review briefly one more time before the test.
    • 70–89%: Repeat the cards that were difficult.
    • Below 70%: Break the material into a smaller set and study it in shorter sessions.

    This makes the study result easier to understand than relying on memory alone. Instead of wondering which questions caused trouble, a parent and child can immediately see whether another round would be helpful.

    One limitation is that the current version shows the total score but does not save it after the browser is closed. This is helpful for privacy because the information stays on the computer, but parents who want a long-term record should write the date and score in a notebook or spreadsheet.

    8. Troubleshooting Common Problems

    The code opens as text

    Check the file name. It must end in .html, not .txt. In File Explorer, enable View → Show → File name extensions if the ending is hidden.

    The page is blank or the buttons do not work

    A quotation mark, comma, brace, or bracket may have been deleted while adding questions. Compare the edited flashcard list with the original sample.

    An apostrophe causes a problem

    The template uses double quotation marks around each question and answer, so ordinary apostrophes in words such as child's should work. Avoid adding unescaped double quotation marks inside the question or answer. You can use single quotation marks inside the text instead.

    Changes do not appear

    Save the file in Notepad, return to the browser, and refresh the page. If an older version still appears, close the browser tab and open the HTML file again.

    Final Thoughts

    A study tool does not need to be complicated to be useful. This flashcard program puts the questions, answers, and results in one place while keeping the setup simple enough for a parent to manage.

    The most useful part for our family is the repeatable routine: read the question, say the answer, check it, and record the result. That structure makes it easier to return to material that was not remembered the first time. Because the program is only one HTML file, I can also make a separate copy for each subject or upcoming test without creating another online account.

    Start with five to ten cards. Once the tool is working, add more questions gradually and keep each answer short enough to review quickly.