• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

RandRange

Guest
Apr 10, 2007 Apr 10, 2007

Copy link to clipboard

Copied

can you capture a random range question from a database and save it. Example I am querying my database for all the question which is 3, than I use the randrange to randomly display 1 question on the screen. Can I hold that random question somehow so when a user answer the question and it's wrong I can send them back to the same page with the same question. not a new question from the database.
TOPICS
Advanced techniques

Views

405

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Apr 11, 2007 Apr 11, 2007

Copy link to clipboard

Copied

Use a hidden field to hold the random question when you return to ask the question again. On the question page, use <CFPARAM NAME="question" DEFAULT=""> at the top of the page. Then test to see if question is null. If so, do the RandRange( ). If not, ask the same question again from the hidden field.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Apr 11, 2007 Apr 11, 2007

Copy link to clipboard

Copied

if I capture the question in a hidden field, and the answer the user provides is wrong what will stop it from displaying another question if I send them back to the questions page? I am very new at this.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Apr 12, 2007 Apr 12, 2007

Copy link to clipboard

Copied

The code below should give you an idea how to proceed. It returns the question in the URL rather than a hidden field.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Apr 24, 2007 Apr 24, 2007

Copy link to clipboard

Copied

LATEST
here is my query, how would I set this up to work with your script
select q.question, I.*
from swa.IdentityQuestions q, swa.IdentityAnswers I
where q.IdentityQuestionId = I.IdentityQuestionId
and userId = '1000'

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation