    <div class="quizz__container">
        <h1>Quiz</h1>
        <div class="quizz__frame">
            <div class="quizz__content">
                <div class="question__order">
                    <p>Question <span id="iterate">1</span> of 10</p>
                </div>
                <div class="question">
                    <p id="quizz__question">Which of the following definitions is not a description of sexual exploitation?</p>
                </div>
                <form class="quizz__form" action="">
                    <div class="quizz__boolean">
                        <div class="boolean">
                            <div class="fake__radio">
                                <div class="checked"></div>
                            </div>
                            <p id="aText">Using a person’s body for sexual purposes in order to gain an advantage.</p>
                            <input class="input1" id="vrai" type="radio" value="A" name="boolean">
                        </div>
                        <div class="boolean">
                            <div class="fake__radio">
                                <div class="checked"></div>
                            </div>
                            <p id="bText">Exchanging sexual services for money or other goods where all parties consent.</p>
                            <input class="input2" id="faux" type="radio" value="B" name="boolean">
                        </div>
                        <div class="boolean question9">
                            <div class="fake__radio">
                                <div class="checked"></div>
                            </div>
                            <p id="cText">Need to survive</p>
                            <input class="input3" id="faux_quest9" type="radio" value="B" name="boolean">
                        </div>
                        <div class="boolean question9">
                            <div class="fake__radio">
                                <div class="checked"></div>
                            </div>
                            <p id="dText">All of the above</p>
                            <input class="input4" id="vrai_quest9" type="radio" value="A" name="boolean">
                        </div>
                    </div>

                    <div class="quizz__submit">
                        <div class="quizz__submit__content">
                            <input class="disabled" id="submit" type="submit" value="OK">
                            <div class="border disabled"></div>
                        </div>
                    </div>
                    <div class="results__answer">
                        <p id="results"></p>
                        <p id="correction"></p>
                    </div>
                    <div class="next__container">
                        <button class="next__question">
                            <p>NEXT <i class="fa fa-arrow-right"></i></p>
                        </button>
                    </div>
                    <div class="start__again">
                        <p id="restart__quizz">Start again <i class="fa fa-rotate-right"></i></p>
                    </div>
                </form>
            </div>
        </div>
    </div>

    <script>
        fake_radio();
        quizz_form();

        function quizz_form() {
            let submit = document.querySelector("#submit")
            let textArr = [
                "Which of the following definitions is not a description of sexual exploitation ? ",
                "True or false? Sexual exploitation is legal.",
                "True or false? Those who are being sexually exploited can stop whenever they want.",
                "True or false? Most pimps are men.",
                "True or false? Pimps are always violent.",
                "True or false? Often, the people recruited are in love with their pimp.",
                "True or false? Only girls and women are at risk of sexual exploitation.",
                "True or false? Sex work can be done in exchange for something other than money.",
                "What are the needs that sex work can meet?",
                "True or false? It is often difficult for the people targeted to reveal the situation they are in."
            ]
            let formSubmit;
            let quizz_allowed = document.querySelector(".quizz__submit__content")
            let inputs = document.querySelectorAll(".boolean input")
            let redflagArray = [
                "Statement B applies to sex work: no one is forced or manipulated into selling sexual services. Sexual exploitation, however, refers to the act of coercing a person by taking advantage of their vulnerability or dependency, or of unequal power dynamics.",

                "FALSE: Human trafficking, sexual exploitation and pimping are illegal. Put more precisely, the act of exploiting someone is prohibited by law. Victims of such actions can turn to community organizations, police departments and hospitals for help.<br><br> By law, minors cannot engage in sex work. In such cases, it is automatically deemed to be sexual exploitation, even if all those involved have consented.",

                "FALSE: Sex work must be distinguished from sexual exploitation. No one can consent to exploitation, just as no one can consent to offer sexual services when threatened and abused by a pimp. People trying to escape from a sexual exploitation situation face several obstacles, including difficulties to bear off from a criminal environment.<br><br> In order to lure their targets, pimps manipulate them into thinking that exchanging sexual services is a choice, and that they can stop whenever they want. Other lies may also be used to prevent the person from leaving. For example, the pimp may pretend to have reported the person to the police for other offences, or may threaten to hurt the victim’s loved ones",

                "TRUE: While the majority of pimps are men, girls and women can also act as pimps or recruiters. In fact, numerous girls and women have been convicted of several charges, including pimping. They play the role of a best friend or big sister to introduce other girls to “sex work”.<br><br> Often for pimps, this is a way of rising up the ranks, or an obligation to recruit other people to generate more money. Most female recruiters have been through one or more situations of sexual exploitation in their lives.",

                "TRUE AND FALSE: Pimps may use physical violence to control those they exploit. However, this could leave marks, which would put them at risk. More often than not, pimps resort to psychological abuse, an invisible form of violence. They use manipulation or verbal abuse to exert control by belittling or threatening their victims.",

                "TRUE: In the early stages of the relationship, seduction, charm, generosity and attentiveness are often used by the pimp to recruit their victims. When this happens, those targeted can fall in love and thus become even more vulnerable. These are attributes used to manipulate, not to build a solid loving relationship.<br><br> The sometimes amorous relationship with the pimp of those targeted into believing they are “helping” their lover financially, rather than seeing themselves as a victim of someone manipulating them.<br><br> On the other hand, there are many other manipulative techniques, which are becoming increasingly sophisticated. Pimps may even offer to share a “business” relationship with their targets. Although these relationships may seem fair on paper, they rarely are in practice. The pimps try to make the people exploited think that they “need” them to ensure their safety or transportation. Labour and earnings are not shared equally: the pimps often receive the largest share of the income.",

                "FALSE: According to statistics, the majority of victims of sexual exploitation are women and girls, but adults and children of all genders can be victims. For example, according to the Table de Concertation sur les agressions à caractère sexuel de Montréal, this segment of the population accounts for 95% of reported victims.",
                
                "TRUE: Sexual services can be carried out to earn money, but also to exchange material goods such as shelter, food or drugs. They may also be performed in exchange for security or protection.",

                "The exchange of sexual services can fulfill various types of need. Yet even though a person in a situation of sexual exploitation may gain certain benefits (such as feeling protected or loved, making money or having a place to stay), their consent is not valid under the law. In fact, they are unable to make a free and informed choice, since this choice is influenced by a third party (the pimp). For a sex worker, having other options to meet their needs is more likely to result in a well-considered and consensual decision.",

                "TRUE: There are many obstacles to disclosing sexual exploitation :<br> <ul><li>The person does not realize or accept that they have been abused.</li> <li>The person’s social circle holds false beliefs about sexual abuse or violence (slutshaming: the person asked for it, not believing that a male can be a victim, etc.).</li><li>Legal proceedings are demanding for victims.</li> <li>More often than not, society tends to protect and defend the aggressor rather than the victim.</li><li>The person fears being sued in return for defamation or damage to reputation. Victims may suffer monetary penalties, bias and a sense of injustice from it.</li></ul> When someone discloses a situation of victimization, we must take it seriously and believe them. These are serious charges and lengthy procedures, meaning that a person will rarely make up an assault."
            ]
            let count = 0;
            let boolArray = ["B", "B", "B", "A", "A", "A", "B", "A", "A", "A"]
            let quizzQuestion = document.querySelector("#quizz__question")
            let spanIterate = document.querySelector("#iterate")
            let greenFlag = "Right answer"
            let redFlag = "Wrong answer"
            let results = document.querySelector("#results")
            let correction = document.querySelector("#correction")
            let nextContainer = document.querySelector(".next__container")
            let spanIterateInt = parseInt(spanIterate.innerHTML)
            let resultsAnswer = document.querySelector(".results__answer")
            let nextCta = document.querySelector(".next__question")
            let checked = document.querySelectorAll(".checked")
            let aText = document.querySelector("#aText")
            let bText = document.querySelector("#bText")
            let startAgainContainer = document.querySelector(".start__again")
            let restartQuizz = document.querySelector("#restart__quizz")
            let question9 = document.querySelectorAll(".question9")
            let firstCtaArray = [
                "Using a person’s body for sexual purposes in order to gain an advantage.",
                "TRUE",
                "TRUE",
                "TRUE",
                "TRUE",
                "TRUE",
                "TRUE",
                "TRUE",
                "Need for money",
                "TRUE",

            ]
            let secondCtaArray = [
                "Exchanging sexual services for money or other goods where all parties consent.",
                "FALSE",
                "FALSE",
                "FALSE",
                "FALSE",
                "FALSE",
                "FALSE",
                "FALSE",
                "Need to be valued",
                "FALSE",
            ]
            // enable le bouton soumettre
            for (let input of inputs) {
                input.addEventListener("change", c => {
                    // disable le bouton submit
                    submit.classList.remove("disabled")
                    // constance des applicatifs css disable pour le border du submit
                    submit.nextElementSibling.classList.remove('disabled')
                })
            }

            submit.addEventListener("click", s => {
                s.preventDefault();
                // variable des inputs
                let vrai = document.querySelector("#vrai")
                let faux = document.querySelector("#faux")
                let vrai9 = document.querySelector("#vrai_quest9")
                let faux9 = document.querySelector("#faux_quest9")

                // vérifie que l'utilisateur a bien choisi une réponse
                if (!vrai.checked && !faux.checked && !vrai9.checked && !faux9.checked) {
                    formSubmit = false
                } else {
                    formSubmit = true
                }
                // si l'utilisateur clique sur soumettre
                if (formSubmit) {
                    // disable le bouton submit
                    submit.classList.add("disabled")
                    // constance des applicatifs css disable pour le border du submit
                    submit.nextElementSibling.classList.add('disabled')
                    inputs.forEach((el) => {
                        // si l'input est bien check et la valeur de l'input est égale 
                        // à celle du du booléen dans l'array en fonction de l'itération
                        // (BONNE RÉPONSE)
                        if (el.checked && el.value === boolArray[count]) {
                            // ajoute la classe pour la couleur verte
                            el.parentElement.classList.add("green__flag")
                            // ajoute le texte de bonne réponse en dessous du submit
                            results.innerHTML = greenFlag
                            // ajoute le texte de correction de l'array selon l'itération
                            correction.innerHTML = redflagArray[count]
                            resultsAnswer.classList.add("next__ready")
                            // display le container pour peser sur 'suivant'
                            nextContainer.classList.add("next__ready")
                            for (let input of inputs) {
                                if (input.value !== el.value) {
                                    input.parentElement.classList.add('red__flag')
                                } else {
                                    input.parentElement.classList.add('green__flag')
                                }
                            }
                        }
                        // si le input est check et que la valeur n'est pas la même que 
                        // celle dans l'array selon l'itération 
                        // (MAUVAISE RÉPONSE)
                        if (el.checked && el.value !== boolArray[count]) {
                            // ajoute la classe pour la couleur rouge
                            el.parentElement.classList.add("red__flag")

                            // ajoute le texte de la mauvaise réponse en dessous du submit
                            results.innerHTML = redFlag
                            // ajoute le texte de correction de l'array selon l'itération
                            correction.innerHTML = redflagArray[count]
                            resultsAnswer.classList.add("next__ready")
                            // display le container pour peser sur 'suivant'
                            nextContainer.classList.add("next__ready")
                            submit.classList.add("disabled")
                            submit.nextElementSibling.classList.add('disabled')
                            for (let input of inputs) {
                                if (input.value !== el.value) {
                                    input.parentElement.classList.add('green__flag')
                                } else {
                                    input.parentElement.classList.add('red__flag')
                                }
                            }
                        }
                    })
                    vrai.parentElement.style.pointerEvents = "none"
                    vrai.parentElement.style.opacity = 0.5
                    vrai9.parentElement.style.pointerEvents = "none"
                    vrai9.parentElement.style.opacity = 0.5
                    faux.parentElement.style.pointerEvents = "none"
                    faux.parentElement.style.opacity = 0.5
                    faux9.parentElement.style.pointerEvents = "none"
                    faux9.parentElement.style.opacity = 0.5
                    if (count === textArr.length - 1) {
                        nextContainer.classList.remove('next__ready');
                        startAgainContainer.classList.add("next__ready")
                    }
                }
            })
            nextCta.addEventListener("click", p => {
                p.preventDefault();
                inputs.forEach((input) => {
                    if (!input.parentElement.classList.contains("question9")) {
                        input.parentElement.style.pointerEvents = 'all'
                        input.parentElement.style.opacity = 1
                        input.checked = false
                    }
                    input.parentElement.classList.remove('green__flag')
                    input.parentElement.classList.remove('red__flag')
                })

                checked.forEach((check) => {
                    check.style.display = "none"
                })
                nextContainer.classList.remove("next__ready")
                resultsAnswer.classList.remove('next__ready')
                // augmente le compteur de la phrase 'Question x de 10'
                // modifie le texte du compteur de la phrase 'Question x de 10'
                count++
                quizzQuestion.innerHTML = textArr[count]
                aText.innerHTML = firstCtaArray[count]
                bText.innerHTML = secondCtaArray[count]
                spanIterate.innerHTML = [count + 1].toString();
              
                if (count === 8) {
                    vrai.value = "B"
                    for (let i = 0; i < question9.length; i++) {
                        question9[i].style.display = "flex"
                        question9[i].style.pointerEvents = "all"
                        question9[i].style.opacity = 1
                    }
                }
                if (count === 9) {
                    vrai.value = "A"
                    question9.forEach((quest9) => {
                        quest9.style.display = "none";
                    })
                }
                if(count > 3 && count < 5) {
                    faux.value = "A"
                } else {
                    faux.value = "B"
                }
            })
            restartQuizz.addEventListener("click", function() {
                count = 0
                inputs.forEach((input) => {
                    if (!input.parentElement.classList.contains("question9")) {
                        input.parentElement.style.pointerEvents = 'all'
                        input.parentElement.style.opacity = 1
                        input.checked = false
                    }
                    input.parentElement.classList.remove('green__flag')
                    input.parentElement.classList.remove('red__flag')
                })
                checked.forEach((check) => {
                    check.style.display = "none"
                })
      
                spanIterate.innerHTML = [count + 1].toString()
                quizzQuestion.innerHTML = textArr[count]
                aText.innerHTML = firstCtaArray[count]
                bText.innerHTML = secondCtaArray[count]
                nextContainer.classList.remove("next__ready")
                resultsAnswer.classList.remove('next__ready')
                startAgainContainer.classList.remove("next__ready")
            })
        }

        function fake_radio() {
            let booleans = document.querySelectorAll(".boolean input")
            let checked = document.querySelectorAll(".checked")
            for (let boolean of booleans) {
                boolean.addEventListener("click", e => {
                    for (let uncheck of checked) {
                        uncheck.style.display = "none"
                    }
                    e.currentTarget.parentElement.childNodes[1].childNodes[1].style.display = "block"
                })
            }
        }
    </script>
{"id":59,"date":"2023-09-17T14:09:59","date_gmt":"2023-09-17T18:09:59","guid":{"rendered":"https:\/\/sentourer.ca\/en\/?page_id=59"},"modified":"2023-09-26T17:47:27","modified_gmt":"2023-09-26T21:47:27","slug":"quiz","status":"publish","type":"page","link":"https:\/\/sentourer.ca\/en\/quiz\/","title":{"rendered":"Quiz"},"content":{"rendered":"\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"class_list":["post-59","page","type-page","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/sentourer.ca\/en\/wp-json\/wp\/v2\/pages\/59","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sentourer.ca\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/sentourer.ca\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/sentourer.ca\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sentourer.ca\/en\/wp-json\/wp\/v2\/comments?post=59"}],"version-history":[{"count":4,"href":"https:\/\/sentourer.ca\/en\/wp-json\/wp\/v2\/pages\/59\/revisions"}],"predecessor-version":[{"id":118,"href":"https:\/\/sentourer.ca\/en\/wp-json\/wp\/v2\/pages\/59\/revisions\/118"}],"wp:attachment":[{"href":"https:\/\/sentourer.ca\/en\/wp-json\/wp\/v2\/media?parent=59"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}