Hi folks,
I bought Quiz Power app from Codecanyon few months before , i used eclipse as my ide to make this app work ,
The problem is when this app fetch data from backend (using php & mysql) , it fetches wrong question from wrong category (level) ,
for example :
- Science Category is getting questions from General knowledge ...
here is the service code from strings.xml :
And here is the code from getquestionrightanswerbylevelid.php :
can you guys help me make the right category work ?
I bought Quiz Power app from Codecanyon few months before , i used eclipse as my ide to make this app work ,
The problem is when this app fetch data from backend (using php & mysql) , it fetches wrong question from wrong category (level) ,
for example :
- Science Category is getting questions from General knowledge ...
here is the service code from strings.xml :
Code:
<!-- This will true if you testing app when you publish on play store make if fasle -->
<bool name="istestmode">true</bool>
<!-- If we set question bank from local Assets folder SQlite file then it will be false if we need question bank from
web that is given PHP admin panel then set here true -->
<bool name="isQuestionFormWeb">true</bool>
<!-- set you service URL plz don't foget otherwise it will be get our question database. For Four Option Question-->
<string name="question_bank_url">http://www.mywebsite.com/quizpower/getquestionwithoptionbylevelid.php?levelid=</string>
<!-- set you service URL plz don't foget otherwise it will be get our question database. FOR ONE option Questions-->
<string name="get_question_right_answare">http://mywebsite.com/getquestionrightanswerbylevelid.php?levelid=</string>
<!-- <string name="get_number_of_level">http://mywebsite.com/getnumberoflevel.php</string> -->
<string name="get_level_info">http://mywebsite.com/getleveliinfo.php</string>
And here is the code from getquestionrightanswerbylevelid.php :
PHP:
<?php
header('Content-type: application/json');
require_once('include/config.php');
$res = array();
if($_GET['levelid'] != ''){
$check_sql = mysql_query("select * from quiz_bank where quiz_level = '" . $_GET['levelid'] . "'");
if(mysql_num_rows($check_sql) > 0)
{
while($row = mysql_fetch_array($check_sql)){
$ans="";
if($row['RightAns']=='A')
$ans=$row['OptionA'];
elseif($row['RightAns']=='B')
$ans=$row['OptionB'];
elseif($row['RightAns']=='C')
$ans=$row['OptionC'];
else
$ans=$row['OptionD'];
$res[] = array('question' => $row['Question'],
'rightans' =>$ans
);
}
}
else{
$sql = mysql_query("select * from quiz_bank ORDER BY RAND() LIMIT 10");
while($row = mysql_fetch_array($sql)){
$ans="";
if($row['RightAns']=='A')
$ans=$row['OptionA'];
elseif($row['RightAns']=='B')
$ans=$row['OptionB'];
elseif($row['RightAns']=='C')
$ans=$row['OptionC'];
else
$ans=$row['OptionD'];
$res[] = array('question' => $row['Question'],
'rightans' =>$ans
);
}
}
}
echo json_encode($res);
?>
can you guys help me make the right category work ?