Travis6876874
Posts: 0
Joined: Sat May 17, 2014 1:27 am

Putting Answers in the Database Part 2

[{"answer": "Answer one", "correct": true}, {"answer": "Answer two", "correct": false}, {"answer": "Answer Tree", "correct": false}]
I got this out of a representative and more, but I have a couple questions from this I need your help with please.
Im putting question in a database, as column 1 String, and answers in Column 2 as Array, I need to know if the "TREE" was a misspell for "Three" ABOVE IN WHAT I PASTED!
Further more, im gonna shuffle my questions and need to know if my answers go the "Tree" field, or if I should put them all in the 2nd Field, or between all 3?

Travis6876874
Posts: 0
Joined: Sat May 17, 2014 1:27 am

Putting Answers in the Database Part 2

Many questions, so I have to get this right!

Travis6876874
Posts: 0
Joined: Sat May 17, 2014 1:27 am

Putting Answers in the Database Part 2

Is it answer 3, or is it answer tree(where correct answers go) ??? please explain

Travis6876874
Posts: 0
Joined: Sat May 17, 2014 1:27 am

Putting Answers in the Database Part 2

I dont even know which field I put my answer in, the only correct one answer to the question. "Correct" or "Answer one" etc..?

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Putting Answers in the Database Part 2

Hi Travis.

I guess you don't need to manage "text" answers. And do not need to place counter inside this answer text(for example two, three etc.).

So your answer array should be like:

[{"answer": "House", "correct": true}, {"answer": "Building", "correct": false}, {"answer": "Car", "correct": false}]

In this case only way to get original order is just to gen index of array. And you do not need to place your certain answers at certain positions.

What about shuffling:

It's recomended to do shuffling on the client part.

For this case you should use "generic security context" - client proxy between server and listener.

Please read here Alena's answer about how to use "generic security context". https://getsatisfaction.com/apperyio/...

Regards.

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Putting Answers in the Database Part 2

Also what about structure of this array. See following collapsible view for this array:

precode

[

//answer
{
"answer": "House", // answer that's shows to user.
"correct": true // this field mark corrent or not answer. true - correct
},

//answer
{
"answer": "Building",
"correct": false
},

//answer
{
"answer": "Car",
"correct": false
}

//Here you can add one more answer if you need.

]

/code/pre

So you can add and delete answers in this array if you need. Also you can mark more then one correct answer.

Regards.

Travis6876874
Posts: 0
Joined: Sat May 17, 2014 1:27 am

Putting Answers in the Database Part 2

Ill be asking sets of questions that are timed and may need to be managed? So what changes in your answer to my question??

Travis6876874
Posts: 0
Joined: Sat May 17, 2014 1:27 am

Putting Answers in the Database Part 2

Im lacking computer skills , learning as I go. THANK YOU

Travis6876874
Posts: 0
Joined: Sat May 17, 2014 1:27 am

Putting Answers in the Database Part 2

Thanks!

Travis6876874
Posts: 0
Joined: Sat May 17, 2014 1:27 am

Putting Answers in the Database Part 2

Thank you for that

Return to “Issues”