Quantcast
Channel: Topic Tag: MySQL | WordPress.org
Viewing all articles
Browse latest Browse all 5527

lhuria941 on "[Plugin: Wp-Pro-Quiz] Custom Insert Answer Data for Import Excel feature"

$
0
0

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

https://wordpress.org/plugins/wp-pro-quiz/


Viewing all articles
Browse latest Browse all 5527

Trending Articles