For real you aren’t just getting us to do your homework? This is a very common question in Comp Sci Classes.
Just in case this is just logic in a mish mash of PHP, python, and java syntax J
$RandomNumberOne = RND(1,100000000000000) // we have lots of questions
Array($AnsweredQustions) = Query
While ( $RandomNumberOne iscontainedin $AnsweredQustions )
{
$RandomNumberOne++
}
Fetch_QuestionByID($RandomNumberOne)
///////////////
If you need it to be more random take the random number and pick a number half way between it and the max rather than just incrementing.
--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-appengine/-/SId0PjB1xtcJ.
To post to this group, send email to google-a...@googlegroups.com.
To unsubscribe from this group, send email to google-appengi...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en.
1 Query for all answered Items
Then calculate 5 to answer.
I don’t see any other way to do it. You can’t query for “Not” X and get randoms. You are going to have to pick 5 ids.
You should assign a key an increment I mean if you want to pick from a list. Each question needs an ID.
--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-appengine/-/ZQHxi2TuuZoJ.