Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter darshan85

    (@darshan85)

    I 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.

    Thread Starter darshan85

    (@darshan85)

    Ok. Thanks a lot for your kind support. Will wait for you new version of HD Quiz.

    Thread Starter darshan85

    (@darshan85)

    Sorry 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.

    Thread Starter darshan85

    (@darshan85)

    Thanks 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.

    Thread Starter darshan85

    (@darshan85)

    Or just say me which variable you have used to count right answers?

Viewing 5 replies - 1 through 5 (of 5 total)