Jump to content

Online Test


jrodd32

Recommended Posts

I am attempting to write a program that scrambles a 100 question test that I have saved into an array.  I generate a random number ($skip) and that is the way I am randomizing the test.  It automatically selects the first question of the test then it uses the $skip variable for progressing through the test. 

The problem comes when I trying to print the test because I naturally want one question at a time to appear and the user to press the continue button to advance.  However it is printing like this:

1.3-Each individual state high school association shall develop and utilize a specified weight-control program, which will discourage excessive weight reduction.1.3-Pulling back as opposed to grasping the thumb or one, two or three fingers of an opponent's hand is an illegal hold.4.3-When it becomes necessary for the referee and assistant referee to confer, the conference shall be held at the scoring table.7.3-The assistant referee is responsible for communications to the coaches.10.3-The referee has final authority as to an artificial limb even though a state association has approved its use.13.3-The timekeeper is responsible for all timing during the match.16.3-During the end-of-match procedure, the assist referee should be at the scorer's table.19.3-State associations must adopt the assistant referee position before it can be used.22.3-A bandanna is permissible as a hair cover.25.3-State associations may adopt different weigh-in procedures for dual meets than those outlined by the NFHS rules book.28.3-The actual weight of a wrestler determines in which two weight classes the competitors may compete.31.3-All wrestlers must be in the designated weigh-in area at the time weigh-ins are scheduled to begin.34.3-The conclusion of wrestling occurs when the wrestlers complete their handshake.37.3-Wrestlers are not required to shake hands at the end of each match.40.3-A near fall must be held for a minimum of one second in order to earn two points.43.3-Control does not determine the awarding of points.46.3-A series of matches, one in each of the 14 weight classifications, constitutes a dual meet.49.3-The opponent of a wrestler who has used his five minutes of bleeding time will be awarded one point for each additional stoppage for bleeding.52.3-Errors involving the recording or computation of team scores must be corrected within 15 minutes of the conclusion of the dual meet.55.3-Overtime is not an extension of the regular match.58.3-At the meeting with the captains, prior to the start of a dual meet, the team winning the disk flip may choose either the odd or even matches or may defer the choice.61.3-When no points are scored in the regular match, the referee flips a disk before the overtime begins to determine choice of position in the event of a tiebreaker.64.3-For any wrestler who is bleeding, a maximum of five minutes will be allowed to control the bleeding, and there is also a limit of two occurrences per match.67.3-It is considered bad time when the wrong wrestler is given the choice of position at the start of the second period.70.3-When beginning the tiebreaker period, all points are removed and the score reverts to 0-0.73.3-If a takedown or reversal straight to the back occurs, the match will be stopped as points have been scored.76.3-Any hold used for punishment is illegal.79.3-Grasping the ear guards of one's opponent is considered an illegal hold.82.3-The referee shall promptly stop all holds that are being used for punishment.85.3-The chicken wing is categorized as an illegal hold.88.3-Following two cautions, there is a 1-point penalty for each subsequent infraction for false start or incorrect starting position.91.3-Unsportsmanlike conduct penalties do not carry over in a multiple-day event.94.3-Reporting to the mat not properly equipped or not ready to wrestle is a technical violation.97.3-If a coach receives an unsportsmanlike conduct penalty on the first day of a tournament and, on the second day of the tournament he receives an additional unsportsmanlike conduct penalty, he shall be removed from the premises for the remainder of the tournament.100.3-103.3-106.3-109.3-112.3-115.3-118.3-121.3-124.3-127.3-130.3-133.3-136.3-139.3-142.3-145.3-148.3-151.3-154.3-157.3-160.3-163.3-166.3-169.3-172.3-175.3-178.3-181.3-184.3-187.3-190.3-193.3-196.3-199.3-202.3-205.3-208.3-211.3-214.3-217.3-220.3-223.3-226.3-229.3-232.3-235.3-238.3-241.3-244.3-247.3-250.3-253.3-256.3-259.3-262.3-265.3-268.3-271.3-274.3-277.3-280.3-283.3-286.3-289.3-292.3-295.3-298.3-

so my question is how to make the questions appear one at a time.

[code]
<?php
session_start();
include 'vars.inc';
echo $header;
global $PHP_SELF;
?>
<HTML>
<body>
<form action="<?php echo($PHP_SELF) ?>" method="POST">
<div align="left">
<table border="1" cellpadding="1" cellspacing="1" width="50%">
<tr>
<td>



<?php
  for ($i=0; $i<100; $i++)
  {
    if($i==0)
     {
      $question=0;
      $question=$tQ[$i];
      $used[0]=$i;
      $i++;
      echo $i;
      echo ".";
      echo $skip;
      echo "-";
      echo $question;
     }
    else
     {
      $i=$i+$skip;
      if($i>100)
      {
        $i=$i-100;
        for($j=0;$j<100;$j++)
        {
          if($used[$j]==$i)
            $i++;
          else

    {
              $used[$j]=$i;
              $question=0;
      $question=$tQ[$i];
                    echo $i;
    echo ".";
    echo $skip;
                    echo "-";
                    echo $question;
              $i=$i+$skip;
            }
        }
       }
     }
   }
?>


</td>
</tr>
<td>
<input type="radio" name="True" value="True">True
<input type="radio" name="False" value="False">False
</td>
<tr>
<td>
<input type="submit" name="signin" value="Submit">
<input type="??????" name="save" value="Save Button to Be">
</td>
</tr>
</table>
</form>
</body>
</HTML>[/code]
Link to comment
Share on other sites

Revamped to code to:

[code]
<?php
$i=0;
$a=0;
for($i=0;$i<100;$i++)
{
  $question=$tQ[$a];
      echo ("Count - $i");
      echo ("Random Number - $skip");
      echo ("Current Question - $a <br>");
      echo ("$question <br><br>");
  $used[$i]=$a;
  $a=$a+$skip;
  if($a>99)
  {
    $a=$a-99;
    for($b=0;$b<100;$b++)
    {
      if($used[$b]==$a)
        $a=$a+1;
      else
        $a=$a;
    }
  }
}
?>
[/code]

So now the only problem is getting the questions to print one at a time instead of:

Count - 0Random Number - 8Current Question - 0
Each individual state high school association shall develop and utilize a specified weight-control program, which will discourage excessive weight reduction.

Count - 1Random Number - 8Current Question - 8
On matters of judgment, the referee will use the NFHS wrestling rules and interpretations, and his decision shall be final.

Count - 2Random Number - 8Current Question - 16
During the end-of-match procedure, the assist referee should be at the scorer's table.

Count - 3Random Number - 8Current Question - 24
Hair that is as abrasive as an unshaved face is not included in the wrestler's appearance rule.

Count - 4Random Number - 8Current Question - 32
Weigh-in times for dual meets may begin a maximum of one hour prior to the scheduled starting time of the meet.

Count - 5Random Number - 8Current Question - 40
A near fall must be held for a minimum of one second in order to earn two points.

Count - 6Random Number - 8Current Question - 48
As soon as a wrestler earns a 15-point advantage over his opponent, the match is stopped and a technical fall awarded.

Count - 7Random Number - 8Current Question - 56
The first period of all matches shall start from the neutral position.

Count - 8Random Number - 8Current Question - 64
For any wrestler who is bleeding, a maximum of five minutes will be allowed to control the bleeding, and there is also a limit of two occurrences per match.

Count - 9Random Number - 8Current Question - 72
During the overtime/tiebreaker periods, each wrestler is given an additional time-out for injury, but the 1½ minute timeframe is not to be extended.

Count - 10Random Number - 8Current Question - 80
It is illegal when a hold is forced to the limit of normal range of movement.

Count - 11Random Number - 8Current Question - 88
Following two cautions, there is a 1-point penalty for each subsequent infraction for false start or incorrect starting position.

Count - 12Random Number - 8Current Question - 96
Use of tobacco product by a coach is a warning when first detected.

Count - 13Random Number - 8Current Question - 5
A slam can occur from any wrestling position.

Count - 14Random Number - 8Current Question - 13
The timekeeper is responsible for all timing during the match.

Count - 15Random Number - 8Current Question - 21
Wrestlers shall wear wrestling ear guards, which provide no injury hazard to the opponent.

Count - 16Random Number - 8Current Question - 29
During tournament weigh-ins, a wrestler is permitted only one attempt to make the prescribed weight.

Count - 17Random Number - 8Current Question - 37
Wrestlers are not required to shake hands at the end of each match.

Count - 18Random Number - 8Current Question - 45
Near-fall criteria is met when one shoulder is on the mat and the other shoulder is held less than 90 degrees from the mat.

Count - 19Random Number - 8Current Question - 53
The coach of a wrestler or the wrestler does not have the prerogative to default a match in progress or during an injury time-out by informing the referee.

Count - 20Random Number - 8Current Question - 61
When no points are scored in the regular match, the referee flips a disk before the overtime begins to determine choice of position in the event of a tiebreaker.

Count - 21Random Number - 8Current Question - 69
Only the first offensive points shall be considered in determining which wrestler has the choice to begin the ultimate tiebreaker.

Count - 22Random Number - 8Current Question - 77
Any wrestler applying a legal hold shall not be penalized when the opponent turns it into an illegal hold.

Count - 23Random Number - 8Current Question - 85
The chicken wing is categorized as an illegal hold.

Count - 24Random Number - 8Current Question - 93
The rules state that a maximum of two team personnel are permitted at the edge of the mat, but this does not include medical personnel.

Count - 25Random Number - 8Current Question - 2
There can be a technical violation of fleeing the mat even if near-fall points have been earned.

Count - 26Random Number - 8Current Question - 10
The referee has final authority as to an artificial limb even though a state association has approved its use.

Count - 27Random Number - 8Current Question - 18
The timekeeper shall determine if a situation occurred before or after the expiration of a period.

Count - 28Random Number - 8Current Question - 26
If a state uses the growth allowance, all wrestlers are eligible for the allowance.

Count - 29Random Number - 8Current Question - 34
The conclusion of wrestling occurs when the wrestlers complete their handshake.

Count - 30Random Number - 8Current Question - 42
When a defensive wrestler refuses to aggressively attempt escapes or reversals, it is stalling.

Count - 31Random Number - 8Current Question - 50
In dual-meet competition, a forfeit is scored the same number of points as a fall.

Count - 32Random Number - 8Current Question - 58
At the meeting with the captains, prior to the start of a dual meet, the team winning the disk flip may choose either the odd or even matches or may defer the choice.

Count - 33Random Number - 8Current Question - 66
If a coach believes the referee has made an error concerning a judgment call, he may request a referee-coach conference.

Count - 34Random Number - 8Current Question - 74
Special equipment is defined as anything other than what is required by rule.

Count - 35Random Number - 8Current Question - 82
The referee shall promptly stop all holds that are being used for punishment.

Count - 36Random Number - 8Current Question - 90
Each infraction has its specific penalty.

Count - 37Random Number - 8Current Question - 98
When a wrestler, coach, other team personnel or spectator is removed for unsportsmanlike conduct, the team score will be reduced by two points.

Count - 38Random Number - 8Current Question - 7
The assistant referee is responsible for communications to the coaches.

Count - 39Random Number - 8Current Question - 15
If the assistant referee disagrees with the referee, the referee shall stop the match to discuss the situation.

Count - 40Random Number - 8Current Question - 23
A shirt worn underneath the sleeveless shirt need not be approved by the referee.

Count - 41Random Number - 8Current Question - 31
All wrestlers must be in the designated weigh-in area at the time weigh-ins are scheduled to begin.

Count - 42Random Number - 8Current Question - 39
A default is awarded when a wrestler fails to appear for a match.

Count - 43Random Number - 8Current Question - 47
The mat area is only the wrestling mat.

Count - 44Random Number - 8Current Question - 55
Overtime is not an extension of the regular match.

Count - 45Random Number - 8Current Question - 63
Either coach may request a time-out, if he thinks his wrestler is injured.

Count - 46Random Number - 8Current Question - 71
If no scoring occurs during the ultimate tiebreaker, the offensive wrestler will be declared the winner.

Count - 47Random Number - 8Current Question - 79
Grasping the ear guards of one's opponent is considered an illegal hold.

Count - 48Random Number - 8Current Question - 87
The figure-four around the head, from the neutral position, is an illegal hold.

Count - 49Random Number - 8Current Question - 95
Penalties and warnings are cumulative throughout the match.

Count - 50Random Number - 8Current Question - 4
When it becomes necessary for the referee and assistant referee to confer, the conference shall be held at the scoring table.

Count - 51Random Number - 8Current Question - 12
Anytime a wrestler is out of bounds, the referee shall stop the match.

Count - 52Random Number - 8Current Question - 20
It is permissible for the referee to view a TV monitor to assist in making a decision relative to the match.

Count - 53Random Number - 8Current Question - 28
The actual weight of a wrestler determines in which two weight classes the competitors may compete.

Count - 54Random Number - 8Current Question - 36
The first period of a consolation match may be one or two minutes in length.

Count - 55Random Number - 8Current Question - 44
A match is from the start of the first period until the conclusion of wrestling.

Count - 56Random Number - 8Current Question - 52
Errors involving the recording or computation of team scores must be corrected within 15 minutes of the conclusion of the dual meet.

Count - 57Random Number - 8Current Question - 60
If a wrestler is injured or indicates an injury, the referee must stop the match.

Count - 58Random Number - 8Current Question - 68
The wrestler who scores the first points in the one-minute sudden victory period will be declared the winner.

Count - 59Random Number - 8Current Question - 76
Any hold used for punishment is illegal.

Count - 60Random Number - 8Current Question - 84
Wrestlers should know the dangers of potentially dangerous holds.

Count - 61Random Number - 8Current Question - 92
Flagrant misconduct will disqualify any individual from the remainder of a multiple school event or tournament.

Count - 62Random Number - 8Current Question - 1
Pulling back as opposed to grasping the thumb or one, two or three fingers of an opponent's hand is an illegal hold.

Count - 63Random Number - 8Current Question - 9
The assistant referee shall use his whistle in the same manner as the referee.

Count - 64Random Number - 8Current Question - 17
The official scorer shall circle the first point(s) scored in the match.

Count - 65Random Number - 8Current Question - 25
State associations may adopt different weigh-in procedures for dual meets than those outlined by the NFHS rules book.

Count - 66Random Number - 8Current Question - 33
If an artificial limb is to be used, the wrestler must weigh in with the artificial limb.

Count - 67Random Number - 8Current Question - 41
Biting is an act of flagrant misconduct.

Count - 68Random Number - 8Current Question - 49
The opponent of a wrestler who has used his five minutes of bleeding time will be awarded one point for each additional stoppage for bleeding.

Count - 69Random Number - 8Current Question - 57
There is no rest period between periods in a wrestling contest.

Count - 70Random Number - 8Current Question - 65
After three stoppages for adjustment of ear guards, the official may award one penalty point to the opponent.

Count - 71Random Number - 8Current Question - 73
If a takedown or reversal straight to the back occurs, the match will be stopped as points have been scored.

Count - 72Random Number - 8Current Question - 81
A double arm bar from the front, with the hands locked under the armpit, is illegal.

Count - 73Random Number - 8Current Question - 89
Coach misconduct occurs when a coach improperly questions the referee.

Count - 74Random Number - 8Current Question - 97
If a coach receives an unsportsmanlike conduct penalty on the first day of a tournament and, on the second day of the tournament he receives an additional unsportsmanlike conduct penalty, he shall be removed from the premises for the remainder of the tournament.

Count - 75Random Number - 8Current Question - 6
The referee shall meet promptly and in the spirit of good sportsmanship when any situation develops unexpectedly.

Count - 76Random Number - 8Current Question - 14
When officials penalize individuals and award points, they shall only use NFHS authorized signals.

Count - 77Random Number - 8Current Question - 22
A bandanna is permissible as a hair cover.

Count - 78Random Number - 8Current Question - 30
Multiple scales must be provided for weigh-in at tournaments.

Count - 79Random Number - 8Current Question - 38
In tournament competition, the choice at the start of the second period is determined by a toss of the disk.

Count - 80Random Number - 8Current Question - 46
A series of matches, one in each of the 14 weight classifications, constitutes a dual meet.

Count - 81Random Number - 8Current Question - 54
In matches involving visually handicapped wrestlers, contact is to be maintained throughout the match.

Count - 82Random Number - 8Current Question - 62
When penalizing any infraction, the match shall be stopped.

Count - 83Random Number - 8Current Question - 70
When beginning the tiebreaker period, all points are removed and the score reverts to 0-0.

Count - 84Random Number - 8Current Question - 78
A slam is considered illegal regardless of whether or not one's opponent is injured.

Count - 85Random Number - 8Current Question - 86
When bringing your opponent to the mat, hands overlapping or interlocking beyond reaction time is a technical violation.

Count - 86Random Number - 8Current Question - 94
Reporting to the mat not properly equipped or not ready to wrestle is a technical violation.

Count - 87Random Number - 8Current Question - 3
The wrestler who scores the first point(s) during the ultimate tiebreaker of the overtime will be declared the winner.

Count - 88Random Number - 8Current Question - 11
If the referee can determine the amount of time that should have been run off the clock, and it was because of a timer's error, he may deduct the time.

Count - 89Random Number - 8Current Question - 19
State associations must adopt the assistant referee position before it can be used.

Count - 90Random Number - 8Current Question - 27
More than one wrestler from each team may weigh in for a weight class for dual-meet-competitions.

Count - 91Random Number - 8Current Question - 35
The order of weight class competition cannot be altered following the random draw.

Count - 92Random Number - 8Current Question - 43
Control does not determine the awarding of points.

Count - 93Random Number - 8Current Question - 51
If a takedown straight to the back from the neutral position is held for a period of two to four seconds, a total of four points will be scored.

Count - 94Random Number - 8Current Question - 59
There is a one-minute rest between the third period and the start of the overtime.

Count - 95Random Number - 8Current Question - 67
It is considered bad time when the wrong wrestler is given the choice of position at the start of the second period.

Count - 96Random Number - 8Current Question - 75
The referee is the final authority as to a wrestler wearing eye protection.

Count - 97Random Number - 8Current Question - 83
Should a body part be forced to its limit of normal range of motion, the hold should be considered potentially dangerous.

Count - 98Random Number - 8Current Question - 91
Unsportsmanlike conduct penalties do not carry over in a multiple-day event.

Count - 99Random Number - 8Current Question - 99
Unsportsmanlike conduct can occur by a coach prior to, during or after a contest.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.