<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 1</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": ["Love and security", "Food, water, and air", "Recognition and appreciation", "Winning awards"], "a": "Food, water, and air"},
    {"q": "What kind of needs include love and security?", "options": ["Basic needs", "Secondary needs", "External needs", "Optional needs"], "a": "Secondary needs"},
    {"q": "What is self-esteem?", "options": ["The evaluation of one’s worth", "The amount of money a person earns", "The ability to run fast", "The need for food"], "a": "The evaluation of one’s worth"},
    {"q": "Which of the following improves self-esteem?", "options": ["Ignoring strengths", "Focusing only on weaknesses", "Identifying abilities and developing them", "Avoiding responsibilities"], "a": "Identifying abilities and developing them"},
    {"q": "What contributes to achieving higher human needs?", "options": ["Self-realization", "Physical health only", "Ignoring responsibilities", "Avoiding social relationships"], "a": "Self-realization"},
    {"q": "Which of the following is an internal factor that affects self-esteem?", "options": ["Encouragement from teachers", "Self-confidence", "Awards and certificates", "Advice from parents"], "a": "Self-confidence"},
    {"q": "What is an external factor that helps in building self-esteem?", "options": ["Commitment and enthusiasm", "Awards and recognition", "Self-realization", "Identifying weaknesses"], "a": "Awards and recognition"},
    {"q": "Who can influence a person's self-esteem externally?", "options": ["Parents and teachers", "Strangers", "Only oneself", "None of the above"], "a": "Parents and teachers"},
    {"q": "What can improve social acceptance and self-esteem?", "options": ["Being kind and honest", "Being rude", "Ignoring responsibilities", "Avoiding friends"], "a": "Being kind and honest"},
    {"q": "Which of the following does NOT help in improving self-esteem?", "options": ["Self-confidence", "Patience and discipline", "Lack of commitment", "Positive social relationships"], "a": "Lack of commitment"},
    {"q": "How do achievements in sports affect self-esteem?", "options": ["They reduce confidence", "They increase self-worth", "They have no impact", "They lead to isolation"], "a": "They increase self-worth"},
    {"q": "How do prizes and certificates help in self-esteem?", "options": ["They make a person arrogant", "They discourage hard work", "They serve as motivation", "They do not influence self-esteem"], "a": "They serve as motivation"},
    {"q": "How does helping others improve self-esteem?", "options": ["It makes us feel valued", "It lowers our confidence", "It has no effect", "It creates fear"], "a": "It makes us feel valued"},
    {"q": "What did Susanthika Jayasinghe achieve?", "options": ["Won an Olympic silver medal", "Became a doctor", "Discovered a new planet", "Wrote a famous book"], "a": "Won an Olympic silver medal"},
    {"q": "How did Sri Lanka’s cricket victory affect the nation?", "options": ["Made everyone feel proud", "Reduced the country’s self-esteem", "Created conflicts", "Had no impact"], "a": "Made everyone feel proud"},
    {"q": "What profession provides medical care to people?", "options": ["Engineers", "Doctors", "Artists", "Farmers"], "a": "Doctors"},
    {"q": "Who contributes to building bridges and buildings?", "options": ["Teachers", "Masons and engineers", "Writers", "Scientists"], "a": "Masons and engineers"},
    {"q": "How should we treat people with different skills?", "options": ["Respect and appreciate them", "Ignore their contribution", "Criticize them", "Compete negatively with them"], "a": "Respect and appreciate them"},
    {"q": "What should we avoid doing to maintain the self-esteem of others?", "options": ["Encouraging them", "Helping them", "Criticizing unnecessarily", "Supporting their success"], "a": "Criticizing unnecessarily"},
    {"q": "How can parents contribute to their child’s self-esteem?", "options": ["Ignoring their abilities", "Giving positive encouragement", "Comparing them negatively with others", "Discouraging them"], "a": "Giving positive encouragement"},
    {"q": "What happens when we respect others’ achievements?", "options": ["It lowers our confidence", "It strengthens relationships", "It creates competition", "It discourages us"], "a": "It strengthens relationships"},
    {"q": "Why should we not harm others’ self-esteem?", "options": ["It is morally wrong", "It creates a negative society", "It affects social harmony", "All of the above"], "a": "All of the above"},
    {"q": "How does recognizing strengths help self-esteem?", "options": ["It boosts confidence", "It discourages growth", "It leads to arrogance", "It isolates people"], "a": "It boosts confidence"},
    {"q": "Why is it important to identify our abilities?", "options": ["To feel superior to others", "To improve self-esteem and confidence", "To avoid responsibilities", "To seek rewards only"], "a": "To improve self-esteem and confidence"},
    {"q": "What is an example of an ability that contributes to self-esteem?", "options": ["Laziness", "Commitment to hard work", "Complaining about others", "Avoiding challenges"], "a": "Commitment to hard work"},
    {"q": "How can artistic talents improve self-esteem?", "options": ["By developing self-confidence and creativity", "By discouraging teamwork", "By making a person arrogant", "By avoiding responsibilities"], "a": "By developing self-confidence and creativity"},
    {"q": "Why should people develop their talents?", "options": ["To boast about them", "To build confidence and self-worth", "To compete unfairly", "To gain financial benefits only"], "a": "To build confidence and self-worth"},
    {"q": "What happens if we ignore our abilities?", "options": ["We fail to reach our potential", "We become more successful", "We gain more confidence", "We inspire others"], "a": "We fail to reach our potential"},
    {"q": "How do teachers help students improve self-esteem?", "options": ["By giving negative feedback", "By encouraging their strengths", "By ignoring their talents", "By punishing mistakes"], "a": "By encouraging their strengths"},
    {"q": "Why is guidance from elders important?", "options": ["It helps develop confidence and responsibility", "It makes children feel weak", "It limits growth", "It discourages independence"], "a": "It helps develop confidence and responsibility"},
    {"q": "How does receiving appreciation affect self-esteem?", "options": ["It lowers self-confidence", "It motivates people to achieve more", "It creates unnecessary pressure", "It discourages success"], "a": "It motivates people to achieve more"},
    {"q": "What role do friends play in self-esteem?", "options": ["They provide encouragement and support", "They discourage learning", "They reduce motivation", "They increase fear of failure"], "a": "They provide encouragement and support"},
    {"q": "Why is social acceptance important?", "options": ["It boosts self-esteem", "It creates a negative mindset", "It increases isolation", "It makes people dependent"], "a": "It boosts self-esteem"},
    {"q": "What is one way to improve self-esteem?", "options": ["Taking responsibility for our actions", "Blaming others for mistakes", "Avoiding difficult tasks", "Refusing to learn new skills"], "a": "Taking responsibility for our actions"},
    {"q": "Why should we avoid harming others’ self-esteem?", "options": ["To maintain positive relationships", "To create conflict", "To make them feel inferior", "To discourage them"], "a": "To maintain positive relationships"},
    {"q": "What happens when a person is disciplined?", "options": ["They build confidence and respect", "They lose social acceptance", "They feel less valued", "They become isolated"], "a": "They build confidence and respect"},
    {"q": "How do good manners help self-esteem?", "options": ["They improve social relationships", "They create conflicts", "They make people arrogant", "They reduce self-worth"], "a": "They improve social relationships"},
    {"q": "What should a person with high self-esteem do?", "options": ["Respect others' abilities", "Ignore social responsibilities", "Boast about their achievements", "Avoid challenges"], "a": "Respect others' abilities"},
    {"q": "Why should we respect different professions?", "options": ["Every profession contributes to society", "Only certain jobs are important", "Some jobs are less valuable", "Certain jobs do not require respect"], "a": "Every profession contributes to society"},
    {"q": "How can teamwork improve self-esteem?", "options": ["By developing social skills and confidence", "By creating competition", "By making people dependent", "By reducing individual effort"], "a": "By developing social skills and confidence"},
    {"q": "What is one way to support self-esteem in younger children?", "options": ["Encouraging their efforts", "Comparing them negatively with others", "Ignoring their achievements", "Making them feel unimportant"], "a": "Encouraging their efforts"},
    {"q": "How do awards and recognition help in self-esteem?", "options": ["They provide motivation to do better", "They create jealousy", "They make people overconfident", "They discourage improvement"], "a": "They provide motivation to do better"},
    {"q": "Why should people be encouraged to develop their abilities?", "options": ["It helps in personal growth", "It creates unnecessary pressure", "It leads to arrogance", "It makes life more difficult"], "a": "It helps in personal growth"},
    {"q": "What is one way to help others build self-esteem?", "options": ["Appreciating their strengths", "Ignoring their achievements", "Criticizing them often", "Making them feel unworthy"], "a": "Appreciating their strengths"},
    {"q": "How can a person develop self-confidence?", "options": ["By recognizing and improving their abilities", "By ignoring their talents", "By avoiding responsibilities", "By giving up on challenges"], "a": "By recognizing and improving their abilities"},
    {"q": "How does setting goals improve self-esteem?", "options": ["It provides direction and motivation", "It makes people feel pressured", "It limits creativity", "It discourages personal growth"], "a": "It provides direction and motivation"},
    {"q": "What is an important step in building self-esteem?", "options": ["Learning from mistakes", "Avoiding new experiences", "Focusing only on failures", "Comparing negatively with others"], "a": "Learning from mistakes"},
    {"q": "Why should we not compare ourselves negatively with others?", "options": ["Every person has unique strengths", "It reduces confidence", "It creates unnecessary pressure", "All of given answers"], "a": "All of given answers"}
]

        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 1</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>
