">
"; echo "Your total number of attempts: ".$num_attempt; //end test function comment_out($code) { $code = str_replace("\n", "\n; ", $code); return "; ".$code; } function echo_commented_code($code) { if ($code) { echo ";; --Everything below this line will be ignored.--\n\n"; echo ";; Original template provided for this exercise:\n\n"; echo comment_out($code); } } function show_original_code($row) { echo "\n
\n
\n"; echo "

Original Content Provided for This Exercise". "

\n"; $code = $row['stu_template']; // $code = str_replace("\n", "
", $code); echo '

'.$code."

\n"; } icmlog("", " in content_nyquist_from_test.php, requiring nyquist.tmpl.php,". " POST[answers] is |".$_POST['answers']."|\n.row is |".json_encode($row)."|\n". " stu_template is |".$row["stu_template"]."|\n"); // see if we can get the previous submission and print it: icmlog("", " get prev submission in content_nyquist_from_test.php\n". "evaluate_answers[row[question_id]] is |". json_encode($evaluate_answers[$row['question_id']])."|\n". "table ".TABLE_PREFIX." row ".json_encode($row)); /*$sql = "SELECT answer, date_taken FROM ".TABLE_PREFIX."tests_answers". " WHERE question_id=".$row['question_id']." AND". " member_id=".$row['member_id']; */ $sql = "SELECT answer FROM ".TABLE_PREFIX."tests_answers". " WHERE result_id=(". "SELECT result_id FROM ".TABLE_PREFIX."tests_results". " WHERE test_id=(SELECT test_id ". " FROM ".TABLE_PREFIX."tests_questions_assoc". " WHERE question_id=".$row['question_id'].") AND member_id=". $row['member_id']." AND status=1 ORDER BY date_taken DESC LIMIT 1)"; icmlog("", "QUERY: $sql"); $result = mysql_query($sql, $db); $previous_answer = mysql_fetch_assoc($result); if ($previous_answer) { $previous_answer = $previous_answer["answer"]; } icmlog("", " previous_answer is |$previous_answer|"); require(AT_INCLUDE_PATH.'../themes/default/test_questions/nyquist.tmpl.php'); if(isset($_POST['evaluate'])){ require(AT_INCLUDE_PATH.'../themes/default/test_questions/nyquist_evaluate.tmpl.php'); } if(isset($_POST['submit_from_test'])){ require(AT_INCLUDE_PATH.'../themes/default/test_questions/nyquist_content_result.php'); } ?>