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

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


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:
34-year-old was saving to buy a house, then decided to focus on early retirement instead: 'I value my time more than home ownership'
Top 10 trending destinations for U.S. travelers in 2026: 'Americans are discovering their own backyard,' expert says
China suspends ban on exports of gallium, germanium, antimony to U.S.
Too early to bet against AI trade, State Street suggests 
Week in review: The Nasdaq's worst week since April, three trades, and earnings
FAA-mandated flight cancellations to worsen next week if shutdown continues
Defense spending isn't going away any time soon. This stock on our list has a pristine chart
29-year-old left his 6-figure tech job and opened a pizza bagel business—it brought in $20K in September
Senate passes bill to end government shutdown, sending it to House
Trump asks Supreme Court to hear appeal of E. Jean Carroll sexual abuse, defamation verdict