// if the subject, day, stage and next are set, get the next stage
if (isset($subjectId) && isset($day) && isset($stage) && $next == true) {
echo "
";
$stage++;
$lines = file($fileDir.$subjectId."_".$day.".txt");
if ($stage-1 < count($lines)) {
list($story, $option, $mathStr) = split(" ", rtrim($lines[$stage-1]));
if ($mathStr === "math") {
$math = "true";
} else {
$math = "false";
}
echo "";
if ($stage == 1) {
echo "Click here to go to the first story...";
} else {
echo "Click here to go to the next story...";
}
} else {
echo "All done!";
}
//echo " $subjectId $day $stage $mathStr |$math| ".strcmp($mathStr,"math");
}else{
// create selector
?>
Reading Study Subject Selector