Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Bob Weber

    (@robertjw)

    Please disregard. Quiz creator didn’t give each question the same score.

    Hi everyone,

    I am building a custom import feature for xls files.
    But i am stuck at a issue:

    In ‘wp_wp_pro_quiz_question; table:

    I am running a query as follows:

    As my no. of options will be dynamic.

    $str = 'a:4:{i:0;O:27:"WpProQuiz_Model_AnswerTypes":7:{s:8:"*_answer";s:8:"Question 4";s:6:"*_html";b:0;s:8:"*_points";i:1;s:9:"*_correct";b:0;s:12:"*_sortString";s:0:"";s:16:"*_sortStringHtml";b:0;s:8:"*_mapper";N;}i:1;O:27:"WpProQuiz_Model_AnswerTypes":7:{s:8:"*_answer";s:8:"Question 5";s:6:"*_html";b:0;s:8:"*_points";i:1;s:9:"*_correct";b:0;s:12:"*_sortString";s:0:"";s:16:"*_sortStringHtml";b:0;s:8:"*_mapper";N;}i:2;O:27:"WpProQuiz_Model_AnswerTypes":7:{s:8:"*_answer";s:8:"Question 6";s:6:"*_html";b:0;s:8:"*_points";i:1;s:9:"*_correct";b:1;s:12:"*_sortString";s:0:"";s:16:"*_sortStringHtml";b:0;s:8:"*_mapper";N;}i:3;O:27:"WpProQuiz_Model_AnswerTypes":7:{s:8:"*_answer";s:8:"Question 7";s:6:"*_html";b:0;s:8:"*_points";i:1;s:9:"*_correct";b:0;s:12:"*_sortString";s:0:"";s:16:"*_sortStringHtml";b:0;s:8:"*_mapper";N;}}';
    
    $sql = "INSERT INTO wp_wp_pro_quiz_question SET quiz_id='".$_POST['import']."', title = '".$value['1']."',
    			question='".$value['1']."', online='1', sort='1', points='1', answer_type='single', answer_data='".$str."',
    			matrix_sort_answer_criteria_width='20'";

    My query runs perfectly but the backend display no info for answers data.
    Question gets created.

    Please help what is wrong.

    Appreciate in advance.

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Scores are wrong’ is closed to new replies.