Click here to Skip to main content
15,891,828 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I am building a demo project on Learning Management System. I have a table to store all questions,those questions will be used while creating tests. Now I want to build a template for question paper. e.g
--------------- Template to be stored in database -------------
(m=marks,n=no of questions)

Name of the Template = Template1

1. Five short questions (m=1xn=5)   Total = 5
2. Three descriptive type questions (m=2xn=3) Total = 6
.
.
---------------- End Template----------------------------------


Now in future when user select that template i.e Template1 then 1. five questions will be fetched from table and marks will be fetched from template. 2. Three descriptive questions will be fetched and marks will be fetched from template.

I am building this project using asp.net Web forms. Help needed to create this kind of scenario.

What I have tried:

I don't have any clue , how to design table for this scenario?
Posted
Updated 25-Jun-17 23:56pm
Comments
Thomas Nielsen - getCore 26-Jun-17 5:55am    
You REALLY need to have a clue about designing relational database systems. I'd very much recommend you to look at some material on this subject you will have to be pretty adept in this if you're planning on a future in Software development.
https://www.pluralsight.com/courses/relational-database-design
https://channel9.msdn.com/Blogs/ASP-NET-Site-Videos/designing-relational-database-tables

1 solution

You can have a column of nvarchar(max) datatype and you can store the HTML form of the template.
These template will have placeholders in it, which will be replaced with actual value either in code or in stored procedure.

template example
{firstName}


later on in code

tmeplate.Replace("{firstName}","your value");
 
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