Q&A System Testing & Demo

Test 1: File Structure

Q&A API Backend: qa_api.php EXISTS
Q&A Frontend Interface: qa_interface.js EXISTS
NLP Utilities (Optional): nlp_utils.php EXISTS
Q&A Data Directory: data/qa/ EXISTS
✅ All required files are in place!

Test 2: File Permissions

Q&A Directory: WRITABLE

Test 3: API Connectivity

Cannot connect to API. Check if qa_api.php exists.

Test 4: NLP Utilities Demo

Sample Text:
இந்தியாவின் தலைநகரம் புது டெல்லி ஆகும். இது மிகப்பெரிய நகரமாகும். The capital of India is New Delhi. It is a very large city.
NLP Analysis Results:
  • Word Count: 21
  • Tamil Words: 8
  • Detected Language: mixed
  • Sentiment: neutral
  • Readability Score: 93/100
Language Detection: mixed

Test 5: Configuration

Gemini API Key: CONFIGURED

Test 6: Sample API Calls

Here are sample API calls you can test with curl or Postman:

Get Q&A Statistics

Get overall statistics

Method: GET
URL: http://dove.ruralos.in//qa_api.php?action=getQAStats
Get Questions for Article

Get questions for specific article

Method: GET
URL: http://dove.ruralos.in//qa_api.php?action=getQuestions&article_id=YOUR_ARTICLE_ID
Generate Questions

Generate new questions

Method: POST
URL: http://dove.ruralos.in//qa_api.php?action=generateQuestions
Body (JSON):
{
    "article_id": "YOUR_ARTICLE_ID",
    "num_questions": 5,
    "difficulty": "mixed"
}

Test 7: Frontend Integration

To test the frontend:

  1. Go to your main application (index.php)
  2. Find a processed article (with AI rewritten content)
  3. Click the Q&A button
  4. Generate questions using the AI
  5. Try Quiz Mode to test interactive questions
Expected Behavior:
• Modal should open with Q&A interface
• Questions should be in both Tamil and English
• Quiz mode should work with scoring
• Questions should be saveable and reloadable

Test Summary

✅ System Ready!

Your Q&A system appears to be properly set up. You can now:

  1. Configure your Gemini API key in Settings
  2. Process some articles with AI rewriting
  3. Generate questions for those articles
  4. Test the quiz mode functionality

Quick Links

Documentation

For detailed documentation, refer to:

Q&A System Testing Script v1.0 | Powered by Gemini 2.0 Flash API