diff options
-rwxr-xr-x | tbc_external_review.module | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/tbc_external_review.module b/tbc_external_review.module index 9bceeec..3666eac 100755 --- a/tbc_external_review.module +++ b/tbc_external_review.module @@ -272,7 +272,10 @@ global $user; $form = array(); /* populating the form with previous entry details if exists */ - $query = "select * from {external_review_profile} where uid = %d"; + $query = " + SELECT * FROM {external_review_profile} + WHERE uid = %d + "; $result = db_query($query, $user->uid); $row = db_fetch_array($result); @@ -414,7 +417,10 @@ function tbc_external_review_view_reviewers_all() { $page_content = ""; - $query = "select * from {external_review_profile}"; + $query = " + SELECT * FROM {external_review_profile} + WHERE active = 1 + "; $result = db_query($query); $page_content .= "<ul>"; @@ -1750,6 +1756,7 @@ $minutes_remaining = 25; $seconds_remaining = 0; + /* checking if a valid question */ if ($question_id > 5 || $question_id < 0) { drupal_set_message("Wrong question number.", "error"); drupal_goto("tbc_external_review/eligibility_test/question/1"); @@ -1823,6 +1830,19 @@ $result = db_query($query); drupal_set_message("Eligibility Test completed successfully. We will get back to you soon.", "status"); } else { + /* checking if the user has filled the profile form */ + $query = " + SELECT uid FROM external_review_profile + WHERE uid = %d + "; + $result = db_query($query, $user->uid); + $num_rows = mysql_num_rows($result); + if(!$num_rows) { + drupal_set_message("Please fill the profile form before you can attend the test.", "error"); + drupal_goto("tbc_external_review/profile"); + } + + /* showing the test details before starting the test */ $page_content .= "<p>You are about to give a test based on which you will be selected as a reviewer for the Scilab Textbook Companions.</p>"; $page_content .= "<ul>"; $page_content .= "<li>The test consists of 5 code review questions that are mandatory.</li>"; |