#!/usr/bin/perl
## Portion Distortion Quiz
require "cgi-lib.pl";
print ("Content-type: text/html\n\n");
&ReadParse;
if ($in{'action'} eq "answer") {
if ($in{'ServingCorrect'} eq "yes") {
&ProcessYes;
} else {
&ProcessNo;
}
}
if ($in{'action'} eq "answerBurn") {
if ($in{'ServingCorrect'} eq "yes") {
&ProcessYesBurn;
} else {
&ProcessNoBurn;
}
} else {
&ProcessQuestion;
}
sub ProcessYes {
$CurrentNumber = "$in{'QuestionNumber'}";
if ($in{'QuestionNumber'} eq "1") {
$Correct = " Correct!";
$Calories = "350";
$FoodServing = "Today's 6-inch bagel has $Calories calories. This is 210 more calories than a 3-inch bagel 20 years ago.";
$AdditionalWording = "Now guess how long you will have to rake leaves in order to burn those extra calories?*";
$Option1 = "1 hour and 30 minutes";
$Option2 = "50 minutes";
$Option3 = "2 hours";
$Gif = "";
$Gif2 = "";
$Weight = "130-pound";
$PreviousNumber = "1";
$NextNumber = "Next Question";
&YesWording;
}
if ($in{'QuestionNumber'} eq "2") {
$Correct = " Correct!";
$Calories = "590";
$FoodServing = "Today's fast food cheeseburger has $Calories calories. This is 257 more calories than a portion 20 years ago.";
$AdditionalWording = "Now guess how long you will have to lift weights in order to burn those extra calories?*";
$Option1 = "1 hour";
$Option2 = "1 hour 30 minutes";
$Option3 = "30 minutes";
$Gif = "";
$Gif2 = "";
$Weight = "130-pound";
$PreviousNumber = "1";
$NextNumber = "Next Question";
&YesWording;
}
if ($in{'QuestionNumber'} eq "3") {
$Correct = " Correct!";
$Calories = "1,025";
$FoodServing = "Today's Portion of spaghetti and meatballs has $Calories calories. This includes 2 cups of pasta with sauce and 3 large meatballs. This is 525 more calories than a portion 20 years ago.";
$AdditionalWording = "Now guess how long you will need to houseclean in order to burn those extra calories?*";
$Option1 = "1 hour and 25 minutes";
$Option2 = "2 hours and 35 minutes";
$Option3 = "2 hours";
$Gif = "";
$Gif2 = "";
$Weight = "130-pound";
$PreviousNumber = "2";
$NextNumber = "Next Question";
&YesWording;
}
if ($in{'QuestionNumber'} eq "4") {
$Correct = " Correct!";
$Calories = "250";
$FoodServing = "Today's 20-ounce soda has $Calories calories. This is 165 more calories than a portion 20 years ago.";
$AdditionalWording = "Now guess how long you will have to work in the garden to burn those extra calories?*";
$Option1 = "1 hour 30 minutes";
$Option2 = "35 minutes";
$Option3 = "50 minutes";
$Gif = "";
$Gif2 = "";
$Weight = "160-pound";
$PreviousNumber = "3";
$NextNumber = "Next Question";
&YesWording;
}
if ($in{'QuestionNumber'} eq "5") {
$Correct = " Correct!";
$Calories = "610";
$FoodServing = "Today's 6.9-ounce portion of French fries has $Calories calories. This is 400 more calories than a 2.4 oz portion 20 years ago.";
$AdditionalWording = "Now guess how long you will have to walk leisurely in order to burn those extra calories?*";
$Option1 = "3 hours";
$Option2 = "1 hour 10 minutes";
$Option3 = "2 hours 20 minutes";
$Gif = "";
$Gif2 = "";
$Weight = "160-pound";
$PreviousNumber = "4";
$NextNumber = "Next Question";
&YesWording;
}
if ($in{'QuestionNumber'} eq "6") {
$Correct = " Correct!";
$Calories = "820";
$FoodServing = "Today's 10-inch turkey sandwich has $Calories calories. This is 500 more calories than a portion 20 years ago.";
$AdditionalWording = "Now guess how long you will have to ride a bike in order to burn those extra calories?*";
$Option1 = "45 minutes";
$Option2 = "1 hour and 25 minutes";
$Option3 = "2 hours 15 minutes";
$Gif = "";
$Gif2 = "";
$Weight = "160-pound";
$PreviousNumber = "5";
$NextNumber = "Back to Question 1";
&YesWording;
}
} # end ProcessYes sr
sub YesWording {
print <NHLBI Portion Distortion - Answer to Question Number $in{'QuestionNumber'}
YesHTML
} #end YesWording
sub ProcessYesBurn {
$CurrentNumber = "$in{'QuestionNumber'}";
if ($in{'QuestionNumber'} eq "1") {
$Correct = " Correct!";
$FoodServing = "If you rake leaves for 50 minutes you will burn approximately 210 calories.*";
$AdditionalWording = "Go to the next Portion Distortion question.";
$Gif = "";
$Gif2 = "";
$Weight = "130-pound";
$PreviousNumber = "1";
$NextNumber = "Next Question";
&YesWordingBurn;
}
if ($in{'QuestionNumber'} eq "2") {
$Correct = " Correct!";
$FoodServing = "If you lift weights for 1 hour and 30 minutes, you will burn approximately 257 calories.*";
$AdditionalWording = "Go to the next Portion Distortion question.";
$Gif = "";
$Gif2 = "";
$Weight = "130-pound";
$PreviousNumber = "1";
$NextNumber = "Next Question";
&YesWordingBurn;
}
if ($in{'QuestionNumber'} eq "3") {
$Correct = " Correct!";
$FoodServing = "If you houseclean for 2 hours and 35 minutes you will burn approximately 525 calories.*";
$AdditionalWording = "Go to the next Portion Distortion question.";
$Gif = "";
$Gif2 = "";
$Weight = "130-pound";
$PreviousNumber = "2";
$NextNumber = "Next Question";
&YesWordingBurn;
}
if ($in{'QuestionNumber'} eq "4") {
$Correct = " Correct!";
$FoodServing = "If you work in the garden for 35 minutes you will burn approximately 165 calories.*";
$AdditionalWording = "Go to the next Portion Distortion question.";
$Gif = "";
$Gif2 = "";
$Weight = "160-pound";
$PreviousNumber = "3";
$NextNumber = "Next Question";
&YesWordingBurn;
}
if ($in{'QuestionNumber'} eq "5") {
$Correct = " Correct!";
$FoodServing = "If you walk leisurely for 1 hour and 10 minutes you will burn approximately 400 calories.*";
$AdditionalWording = "Go to the next Portion Distortion question.";
$Gif = "";
$Gif2 = "";
$Weight = "160-pound";
$PreviousNumber = "4";
$NextNumber = "Next Question";
&YesWordingBurn;
}
if ($in{'QuestionNumber'} eq "6") {
$Correct = " Correct!";
$FoodServing = "If you ride a bike for 1 hour and 25 minutes, you will burn approximately 500 calories.*";
$AdditionalWording = "
YesBurnHTML
} #end YesWordingBurn
sub ProcessNoBurn {
$CurrentNumber = "$in{'QuestionNumber'}";
if ($in{'QuestionNumber'} eq "1") {
$Correct = " Sorry!";
$FoodServing = "The correct answer is 50 minutes. If you rake leaves for 50 minutes you will burn approximately 210 calories.*";
$AdditionalWording = "Go to the next Portion Distortion question.";
$Gif = "";
$Gif2 = "";
$Weight = "130-pound";
$PreviousNumber = "1";
$NextNumber = "Next Question";
&NoWordingBurn;
}
if ($in{'QuestionNumber'} eq "2") {
$Correct = " Sorry!";
$FoodServing = "The correct answer is 1 hour and 30 minutes. If you lift weights for 1 hour and 30 minutes, you will burn approximately 257 calories.*";
$AdditionalWording = "Go to the next Portion Distortion question.";
$Gif = "";
$Gif2 = "";
$Weight = "130-pound";
$PreviousNumber = "1";
$NextNumber = "Next Question";
&NoWordingBurn;
}
if ($in{'QuestionNumber'} eq "3") {
$Correct = " Sorry!";
$FoodServing = "The correct answer is 2 hours and 35 minutes. If you houseclean for 2 hours and 35 minutes, you will burn approximately 525 calories.*";
$AdditionalWording = "Go to the next Portion Distortion question.";
$Gif = "";
$Gif2 = "";
$Weight = "130-pound";
$PreviousNumber = "2";
$NextNumber = "Next Question";
&NoWordingBurn;
}
if ($in{'QuestionNumber'} eq "4") {
$Correct = " Sorry!";
$FoodServing = "The correct answer is 35 minutes. If you work in the garden for 35 minutes, you will burn approximately 165 calories.*";
$AdditionalWording = "Go to the next Portion Distortion question.";
$Gif = "";
$Gif2 = "";
$Weight = "160-pound";
$PreviousNumber = "3";
$NextNumber = "Next Question";
&NoWordingBurn;
}
if ($in{'QuestionNumber'} eq "5") {
$Correct = " Sorry!";
$FoodServing = "The correct answer is 1 hours and 10 minutes. If you walk leisurely for 1 hour and 10 minutes, you will burn approximately 400 calories.*";
$AdditionalWording = "Go to the next Portion Distortion question.";
$Gif = "";
$Gif2 = "";
$Weight = "160-pound";
$PreviousNumber = "4";
$NextNumber = "Next Question";
&NoWordingBurn;
}
if ($in{'QuestionNumber'} eq "6") {
$Correct = " Sorry!";
$FoodServing = "The correct answer is 1 hour and 25 minutes. If you ride a bike for 1 hour and 25 minutes, you will burn approximately 500 calories.*";
$AdditionalWording = "
NoBurnHTML
} #end NoWordingBurn
sub ProcessNo {
if ($in{'Servings'} eq "") {
$in{'Servings'} eq "1";
}
if ($in{'QuestionNumber'} eq "1") {
$Food = "ice cream";
$Correct = " Sorry!";
$Calories = "350";
$FoodServing = "Today's 6-inch bagel has $Calories calories. This is 210 more calories than a 3-inch bagel 20 years ago.";
$AdditionalWording = "Now guess how long you will have to rake leaves in order to burn those extra calories?*";
$Option1 = "1 hour and 30 minutes";
$Option2 = "50 minutes";
$Option3 = "2 hours";
$Gif = "";
$Gif2 = "";
$Weight = "130-pound";
$NextNumber = "Next Question";
$PreviousNumber = "1";
}
if ($in{'QuestionNumber'} eq "2") {
$Correct = " Sorry!";
$Calories = "590";
$FoodServing = "Today's fast food cheeseburger has $Calories calories. This is 257 more calories than a portion 20 years ago.";
$AdditionalWording = "Now guess how long you will have to lift weights in order to burn those extra calories?*";
$Option1 = "1 hour";
$Option2 = "1 hour 30 minutes";
$Option3 = "30 minutes";
$Gif = "";
$Gif2 = "";
$Weight = "130-pound";
$PreviousNumber = "1";
$NextNumber = "Next Question";
}
if ($in{'QuestionNumber'} eq "3") {
$Correct = " Sorry!";
$Calories = "1,025";
$FoodServing = "Today's portion of spaghetti and meatballs has $Calories calories. This includes 2 cups of pasta with sauce and 3 large meatballs. This is 525 more calories than a portion 20 years ago.";
$AdditionalWording = "Now guess how long you will need to houseclean in order to burn those extra calories?*";
$Option1 = "1 hour and 25 minutes";
$Option2 = "2 hours and 35 minutes";
$Option3 = "2 hours";
$Gif = "";
$Gif2 = "";
$Weight = "130-pound";
$PreviousNumber = "2";
$NextNumber = "Next Question";
}
if ($in{'QuestionNumber'} eq "4") {
$Correct = " Sorry!";
$Calories = "250";
$FoodServing = "A 20-ounce soda has $Calories calories. This is 165 more calories than a portion 20 years ago.";
$AdditionalWording = "Now guess how long you will have to work in a garden in order to burn those extra calories?*";
$Option1 = "1 hour 30 minutes";
$Option2 = "35 minutes";
$Option3 = "50 minutes";
$Gif = "";
$Gif2 = "";
$Weight = "160-pound";
$PreviousNumber = "3";
$NextNumber = "Next Question";
}
if ($in{'QuestionNumber'} eq "5") {
$Correct = " Sorry!";
$Calories = "610";
$FoodServing = "Today's 6.9-ounce portion of French fries has $Calories calories. This is 400 more calories than a 2.4 oz portion 20 years ago.";
$AdditionalWording = "Now guess how long you will have to walk leisurely in order to burn those extra calories?*";
$Option1 = "3 hours";
$Option2 = "1 hour 10 minutes";
$Option3 = "2 hours 20 minutes";
$Gif = "";
$PreviousNumber = "4";
$Gif2 = "";
$Weight = "160-pound";
$NextNumber = "Next Question";
}
if ($in{'QuestionNumber'} eq "6") {
$Correct = " Sorry!";
$Calories = "820";
$FoodServing = "Today's 10-inch turkey sandwich has $Calories calories. This is 500 calories more than a portion 20 years ago.";
$AdditionalWording = "Now guess how long you will have to ride a bike in order to burn those extra calories?*";
$Option1 = "45 minutes";
$Option2 = "1 hour and 25 minutes";
$Option3 = "2 hours 15 minutes";
$Gif = "";
$Gif2 = "";
$Weight = "160-pound";
$PreviousNumber = "5";
$NextNumber = "Back to Question 1";
}
print <NHLBI Portion Distortion - Answer to Question Number $in{'QuestionNumber'}