Answered: Is there a bulk import option for questions in the core functionality?

Post date: 2021-02-28 09:40:09
Views: 208


It is not really hard to do.

Basic steps:

  1. Parse your questions from CSV file, for example.
  2. Include these files in your script:
    • /qa-include/qa-base.php
    • qa-app-users.php
    • qa-app-posts.php
  3. Now you can use core function qa_post_create() to post questions.
Code example:
----------------
//Parse questions from your source and put data in array

//Include Q2A scripts:

require_once '/PATH/TO/qa-include/qa-base.php';
require_once QA_INCLUDE_DIR.'qa-app-users.php';
require_once QA_INCLUDE_DIR.'qa-app-posts.php';

//Publish questions:

qa_post_create($type, $parentid, $title, $content, $format, $categoryid, $tags, $userid);

----------------

You can find more info here - https://docs.question2answer.org/code/external/

Please click Here to read the full story.
 
Other Top and Latest Questions:
Fed still expects to cut rates once this year despite spiking oil prices
Amazon says U.S. Postal Service 'walked away at the eleventh hour' in negotiations
Thursday's big stock stories: What’s likely to move the market in the next trading session
Which credit card should you pay off first? 5 tips to help you decide
AI, crypto industries dump millions into Illinois primaries to mixed results
Dad is dying - how do I cope right now?
Odds of a Fed rate hike by June are now higher than the chances for a rate cut
Book: Mistborn: The Final Empire
Movie: War Machine
Stargate SG-1: Entity Rewatch