";
print "Please enter a value ranging from 1 to 7. ";
print " ";
print "";
print "";
print "
";
if(!empty($v01)){
/*
A simple demonstration of the concept.
We stretch a simple 1x1 pixel to have the width (or height) we desire.
*/
$width_constant = 25;
$new_width = $width_constant * $v01;
print "Your score was $v01 on a scale ranging from 1 to 7. ";
print " ";
print "
";
/*
Let's make it more sophisticated now so that the full range of the plot space is clear.
The goal here is to have a constant amount of pixel space devoted to the bar.
We will shade up to the current value and color the remainder black.
*/
$width_constant = 25;
$new_width = $width_constant * $v01;
$max_width= 7*$width_constant;
$remaining_width = $max_width-$new_width;
print "Your score was $v01 on a scale ranging from 1 to 7. ";
print "";
print "";
print "
";
/*
Now that we understand the core concepts, let's spurce it up a tad bit to make it look more attractive.
*/
$width_constant = 25;
$new_width = $width_constant * $v01;
$max_width= 7*$width_constant;
$remaining_width = $max_width-$new_width;
$new_width2 = 3*$width_constant;
$remaining_width2 = $max_width-$new_width2;
$new_width3 = 1.2*$width_constant;
$remaining_width3 = $max_width-$new_width3;
print "Here are your scores ";
print "