I am working on an online medical exam project, which has the Admin panel/webpage where the Admin can add/set questions and answers to them, and the User panel where the user logs in to the application for him/her to take the test. For the Chemistry questions, a few of them have complex formulas which involve subscripts and superscripts in them and also a few special characters. I have to develop an interface where the Admin can enter these questions consisting formulas into the text field and it gets stored in the mysql database and the same would be rendered and displayed to the User when taking the test.
How can I make the text field accept special characters or in other words how can the Admin enter the formulas and then store them in the DB and display the formulas in the test. Please help, I have looked on the net but was unable to find a solution for it. Also, I am using the codeigniter framework for this application.
Below is the code am using in my controller :
$inputdata['question'] = str_replace("&","&",htmlentities($this-
>input->post('question')));
The main problem is to have the Admin enter special characters in text field and save that to the Database and then display it and also how can I make Admin to add images to the question? Am sorry if the question was too long. (Below Image shows the way it needs to b displayed] Please help me with this, Thanks.
You can use the images of that formula instead of text. For storing image,you can create a field where you'll store the path to the image.