removed option for ai to give media (in generate q uing ai, in create in kahhot clone), as it may give a wrong link as its not up to date and cant get the internet

This commit is contained in:
RezHackXYZ 2025-06-19 00:58:46 +05:30
parent d448517fb3
commit 389a7de0b5
No known key found for this signature in database
GPG key ID: C4C90E569C9669E2

View file

@ -14,14 +14,11 @@ Generate a list of quiz questions with possible answers and the correct answer i
Each question must have:
- A "questionText" (what the question is about)
- A "timeLimit" (in seconds, any of these: null (no time limit), 5, 10, 15, 30, 60, 120, 300)
- An "type" (only set to "SingleAnswer" for now)
- An "options" (an array of options with at least 2 and at most 8 options)
- A "CorrectOption" (an object with a key "SingleAnswer" and a value that is the index of the correct answer)
- A "hasMedia" (boolean indicating if the question has media) only set to true if you are sure the URL is valid and related to the question.
- A "mediaURL" (a URL to the media, can be null if no media is present) only add this if you are sure the URL is valid and related to the question.
Ensure the questions are diverse.
Example format:
[{"questionText":"What should you do when you're free?","timeLimit":15,"type":"SingleAnswer","options":["Do something in real life!","Play video games","Code!","Touch grass!"],"CorrectOption":{"SingleAnswer":2},"hasMedia":false,"mediaURL":null},{"questionText":"Is RezHackXYZ the best programmer in the world?","timeLimit":5,"type":"SingleAnswer","options":["Yes :)","No :("],"CorrectOption":{"SingleAnswer":0},"hasMedia":true,"mediaURL":"https://github.com/RezHackXYZ.png"},{"questionText":"Best place in the world?","timeLimit":5,"type":"SingleAnswer","options":["Google","Microsoft","Apple","Samsung","Hack Club!! :D","Amazon","Facebook","Twitter"],"CorrectOption":{"SingleAnswer":4},"hasMedia":false,"mediaURL":null}]
[{"questionText":"What should you do when you're free?","timeLimit":15,"options":["Do something in real life!","Play video games","Code!","Touch grass!"],"CorrectOption":2},{"questionText":"Is RezHackXYZ the best programmer in the world?","timeLimit":5,"options":["Yes :)","No :("],"CorrectOption":0},{"questionText":"Best place in the world?","timeLimit":5,"options":["Google","Microsoft","Apple","Samsung","Hack Club!! :D","Amazon","Facebook","Twitter"],"CorrectOption":4}]
JUST PROVIDE THE JSON AND NOTHING ELSE.
@ -49,7 +46,17 @@ The User wants [number of questions] questions.
const data = await response.json();
try {
QuestionsData.v = JSON.parse(data.choices[0].message.content);
QuestionsData.v = JSON.parse(data.choices[0].message.content).map((q) => ({
questionText: q.questionText,
timeLimit: q.timeLimit,
type: "SingleAnswer",
options: q.options,
CorrectOption: {SingleAnswer: q.CorrectOption},
hasMedia: false,
mediaURL: null,
}));
} catch (error) {
if (ParsingTry <= 5) {
ParsingTry++;