Page 1 of 3

Putting Answers in the Database Part 2

Posted: Fri May 30, 2014 2:05 am
by Travis6876874

[{"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?


Putting Answers in the Database Part 2

Posted: Fri May 30, 2014 2:07 am
by Travis6876874

Many questions, so I have to get this right!


Putting Answers in the Database Part 2

Posted: Fri May 30, 2014 2:12 am
by Travis6876874

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


Putting Answers in the Database Part 2

Posted: Fri May 30, 2014 2:22 am
by Travis6876874

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


Putting Answers in the Database Part 2

Posted: Fri May 30, 2014 3:54 am
by Yurii Orishchuk

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.


Putting Answers in the Database Part 2

Posted: Fri May 30, 2014 4:01 am
by Yurii Orishchuk

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.


Putting Answers in the Database Part 2

Posted: Fri May 30, 2014 4:20 am
by Travis6876874

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


Putting Answers in the Database Part 2

Posted: Fri May 30, 2014 4:22 am
by Travis6876874

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


Putting Answers in the Database Part 2

Posted: Fri May 30, 2014 4:40 am
by Travis6876874

Thanks!


Putting Answers in the Database Part 2

Posted: Fri May 30, 2014 4:42 am
by Travis6876874

Thank you for that