Solved WORKING WITH JAVASCRIPT DOCUMENTS
-
Good day, please I need your help on qt c++. Am working on a quiz program, I have designed the interface, but the question bank is a JavaScript document. I don't know if there's a way for me to query it from c++ and get the questions.
Thanks in anticipation -
@gblessed Do you mean JSON? If so take a look at https://doc.qt.io/qt-5/json.html
-
@gblessed
Or an XML ?
Examples : https://doc.qt.io/qt-5/examples-xml.html -
Thanks alot,both replies were helpful
-
Hi
So was it json or XML doc ? -
@mrjj hi, am still confused on what it actually is, here is the file
h ttps://www.datafilehost.com/d/ddbe4531I don't know how to work with it
-
@gblessed It's JavaScript script, so neither JSON nor XML.
What exactly do you want to do with it? -
@jsulm hi, if you open it with notepad you will notice that there are some multiple choice questions , so I want to query the questions and answers randomly to form a quiz program
-
@gblessed Then you will need to parse that manually using Regular Expressions (https://doc.qt.io/qt-5/qregularexpression.html)
-
-
@gblessed Yes, you read the content of the file into a QString variable and then use regular expressions to extract the information you need.
-
@jsulm alright thanks a lot for your assistance