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”:[“Globe and Map”,”Earth and Solar System”,”Weather and Climate”,”Our Environment”,”Natural Resources”],
“Class 6”:[“The Earth”,”Latitudes and Longitudes”,”Motions of the Earth”,”Major Landforms”,”Rivers and Water Bodies”],
“Class 7”:[“Atmosphere”,”Hydrosphere”,”Natural Vegetation”,”Human Environment”,”Industries”],
“Class 8”:[“Resources”,”Agriculture”,”Minerals and Power”,”Manufacturing Industries”,”Transport and Communication”],
“Class 9”:[“India Size and Location”,”Physical Features of India”,”Drainage”,”Climate”,”Natural Vegetation and Wildlife”],
“Class 10”:[“Resources and Development”,”Agriculture”,”Minerals and Energy Resources”,”Manufacturing Industries”,”Lifelines of National Economy”]
};
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:3}, 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 Geography 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_Geography_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.