<?php include_once 'code/page_code.php' ?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>GRE Exam</title>
    <link rel="stylesheet" href="css/gre.css">
</head>
<body>
    <div class="control-panel">
        <div class="container exam-timer">
            <h1 class="center-heading" id="timer-display">30:00</h1><br>
            <center><button class="center-heading" id="startButton">Start Test</button></center>
            <hr>
            <center><a href="index.php">Go Back</a></center>
        </div>
        
        <div class="container section-1 hidden">
            <h1 class="center-heading" id="paper-display">30:00</h1>
            <h1 class="center-heading">VERBAL REASONING</h1>
            <h4 class="center-heading subtitle">SECTION 2</h4>
            <h4 class="center-heading subtitle">20 QUESTIONS</h4>
            <h4 class="center-heading subtitle">30 MINUTES</h4>
            <input type="hidden" id="exam_module" value="Verbal Reasoning - Part 2">
            <div class="instruction">
                <p>For each blank select an answer choice from the corresponding column of choices. Fill all blanks in such a way that it best completes the text.</p>
            </div>
            <div class="question" number="21">
            <p class="circle">21</p>
                <p>Both the relationship with space and penetration of space are of  (i)
                    <select name="blank-i" data-blank-id="i" id="qn21-i-answer">
                        <option value=""></option>
                        <option value="consequent">consequent</option>
                        <option value="fundamental">fundamental</option>
                        <option value="malleable">malleable</option>
                    </select>   
                    importance in dance. This is the same rapport the sculptor has with his clay or marble. The body sculpts the space, forming a place for itself,  (ii) 
                    <select name="blank-i" data-blank-id="i" id="qn21-ii-answer">
                        <option value=""></option>
                        <option value="caustically">caustically</option>
                        <option value="deferentially">deferentially</option>
                        <option value="simultaneously">simultaneously</option>
                    </select>
                    negative space, that which is unoccupied. A reviewer, writing about the  (iii) 
                    <select name="blank-i" data-blank-id="i" id="qn21-iii-answer">
                        <option value=""></option>
                        <option value="eloquent">eloquent</option>
                        <option value="haughty">haughty</option>
                        <option value="obliging">obliging</option>
                    </select>   
                    dancer Hoyer, said that Hoyer could express what could bot be born in film or photography. She could capture the space as her own.</p>
            </div>
            <!--  -->
            <div class="question" number="22">
            <p class="circle">22</p>
                <p>The artist was never very productive because of his  (i)
                    <select name="blank-i" data-blank-id="i" id="qn22-i-answer">
                        <option value=""></option>
                        <option value="poverty">poverty</option>
                        <option value="standards">standards</option>
                        <option value="diffidence">diffidence</option>
                    </select>   
                    however, when a glowing review of his latest work was featured on the front page of  (ii) 
                    <select name="blank-i" data-blank-id="i" id="qn22-ii-answer">
                        <option value=""></option>
                        <option value="a prestigious">a prestigious</option>
                        <option value="an ostentatious">an ostentatious</option>
                        <option value="a local">a local</option>
                    </select>
                    newspaper, his confidence returned and he became what he had not been before,   (iii) 
                    <select name="blank-i" data-blank-id="i" id="qn22-iii-answer">
                        <option value=""></option>
                        <option value="an infamous">an infamous</option>
                        <option value="a perfunctory">a perfunctory</option>
                        <option value="a prolific">a prolific</option>
                    </select>   
                    painter.</p>
            </div>
            <!--  -->
            <div class="question" number="23">
                <p class="circle">23</p>
                <p>Aside from their values and a  (i) 
                    <select name="blank-i" data-blank-id="i" id="qn23-i-answer">
                        <option value=""></option>
                        <option value="keenness">keenness</option>
                        <option value="lethargy">lethargy</option>
                        <option value="vivaciousness">vivaciousness</option>
                    </select>to contest conventional thinking in their industry, what differentiates the mavericks chosen is their  (ii) 
                    <select name="blank-i" data-blank-id="ii" id="qn23-ii-answer">
                        <option value=""></option>
                        <option value="actions against">actions against</option>
                        <option value="practice of">practice of</option>
                        <option value="praise for">outrapraise forge</option>
                    </select>
                    hiring the best and motivating them well. 
                </p>
            </div>
            <!--  -->
            <div class="instruction">
                <p>Select one choice for the blank. Fill in the blank in such a way that it best completes the text.</p>
            </div>
            <div class="question" number="24">
                <p class="circle">24</p>
                <p>Lacking sacred scriptures or 
                    <select name="answer" id="qn24-answer">
                        <option value=""></option>
                        <option value="followers">followers</option>
                        <option value="customs">customs</option>
                        <option value="dogma">dogma</option>
                        <option value="relics">relics</option>
                        <option value="faith">faith</option>
                    </select>
                    , Shinto is more properly regarded as a legacy of traditional religious practices and basic values than as a formal system of belief.
                </p>
            </div>
            <!--  -->
            <div class="question" number="25">
                <p class="circle">25</p>
                <p>In some countries, government restrictions are so
                    <select name="answer" id="qn25-answer">
                        <option value=""></option>
                        <option value="traditional">traditional</option>
                        <option value="judicious">judicious</option>
                        <option value="ambiguous">ambiguous</option>
                        <option value="exacting">exacting</option>
                        <option value="lax">lax</option>
                    </select>
                    that businesses operate with nearly complete impunity.
                </p>
            </div>
            <!--  -->
            <div class="instruction">
                <p>For each blank select an answer choice from the corresponding column of choices. Fill all blanks in such a way that it best completes the text.</p>
            </div>
            <!--  -->
            <div class="question" number="26">
                <p class="circle">26</p>
                <p>That teachers are grossly underpaid, while not  (i) 
                    <select name="blank-i" data-blank-id="i" id="qn26-i-answer">
                        <option value=""></option>
                        <option value="completely palpable">completely palpable</option>
                        <option value="quite hyperbole">quite hyperbole</option>
                        <option value="entirely salacious">entirely salacious</option>
                    </select>
                    , may nevertheless still be  (ii) 
                        <select name="blank-i" data-blank-id="i" id="qn26-ii-answer">
                            <option value=""></option>
                            <option value="somewhat perverted">somewhat perverted</option>
                            <option value="utterly spurious">utterly spurious</option>
                            <option value="a bit of a stretch">a bit of a stretch</option>
                        </select>
                        . While their (iii) 
                        <select name="blank-i" data-blank-id="i" id="qn26-iii-answer">
                            <option value=""></option>
                            <option value="pecuniary">pecuniary</option>
                            <option value="pellucid">pellucid</option>
                            <option value="pulverous">pulverous</option>
                        </select> compensation is rather low, they do receive excellent fringe benefits to more than make up for this deficiency.  
                </p>
            </div>
            <!--  -->
            <div class="instruction">
                <p>For the following questions, select the two answers that, when inserted into the sentence, fit the meaning of the sentence as a whole and yield complete sentences that are similar in meaning.</p>
            </div>
            <!--  -->
            <div class="question" number="27">
                <p class="circle">27</p>
                <p>The paper recently promoted the reporter; she is known for her 
                    <select name="answer" id="qn27-answer">
                        <option value=""></option>
                        <option value="subtle">subtle</option>
                        <option value="affable">affable</option>
                        <option value="languid">languid</option>
                        <option value="lethargic">lethargic</option>
                        <option value="understated">understated</option>
                        <option value="amiable">amiable</option>
                    </select>
                    style, which elicits information better than the more aggressive approach taken by her colleagues.
                </p> 
            </div>
            <!--  -->
            <div class="question" number="28">
                <p class="circle">28</p>
                <p>Defense attorneys contend that advances in DNA testing must be applied retroactively in cases where
                     a guilty verdict was decided using non-DNA evidence; there is the possibility that when these advances
                      are applied to the case, potentially innocent people could be 
                    <select name="answer" id="qn28-answer">
                        <option value=""></option>
                        <option value="incriminated">incriminated</option>
                        <option value="exculpated">exculpated</option>
                        <option value="disciplined">disciplined</option>
                        <option value="castigated">castigated</option>
                        <option value="inculpated">inculpated</option>
                        <option value="exonerated">exonerated</option>
                    </select>
                    and their verdicts reversed.
                </p>
            </div>
            <!--  -->
            <div class="question" number="29">
                <p class="circle">29</p>
                <p>Considering the difficulty of the terrain and the great distance over which the expedition 
                traveled, the journey was completed with very little incident and with noteworthy 
                    <select name="answer" id="qn29-answer">
                        <option value=""></option>
                        <option value="success">success</option>
                        <option value="renown">renown</option>
                        <option value="results">results</option>
                        <option value="accolades">accolades</option>
                        <option value="alacrity">alacrity</option>
                        <option value="swiftness">swiftness</option>
                    </select>
                    </p>
            </div>
            <!--  -->
            <div class="question" number="30">
                <p class="circle">30</p>
                <p>Because she was famed for her objectivity and temperate attitude, the 
                    <select name="answer" id="qn30-answer">
                        <option value=""></option>
                        <option value="account">account</option>
                        <option value="accolades">accolades</option>
                        <option value="invective">invective</option>
                        <option value="diatribe">diatribe</option>
                        <option value="perspective">perspective</option>
                        <option value="insinuations">insinuations</option>
                    </select>
                    offered by the news anchor at the protest rally seemed especially uncharacteristic.
                    </p>
            </div>
            <!--  -->
            <button id="continueBtn-1">Continue</button>
            <button id="submitBtn1">Submit</button>
        </div>
        <div class="container section-2 hidden">
        <h1 class="center-heading" id="paper2-display">30:00</h1>
            <h1 class="center-heading">VERBAL REASONING</h1>
            <h4 class="center-heading subtitle">SECTION 2</h4>
            <h4 class="center-heading subtitle">20 QUESTIONS</h4>
            <h4 class="center-heading subtitle">30 MINUTES</h4>
            <div class="instruction">
                <p>Questions 31 and 32 are based on the passage below.  </p>
            </div>
            <div class="passage">
                    <p>
                    The vote to demote Pluto from the status of planet was made by only 5% of astronomers,
                     a fact lending force to the opposition's stance. The original intention of the summit was to preserve
                      Pluto as the ninth planet, but the definition supporting that decision would also regulate that a number
                       of other bodies in space be considered as planets, and thus, it was considered false. The resolution came
                        a little over a week later stating that Pluto is, in fact, in a class of dwarf planets. Brown contends that
                         dwarf planets are outside the scope of what defines a planet. He also believes that hundreds of dwarf planets
                          exist that are yet unrecognized. But the term "dwarf planet" is confusing if the celestial body being referred to is not a planet. Gingerich believes this to be true and hopes that public opinion and further investigating will overturn the demotion.
                    </p>
            </div>
            <!--  -->
            <div class="question" number="31">
                <p class="circle">31</p>
                <p>Which of the following best expresses the main idea of the passage? 
                    <select name="answer" id="qn31-answer">
                        <option value=""></option>
                        <option value="support the concepts surrounding the movements to make Pluto a planet">support the concepts surrounding the movements to make Pluto a planet</option>
                        <option value="detail the issues involved in the decision to remove Pluto’s status as a planet.">detail the issues involved in the decision to remove Pluto’s status as a planet.</option>
                        <option value="analyze the various theories on Pluto’s position in the solar system">analyze the various theories on Pluto’s position in the solar system</option>
                        <option value="Emphasize the size and shape of the planet Pluto">Emphasize the size and shape of the planet Pluto</option>
                        <option value="promote the ideas of the one astronomer over another’s">promote the ideas of the one astronomer over another’s</option>
                    </select>  
                </p>
            </div>
            <!--  -->
            <div class="question" number="32">
                <p class="circle">32</p>
                <p>Underline the sentence in the passage that supports the opposition's rationale against an explanation cited earlier in the passage
                    <select name="answer" id="qn32-answer">
                        <option value=""></option>
                        <option value="detail the issues involved in the decision to remove Pluto’s status as a planet.">detail the issues involved in the decision to remove Pluto’s status as a planet.</option>
                        <option value="analyze the various theories on Pluto’s position in the solar system">analyze the various theories on Pluto’s position in the solar system</option>
                        <option value="Emphasize the size and shape of the planet Pluto">Emphasize the size and shape of the planet Pluto</option>
                        <option value="promote the ideas of the one astronomer over another’s">promote the ideas of the one astronomer over another’s</option>
                    </select>  
                </p>
            </div>
            
            <div class="instruction">
                <p>Questions 33 and 34 are based on the passage below. </p>
            </div>
            <!--  -->
            <div class="passage">
                <p>
                The accusation that a particular critical remark is "irrelevant" to its object is one of the most frequently
                 heard in discussion and debate among critics. Frequently heard because frequently correct: there has never been
                  a dearth of criticism that carelessly relates a work to an artist's biography, or employs pointless historic
                   speculation, or invokes inappropriate creative standards, or describes the critic's own fuzzy reveries to
                    misdirect our attention and obscure the essential significance of the object before us. 
                    Relevance and precision are critical to criticism. 
                    This fact underscores our concern to find a correct method for doing criticism, a concern that has 
                    generated more controversy than any single commentator might hope to obfuscate with footnotes.
                </p>
            </div>
            <div class="instruction">
                <p>Consider each of the choices separately, and select all that apply.</p>
            </div>
            <!--  -->
            <div class="question" number="33">
                <p class="circle">33</p>
                <p>The passage suggests that the author would agree with which of the following statements?
                    <select name="answer" id="qn33-answer">
                        <option value=""></option>
                        <option value="Critics can take many paths to making irrelevant critical remarks">Critics can take many paths to making irrelevant critical remarks</option>
                        <option value="Pointless historical speculation can lead to irrelevant comments about critics">Pointless historical speculation can lead to irrelevant comments about critics</option>
                        <option value="The concern for defining a correct method of relevant criticism has engendered enormous controversy">The concern for defining a correct method of relevant criticism has engendered enormous controversy</option>
                    </select>  
                </p>
            </div>
            <!--  -->
            <div class="question" number="34">
                <p class="circle">34</p>
                <p>In the context in which it appears, “death” most nearly means 
                    <select name="answer" id="qn34-answer">
                        <option value=""></option>
                        <option value="sufficiency">sufficiency</option>
                        <option value="enigma">enigma</option>
                        <option value="depredation">depredation</option>
                        <option value="scarcity">scarcity</option>
                        <option value="inadequacy">inadequacy</option>
                    </select>  
                </p>
            </div>
            <!--  -->
            <div class="instruction">
                <p>Questions 35 through 37 are based on the passage below.</p>
            </div>
            <div class="passage">
                <p>
                Declassification of government documents has shed new light on the events comprising the Cuban Missile Crisis
                 of October 1962. Prior to the accessibility of these records, the only sources of account of the Crisis for scholars
                  and historians were the personal memoirs and narratives of the officials who served under Kennedy and Khrushchev 
                  during this period. Many of the declassified documents are transcriptions and notes of meetings between members
                   of the CIA and President Kennedy's cabinet, as well the president himself. The revelations in these documents have
                    demonstrated the inadvertent inaccuracies and intended obscurities inherent in the first-person narratives of the 
                    Crisis and have aided historians from all three countries involved in the Crisis to get a more authentic 
                    representation of what truly transpired, and for what reasons. Of perhaps the most interest to historians 
                    are declassified correspondences between John F. Kennedy and Nikita Khrushchev that challenge the idea that the 
                    height of the Crisis extended only over the course of thirteen days. Indeed, these letters indicate that the 
                    Crisis was far from resolved by Khrushchev's October 28 decision to withdraw the Soviet missiles from Cuba; 
                    instead it endured far into the following month, while America slept fitfully under the illusion of peace.
                </p>
            </div>
            <!--  -->
            <div class="question" number="35">
                <p class="circle">35</p>
                <p>In the argument given, the two portions in boldface play which of the following roles?  
                <div class="choices options" id="qn35-answer">
                    <label><b>A</b><input type="radio" name="answer35" value="petitioning the government to make all classified documents of historic interest accessible to the general public."> petitioning the government to make all classified documents of historic interest accessible to the general public. </label><br><br>
                    <label><b>B</b><input type="radio" name="answer35" value="discounting the sense of danger many Americans felt during the Cuban Missile Crisis">discounting the sense of danger many Americans felt during the Cuban Missile Crisis </label><br><br>
                    <label><b>C</b><input type="radio" name="answer35" value="revealing a calculated deception perpetrated by members of Kennedy’s cabinet"> revealing a calculated deception perpetrated by members of Kennedy’s cabinet</label><br><br>
                    <label><b>D</b><input type="radio" name="answer35" value="illustrating how previously accepted ideas based on hearsay are being refuted by concrete evidence"> illustrating how previously accepted ideas based on hearsay are being refuted by concrete evidence</label><br><br>
                    <label><b>E</b><input type="radio" name="answer35" value="portraying in detail the events that transpired during the Cuban Missile Crisis"> portraying in detail the events that transpired during the Cuban Missile Crisis </label><br><br>
                </div>
    
                </p>
            </div>
            <!--  -->
            <!--  -->
            <div class="question" number="36">
                <p class="circle">36</p>
                <p>According to the passage, which of the following statements is/are true of the Cuban Missile Crisis?  
                <div class="choices options" id="qn36-answer">
                    <label><b>A</b><input type="radio" name="answer36" value="The Crisis is still shrouded in mystery"> The Crisis is still shrouded in mystery </label><br><br>
                    <label><b>B</b><input type="radio" name="answer36" value="The memoirs of those closely involved in the Crisis were not entirely factual">The memoirs of those closely involved in the Crisis were not entirely factual</label><br><br>
                    <label><b>C</b><input type="radio" name="answer36" value="The Crisis spanned 13 tense days"> The Crisis spanned 13 tense days</label><br><br>
                </div>
    
                </p>
            </div>
            <!--  -->
            <div class="question" number="37">
                <p class="circle">37</p>
                <p>The author's use of the phrase "inadvertent inaccuracies and intended obscurities" (Lines 10-11) suggests all of the following EXCEPT   
                <div class="choices options" id="qn37-answer">
                    <label><b>A</b><input type="radio" name="answer37" value="the historical record is often skewed by human perception"> the historical record is often skewed by human perception</label><br><br>
                    <label><b>B</b><input type="radio" name="answer37" value="every politician deals in deception and prevarication"> every politician deals in deception and prevarication</label><br><br>
                    <label><b>C</b><input type="radio" name="answer37" value="details of the Crisis were purposely omitted or vague">details of the Crisis were purposely omitted or vague</label><br><br>
                    <label><b>D</b><input type="radio" name="answer37" value="memory is incapable of recapturing the full details of an event">memory is incapable of recapturing the full details of an event</label><br><br>
                </div>
    
                </p>
            </div>
            <!--  -->
            <div class="instruction">
                <p>Questions 38 through 20 are based on the passage below.</p>
            </div>
            <div class="passage">
                <p>
                Two of the most revered poets in American history, Walt Whitman and Emily Dickinson, are seemingly a study in contrast. 
                But the nature in which both nineteenth-century poets chose to lead their lives, which has deceivingly set them apart 
                in the eyes of many historians, is actually their greatest similarity. Whitman's energetic wanderings around the 
                United States and his informal, inquisitive disposition were directly reflected in his style of verse and subject matter.
                 He was a self-proclaimed man of the people, larger than life, interested in breaking down social preconceptions
                  and boundaries, using his explorations of reality and the world at large in an attempt to translate the 
                  language of the universal soul. As he was open to the world, so was his style of poetry; rambling and unconstrained,
                   yet accessible. While Whitman's style was a mirror of his external forays, Emily Dickinson's travels into the dark 
                   inner realms echoed throughout her writings. Where Whitman blazed an ample path for the masses, the introspective 
                   Dickinson beckoned them to get lost in her spare verse. Deftly picking and choosing her words, her vivid, aphoristic
                    style was the distillation of a life spent in solitary contemplation and experimentation with form. 
                    The common bond shared between Whitman and Dickinson was each poet's obsessive drive for self-discovery. 
                    Though both poets' explorations into meaning took them on two very different journeys, the courage required for 
                    those personal voyages was tantamount, and the resulting work was an unconventional brilliance that still exerts 
                    its influence upon American poetry to this day. 
                </p>
            </div>
            
            <!--  -->
            <div class="question" number="38">
                <p class="circle">38</p>
                <p>Which of the following best describes the author's attitude toward Dickinson and Whitman?
                <div class="choices options" id="qn38-answer">
                    <label><b>A</b><input type="radio" name="answer38" value="Unwarranted esteem">Unwarranted esteem </label><br><br>
                    <label><b>B</b><input type="radio" name="answer38" value="Justified admiration">Justified admiration</label><br><br>
                    <label><b>C</b><input type="radio" name="answer38" value="feigned interest">feigned interest</label><br><br>
                    <label><b>D</b><input type="radio" name="answer38" value="Undisguised contempt">Undisguised contempt </label><br><br>
                    <label><b>D</b><input type="radio" name="answer38" value="undue criticism">undue criticism</label><br><br>
                </div>
    
                </p>
            </div>
            <!--  -->
            <div class="question" number="39">
                <p class="circle">39</p>
                <p>The “greatest similarity” the author refers to is the poets’
                <div class="choices options" id="qn39-answer">
                    <label><b>A</b><input type="radio" name="answer39" value="introverted natures">introverted natures</label><br><br>
                    <label><b>B</b><input type="radio" name="answer39" value="fondness for travel">fondness for travel</label><br><br>
                    <label><b>C</b><input type="radio" name="answer39" value="ceaseless explorations">ceaseless explorations</label><br><br>
                    <label><b>D</b><input type="radio" name="answer39" value="disdain for other art">disdain for other art</label><br><br>
                    <label><b>E</b><input type="radio" name="answer39" value="lack of formal education">lack of formal education</label><br><br>
                </div>
    
                </p>
            </div>
            <!--  -->
            <div class="question" number="40">
                <p class="circle">40</p>
                <p>It can be inferred from the passage that ______________ 
                <div class="choices options" id="qn40-answer">
                    <label><b>A</b><input type="radio" name="answer40" value="Whitman’s poetry has more relevance today than Dickson’s">Whitman’s poetry has more relevance today than Dickson’s</label><br><br>
                    <label><b>B</b><input type="radio" name="answer40" value="Walt Whitman and Emily Dickson did not get along, Emily Dickson’s subject matter is more profound than Whitman’s"> Walt Whitman and Emily Dickson did not get along, Emily Dickson’s subject matter is more profound than Whitman’s</label><br><br>
                    <label><b>C</b><input type="radio" name="answer40" value="Emily Dickson was a reclusive figure"> Emily Dickson was a reclusive figure</label><br><br>
                    <label><b>D</b><input type="radio" name="answer40" value="Walt Whitman enjoyed more success in his life than Dickson">Walt Whitman enjoyed more success in his life than Dickson</label><br><br>
                </div>
    
                </p>
            </div>
            <!--  -->
            <button id="previousBtn-1">Previous</button>
            <button id="continueBtn-2">Continue</button>
            <button id="submitBtn2">Submit</button>
        </div>
    </div>
    <script src="js/jquery.js"></script>
    <script>
        var student_id = '<?php echo $student_id ?>';
        var key = '<?php echo $_SESSION['key'] ?>';
    </script>
    <!-- <script src="js/main.js"></script> -->
    
    <!-- <script src="js/gre.js"></script> -->
    <script>
        $(document).ready(function(){
            var exam_module = $('#exam_module').val();
            
            $('#continueBtn-1').click(function(){
                $('.section-1').addClass('hidden');
                $('#continueBtn-2').addClass('hidden');
                $('.section-2').removeClass('hidden');
            });
            $('#previousBtn-1').click(function(){
                $('.section-1').removeClass('hidden');
                $('.section-2').addClass('hidden');
            });

            var countdown = 30 * 60; // 30 minutes in seconds
            var display1 = $('#timer-display');
            var display2 = $('#paper-display');
            var display3 = $('#paper2-display');
            var timerInterval; // Declare the timerInterval variable
            
            function startTimer(duration, display1, display2, display3) {
            var timer = duration, minutes, seconds;
            timerInterval = setInterval(function () {
                minutes = parseInt(timer / 60, 10);
                seconds = parseInt(timer % 60, 10);
            
                minutes = minutes < 10 ? "0" + minutes : minutes;
                seconds = seconds < 10 ? "0" + seconds : seconds;
            
                display1.text(minutes + ":" + seconds);
                display2.text(minutes + ":" + seconds);
                display3.text(minutes + ":" + seconds);
            
                if (--timer === 0) {
                clearInterval(timerInterval); // Clear the interval when timer reaches zero
                $('.exam-timer').removeClass('hidden');
                    $('.section-1').addClass('hidden');
                    $('.section-2').addClass('hidden');
                    $('#startButton').addClass('hidden')
                    $('#timer-display').html('<b><h3 style="color:darkred">Time Up!</h3></b><b><h4>Your Responses has been submitted</h4></b>')
                    var verbal_reasoning_section_1 = {
                        save_script: '',
                        student_id: student_id,
                        exam_module: exam_module,
                        key: key,
                        data:collectAnswers()
                    }
                    $.post('code/script_code.php',verbal_reasoning_section_1,function(response){
                        console.log(response)
                    })  
                console.log(collectAnswers());
                return 0;
                }
            }, 1000);
            }
            
            $('#startButton').click(function () {
            $('.exam-timer').addClass('hidden');
            $('.section-1').removeClass('hidden');
            startTimer(countdown, display1, display2, display3); // Start the timer
            });
            

            $('#submitBtn1').click(function() {
                $('.exam-timer').removeClass('hidden');
                $('.section-1').addClass('hidden');
                $('.section-2').addClass('hidden');
                $('#startButton').addClass('hidden')
                $('#timer-display').html('<b><h3 style="color:darkred">Submitted Successfully!</h3></b><b><h4>Your Responses has been submitted</h4></b><p><b><a href="index.php">Back to modules</a></p></b>')
                console.log(collectAnswers())
                clearInterval(timerInterval); 
                var verbal_reasoning_section_1 = {
                    save_script: '',
                    student_id: student_id,
                    exam_module: exam_module,
                    key: key,
                    data:collectAnswers()
                }
                console.log(verbal_reasoning_section_1)
                $.post('code/script_code.php',verbal_reasoning_section_1,function(response){
                    console.log(response)
                })
                return 0;
                
            });

            $('#submitBtn2').click(function() {
                $('.exam-timer').removeClass('hidden');
                $('.section-1').addClass('hidden');
                $('.section-2').addClass('hidden');
                $('#startButton').addClass('hidden')
                $('#timer-display').html('<b><h3 style="color:darkred">Submitted Successfully!</h3></b><b><h4>Your Responses has been submitted</h4></b><p><b><a href="index.php">Back to modules</a></p></b>')
                console.log(collectAnswers())
                clearInterval(timerInterval); 
                var verbal_reasoning_section_1 = {
                    save_script: '',
                    student_id: student_id,
                    exam_module: exam_module,
                    key: key,
                    data:collectAnswers()
                }
                $.post('code/script_code.php',verbal_reasoning_section_1,function(response){
                    console.log(response)
                })
                return 0;
                
            });

            // Get Answers
            function collectAnswers() {
                let answers = {};
                
                // Loop through questions 3 to 17
                for (let i = 21; i <= 40; i++) {
                    let questionId;
                    let answer;
                    if(i===21){
                        questionId = `#qn${i}-i-answer`;
                        answer1 = $(questionId).val();
                        // 
                        questionId = `#qn${i}-ii-answer`;
                        answer2 = $(questionId).val();
                        //  
                        questionId = `#qn${i}-iii-answer`;
                        answer3 = $(questionId).val();
                        //  
                        answers[`qn${i}`] = answer1+','+answer2+','+answer3;
                    }else if(i===22){
                        questionId = `#qn${i}-i-answer`;
                        answer1 = $(questionId).val();
                        // 
                        questionId = `#qn${i}-ii-answer`;
                        answer2 = $(questionId).val();
                        // 
                        questionId = `#qn${i}-iii-answer`;
                        answer3 = $(questionId).val();
                        // 
                        answers[`qn${i}`] = answer1+','+answer2+','+answer3;
                    }else if(i===23){
                        questionId = `#qn${i}-i-answer`;
                        answer1 = $(questionId).val();
                    // 
                        questionId = `#qn${i}-ii-answer`;
                        answer2 = $(questionId).val();
                    //  
                        answers[`qn${i}`] = answer1+','+answer2;
                    }else if(i===26){
                        questionId = `#qn${i}-i-answer`;
                        answer1 = $(questionId).val();
                        // 
                        questionId = `#qn${i}-ii-answer`;
                        answer2 = $(questionId).val();
                        // 
                        questionId = `#qn${i}-iii-answer`;
                        answer3 = $(questionId).val();
                        // 
                        answers[`qn${i}`] = answer1+','+answer2+','+answer3;
                    }else if (i === 35 || i === 36 || i === 37 || i === 38 || i === 39 || i === 40) { // Handle radio button questions
                        questionId = `#qn${i}-answer`;
                        answer = $(questionId + ' input[type=radio]:checked').val();
                        answers[`qn${i}`] = answer || ''; // Use an empty string if no answer is selected
                    }else{
                        questionId = `#qn${i}-answer`;
                        answer = $(questionId).val();
                        answers[`qn${i}`] = answer;
                    }
                    
                }


                return answers;
            }
            // console.log(collectAnswers())


        });
    </script>
</body>
</html>
