<html lang="en">
<head>
    <meta charset="UTF-8"></meta>
    <meta content="width=device-width, initial-scale=1.0" name="viewport"></meta>
    <title>Grade 8, Health and Physical Education, Let us improve our self esteem, worksheet 2</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 the basic human needs?", "options": ["Food, water, and air", "Love and security", "Self-esteem and achievement", "Money and power"], "a": "Food, water, and air"},
    {"q": "Which of the following is a secondary need?", "options": ["Food", "Water", "Sense of security", "Air"], "a": "Sense of security"},
    {"q": "Self-esteem is classified as a:", "options": ["Basic need", "Secondary need", "Higher need", "Physiological need"], "a": "Higher need"},
    {"q": "What is self-esteem?", "options": ["A person’s evaluation of their own worth", "A person’s physical strength", "A person’s financial status", "A person’s social popularity"], "a": "A person’s evaluation of their own worth"},
    {"q": "Which of the following is NOT a basic need?", "options": ["Food", "Love", "Water", "Air"], "a": "Love"},
    {"q": "What can improve self-esteem?", "options": ["Achievements in sports", "Engaging in art", "Helping others", "All of the above"], "a": "All of the above"},
    {"q": "Which of the following is an internal factor that influences self-esteem?", "options": ["Recognition by teachers", "Self-confidence", "Awards and certificates", "Guidance from parents"], "a": "Self-confidence"},
    {"q": "Which of the following is an external factor that influences self-esteem?", "options": ["Self-realization", "Commitment", "Appreciation by teachers", "Enthusiasm"], "a": "Appreciation by teachers"},
    {"q": "What is one way to improve self-esteem?", "options": ["By ignoring one’s abilities", "By identifying and improving one’s abilities", "By avoiding social interactions", "By focusing only on weaknesses"], "a": "By identifying and improving one’s abilities"},
    {"q": "Which of the following can negatively impact self-esteem?", "options": ["Being ridiculed or bullied", "Receiving awards", "Being appreciated", "Helping others"], "a": "Being ridiculed or bullied"},
    {"q": "Which skill can help improve self-esteem?", "options": ["Sports abilities", "Drawing", "Dancing", "All of the above"], "a": "All of the above"},
    {"q": "What can achievements in sports lead to?", "options": ["Increased self-esteem", "Decreased self-esteem", "No change in self-esteem", "Social isolation"], "a": "Increased self-esteem"},
    {"q": "Which of the following is NOT a skill that can improve self-esteem?", "options": ["Mathematics", "Music", "Acting", "Procrastination"], "a": "Procrastination"},
    {"q": "What can creativity and innovativeness lead to?", "options": ["Becoming an inventor", "Becoming a mathematician", "Becoming a dancer", "Becoming a teacher"], "a": "Becoming an inventor"},
    {"q": "Which of the following is a skill that can improve self-esteem?", "options": ["Following rules (Discipline)", "Negligence", "Violating the law", "Being abusive"], "a": "Following rules (Discipline)"},
    {"q": "How can healthy social relationships affect self-esteem?", "options": ["They have no effect", "They can improve self-esteem", "They can decrease self-esteem", "They lead to isolation"], "a": "They can improve self-esteem"},
    {"q": "What should people with high self-esteem be conscious of?", "options": ["Their own needs only", "The self-esteem of others", "Their financial status", "Their physical appearance"], "a": "The self-esteem of others"},
    {"q": "What can damage others’ self-esteem?", "options": ["Appreciation", "Encouragement", "Ridicule or bullying", "Awards and certificates"], "a": "Ridicule or bullying"},
    {"q": "What is one way to boost the self-esteem of others?", "options": ["By criticizing them", "By appreciating their good work", "By ignoring them", "By ridiculing them"], "a": "By appreciating their good work"},
    {"q": "What should we avoid to protect others’ self-esteem?", "options": ["Helping others", "Appreciating others", "Ridiculing or bullying others", "Encouraging others"], "a": "Ridiculing or bullying others"},
    {"q": "What can winning a competition do for a person’s self-esteem?", "options": ["Decrease it", "Increase it", "Have no effect", "Cause stress"], "a": "Increase it"},
    {"q": "What did Susanthika Jayasinghe achieve?", "options": ["An Olympic silver medal", "A gold medal in cricket", "A prize in an art competition", "A certificate in mathematics"], "a": "An Olympic silver medal"},
    {"q": "How did Sri Lanka’s cricket world cup win affect the country?", "options": ["It made the country feel proud", "It had no effect", "It caused sadness", "It led to confusion"], "a": "It made the country feel proud"},
    {"q": "What is an example of an internal factor that influences self-esteem?", "options": ["Recognition by teachers", "Self-confidence", "Awards and certificates", "Guidance from parents"], "a": "Self-confidence"},
    {"q": "What is an example of an external factor that influences self-esteem?", "options": ["Self-realization", "Commitment", "Appreciation by teachers", "Enthusiasm"], "a": "Appreciation by teachers"},
    {"q": "Which of the following is NOT an internal factor?", "options": ["Self-confidence", "Commitment", "Appreciation by teachers", "Enthusiasm"], "a": "Appreciation by teachers"},
    {"q": "Which of the following is NOT an external factor?", "options": ["Recognition by teachers", "Awards and certificates", "Self-realization", "Guidance from parents"], "a": "Self-realization"},
    {"q": "What is one way to cultivate internal factors for self-esteem?", "options": ["By ignoring one’s strengths", "By identifying one’s strengths and weaknesses", "By avoiding responsibilities", "By focusing only on weaknesses"], "a": "By identifying one’s strengths and weaknesses"},
    {"q": "What can negatively impact self-esteem?", "options": ["Being appreciated", "Being ridiculed or bullied", "Receiving awards", "Helping others"], "a": "Being ridiculed or bullied"},
    {"q": "What is one social factor that can negatively impact self-esteem?", "options": ["Following rules", "Being disciplined", "Being abused", "Helping others"], "a": "Being abused"},
    {"q": "What can lack of appreciation lead to?", "options": ["Increased self-esteem", "Decreased self-esteem", "No change in self-esteem", "Social popularity"], "a": "Decreased self-esteem"},
    {"q": "What is one behavior that can damage self-esteem?", "options": ["Being kind", "Being patient", "Being criticized", "Being honest"], "a": "Being criticized"},
    {"q": "What should people with high self-esteem avoid?", "options": ["Helping others", "Damaging others’ self-esteem", "Appreciating others", "Encouraging others"], "a": "Damaging others’ self-esteem"},
    {"q": "What is the first aim of a person?", "options": ["To fulfil higher needs", "To fulfil basic needs", "To fulfil secondary needs", "To fulfil social needs"], "a": "To fulfil basic needs"},
    {"q": "What is one way to improve self-esteem?", "options": ["By ignoring one’s abilities", "By identifying and improving one’s abilities", "By avoiding social interactions", "By focusing only on weaknesses"], "a": "By identifying and improving one’s abilities"},
    {"q": "What is one characteristic that can improve social acceptance?", "options": ["Dishonesty", "Kindness", "Impatience", "Breaking rules"], "a": "Kindness"},
    {"q": "What is one way to contribute to society positively?", "options": ["By having high self-esteem", "By ridiculing others", "By avoiding responsibilities", "By being abusive"], "a": "By having high self-esteem"},
    {"q": "What should we appreciate in others?", "options": ["Their weaknesses", "Their positive aspects", "Their failures", "Their negative behaviors"], "a": "Their positive aspects"},
    {"q": "What should you list in the activity about abilities and self-esteem?", "options": ["Abilities and how they can improve self-esteem", "Weaknesses and how they can decrease self-esteem", "Negative behaviors and their impact", "Social norms and their importance"], "a": "Abilities and how they can improve self-esteem"},
    {"q": "What is one opportunity that can boost self-esteem at school?", "options": ["Being ridiculed", "Receiving awards", "Being ignored", "Being criticized"], "a": "Receiving awards"},
    {"q": "What is one opportunity that can boost self-esteem at home?", "options": ["Lack of appreciation", "Guidance and appreciation from parents", "Being abused", "Being ridiculed"], "a": "Guidance and appreciation from parents"},
    {"q": "What is one way to improve self-esteem through social relationships?", "options": ["By isolating oneself", "By maintaining healthy relationships", "By ridiculing others", "By avoiding responsibilities"], "a": "By maintaining healthy relationships"},
    {"q": "What is one way to ensure you don’t harm others’ self-esteem?", "options": ["By ridiculing them", "By appreciating their good work", "By ignoring them", "By criticizing them"], "a": "By appreciating their good work"},
    {"q": "What is one way to improve self-esteem through achievements?", "options": ["By avoiding challenges", "By setting and achieving goals", "By focusing only on failures", "By ignoring one’s abilities"], "a": "By setting and achieving goals"},
    {"q": "What is one way to improve self-esteem through characteristics?", "options": ["By being dishonest", "By being kind and patient", "By breaking rules", "By being undisciplined"], "a": "By being kind and patient"},
    {"q": "What is one way to improve self-esteem through social acceptance?", "options": ["By being rude", "By being honest and disciplined", "By violating the law", "By being abusive"], "a": "By being honest and disciplined"},
    {"q": "What is one way to improve self-esteem through helping others?", "options": ["By ignoring others’ needs", "By using one’s abilities to help others", "By ridiculing others", "By avoiding social interactions"], "a": "By using one’s abilities to help others"}
]

        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 8, Health and Physical Education, Let us improve our self esteem, worksheet 2</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>
