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

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


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:
Bitcoin and ether end 2025 with losses, but industry optimism on the horizon: CNBC Crypto World
DOJ has 5.2 million pages of Epstein files left to review: Reports
Gold, silver prices fall after CME raises precious metals margins — again
Khanna calls for nationwide fraud investigation after wealth tax proposal caused firestorm
U.S. grants TSMC annual licence to import U.S. chipmaking tools into China
We asked a humanoid robot if there is an AI bubble. Here's what it said
Warren Buffett is stepping down as CEO after 60 years. For a successful career, 'don't worry' about your salary early on, he says
New Year's resolutions rarely work, neuroscientist says: Here's a smarter way to build new habits
Dozens feared dead after fire rips through Swiss ski resort bar, police say
Bernie Sanders and Ron DeSantis speak out against data center boom. It's a bad sign for AI industry