darshan85
Forum Replies Created
-
Forum: Plugins
In reply to: [HD Quiz] How to store quiz result in databaseI have modified template.php of HDQuiz. I have added following lines at the end of file:
$score=$_GET[‘currentScore’];
$quizID=$hdq_id;
hdq_on_quiz_completion($score,$quizID);
I have modified
function hdq_on_quiz_completion($score,$quizID)
{
global $wpdb;
//$tablename = ‘wp_result’;
$current_user = get_current_user_id();
$success=$wpdb->insert( “wp_result”, array(
‘username’ => $current_user,
‘quizid’ => $quizID,
‘score’ => $score));
print_r($wpdb->last_query);
if($success) {
echo ‘ Inserted successfully’;
} else {
echo ‘not’;
}
}
but now problem is i am not getting score. If you have used $_GET[‘currentscore’] for some purpose why I am not able to use it. Pls do provide any solution so I can get final score over here. pls…thanking you in anticipation.Forum: Plugins
In reply to: [HD Quiz] How to store quiz result in databaseOk. Thanks a lot for your kind support. Will wait for you new version of HD Quiz.
Forum: Plugins
In reply to: [HD Quiz] How to store quiz result in databaseSorry to disturb you again. Can you say me where and how to call hdq_on_quiz_completion(). How to pass quizData to it. I know it may sound bit silly but I need it quickly. Actually tomorrow and day after tomorrow we have holiday and Monday we need to go through online test. Pls help me out. Thanking you in anticipation.
Forum: Plugins
In reply to: [HD Quiz] How to store quiz result in databaseThanks For Quick Help. But yet I have some doubts.
1)Where is quiz loading code? I searched but was unable to find.
2)update_user_meta($current_user, “hdq_custom_user_meta”, $hdq_custom_user_meta) which table will be updated by this. If it custom table what should be the structure of that table?
Help is appreciated.Forum: Plugins
In reply to: [HD Quiz] How to store quiz result in databaseOr just say me which variable you have used to count right answers?