<?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>
        </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 1</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 1">
            <div class="instruction">
                <p>Select one answer choice for the blank. Fill the blank in such a way that it best completes the text.</p>
            </div>
            <div class="question" number="1">
                <p class="circle">1<p>
                <p> His calm exterior 
                    <select name="answer" id="qn1-answer">
                        <option value=""></option>
                        <option value="delineated">delineated</option>
                        <option value="reviled">reviled</option>
                        <option value="falsified">falsified</option>
                        <option value="ridiculed">ridiculed</option>
                        <option value="belied">belied</option>
                    </select> 
                    the militant fervor with which he threw himself into the campaign
                </p>
            </div>
            <!--  -->
            <div class="question" number="" id="">
                <p class="circle">2<p>
                <p>Inured to the intense work engendered by the deadlines they normally faced, the production managers felt somewhat
                    <select name="answer" id="qn2-answer">
                        <option value=""></option>
                        <option value="constrained">constrained</option>
                        <option value="disoriented">disoriented</option>
                        <option value="wizened">wizened</option>
                        <option value="overworked">overworked</option>
                        <option value="dehumanized">dehumanized</option>
                    </select> 
                    by the temporary hiatus in orders.
                </p>
            </div>
            <!--  -->
            <div class="question" number="3">
                <p class="circle">3<p>
                <p>During their famous clash, Jung was ambivalent about Freud, so he attacked the father of modern psychoanalysis even as he
                    <select name="answer" id="qn3-answer">
                        <option value=""></option>
                        <option value="enlightened">enlightened</option>
                        <option value="chastened">chastened</option>
                        <option value="revered">revered</option>
                        <option value="despised">despised</option>
                        <option value="understood">understood</option>
                    </select> 
                    him.
                </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 test.</p>
            </div>
            <div class="question" number="4">
                <p class="circle">4</p>
                <p>The issue of censorship on television is long-running; those few responsible for (i) 
                    <select name="blank-i" data-blank-id="i" id="qn4-i-answer">
                        <option value=""></option>
                        <option value="creating">creating</option>
                        <option value="expurgating">expurgating</option>
                        <option value="edifying">edifying</option>
                    </select> what content is delivered to the public have an often-misguided sense of their ability to predict the (ii) 
                    <select name="blank-i" data-blank-id="ii" id="qn4-ii-answer">
                        <option value=""></option>
                        <option value="reaction">reaction</option>
                        <option value="distress">distress</option>
                        <option value="outrage">outrage</option>
                    </select>
                    of the public to material that may not even be considered questionable by all.
                </p>
            </div>
            <!--  -->
            <div class="question" number="5">
            <p class="circle">5</p>
                <p>“Blog” is just one of the many (i)
                    <select name="blank-i" data-blank-id="i" id="qn5-i-answer">
                        <option value=""></option>
                        <option value="publications">publications</option>
                        <option value="neologisms">neologisms</option>
                        <option value="advances">advances</option>
                    </select>   
                    that have emerged as computers have become (ii) 
                    <select name="blank-i" data-blank-id="i" id="qn5-ii-answer">
                        <option value=""></option>
                        <option value="inchoate">inchoate</option>
                        <option value="indispensable">indispensable</option>
                        <option value="temporary">temporary</option>
                    </select>
                    fixtures of daily life. There are, of course, (iii) 
                    <select name="blank-i" data-blank-id="i" id="qn5-iii-answer">
                        <option value=""></option>
                        <option value="obstinate">obstinate</option>
                        <option value="well-educated">well-educated</option>
                        <option value="experienced">experienced</option>
                    </select>   
                    linguists who refuse to accept these computer-related terms, even though these same linguists rely just as much on computers as the rest of the population.</p>
            </div>
            <!--  -->
            <div class="question" number="6">
                <p class="circle">6</p>
                <p>Despite the absurdity, her lengthy manifesto expressed many (i) 
                    <select name="blank-i" data-blank-id="i" id="qn6-i-answer">
                        <option value=""></option>
                        <option value="cerebral">cerebral</option>
                        <option value="inaudible">inaudible</option>
                        <option value="banal">banal</option>
                    </select>
                    arguments , and many of her grievances were subsequently (ii) 
                        <select name="blank-i" data-blank-id="i" id="qn6-ii-answer">
                            <option value=""></option>
                            <option value="cerebral">cerebral</option>
                            <option value="inaudible">inaudible</option>
                            <option value="banal">banal</option>
                        </select>
                    by the women’s movement, which gained force a year or so later.
                </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="7">
                <p class="circle">7</p>
                <p>It was easy to explain the haughty teenager’s impertinent behavior and limitless desires; she was 
                    <select name="answer" id="qn7-answer">
                        <option value=""></option>
                        <option value="cosseted">cosseted</option>
                        <option value="borne">borne</option>
                        <option value="exculpated">exculpated</option>
                        <option value="dandled">dandled</option>
                        <option value="moderated">moderated</option>
                    </select>
                    throughout her childhood, and no whim was ever denied her.
                </p> 
            </div>
            <!--  -->
            <div class="question" number="8">
                <p class="circle">8</p>
                <p>Pundits were quick to say that the mayor’s stance on environmental reform was far too
                    <select name="answer" id="qn8-answer">
                        <option value=""></option>
                        <option value="temperate">temperate</option>
                        <option value="craven">craven</option>
                        <option value="timid">timid</option>
                        <option value="moderate">moderate</option>
                        <option value="self-serving">self-serving</option>
                        <option value="radical">radical</option>
                    </select>
                    : she easily relinquished her already minimal resolve to avoid confrontation.
                </p>
            </div>
            <!--  -->
            <div class="question" number="9">
                <p class="circle">9</p>
                <p>Reporters described the storm’s effect on voter turnout as
                    <select name="answer" id="qn9-answer">
                        <option value=""></option>
                        <option value="harmful">harmful</option>
                        <option value="benign">benign</option>
                        <option value="inconsequential">inconsequential</option>
                        <option value="calamitous">calamitous</option>
                        <option value="deleterious">deleterious</option>
                        <option value="beneficial">beneficial</option>
                    </select>
                    </p>
            </div>
            <!--  -->
            <div class="question" number="10">
                <p class="circle">10</p>
                <p>Aristotle
                    <select name="answer" id="qn10-answer">
                        <option value=""></option>
                        <option value="dismissed">dismissed</option>
                        <option value="supported">supported</option>
                        <option value="accepted">accepted</option>
                        <option value="renounced">renounced</option>
                        <option value="contrived">contrived</option>
                        <option value="abhorred">abhorred</option>
                    </select>
                    the popular characterization of outer space as being a void; according to his philosophy, empty space would be an impossibility.
                    </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 1</h4>
            <h4 class="center-heading subtitle">20 QUESTIONS</h4>
            <h4 class="center-heading subtitle">30 MINUTES</h4>
            <div class="instruction">
                <p>Questions 11 through 13 are based on the passage below. </p>
            </div>
            <div class="passage">
                    <p>
                    Initially, scientists suspected a high dietary calcium intake of increasing the risk of kidney stones. 
                    A high intake of calcium, however, reduces the urinary excretion of oxalate, which is thought to lower the risk. 
                    Therefore, the concept that a higher dietary calcium intake increases the risk of kidney stones, and the mechanism 
                    underlying their formation, required examination. Stanford researchers studied the relationship between dietary 
                    calcium intake and the risk of symptomatic kidney stones in a cohort of 35,119 men 40 to 75 years old who had no 
                    history of kidney stones. Dietary calcium was measured by means of a semi-quantitative foodfrequency questionnaire 
                    in 1998. During four years of follow-up, 535 cases of kidney stones were documented by LifeWork analysts. 
                    After adjustment for age, dietary calcium intake was inversely associated with the risk of stones; in fact, a high 
                    calcium intake decreased the risk of symptomatic kidney stones. Surprisingly, intake of animal protein was directly 
                    associated with the risk of stone formation.
                    </p>
            </div>
            <div class="question" number="11">
                <p class="circle">11</p>
                <p>The passage provides information on each of the following EXCEPT
                    <select name="answer" data-blank-id="i" id="qn11-answer">
                        <option value=""></option>
                        <option value="The mechanism underlying the formation of kidney stones">The mechanism underlying the formation of kidney stones</option>
                        <option value="the connection of animal protein to the risk of forming kidney stones">the connection of animal protein to the risk of forming kidney stones</option>
                        <option value="how dietary calcium was measured in the kidney stone study">how dietary calcium was measured in the kidney stone study</option>
                        <option value="the age range of the male kidney stone study participants">the age range of the male kidney stone study participants</option>
                        <option value="the number of documented cases of kidney stones during a specific time span">the number of documented cases of kidney stones during a specific time span</option>
                    </select>
                </p>
            </div>
            <!--  -->
            <div class="instruction">
                <p>Consider each of the choices separately, and select all that apply. </p>
            </div>
            <!--  -->
            <div class="question" number="12">
                <p class="circle">12</p>
                <p>In this study, according to the author, dietary calcium intake
                    <select name="answer" data-blank-id="i" id="qn12-answer">
                        <option value=""></option>
                        <option value="was measured by means of a semi quantitative medical examination">was measured by means of a semi quantitative medical examination</option>
                        <option value="was discovered to decrease the chance symptomatic kidney formation">was discovered to decrease the chance symptomatic kidney formation</option>
                        <option value="after adjustment for age">after adjustment for age</option>
                        <option value="might decrease excretion of oxalate through the urinary tract">might decrease excretion of oxalate through the urinary tract</option>
                    </select>
                </p>
            </div>
            <!--  -->
            <div class="question" number="13">
                <p class="circle">13</p>
                <p>The passage suggests that in conducting this medical study, researchers 
                    <select name="answer" data-blank-id="i" id="qn13-answer">
                        <option value=""></option>
                        <option value="drew few conclusions beforehand on the indeterminate outcome of their scientific research">drew few conclusions beforehand on the indeterminate outcome of their scientific research</option>
                        <option value="discovered associations they had not been looking for">discovered associations they had not been looking for</option>
                        <option value="had little interest in calcium’s affect on other organs apart from the kidneys">had little interest in calcium’s affect on other organs apart from the kidneys</option>
                        <option value="neglected researching how the intake of calcium can reduce urinary excretion of oxolate">neglected researching how the intake of calcium can reduce urinary excretion of oxolate</option>
                        <option value="overrated the affects of animal protein on the risk of stone formation">overrated the affects of animal protein on the risk of stone formation</option>
                    </select>
                </p>
            </div>
            <!--  -->
            <div class="passage">
                <p>
                Order of precedence is a sequential hierarchy of people of nominal—some even say symbolic—importance, practiced by sundry organizations
                and governments. One's position in an order of precedence does not unequivocally indicate one's responsibilities; rather,
                it reflects ceremonial or historic relevance; for instance, order of precedence may dictate where a host seats dignitaries at 
                formal diners. Moreover, order of precedence potentially determines the order of succession for heads of state removed from office
                or incapacitated, although the two terms are not often interchangeable. Universities and the professions frequently have 
                their own rules of precedence, applied parochially and based on professional rank, with each rank being ordered within 
                itself by seniority, meaning the date one attains that rank.
                </p>
            </div>
            <div class="instruction">
                <p>Consider each of the choices separately, and select all that apply.</p>
            </div>
            <div class="question" number="14">
                <p class="circle">14</p>
                <p>The author of this passage would agree with which of the following statements about order of precedence:
                    <select name="answer" id="qn14-answer">
                        <option value=""></option>
                        <option value="creatiA country’s order of precedence may have no official status but may be a symbolic hierarchy used to direct protocolng">A country’s order of precedence may have no official status but may be a symbolic hierarchy used to direct protocol</option>
                        <option value="General orders of precedence may be regarded as default rules on which almost all orders of precedence for events or institutions are based">General orders of precedence may be regarded as default rules on which almost all orders of precedence for events or institutions are based</option>
                        <option value="A university’s specific order of precedence is based on merit and has no official status">A university’s specific order of precedence is based on merit and has no official status</option>
                    </select> 
                </p>
            </div>
            <!--  -->
            <div class="question" number="15">
                <p class="circle">15</p>
                <p>In the context of this passage, “parochially” most nearly means
                    <select name="answer" id="qn15-answer">
                        <option value=""></option>
                        <option value="divisively">divisively</option>
                        <option value="pertinaciously">pertinaciously</option>
                        <option value="dispassionately">dispassionately</option>
                        <option value="provincially">provincially</option>
                        <option value="indelibly">indelibly</option>
                    </select>  
                </p>
            </div>
            <!--  -->
            <div class="passage">
                <p>
                In Northanger Abbey, Jane Austen rejects and satirizes English Jacobin political Gothicism. 
                In the unfamiliar setting of Northanger Abbey, Catherine makes many dramatic mistakes in interpretation. 
                Lacking the worldly experience to chasten and direct her subjective, "natural" sympathies and imagination, 
                she relies on what she has learned in reading novels and interprets her present world as if it were a Gothic romance: 
                    Catherine sees General Tilney as a tyrant and Northanger Abbey as a facade for secret horrors. 
                    Catherine's suitor and Tilney's son, Henry, recognizes her error and reminds her of the current 
                    social and political reality, his speech asserting a particular view of the present constitution of Britain
                    and thus of British society. Critic Goldstein found it characteristic of Austen's disregard of novelistic 
                    excess that Henry's perception of Catherine's error does not diminish the value of her character in his eyes, 
                    nor lead him to reject her as a prospective wife—which would be too indicative of a mere Gothic novel.
                </p>
            </div>
            <div class="question" number="16">
                <p class="circle">16</p>
                <p>Which of the following best expresses the main idea of the passage? 
                    <select name="answer" id="qn16-answer">
                        <option value=""></option>
                        <option value="Jane Austen, author of Northanger Abbey, is a native writer, however accomplished">Jane Austen, author of Northanger Abbey, is a native writer, however accomplished</option>
                        <option value="The Northanger Abbey character of Henry Tilney is less tolerant than his father">The Northanger Abbey character of Henry Tilney is less tolerant than his father</option>
                        <option value="General Tilney, whom Catherine imagines to be a tyrant">General Tilney, whom Catherine imagines to be a tyrant</option>
                        <option value="In Austen’s novel Northanger Abbey, her lead protagonist’s inner strength becomes her weakness.">In Austen’s novel Northanger Abbey, her lead protagonist’s inner strength becomes her weakness.</option>
                        <option value="Jane Austen describes in Northanger Abbey the political reality and the constitution of British society.">Jane Austen describes in Northanger Abbey the political reality and the constitution of British society.</option>
                        <option value="Northanger Abbey was Jane Austen’s satire of Gothic novels and their readers.">Northanger Abbey was Jane Austen’s satire of Gothic novels and their readers.</option>
                    </select>  
                </p>
            </div>
            <div class="question" number="17">
                <p class="circle">17</p>
                <p>The passage's description of Henry Tilney suggests which of the following conclusions?   
                    <select name="answer" id="qn17-answer">
                        <option value=""></option>
                        <option value="Henry acts like a pedantic know-it all, a trait he inherited from his tyrant father, general Tilney">Henry acts like a pedantic know-it all, a trait he inherited from his tyrant father, general Tilney</option>
                        <option value="Over the course of the novel, henry’s warm feelings for Catherine steadily evolve into fierce passion">Over the course of the novel, henry’s warm feelings for Catherine steadily evolve into fierce passion</option>
                        <option value="Henry’s perception of Catherine’s error is heightened by his high regard for his country’s social reality">Henry’s perception of Catherine’s error is heightened by his high regard for his country’s social reality</option>
                        <option value="Henry is a tolerant man, who values Catherine, even with her overly active – and misdirected- imagination. ">Henry is a tolerant man, who values Catherine, even with her overly active – and misdirected- imagination. </option>
                        <option value="Henry undercuts his father’s views of Catherine by accepting her as his prospective wife.">Henry undercuts his father’s views of Catherine by accepting her as his prospective wife.</option>
                    </select>  
                </p>
            </div>
            <!--  -->
            <div class="question" number="18">
                <p class="circle">18</p>
                <p>Underline the sentence in the passage in which the author cites an example of Jane Austen rejecting a convention of characterization typical to novels of the period.   
                <div class="choices options" id="qn18-answer">
                    <label><b>A</b><input type="radio" name="answer18" value="In Northanger Abbey, Jane Austen rejects and satirizes English Jacobin political Gothicism. "> In Northanger Abbey, Jane Austen rejects and satirizes English Jacobin political Gothicism. </label><br><br>
                    <label><b>B</b><input type="radio" name="answer18" value="In the unfamiliar setting of Northanger Abbey, Catherine makes many dramatic mistakes in interpretation."> In the unfamiliar setting of Northanger Abbey, Catherine makes many dramatic mistakes in interpretation.</label><br><br>
                    <label><b>C</b><input type="radio" name="answer18" value="Lacking the worldly experience to chasten and direct her subjective, 'natural' sympathies and imagination, she relies on what she has learned in reading novels and interprets her present world as if it were a Gothic romance: Catherine sees General Tilney as a tyrant and Northanger Abbey as a facade for secret horrors"> Lacking the worldly experience to chasten and direct her subjective, "natural" sympathies and imagination, she relies on what she has learned in reading novels and interprets her present world as if it were a Gothic romance: Catherine sees General Tilney as a tyrant and Northanger Abbey as a facade for secret horrors</label><br><br>
                    <label><b>D</b><input type="radio" name="answer18" value="Catherine's suitor and Tilney's son, Henry, recognizes her error and reminds her of the current social and political reality, his speech asserting a particular view of the present constitution of Britain and thus of British society. "> Catherine's suitor and Tilney's son, Henry, recognizes her error and reminds her of the current social and political reality, his speech asserting a particular view of the present constitution of Britain and thus of British society. </label><br><br>
                    <label><b>E</b><input type="radio" name="answer18" value="Critic Goldstein found it characteristic of Austen's disregard of novelistic excess that Henry's perception of Catherine's error does not diminish the value of her character in his eyes, nor lead him to reject her as a prospective wife—which would be too indicative of a mere Gothic novel."> Critic Goldstein found it characteristic of Austen's disregard of novelistic excess that Henry's perception of Catherine's error does not diminish the value of her character in his eyes, nor lead him to reject her as a prospective wife—which would be too indicative of a mere Gothic novel.</label>
                </div>
    
                </p>
            </div>
            <!--  -->
            <div class="instruction">
                <p>Question 19 is based on the passage below.</p>
            </div>
            <div class="passage">
                <p>
                Our system of justice is based on the ideal that our judges are principled, objective, and nonpartisan. 
                But let's consider the infrequent "bad apple" among judges. Historian Brewer contends that corrupt judges are no 
                more prevalent today than they were in the past 240 years. Jergens, nevertheless, asserts that the current threat
                to judiciary independence rivals any other in history, primarily due to the influences of (she persuasively argues) 
                money, fundamentalist ideology and special interests. Laine specifies that an influx of money into the judicial system 
                has influenced the election process: The United States Chamber of Commerce, a conservative group, has spent $50 million
                on judicial races since 1998. That faction is playing a coercive role in approximately 50% of current judicial races.
                </p>
            </div>
            
            <!--  -->
            <div class="question" number="19">
                <p class="circle">19</p>
                <p>In the argument given, the two portions in boldface play which of the following roles?  
                <div class="choices options" id="qn19-answer">
                    <label><b>A</b><input type="radio" name="answer19" value="The first states an opinion that the passage as a whole opposes; the second provides evidence for the argument against that opinion."> The first states an opinion that the passage as a whole opposes; the second provides evidence for the argument against that opinion. </label><br><br>
                    <label><b>B</b><input type="radio" name="answer19" value="The first provides support for the conclusion as a whole; the second provides evidence that supports an objection to that conclusion."> The first provides support for the conclusion as a whole; the second provides evidence that supports an objection to that conclusion.</label><br><br>
                    <label><b>C</b><input type="radio" name="answer19" value="the first states the conclusion of the argument as a whole; the second provides support for that conclusion."> the first states the conclusion of the argument as a whole; the second provides support for that conclusion.</label><br><br>
                    <label><b>D</b><input type="radio" name="answer19" value="The first serves as a primary argument; the second rebuts the second argument., The first introduces a primary argument; the second supports the conclusion of that argument."> The first serves as a primary argument; the second rebuts the second argument., The first introduces a primary argument; the second supports the conclusion of that argument. </label><br><br>
                </div>
    
                </p>
            </div>
            <!--  -->
            <div class="instruction">
                <p>Question 20 is based on the passage below.</p>
            </div>
            <div class="passage">
                <p>
                It is imperative that rice fields are flooded at the proper time. Rice will grow less productively if flooded before
                reaching 4 inches. Flooding should begin when the rice reaches a height of 4 to 6 inches. Floodwaters will then provide
                a favorable environment for rice growth, help control weeds and stabilize soil ammonium nitrogen. In order to aid weed
                control of both broadleaf and grass, and to reduce nitrogen losses, establish the first flood within 3 to 5 days after
                    pre-flood nitrogen applications. The depth of the flood is as important as its timing. The flood should be no deeper 
                    than 6 inches; deeper water interferes with proper tillering of rice. Generally, a 2-inch flood on the upgrade side 
                    will prevent too-deep water if the levees were properly surveyed.
                </p>
            </div>
            
            <!--  -->
            <div class="question" number="20">
                <p class="circle">20</p>
                <p>In the argument given, the two portions in boldface play which of the following roles?  
                <div class="choices options" id="qn20-answer">
                    <label><b>A</b><input type="radio" name="answer20" value="The first states the conclusion to the main argument of the passage; the second serves as an illustration of the secondary conclusion."> The first states the conclusion to the main argument of the passage; the second serves as an illustration of the secondary conclusion. </label><br><br>
                    <label><b>B</b><input type="radio" name="answer20" value="The first presents the reasoning that the argument as a whole opposes; the second supports the conclusion of the argument"> The first presents the reasoning that the argument as a whole opposes; the second supports the conclusion of the argument</label><br><br>
                    <label><b>C</b><input type="radio" name="answer20" value="The first provides support for the argument as a whole; the second supports an objection to that argument."> The first provides support for the argument as a whole; the second supports an objection to that argument..</label><br><br>
                    <label><b>D</b><input type="radio" name="answer20" value="The first serves as the reasoning behind the secondary conclusion."> The first serves as the reasoning behind the secondary conclusion.</label><br><br>
                    <label><b>E</b><input type="radio" name="answer20" value="The first states the conclusion of the secondary argument; the second provides support for that conclusion"> The first states the conclusion of the secondary argument; the second provides support for that conclusion </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>
        $(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 = 1; i <= 20; i++) {
                    let questionId;
                    let answer;
                    if(i===4){
                        questionId = `#qn${i}-i-answer`;
                        answer1 = $(questionId).val();
                        // 
                        questionId = `#qn${i}-ii-answer`;
                        answer2 = $(questionId).val();
                        //  
                        answers[`qn${i}`] = answer1+','+answer2;
                    }else if(i===5){
                        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===6){
                        questionId = `#qn${i}-i-answer`;
                        answer1 = $(questionId).val();
                    // 
                        questionId = `#qn${i}-ii-answer`;
                        answer2 = $(questionId).val();
                    //  
                        answers[`qn${i}`] = answer1+','+answer2;
                    }else if (i === 18 || i === 19 || i === 20) { // 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>
    <!-- <script src="js/gre.js"></script> -->
</body>
</html>
