i have a problem am trying to setup a quiz using mtouch quiz based of quizzin (WordPress plugins), i need to select one correct answer and 3 random answers from database.<br>
ID--question_id------answer-----hint-----correct------sort_order<br>
1--------1---------------test1---------------------1----------------1<br>
2--------1---------------test 1---------------------0----------------2<br>
3--------1---------------test2---------------------0----------------3<br>
4--------1---------------test3---------------------0----------------4<br>
5--------2---------------test5---------------------1----------------1
the above is example of the sql structure, what i want to do is get rid of the incorrect answers and use the correct answers from other question and make them the wrong answers i.e for question 1
<a href="http://wordpress.org/extend/plugins/mtouch-quiz/" rel="nofollow">http://wordpress.org/extend/plugins/mtouch-quiz/</a>
i just need to now how to edit the show_quiz.php file to do this.
if ( $random_answers == 1 ) {
$dans = $wpdb->get_results("SELECT ID,answer,correct,hint FROM {$wpdb->prefix}mtouchquiz_answer WHERE question_id={$ques->ID} ORDER BY RAND()"); // This will randomize the question answer order
} else {
$dans = $wpdb->get_results("SELECT ID,answer,correct,hint FROM {$wpdb->prefix}mtouchquiz_answer WHERE question_id={$ques->ID} ORDER BY sort_order");
}
can anyone help. thanks
ID--question_id------answer-----hint-----correct------sort_order<br>
1--------1---------------test1---------------------1----------------1<br>
2--------1---------------test 1---------------------0----------------2<br>
3--------1---------------test2---------------------0----------------3<br>
4--------1---------------test3---------------------0----------------4<br>
5--------2---------------test5---------------------1----------------1
the above is example of the sql structure, what i want to do is get rid of the incorrect answers and use the correct answers from other question and make them the wrong answers i.e for question 1
<a href="http://wordpress.org/extend/plugins/mtouch-quiz/" rel="nofollow">http://wordpress.org/extend/plugins/mtouch-quiz/</a>
i just need to now how to edit the show_quiz.php file to do this.
if ( $random_answers == 1 ) {
$dans = $wpdb->get_results("SELECT ID,answer,correct,hint FROM {$wpdb->prefix}mtouchquiz_answer WHERE question_id={$ques->ID} ORDER BY RAND()"); // This will randomize the question answer order
} else {
$dans = $wpdb->get_results("SELECT ID,answer,correct,hint FROM {$wpdb->prefix}mtouchquiz_answer WHERE question_id={$ques->ID} ORDER BY sort_order");
}
can anyone help. thanks