<html lang="en">
<head>
    <meta charset="UTF-8"></meta>
    <meta content="width=device-width, initial-scale=1.0" name="viewport"></meta>
    <title>Grade 3, Primary Science, Types of Plants, worksheet</title>
    <style>
    
            h1 {
            font-size: 24px; /* Adjust this value as needed */
            color: green;
        }
        .correct {
            color: green;
        }
        .wrong {
            color: red;
        }
        body, html {
            -webkit-user-select: none; /* Safari */
            -moz-user-select: none; /* Firefox */
            -ms-user-select: none; /* Internet Explorer/Edge */
            user-select: none; /* Non-prefixed version, currently supported by Chrome, Opera, and Edge */
        }
        label {
            font-size: 20px;
        }
        p {
            font-size: 20px;
        }
        .question {
            display: flex;
            align-items: center;
            margin-bottom: 15px;
            font-size: 20px; /* Ensure font size consistency */
        }
        .question label {
            margin-right: 10px;
        }
        .question input[type="text"] {
            width: 50px;
            text-align: center;
            margin-right: 10px;
            font-size: 20px; /* Match font size with the label */
        }
        .question .answer-display {
            font-size: 20px;
            margin-left: 10px;
        }
        .exercise-instructions {
            font-size: 20px;
            margin-bottom: 20px;
            font-weight: bold; /* Make the instructions bold */
        }
        .result-images img {
            width: 50px;
            height: 50px;
        }
        .buttons {
            margin-top: 20px;
        }
        .buttons button {
            font-size: 18px;
            padding: 10px 20px;
            margin: 5px;
            color: white;
            border: none;
            border-radius: 5px;
            cursor: pointer;
        }
        .check-button {
            background-color: #4CAF50; /* Green */
        }
        .retry-button {
            background-color: #f44336; /* Red */
        }
        .marks {
            color: blue;
            font-size: 20px;
            font-weight: bold;
        }
    </style>
    <script>
        document.addEventListener('contextmenu', event => event.preventDefault());

        document.addEventListener('keydown', event => {
            if (event.key === "F12" || (event.ctrlKey && event.shiftKey && event.key === 'I') || (event.ctrlKey && event.shiftKey && event.key === 'J') || (event.ctrlKey && event.key === 'U')) {
                event.preventDefault();
            }
        });

        document.addEventListener('copy', event => {
            event.preventDefault();
        });

        function shuffle(array) {
            for (let i = array.length - 1; i > 0; i--) {
                const j = Math.floor(Math.random() * (i + 1));
                [array[i], array[j]] = [array[j], array[i]];
            }
            return array;
        }

const questions1 = [
    {"q": "What are plants?", "options": ["Non-living things", "Living things", "Toys"], "a": "Living things"},
    {"q": "Where do plants grow?", "options": ["In soil and water", "In the sky", "Inside houses only"], "a": "In soil and water"},
    {"q": "Which is the largest plant?", "options": ["Shrubs", "Herbs", "Trees"], "a": "Trees"},
    {"q": "What is the stem of a tree called?", "options": ["Leaf", "Bark", "Trunk"], "a": "Trunk"},
    {"q": "What do climbers do?", "options": ["Climb up sticks, walls, or trees", "Grow along the ground", "Grow only in water"], "a": "Climb up sticks, walls, or trees"},
    {"q": "What do creepers do?", "options": ["Grow along the ground", "Climb walls", "Grow under water"], "a": "Grow along the ground"},
    {"q": "Where do cactuses usually grow?", "options": ["In deserts or dry places", "In forests", "In water"], "a": "In deserts or dry places"},
    {"q": "What are cactuses covered with?", "options": ["Flowers", "Spines or thorns", "Bark"], "a": "Spines or thorns"},
    {"q": "What is a shrub?", "options": ["A small plant with hard stems", "A plant that grows in water", "A large tree"], "a": "A small plant with hard stems"},
    {"q": "What is a herb?", "options": ["A small plant with soft and weak stems", "A tall plant with a single trunk", "A plant that grows only in water"], "a": "A small plant with soft and weak stems"},
    {"q": "What are weeds?", "options": ["Plants that grow where they are not wanted", "Plants that grow in water only", "Tall plants with woody stems"], "a": "Plants that grow where they are not wanted"},
    {"q": "Which of these is a climber?", "options": ["Grapevine", "Watermelon", "Mint"], "a": "Grapevine"},
    {"q": "Which of these is a creeper?", "options": ["Watermelon", "Mint", "Grapevine"], "a": "Watermelon"},
    {"q": "Which of these is a herb?", "options": ["Mint", "Cactus", "Watermelon"], "a": "Mint"},
    {"q": "What are grasses and reeds?", "options": ["Short or tall plants that grow in water or wet soil", "Plants with woody stems", "Plants that climb trees"], "a": "Short or tall plants that grow in water or wet soil"},
    {"q": "What happens to a tree trunk every year?", "options": ["It gets smaller", "It grows bigger and gets new rings", "It falls off"], "a": "It grows bigger and gets new rings"},
    {"q": "Why are herbs useful to humans?", "options": ["They are used to make perfumes, medicines, and flavor food", "They help trees grow tall", "They climb walls and sticks"], "a": "They are used to make perfumes, medicines, and flavor food"},
    {"q": "Which of these has spines instead of leaves?", "options": ["Cactus", "Mint", "Shrub"], "a": "Cactus"},
    {"q": "What do we call tall slender plants growing near water?", "options": ["Reeds", "Climbers", "Creepers"], "a": "Reeds"},
    {"q": "Which part of a tree stretches and cracks as it grows?", "options": ["Bark", "Leaves", "Roots"], "a": "Bark"},
    {"q": "What do all plants need to grow?", "options": ["Sunlight, water, and air", "Toys and food", "Houses and roads"], "a": "Sunlight, water, and air"},
    {"q": "Which plant grows along the ground?", "options": ["Creeper", "Climber", "Tree"], "a": "Creeper"},
    {"q": "Which plant climbs up sticks and walls?", "options": ["Climber", "Shrub", "Herb"], "a": "Climber"},
    {"q": "What is a tree's bark?", "options": ["The outer layer of the tree trunk", "The leaves of a tree", "The roots of a tree"], "a": "The outer layer of the tree trunk"},
    {"q": "Which type of plant grows in deserts?", "options": ["Cactus", "Shrub", "Reed"], "a": "Cactus"},
    {"q": "What are spines on a cactus?", "options": ["Modified leaves", "Roots", "Flowers"], "a": "Modified leaves"},
    {"q": "Which type of plant has soft and weak stems?", "options": ["Herb", "Shrub", "Tree"], "a": "Herb"},
    {"q": "What type of plant is mint?", "options": ["Herb", "Shrub", "Tree"], "a": "Herb"},
    {"q": "What type of plant is coriander?", "options": ["Herb", "Climber", "Creeper"], "a": "Herb"},
    {"q": "What is an example of a creeper?", "options": ["Watermelon", "Grapevine", "Mint"], "a": "Watermelon"},
    {"q": "What are trees in thick jungles trying to reach?", "options": ["Sunlight", "Water", "Air"], "a": "Sunlight"},
    {"q": "What shape can tree tops be?", "options": ["Dome, fan, or cone shape", "Round only", "Flat only"], "a": "Dome, fan, or cone shape"},
    {"q": "What is the largest plant?", "options": ["Tree", "Shrub", "Herb"], "a": "Tree"},
    {"q": "What happens to tree trunks as they grow?", "options": ["They grow bigger and get rings", "They grow smaller and weaker", "They stay the same"], "a": "They grow bigger and get rings"},
    {"q": "What do climbers need to grow?", "options": ["Support like sticks or walls", "Only water", "Nothing"], "a": "Support like sticks or walls"},
    {"q": "What are reeds?", "options": ["Tall slender grasses growing near water", "Trees with thick trunks", "Herbs used in medicines"], "a": "Tall slender grasses growing near water"},
    {"q": "Which plants grow in water or wet soil?", "options": ["Water plants", "Shrubs", "Cactuses"], "a": "Water plants"},
    {"q": "What is the name of plants that grow where they are not wanted?", "options": ["Weeds", "Shrubs", "Climbers"], "a": "Weeds"},
    {"q": "Which type of plant has many separate stems?", "options": ["Shrubs", "Herbs", "Trees"], "a": "Shrubs"},
    {"q": "What do we use herbs for?", "options": ["To make medicine, perfumes, and food flavors", "To build houses", "To climb walls"], "a": "To make medicine, perfumes, and food flavors"}
]

        function displayQuestions() {
            shuffle(questions1);

            const questionsContainer1 = document.getElementById('questionsContainer1');
            questionsContainer1.innerHTML = `
                <div class="exercise-instructions">Exercise 1: Choose the correct answer.</div>
            `;
            questions1.forEach((question, index) => {
                const options = shuffle(question.options).map(option => 
                    `<label>
                        <input type="radio" name="question1${index}" value="${option}">
                        ${option}
                    </label><br>`
                ).join('');

                const questionHTML = `
                    <div>
                        <p>${index + 1}. ${question.q}</p>
                        ${options}
                        <p id="feedback1${index}"></p>
                    </div>
                `;
                questionsContainer1.innerHTML += questionHTML;
            });

   





            document.querySelectorAll('#questionsContainer4 .remainder-input').forEach(input => {
                input.addEventListener('keydown', event => {
                    if (event.key === 'Enter') {
                        event.preventDefault();
                        const quotientInputs = Array.from(document.querySelectorAll('#questionsContainer4 .quotient-input'));
                        const currentIndex = quotientInputs.indexOf(input.parentElement.querySelector('.quotient-input'));
                        const nextRowQuotient = quotientInputs[currentIndex + 1];
                        if (nextRowQuotient) {
                            nextRowQuotient.focus();
                        }
                    }
                });
            });
        }

        function checkAnswers() {
            let score1 = 0;

            const totalQuestions1 = questions1.length;


            // Check answers for Exercise 1
            questions1.forEach((question, index) => {
                const selectedAnswer = document.querySelector(`input[name="question1${index}"]:checked`);
                const feedback = document.getElementById(`feedback1${index}`);

                if (selectedAnswer) {
                    if (selectedAnswer.value === question.a) {
                        feedback.innerHTML = '<span class="correct">Correct!</span>';
                        score1++;
                    } else {
                        feedback.innerHTML = `<span class="wrong">Wrong! The correct answer is: ${question.a}</span>`;
                    }
                } else {
                    feedback.innerHTML = `<span class="wrong">No answer selected. The correct answer is: ${question.a}</span>`;
                }
            });

            // Hide the "Check Answers" button after checking the answers

            document.getElementById('checkAnswersButton').style.display = 'none';

            // Calculate percentage
            const totalScore = score1;
            const totalQuestions = totalQuestions1;
            const percentage = (totalScore / totalQuestions) * 100;

            // Display individual and total results
            const resultText = `
                <div class="marks">Exercise 1 Score: ${score1}/${totalQuestions1}</div>

                <div class="marks"><strong>Total Score: ${totalScore}/${totalQuestions} (${percentage.toFixed(2)}%)</strong></div>
                <div>${getGradeFeedback(percentage)}</div>
                ${percentage === 100 ? '<div class="result-images"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2-ubMp9uAa6YdIe_kBJ5KHLm9lvzYdypfXpvij7BtmhFONiFt9j3D7r1V_M4wPnIkIsocug7NzEHIYr35z4J8KqsKIXqw2YCpi_HY6C3OiGkC9ADz9Ee2ne-gO0VgladOU5r5FbSk2jrIy8rdgM0G895UGG_ayI0Bkeh1CU5ZswyoeWQyHsaICeB6Z7k/s1600/star.jpg" alt="Star"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQ6tyya1xafjBJ3poGtUE9T5Tj-YAnRsc1SnByb_1pebaR-LBVZYtBJyZ2y_0BMix1y5byTXw2FDWyRzK7_6gAq3duQofJEibkjoQYhCQ-qGcisr9uR6jJ2IN0P510osrhyphenhyphencjOEYoC9uuYnnnL6L61GTgAoWhtcUHu2sXs5RTwaLZAsIwGlePDW-ZXBb8/s1600/happy%20face.jpg" alt="Happy Face"></div>' : ''}
            `;
            document.getElementById('result').innerHTML = resultText;
            document.getElementById('result').style.fontSize = '20px'; // Ensure font size matches questions
            document.getElementById('result').style.fontWeight = 'bold'; // Make the result text bold
            document.querySelectorAll('.marks').forEach(element => {
                element.style.color = 'blue'; // Set color for all marks
            });
        }

        function getGradeFeedback(percentage) {
            if (percentage <= 25) {
                return 'Keep trying, you are improving! Keep up the effort!';
            } else if (percentage <= 50) {
                return 'Good job! You are doing well, keep practicing!';
            } else if (percentage <= 75) {
                return 'Great work! You are almost there, keep it up!';
            } else if (percentage <= 85) {
                return 'Excellent! You are doing fantastic!';
            } else if (percentage <= 99) {
                return 'Almost perfect! Keep up the great work!';
            } else {
                return 'Perfect score! You did an amazing job!';
            }
        }

        window.onload = function() {
            displayQuestions();

            document.getElementById('checkAnswersButton').addEventListener('click', checkAnswers);
document.getElementById('retryButton').addEventListener('click', () => {
    location.reload(); // This will refresh the page
       document.getElementById('result').innerHTML = '';
                displayQuestions();
            });
        }
    </script>
</head>
<body>
  
   <h1>Grade 3, Primary Science, Types of Plants, worksheet</h1> <!-- Add a title heading here -->
  
  
    <div id="questionsContainer1"></div>

    <div id="result"></div>
    <div class="buttons">
        <button class="check-button" id="checkAnswersButton">Check Answers</button>
        <button class="retry-button" id="retryButton">Retry</button>
    </div>
</body>
</html>
