";
}
});
}
function updateUserStatsSidebar(uid) {
db.ref('testHistory/' + uid).on('value', snap => {
if (snap.exists()) {
const tests = Object.values(snap.val());
document.getElementById('statTotalTests').innerText = tests.length;
let lowestMistake = 100;
tests.forEach(t => {
let val = parseFloat(t.accuracy);
if (val > 50) val = 100 - val;
if (val < lowestMistake) lowestMistake = val;
});
document.getElementById('statBestAcc').innerText = lowestMistake.toFixed(2) + "%";
document.getElementById('myStatsSidebar').style.display = 'block';
}
});
}
// Review Modal kholne ke liye
function showReviews() {
// 1. Modal dikhao
const modal = document.getElementById('reviewsSection');
if (modal) {
modal.style.display = 'block';
// 2. Data load karo
loadReviewsList();
}
}
// Review submit karne ka sahi logic
function submitReview() {
const name = document.getElementById('revName').value.trim();
const text = document.getElementById('revText').value.trim();
if (!name || !text) {
return alert("Please enter both your name and review.");
}
db.ref('studentReviews').push({
name: name,
text: text,
date: new Date().toLocaleDateString('en-IN'),
timestamp: firebase.database.ServerValue.TIMESTAMP
}).then(() => {
alert("Thank you! Your review has been added.");
document.getElementById('revName').value = "";
document.getElementById('revText').value = "";
}).catch(err => {
console.error(err);
alert("Error: Review submit nahi hua.");
});
}
// 2. Reviews load karne ke liye
function loadReviewsList() {
const reviewsDiv = document.getElementById('reviewsList');
if (!reviewsDiv) return;
// Pehle loading dikhao
reviewsDiv.innerHTML = "
Loading reviews...
";
// Firebase se 'studentReviews' uthao
db.ref('studentReviews').on('value', snap => {
let html = "";
if (snap.exists()) {
snap.forEach(child => {
let r = child.val();
// Ek card banate hain har review ke liye
html = `
";
}
});
}
// 7. LEGAL POLICIES
function showLegal(type) {
let t = "", c = "";
if (type === 'privacy') {
t = "🔒 PRIVACY POLICY";
c = `Privacy Policy
7 House Shorthand Online Institute is committed to protecting your privacy. Please read this policy to understand how we collect and use your personal data.
Personal Data that We may Collect
We may collect information related to your personal identity when you use 7 House Shorthand services. This includes, but is not limited to, personal identification information, device information, and location data. If you upload or post information in public areas that are visible to other users, please note that such information may be collected and used by others. If you notice any improper collection or use of information, please contact us at 7houseshorthandinstitute@gmail.com.
How We Collect and Use the Information
- Information Provided by you when registering or using 7 House Shorthand services.
- Information shared by other parties through their use of 7 House Shorthand services.
- Information collected through cookies, web beacons, and log archives.
We use cookies to provide users with a personalized experience, including remembering your identity and analyzing your use of our services. You can manage cookies through your browser settings.
Push Notifications and Advertising
We may use your information to send you marketing messages, notifications related to service updates, and promotional content. You can opt-out of these communications through settings on your device or by following unsubscribe guidelines in messages.
Sharing, Transfer, and Disclosure of Information
- We may share your information with partners and third parties to provide better services or as required by law.
- Your information may be transferred if there are mergers, acquisitions, or similar transactions.
- We will disclose your information only under the conditions required by law or with your explicit consent.
How We Protect Your Information
We retain your information during the period required to provide services and within time limits required by law. We employ industry-standard security measures such as encryption and strict access control to protect your data from unauthorized access, alteration, or destruction. However, the internet is not entirely secure, and we encourage you to use strong passwords and be careful when sharing information.
Managing Your Information
You have the right to access, update, or delete your personal information. Please contact us at 7houseshorthandinstitute@gmail.com for any requests related to your data.
Age Limit
We recommend that minors obtain prior consent from their parents or guardians before using 7 House Shorthand services. We do not knowingly process personal data from minors without parental consent. If you believe we have any personal data from minors, please contact us.
Notice and Amendment
We may revise this Privacy Policy as necessary. We encourage you to review the policy periodically. By continuing to use 7 House Shorthand services, you agree to the revised policy.
How to Contact Us
If you have any questions, comments, or suggestions regarding this Privacy Policy, please contact us at 7houseshorthandinstitute@gmail.com.`;
}
else if (type === 'terms') {
t = "📜 TERMS & CONDITIONS";
// Aapka poora text bina kisi badlav ke neeche hai
c = `Terms & Conditions: 7 House Shorthand Online Institute
Welcome to 7 House Shorthand Online Institute's Terms & Conditions. Please read these carefully before using our platform.
What do our Terms & Conditions cover?
These terms and conditions ("Terms and Conditions") are between 7 House Shorthand Online Institute and you, (hereinafter referred to as "You" or "Your" or "User(s)"). By accessing our website and services, together referred to as "7 House Platform", you agree to be bound by the provisions of these Terms and Conditions.
Please read these Terms and Conditions, along with the Privacy Policy and all other rules as they shall govern your use of the 7 House Platform. By using or visiting the 7 House Platform or any software, data feeds, and services provided to you, you signify your agreement to (1) these "Terms and Conditions", (2) 7 House Shorthand’s Privacy Policy. If you do not agree to any of these terms, please do not use the 7 House Platform.
About 7 House Shorthand
The services and platform are owned, registered, and operated by 7 House Shorthand Online Institute, managed by Deepak Koli (hereinafter referred to as "7 House Shorthand" or "us" or "we" or "our").
7 House Platform
These Terms and Conditions apply to all Users of the 7 House Platform. The platform provides educational shorthand dictations, tutorials, and materials. Content uploaded through the use of the 7 House Platform shall hereinafter be referred to as "7 House Content".
Subject to these Terms and Conditions, 7 House Shorthand hereby grants you a non-exclusive, non-transferable, non-sublicensable, limited license to use the platform in accordance with these Terms and Conditions.
7 House Accounts
In order to access premium features, you have to create an account. You agree and confirm that you will never use another User's account nor provide access to your account to any third party. You are solely responsible for the activities that occur on your account.
Important: If a user's account is found to be active on multiple devices or multiple users are found operating a single account, 7 House Shorthand reserves the right to suspend the subscription(s) linked to that account or even the account itself, without any prior notice.
Access, Permissions, and Restrictions
You agree not to distribute any part of the 7 House Content without prior written authorization.
You agree not to alter or modify any part of the platform.
You agree not to use the 7 House Platform for any commercial uses.
Content Use
7 House Content utilized on the platform, which includes but is not limited to trademarks, logos, audio dictations, and shorthand outlines, are owned by or licensed to 7 House Shorthand and are subject to copyright and other intellectual property rights under the law.
Limitation of Liability
In no event shall 7 House Shorthand or its owner be liable to you for any direct, indirect, or consequential damages resulting from errors in content, unauthorized access to secure servers, or any interruption of service.
7 House Shorthand reserves the right to terminate your account and subscriptions if you engage in behavior that violates our standards of conduct. If any user exhibits abusive, derogatory, or offensive language on the Platform or via affiliated channels (WhatsApp, etc.), 7 House Shorthand may immediately suspend or cancel all active subscriptions without any prior notice and shall not be liable for any refund.
By using the 7 House Platform, you acknowledge and agree to these Terms & Conditions.`;
}
else if (type === 'refund') {
t = "💳 REFUND & CANCELLATION POLICY";
c = `Refund and Cancellation Policy
Effective Date: 13th Feb. 2013
Introduction
Thank you for choosing 7 House Shorthand! We appreciate your trust in our platform. Please read our refund and cancellation policy carefully before enrolling in any of our courses.
At 7 House Shorthand, we are committed to providing high-quality education and resources to our users. We aim to maintain transparency and fairness in our refund and cancellation policy. This policy outlines the terms and conditions governing refunds and cancellations for courses offered on our website.
Refund and Cancellation Timeline
Once a user enrolls in a course on 7 House Shorthand and makes the required payment, the following refund and cancellation policy applies:
2.1 Refunds
Once a user is enrolled in a pass/subscription/batch, it is treated as final, and no refund is provided in any circumstances.
2.2 No Refund for Referral Code Usage
Under no circumstances will a refund be provided if a user has used a referral code while signing up/ purchasing any plan or subscription on the website. This policy applies even within the initial 24 hours window.
2.3 No Refund for Coupon code usages
No refund is provided if the user has used any coupon code while purchasing any pass/subscription/batch on 7 House Shorthand.
Contacting Customer Support
To inquiry about any possible exception, users should contact our customer support team at 7houseshorthandinstitute@gmail.com with the following information:
- Full name
- Email address associated with the account
- Course title
- Reason for the request
Account Suspension due to False or Unethical News
7 House Shorthand is committed to promoting accurate and ethical information. If it is found that a user is spreading false or unethical news without contacting our support team to address the issue, we reserve the right to suspend or disable their account immediately. In such cases, no refunds will be provided for the remaining subscription period.
Conclusion
At 7 House Shorthand, we strive to provide the best learning experience to our users. We believe our refund and cancellation policy maintains a fair balance between user flexibility and our commitment to delivering high-quality educational content. Please ensure that you read and understand this policy before enrolling in any course on our platform.
By enrolling in a 7 House Shorthand course, you acknowledge and agree to abide by the terms and conditions outlined in this refund and cancellation policy.
For any questions or clarifications regarding this policy, please contact our customer support team at 7houseshorthandinstitute@gmail.com.`;
}
document.getElementById('legalTitle').innerText = t; // Title set karega
document.getElementById('legalBody').innerText = c; // Pura text bharega
document.getElementById('legalModal').style.display = "block"; // Box ko dikhayega
}
function closeLegalModal() { document.getElementById('legalModal').style.display = "none"; }
// 1. Galtiyon ko Save karne ka function (Ise checkResult function ke andar bulana hoga)
function trackWeakWords(mistakesArray) {
// Agar bacha login nahi hai ya galti nahi hai toh rukh jao
if (!currentUser || !mistakesArray || mistakesArray.length === 0) return;
mistakesArray.forEach(word => {
// Word ko saaf karna (symbols hatana)
let cleanWord = word.toLowerCase().trim().replace(/[.,#!$%&;:{}=\-_`~()]/g,"");
// Sirf 2 se bade words (jaise 'the', 'is' ko chhod kar)
if(cleanWord.length > 2) {
// Firebase Path: studentAnalysis/UID/weakWords/word_name
const wordPath = 'studentAnalysis/' + currentUser.uid + '/weakWords/' + cleanWord;
// Transaction use kar rahe hain taaki count sahi se update ho
db.ref(wordPath).transaction((currentData) => {
if (currentData) {
currentData.count = (currentData.count || 0) + 1;
return currentData;
} else {
return { count: 1 };
}
});
}
});
}
// 2. Section dikhane ke liye
function showWeakWords() {
if (!currentUser) return alert("Pehle Login karein!");
navigateToSection('weakWords');
// baaki code wahi rahega...
document.getElementById('mainMenu').style.display = 'none';
document.getElementById('weakWordsView').style.display = 'block';
const listDiv = document.getElementById('weakWordsList');
listDiv.innerHTML = "
Loading weak words...
";
db.ref('studentAnalysis/' + currentUser.uid + '/weakWords').once('value', snap => {
if (snap.exists()) {
let html = "";
let words = Object.entries(snap.val()).sort((a,b) => b[1].count - a[1].count);
words.forEach(([word, data]) => {
html += `
No weak words recorded yet. Start taking tests to track errors.
";
}
});
}
// 3. Words ko screen par dikhane ke liye
function loadWeakWords() {
const listDiv = document.getElementById('weakWordsList');
const weakWords = JSON.parse(localStorage.getItem('weakWords')) || {};
let html = "";
// Words ko sort karna (jo sabse zyada galat hue wo pehle)
const sortedWords = Object.entries(weakWords).sort((a,b) => b[1] - a[1]);
if(sortedWords.length === 0) {
listDiv.innerHTML = "
Abhi tak koi galti record nahi hui. Practice jari rakhein!
";
return;
}
sortedWords.forEach(([word, count]) => {
if(count >= 2) { // Jo word kam se kam 2 baar galat hua ho
html += `
${word}${count}
`;
}
});
listDiv.innerHTML = html || "
Thodi aur practice karein, tabhi data dikhega!
";
}
async function shareWeakWordsOnWhatsApp() {
if (!currentUser) return alert("Pehle login karein!");
try {
// 1. Firebase se data uthao
const snapshot = await db.ref('studentAnalysis/' + currentUser.uid + '/weakWords').once('value');
const weakWordsData = snapshot.val();
// CHECK: Agar data bilkul khali hai
if (!weakWordsData) {
alert("Deepak Sir, Database mein abhi koi galti record nahi hui hai!");
return;
}
// 2. Data ko List mein badlo (Handle both formats)
let words = [];
for (let word in weakWordsData) {
let count = 0;
// Agar data { count: 5 } ke roop mein hai
if (typeof weakWordsData[word] === 'object') {
count = weakWordsData[word].count || 0;
} else {
// Agar data seedha number hai { "apple": 5 }
count = weakWordsData[word];
}
words.push({ word: word, count: count });
}
// 3. Sorting (Zyada galti wale upar)
words.sort((a, b) => b.count - a.count);
// 4. Message Design
let message = "*🔥 MY WEAK SHORTHAND WORDS LIST *%0A";
message += "--------------------------------%0A";
let hasWords = false;
words.forEach(item => {
if(item.count >= 2) { // Kam se kam 2 baar galti
message += `👉 *${item.word.toUpperCase()}* (Mistakes: ${item.count})%0A`;
hasWords = true;
}
});
if (!hasWords) {
alert("Deepak Sir, 2 se kam galti wale words share nahi honge. Thoda aur practice karein!");
return;
}
message += "--------------------------------%0A";
message += "🎯 *Target:* In words ki 10-10 line practice karni hai.%0A";
message += "🚀 *Source:* 7 House Shorthand Portal";
// 5. WhatsApp Par Bhejo
window.location.href = `https://wa.me/?text=${message}`;
} catch (error) {
console.error("Firebase Error:", error);
alert("Data load karne mein dikkat hui!");
}
}
function clearWeakWords() {
if (!currentUser) return alert("Please login first!");
if (confirm("Are you sure you want to delete all weak words data?")) {
// 1. LocalStorage se delete karein
localStorage.removeItem('weakWords');
// 2. Firebase Database se permanently delete karein
db.ref('studentAnalysis/' + currentUser.uid + '/weakWords').remove()
.then(() => {
alert("Weak words data cleared successfully!");
const listDiv = document.getElementById('weakWordsList');
if (listDiv) {
listDiv.innerHTML = "
No weak words recorded yet. Start taking tests to track errors.
";
}
})
.catch(err => {
console.error("Error deleting weak words:", err);
alert("Failed to clear data from server. Please try again.");
});
}
}
function testButton() {
alert("System kaam kar raha hai!");
}
let gameActive = false;
let score = 0;
let fallingWords = [];
let gameWords = ["government", "parliament", "honorable", "committee", "shorthand", "dictation", "accuracy", "president", "justice", "education", "financial", "official"];
let gameInterval;
// 1. Game View dikhane ke liye
function showGame() {
navigateToSection('game');
// Sabse pehle dashboard chhupao (ID: mainMenu)
document.getElementById('mainMenu').style.display = 'none';
// Game dikhao (ID: gameView)
document.getElementById('gameView').style.display = 'block';
// Start screen dikhao
document.getElementById('startScreen').style.display = 'flex';
}
// 2. Game shuru karne ke liye
function initGame() {
document.getElementById('startScreen').style.display = 'none';
score = 0;
document.getElementById('gameScore').innerText = score;
gameActive = true;
fallingWords = [];
document.getElementById('gameInput').value = "";
document.getElementById('gameInput').focus();
// Har 2.5 second mein naya word banega
gameInterval = setInterval(createWord, 2500);
// Game loop shuru (Words ko niche girana shuru)
requestAnimationFrame(updateGame);
}
// 3. Naya shabd banane ke liye
// Is hisse ko dhyan se dekhiye aur aise hi replace kijiye
function createWord() {
if (!gameActive) return;
// Aapke photos ke naye naam yahan likhein (Bina .png ke)
const gameWords = ["iwish", "ishall", "iwouldlike", "beyond", "historical", "government"];
const word = gameWords[Math.floor(Math.random() * gameWords.length)];
const x = Math.random() * (document.getElementById('gameCanvas').offsetWidth - 80);
const wordObj = {
text: word,
x: x,
y: 0,
element: document.createElement('div')
};
wordObj.element.className = 'falling-word';
wordObj.element.innerHTML = `
`;
wordObj.element.style.cssText = `position:absolute; left:${x}px; top:0px; z-index:100;`;
const canvas = document.getElementById('gameCanvas');
if (canvas) {
canvas.appendChild(wordObj.element);
fallingWords.push(wordObj);
}
}
// 4. Words ko niche girane wala engine (MAIN ENGINE)
function updateGame() {
if(!gameActive) return;
let canvasHeight = document.getElementById('gameCanvas').offsetHeight;
for(let i = 0; i < fallingWords.length; i++) {
let word = fallingWords[i];
word.y += 1.2; // Yahan se speed control hoti hai
word.element.style.top = word.y + "px";
// Agar word niche touch ho gaya toh GAME OVER
if(word.y > (canvasHeight - 40)) {
gameOver();
return;
}
}
requestAnimationFrame(updateGame);
}
// 5. Typing check karne ke liye
document.getElementById('gameInput').addEventListener('input', (e) => {
const typed = e.target.value.toLowerCase().replace(/\s+/g, ''); // Space hata kar check karega
for (let i = 0; i < fallingWords.length; i++) {
if (fallingWords[i].text === typed) {
fallingWords[i].element.remove();
fallingWords.splice(i, 1);
score += 10;
document.getElementById('gameScore').innerText = score;
e.target.value = "";
break;
}
}
});
// 6. Game khatam hone par
function gameOver() {
gameActive = false;
clearInterval(gameInterval);
// High Score save karna
let oldHighScore = localStorage.getItem('gameHighScore') || 0;
if(score > oldHighScore) {
localStorage.setItem('gameHighScore', score);
if(document.getElementById('statHighScore')) {
document.getElementById('statHighScore').innerText = score;
}
alert("💥 NEW RECORD! Your Score: " + score);
} else {
alert("Game Over! Your final score: " + score);
}
// Canvas saaf karna
fallingWords.forEach(w => w.element.remove());
fallingWords = [];
document.getElementById('startScreen').style.display = 'flex';
}
function loadLeaderboard() {
const filter = document.getElementById('leaderboardFilter').value;
const today = new Date().toISOString().split('T')[0];
const lbBody = document.getElementById('leaderboardBody');
// सही रास्ता (Path) चुनना
let path = (filter === 'today') ? 'leaderboard/' + today : 'allTimeLeaderboard';
db.ref(path).on('value', snap => {
let players = [];
if (snap.exists()) {
snap.forEach(child => {
let data = child.val();
players.push(data);
});
// 🥇 सबसे कम गलती वाला सबसे ऊपर
players.sort((a, b) => parseFloat(a.mistakePer || 100) - parseFloat(b.mistakePer || 100));
let html = "";
let top10 = players.slice(0, 10); // सिर्फ टॉप 10
top10.forEach((d, index) => {
let medal = (index === 0) ? "🥇" : (index === 1) ? "🥈" : (index === 2) ? "🥉" : (index + 1);
// साफ़-सुथरा नाम और पैसेज
let pName = String(d.name || "Student").substring(0, 25);
let pPassage = String(d.passage || "Test").substring(0, 30);
let pMistakes = d.totalMistakes || 0;
let pPercent = (d.mistakePer !== undefined) ? parseFloat(d.mistakePer).toFixed(2) + "%" : "0%";
html += `