Hello
From google chrome console.
I got this error below.
localhost/:244 Uncaught SyntaxError: Invalid or unexpected token
It says the error is on line 244 ?
Below are the codes where the error resides.
<?php
$content = $this->session->userdata('content_data');
$topic = $this->session->userdata('topic');
$qa_data = $this->session->userdata('qa_data');
$end = '';
$end_of_array = $this->session->userdata('condition');
$init = $this->session->userdata('init');
$total_array = $this->session->userdata('total_array');
$result_msg = $this->session->userdata('result_msg');
if($end_of_array === 'yes')
{
$end = '/end/';
}
#$init = $this->session->userdata('init');
#showArray($qa_data);
#echo 'Question: '. $qa_data[0]->question;
#echo '<br>Answer: '. $qa_data[0]->answer;
#echo '<br>Reference: '. $qa_data[0]->info;
#echo '<br> Minutes: '. $qa_data[0]->time;
?>
<div id="landingqa">
<br>
<center>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- codesmastery-top -->
<ins class="adsbygoogle"
style="display:inline-block;width:970px;height:90px"
data-ad-client="ca-pub-6956881401283026"
data-ad-slot="6762698841"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</center>
<center>
<h1><?php echo $content['subject']; echo ' ver. '. $content['version']; ?> Codes Mastery Test </h1>
<?php echo '(<b>'.$topic. '</b>)'; ?><br><br>
<?php
if($init !== 'end')
{
echo 'Try to answer the question below without looking at the documentation or cheating.';
}
?>
</center>
</div>
<div align='center'>
<div>
<?php
//echo form_open('front/save_lang');
#echo form_open('');
?>
<table width="100%" border="0">
<tr>
<td>
<?php
$str = htmlspecialchars_decode($qa_data[0]->question);
$data_question = array(
'name' => 'question',
'id' => 'question',
'value' => $str,
'cols' => '50',
'rows' => '10',
'wrap' => 'off',
'style' => 'width:95%'
);
if($init !== 'end') {
echo form_textarea($data_question);
}
?>
</td>
</tr>
</table>
<center>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- codesmastery-middle -->
<ins class="adsbygoogle"
style="display:inline-block;width:970px;height:90px"
data-ad-client="ca-pub-6956881401283026"
data-ad-slot="8239432049"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</center>
<table width="100%" border="0">
<tr>
<td>
<?php
$data_coder_answer = array(
'name' => 'coder-answer',
'id' => 'coder-answer',
'placeholder' => 'Write the codes of your answer here.',
'cols' => '50',
'rows' => '18',
'wrap' => 'off',
'style' => 'width:95%'
);
if($init !== 'end') {
echo form_textarea($data_coder_answer);
}
?>
</td>
<td>
<div id="right-answer">
<?php
#$str = htmlspecialchars_decode($qa_data[0]->answer);
$str = '';
$data_right_answer = array(
'name' => '',
'id' => 'right-answer2',
'value' => '',
'cols' => '50',
'rows' => '18',
'wrap' => 'off',
'style' => 'width:95%'
);
if($init !== 'end') {
echo form_textarea($data_right_answer);
}
?>
</div>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td align="left" colspan="3">
<br>
<?php
$data_done = array(
'name' => 'done',
'id' => 'done',
'value' => 'Done and compare',
);
if($init === 'end')
{
?>
<br><br>
<center><h2><?php echo $result_msg; ?></h2></center>
<?php
}
else
{
echo '<center>Press this button below, when you are done answering the question.</center>';
echo '<center>';
echo form_submit($data_done);
#echo form_close();
echo '</center>';
}
?>
</td>
</tr>
</table>
<br>
<center>
<?php
if($init !== 'end')
{
echo 'If there is missing character(s) in your codes then your answer is wrong.<br>
Pressing the buttons either Yes or No below, will proceed you to the next question.<br>
Is your answer corrrect?';
$data_yes = array(
'name' => 'yes',
'id' => 'yes',
'value' => 'Yes',
);
echo form_open('language/show_qa/'. $topic . $end);
echo form_submit($data_yes);
echo '<input type="submit" name="no" id="no" value="No" />';
echo form_close();
}
?>
</center>
<br>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- codesmastery-bottom -->
<ins class="adsbygoogle"
style="display:inline-block;width:970px;height:90px"
data-ad-client="ca-pub-6956881401283026"
data-ad-slot="9716165245"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<br>
<table width="100%" border="0">
<tr>
<td>
<div id="reference">
<?php
$data_reference = array(
'name' => 'reference',
'id' => 'reference',
'value' => $qa_data[0]->info,
'cols' => '50',
'rows' => '6',
'wrap' => 'off',
'style' => 'width:95%'
);
echo form_textarea($data_reference);
?>
</div>
</td>
</tr>
</table>
</div>
</div>
<br><br>
<div id="wrapper">
<div align='center'>
<div>
<a href="<?php echo base_url() . 'language/suggestion/'; ?>" target="_blank"><b>Leave Feedback</b></a>
</div>
</div>
</div>
<!-- hidden inline form -->
<div id="inline">
<form id="contact" name="contact" action="#" method="post">
</form>
</div>
I tried finding the bug but failed many times…
Help me find the bug.
Thanks in advance.