This content covers WBBSE History AI Question Generator in detail.
WBBSE History AI Question Answer Generator (Class 5–10)
{
“@context”:”https://schema.org”,
“@type”:”WebApplication”,
“name”:”WBBSE History AI Question Answer Generator”,
“applicationCategory”:”EducationalApplication”,
“operatingSystem”:”All”,
“offers”:{“@type”:”Offer”,”price”:”0″,”priceCurrency”:”INR”}
}
body{font-family:Segoe UI;margin:0;background:#fbe9e7}
.container{max-width:1100px;margin:auto;padding:20px}
.card{background:#fff;padding:25px;border-radius:12px;box-shadow:0 5px 20px rgba(0,0,0,.1)}
select,input,button{width:100%;padding:10px;margin:8px 0;border-radius:6px;border:1px solid #ccc}
button{background:#bf360c;color:#fff;border:none;cursor:pointer;font-weight:600}
button:hover{background:#8d2b07}
.section{margin-top:20px;background:#f9f9f9;padding:15px;border-radius:8px;white-space:pre-wrap;border-left:5px solid #bf360c}
.progress-bar-bg{background:#ddd;border-radius:20px;overflow:hidden;height:20px;position:relative;margin-top:10px}
.progress-bar-fill{height:100%;width:0%;background:linear-gradient(90deg,#ff512f,#dd2476,#ff9966,#ff5e62);background-size:400% 400%;animation:move 3s ease infinite;transition:width .3s}
@keyframes move{0%{background-position:0% 50%}50%{background-position:100% 50%}100%{background-position:0% 50%}}
.progress-text{position:absolute;width:100%;text-align:center;font-size:13px;font-weight:600;color:#000;top:0;line-height:20px}
WBBSE History AI Question Answer Generator
English
Bengali
Hindi
Marathi
Gujarati
Tamil
Telugu
Kannada
Malayalam
Punjabi
Class 5
Class 6
Class 7
Class 8
Class 9
Class 10
Easy
Medium
Hard
30
50
80
100
0%
Question Paper
Answer Key
Model Solution
const API_KEY=”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″;
let savedPaper=””;
let progressInterval;
const syllabus={
“Class 5”:[“Prehistoric Age”,”Ancient Civilizations”,”Indus Valley Civilization”,”Early Kingdoms”,”Mauryan Empire”],
“Class 6”:[“Early Human Life”,”Vedic Age”,”Buddhism and Jainism”,”Mauryan and Gupta Period”,”South Indian Kingdoms”],
“Class 7”:[“Delhi Sultanate”,”Mughal Empire”,”Bhakti Movement”,”Advent of Europeans”,”Regional Kingdoms”],
“Class 8”:[“British Expansion in India”,”Revolt of 1857″,”Social Reform Movements”,”Indian National Movement”,”Freedom Struggle”],
“Class 9”:[“French Revolution”,”Industrial Revolution”,”World War I”,”Russian Revolution”,”Nazism and Hitler”],
“Class 10”:[“Nationalism in India”,”First World War”,”Second World War”,”Cold War Era”,”Independence and Partition”]
};
function loadChapters(){
let cls=document.getElementById(“class”).value;
let ch=document.getElementById(“chapter”);
ch.innerHTML=””;
syllabus[cls].forEach(c=>{
let opt=document.createElement(“option”);
opt.textContent=c;
ch.appendChild(opt);
});
}
loadChapters();
function cleanAIText(text){
return text.replace(/[*#\-]{1,}/g,””).trim();
}
function getDistribution(marks){
if(marks==30) return {mcq:{q:5,m:1}, short:{q:5,m:2}, long:{q:3,m:5}};
if(marks==50) return {mcq:{q:10,m:1}, short:{q:5,m:4}, long:{q:4,m:5}};
if(marks==80) return {mcq:{q:15,m:1}, short:{q:10,m:3}, long:{q:5,m:7}};
if(marks==100) return {mcq:{q:20,m:1}, short:{q:10,m:4}, long:{q:6,m:10}};
}
function startProgress(){
let progress=0;
clearInterval(progressInterval);
progressInterval=setInterval(()=>{
if(progressupdateProgress(0),1000);
}
function updateProgress(value){
document.getElementById(“progressFill”).style.width=value+”%”;
document.getElementById(“progressText”).innerText=value+”%”;
}
async function callAI(prompt){
startProgress();
try{
let response=await fetch(“https://openrouter.ai/api/v1/chat/completions”,{
method:”POST”,
headers:{
“Authorization”:”Bearer “+API_KEY,
“Content-Type”:”application/json”
},
body:JSON.stringify({
model:”openai/gpt-4o-mini”,
temperature:0.2,
messages:[{role:”user”,content:prompt}]
})
});
let data=await response.json();
completeProgress();
return cleanAIText(data.choices[0].message.content);
}catch(e){
completeProgress();
return “AI error”;
}
}
async function generatePaper(){
let marks=parseInt(document.getElementById(“marks”).value);
let dist=getDistribution(marks);
let cls=document.getElementById(“class”).value;
let chapter=document.getElementById(“chapter”).value;
let difficulty=document.getElementById(“difficulty”).value;
let language=document.getElementById(“language”).value;
let prompt=`Create WBBSE History question paper in ${language}.
Class ${cls}
Chapter ${chapter}
Difficulty ${difficulty}
Full Marks ${marks}
SECTION A ${dist.mcq.q} MCQ ${dist.mcq.m} marks each
SECTION B ${dist.short.q} Short ${dist.short.m} marks each
SECTION C ${dist.long.q} Long ${dist.long.m} marks each
No special symbols. Clean exam format only.`;
savedPaper=await callAI(prompt);
document.getElementById(“paper”).innerText=savedPaper;
document.getElementById(“answer”).innerText=””;
document.getElementById(“solution”).innerText=””;
}
async function generateAnswer(){
if(!savedPaper){alert(“Generate Question Paper first”);return;}
document.getElementById(“answer”).innerText=await callAI(“Generate clean answer key: “+savedPaper);
}
async function generateSolution(){
if(!savedPaper){alert(“Generate Question Paper first”);return;}
document.getElementById(“solution”).innerText=await callAI(“Generate clean model solution: “+savedPaper);
}
function downloadTXT(){
let content=`QUESTION PAPER\n${paper.innerText}\n\nANSWER KEY\n${answer.innerText}\n\nMODEL SOLUTION\n${solution.innerText}`;
let blob=new Blob([content],{type:”text/plain”});
let link=document.createElement(“a”);
link.href=URL.createObjectURL(blob);
link.download=”WBBSE_History_Exam.txt”;
link.click();
}
My Name is Sourav Mukherjee. I am a Website Developer and SEO Expart. AllBestTool.com is a browser-based collection of free online utilities — everything from PDF converters and text tools to SEO helpers and calculators. The idea is pretty simple: make a bunch of useful web tools available in one place without requiring users to sign up.