22

I am trying to create a random question generator on perchance.org for practice in responding to french questions. I have a generator that selects questions from a list of questions (“outputa”) (https://perchance.org/4ewrtclbl5#edit).

For example, I have:

[outputa]

and defined the following:

title=Random Question Generator title2=Second Language Evaluation – Oral Language Assessment title3=French Level B & C title4=Question: title5=Des trucs et des astuces:

outputa //Decriver ou expliquer au present Où travaillez-vous? Où vous situez-vous au travail? Expliquez et précisez le rôle de votre ministère. Expliquez et précisez le rôle de votre direction. …

//Raconter au passé Comment votre travaille a affecté par la pandemie ? Durant votre carrière, qu’est-ce qui a été le plus satisfaisant jusqu’ici? …

This works well right now, but I would like to improve the generator to be more helpful. Essentially, within the list of questions, there are a number of different styles of questions (“Decriver ou expliquer au present”, “Raconter au passé”, etc.). Each style of question has a strategy to follow when responding to it, so I would like to add some standard text under the question to provide some tips for responding based on the type of question.

I was thinking this could be done by first randomly select a style of question from one list, and then based on the style of question selected, I could select a random question of that style, and then print the random question along with the standard text. Is there a straightforward way to do this?

Thank you in advance!!

top 4 comments
sorted by: hot top controversial new old
[-] GroteStreet@aussie.zone 9 points 1 year ago

You may get a better answer if you follow the suggestion in the comment at the bottom of your source:

// - Ask our friendly community members if you need help: lemmy.world/c/perchance

The syntax is specific to Perchance, a website that 99% of the general public have never heard of.

[-] BethyA@lemmy.world 2 points 1 year ago

Oh thanks! I will repost this there.

[-] TylerDurdenJunior@lemmy.ml 3 points 1 year ago

Sounds like you are about to write a relational database.

The dropdown could help you with selecting questions in related to the style of questions.

[-] hi_its_me@lemmy.world 1 points 1 year ago

From our friend ChatGPT:

Certainly! You're on the right track with your idea of selecting a style first and then selecting a random question based on that style.

Here's how you can structure this on Perchance:

  1. Define the question styles and tips:
style
Decriver ou expliquer au present
Raconter au passé
[... more styles ...]

tipsForStyle
[style:Decriver ou expliquer au present] 
Tip for this style: [Tip for Decriver ou expliquer au present]
[style:Raconter au passé]
Tip for this style: [Tip for Raconter au passé]
[... more tips for each style ...]
  1. Define questions for each style:
questionsForStyle
[style:Decriver ou expliquer au present]
Où travaillez-vous?
Où vous situez-vous au travail?
[... more questions for this style ...]

[style:Raconter au passé]
Comment votre travaille a affecté par la pandemie ?
Durant votre carrière, qu’est-ce qui a été le plus satisfaisant jusqu’ici?
[... more questions for this style ...]
  1. Structure the main generator output:
output
<h1>[title]</h1>
<h2>[title2]</h2>
<h3>[title3]</h3>

<h4>[title4]</h4>


[style]


[questionsForStyle]


[tipsForStyle]
  1. Use this in the HTML area:
<div>
    **[output]**
</div>

With this structure:

  1. A style will be chosen randomly.
  2. A question will be chosen from that style.
  3. The tip for the selected style will be shown below the question.

You can further modify and expand upon this structure to customize the output to your liking!

this post was submitted on 25 Oct 2023
22 points (82.4% liked)

No Stupid Questions

35822 readers
1067 users here now

No such thing. Ask away!

!nostupidquestions is a community dedicated to being helpful and answering each others' questions on various topics.

The rules for posting and commenting, besides the rules defined here for lemmy.world, are as follows:

Rules (interactive)


Rule 1- All posts must be legitimate questions. All post titles must include a question.

All posts must be legitimate questions, and all post titles must include a question. Questions that are joke or trolling questions, memes, song lyrics as title, etc. are not allowed here. See Rule 6 for all exceptions.



Rule 2- Your question subject cannot be illegal or NSFW material.

Your question subject cannot be illegal or NSFW material. You will be warned first, banned second.



Rule 3- Do not seek mental, medical and professional help here.

Do not seek mental, medical and professional help here. Breaking this rule will not get you or your post removed, but it will put you at risk, and possibly in danger.



Rule 4- No self promotion or upvote-farming of any kind.

That's it.



Rule 5- No baiting or sealioning or promoting an agenda.

Questions which, instead of being of an innocuous nature, are specifically intended (based on reports and in the opinion of our crack moderation team) to bait users into ideological wars on charged political topics will be removed and the authors warned - or banned - depending on severity.



Rule 6- Regarding META posts and joke questions.

Provided it is about the community itself, you may post non-question posts using the [META] tag on your post title.

On fridays, you are allowed to post meme and troll questions, on the condition that it's in text format only, and conforms with our other rules. These posts MUST include the [NSQ Friday] tag in their title.

If you post a serious question on friday and are looking only for legitimate answers, then please include the [Serious] tag on your post. Irrelevant replies will then be removed by moderators.



Rule 7- You can't intentionally annoy, mock, or harass other members.

If you intentionally annoy, mock, harass, or discriminate against any individual member, you will be removed.

Likewise, if you are a member, sympathiser or a resemblant of a movement that is known to largely hate, mock, discriminate against, and/or want to take lives of a group of people, and you were provably vocal about your hate, then you will be banned on sight.



Rule 8- All comments should try to stay relevant to their parent content.



Rule 9- Reposts from other platforms are not allowed.

Let everyone have their own content.



Rule 10- Majority of bots aren't allowed to participate here.



Credits

Our breathtaking icon was bestowed upon us by @Cevilia!

The greatest banner of all time: by @TheOneWithTheHair!

founded 1 year ago
MODERATORS