Assessment
Question

I am making a quiz app but not able to insert question with selected  answer in database .

A.oml

 Hello Prashant 

I took a look at your oml and these are my suggestions. 

Add a User Id to your UserQuiz entity to ensure that you know what user answered to the question and that users answered.

And a Unselected option to your answers Static Entity:


Next, create a Web block with your options: This will allow you to better manage your code.

Add this web block to your table on the "UserQuiz" screen.

Now let's look at your aggregate. 

Thanks to the web block you no longer have to worry about getting your answers ( the web block handles that data ) 

so you only need your users and questions. 

Now we have something like this. 

And lastly the Save button. 

You should modify your logic to accept a list of UserQuiz instead of only 1.


I will attach an oml with the changes o you can take a look. 

Hope it helps! 

Paulo Rosário

AAltered.oml

Thanks. 

mvp_badge
MVP

Hi Prashant,

What do you mean by "not able to insert"? Do you get an error? If so, what error?

 Hello Prashant 

I took a look at your oml and these are my suggestions. 

Add a User Id to your UserQuiz entity to ensure that you know what user answered to the question and that users answered.

And a Unselected option to your answers Static Entity:


Next, create a Web block with your options: This will allow you to better manage your code.

Add this web block to your table on the "UserQuiz" screen.

Now let's look at your aggregate. 

Thanks to the web block you no longer have to worry about getting your answers ( the web block handles that data ) 

so you only need your users and questions. 

Now we have something like this. 

And lastly the Save button. 

You should modify your logic to accept a list of UserQuiz instead of only 1.


I will attach an oml with the changes o you can take a look. 

Hope it helps! 

Paulo Rosário

AAltered.oml

Thanks. 

Hello @Prashant Bais 

while selecting the aggregate you had done the mistake instead of GetuserQuiz u have choosen GetuserQuizByid for save details 

Regards

Priyanka

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.