Suggest best separator for Imported Questions, Options and Answers

4.46K viewsCore
0

Hi,

As I have told you, I have a separate database of questions, from which I am importing contents to AnsPress.

My Question-Database has following relevant columns –

	Question (Text)

	Option1 (Text)

	Option2 (Text)

	Option3 (Text)

	Option4 (Text)

	isOption1Correct (0 or 1)

	isOption2Correct (0 or 1)

	isOption3Correct (0 or 1)

	isOption4Correct (0 or 1)

At present (in my localhost), I am storing all of the above info into “AnsPress Question Content”, and these are separated by using “|||” as separator, in the following manner –

Question|||Option1|||Option2|||Option3|||Option4|||0000

…and then while viewing the Question in Anspress, I am exploding the whole content with the mentioned separator, and then assigning relevant divs on client-side (by overriding your default theme).

But, before going live, I wanted to finalize, what should I use as a separator?

I am using separator, in place of normal method like one would suggest –

Question
<br>A. Option1
<br>B. Option2
<br>C. Option3
<br>D. Option4
<br>Correct Answer

Because, in your pre-release version, I successfully modified AnsPress, with my custom onclick function, which was used just to check weather or not user answered this multiple choice question correctly (if its correct answer is already stored in database), with some other custom functions. Basically I modified AnsPress into additional Quiz portal. But, since AnsPress has evolved a lot since then, I will have to re-create my functions from scratch. and I hope I will do that eventually.

But, to get onclick even on options, I will have to assign Questions and Options to different divs and also read their respective isCorrect values (0 or 1).

One way to do this is by adding some separator like I am using “|||” so far.

Another way is I add relevant div info for each element into the database itself. This will relative increase my Db size, because in this case I will have to store each option’s iscorrect value as separate hidden input type.

One more way I could think of, was to use short-codes to my Question-Id, and display the question content directly from my original Question-Database. But, this will cause problems if user search Question from AnsPress. (So, I had to drop this Idea).

Lastly why I am sticking to my custom Question-Database – Its because it’s currently serving in my custom made Quiz program (GUI of which, is nowhere near your Themes), and all the fellow medicos come to my site, just for the quiz (acc. to google analytics, ~5,000 visits in past 30 days to the quizzes themselves). My users are Not interested in simple Q&A participation right now. To engage them here, I will have to customize Quiz in Anspress. It’s a very long and hard process for me, but so was understanding PHP and AnsPress code. So I think it’s worth trying.

My question to you is relatively simple, which approach/separator should I use to insert My multiple choice questions into AnsPress Database?

(Sorry for the long post, but I think it was necessary to make you understand my situation correctly)
Regards,
Dr. Atul

and btw, I can now confirm that AnsPress has an issue – “After editing a private question, it becomes public” 🙁

will fix it, added to current roadmap.

0

Your q2a custom fields need to be imported as WP post meta. let me try. when you get time contact me from FB chat.