Click here to Skip to main content
16,021,293 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am making an online exam practice website in which user can give test and practice exams . While practicing exam user can view correct answer and it's explanation. It is easy to store mathematics questions in database but how to store mathematical expressions like fraction numbers, variable containing powers, differentiation, Integration, etc.

What I have tried:

here is the table of questions :-

CREATE TABLE [dbo].[Questions] (
[QuestionId] INT IDENTITY (1, 1) NOT NULL,
[SectionId] INT NOT NULL,
[PassageId] INT NULL,
[Question] VARCHAR (MAX) NOT NULL,
[Option1] VARCHAR (MAX) NOT NULL,
[Option2] VARCHAR (MAX) NOT NULL,
[Option3] VARCHAR (MAX) NOT NULL,
[Option4] VARCHAR (MAX) NOT NULL,
[CorrectAns] INT NOT NULL,
[Description] VARCHAR (MAX) NULL,
PRIMARY KEY CLUSTERED ([QuestionId] ASC),
CONSTRAINT [FK_Questions_Section] FOREIGN KEY ([SectionId]) REFERENCES [dbo].[Section] ([SectionId])
);
Posted
Updated 2-Apr-16 4:13am

1 solution

Save it as Rich Text - and use a display control that can display RTF data - that way, you can set up the text you need to any format and display it the same way when you pull it back from the DB.
Alternatively, you could use LaTeX: Show inline math as if it were display math - TeX - LaTeX Stack Exchange[^]
You will have to look for web controls which can display your chosen data format, but Google will help you there.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900