talimbot / backend /static /pages /ams-questionnaire.html
parinazAkef's picture
Fresh start: TalimBot project without binary files
2fe573b
<!DOCTYPE html>
<html lang="fa" dir="rtl">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>پرسشنامه انگیزش تحصیلی (AMS) - سیستم گروه‌بندی</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700;800&display=swap" rel="stylesheet">
<style>
body {
font-family: 'Vazirmatn', system-ui, -apple-system, sans-serif;
}
.question-card {
transition: all 0.3s ease;
}
.question-card:hover {
transform: translateY(-2px);
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}
.scale-option {
transition: all 0.2s ease;
}
.scale-option:hover {
transform: scale(1.05);
}
.scale-option input:checked + label {
background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
color: white;
font-weight: 600;
}
</style>
<script>
tailwind.config = {
theme: {
extend: {
fontFamily: {
vazir: ['Vazirmatn', 'sans-serif']
}
}
}
}
</script>
</head>
<body class="font-vazir bg-gray-50 min-h-screen">
<!-- Top Navigation Bar -->
<nav style="background-color: #1b6e6e;" class="shadow-lg border-b border-gray-200 sticky top-0 z-50">
<div class="max-w-7xl mx-auto px-4">
<div class="flex items-center justify-between h-16">
<div class="flex items-center gap-3">
<div class="bg-white/20 w-10 h-10 rounded-lg flex items-center justify-center">
<svg class="w-6 h-6 text-white" fill="currentColor" viewBox="0 0 20 20">
<path d="M10.394 2.08a1 1 0 00-.788 0l-7 3a1 1 0 000 1.84L5.25 8.051a.999.999 0 01.356-.257l4-1.714a1 1 0 11.788 1.838L7.667 9.088l1.94.831a1 1 0 00.787 0l7-3a1 1 0 000-1.838l-7-3zM3.31 9.397L5 10.12v4.102a8.969 8.969 0 00-1.05-.174 1 1 0 01-.89-.89 11.115 11.115 0 01.25-3.762zM9.3 16.573A9.026 9.026 0 007 14.935v-3.957l1.818.78a3 3 0 002.364 0l5.508-2.361a11.026 11.026 0 01.25 3.762 1 1 0 01-.89.89 8.968 8.968 0 00-5.35 2.524 1 1 0 01-1.4 0zM6 18a1 1 0 001-1v-2.065a8.935 8.935 0 00-2-.712V17a1 1 0 001 1z"/>
</svg>
</div>
<div>
<h1 class="text-xl font-bold text-white">TalimBot</h1>
<p class="text-xs text-white/80">پرسشنامه انگیزش تحصیلی</p>
</div>
</div>
<button onclick="goBack()" class="bg-white text-teal-700 px-4 py-2 rounded-lg font-semibold hover:bg-teal-50 transition-colors flex items-center gap-2">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 19l-7-7m0 0l7-7m-7 7h18"/>
</svg>
بازگشت به داشبورد
</button>
</div>
</div>
</nav>
<!-- Main Content -->
<div class="max-w-5xl mx-auto px-4 py-8">
<!-- Header -->
<div class="bg-white rounded-2xl shadow-lg p-8 mb-8">
<h2 class="text-3xl font-bold text-gray-900 mb-4 text-center">پرسشنامه انگیزش تحصیلی (AMS)</h2>
<p class="text-gray-600 text-center mb-6">لطفاً برای هر جمله مشخص کنید که تا چه حد درباره شما درست است</p>
<!-- Progress Bar -->
<div class="bg-gray-200 rounded-full h-3 mb-4">
<div id="progressBar" class="bg-gradient-to-r from-blue-500 to-blue-600 h-3 rounded-full transition-all duration-300" style="width: 0%"></div>
</div>
<p class="text-center text-sm text-gray-600">
<span id="progressText">0 از 28 سؤال پاسخ داده شده</span>
</p>
</div>
<!-- Scale Legend -->
<div class="bg-blue-50 border-2 border-blue-200 rounded-xl p-6 mb-8">
<h3 class="font-bold text-blue-900 mb-4 text-center">مقیاس پاسخ‌دهی:</h3>
<div class="grid grid-cols-2 md:grid-cols-4 lg:grid-cols-7 gap-2 text-sm">
<div class="bg-white p-2 rounded text-center border border-blue-200">
<div class="font-bold text-blue-900">1</div>
<div class="text-xs text-gray-600">اصلاً درست نیست</div>
</div>
<div class="bg-white p-2 rounded text-center border border-blue-200">
<div class="font-bold text-blue-900">2</div>
<div class="text-xs text-gray-600">خیلی کم درست است</div>
</div>
<div class="bg-white p-2 rounded text-center border border-blue-200">
<div class="font-bold text-blue-900">3</div>
<div class="text-xs text-gray-600">کمی درست است</div>
</div>
<div class="bg-white p-2 rounded text-center border border-blue-200">
<div class="font-bold text-blue-900">4</div>
<div class="text-xs text-gray-600">تا حدی درست است</div>
</div>
<div class="bg-white p-2 rounded text-center border border-blue-200">
<div class="font-bold text-blue-900">5</div>
<div class="text-xs text-gray-600">نسبتاً درست است</div>
</div>
<div class="bg-white p-2 rounded text-center border border-blue-200">
<div class="font-bold text-blue-900">6</div>
<div class="text-xs text-gray-600">خیلی درست است</div>
</div>
<div class="bg-white p-2 rounded text-center border border-blue-200">
<div class="font-bold text-blue-900">7</div>
<div class="text-xs text-gray-600">کاملاً درست است</div>
</div>
</div>
</div>
<!-- Questions -->
<form id="amsForm">
<!-- Section A: بی‌انگیزشی -->
<div class="mb-8">
<h3 class="text-xl font-bold text-gray-800 mb-4 flex items-center gap-2 bg-gradient-to-r from-red-50 to-orange-50 p-4 rounded-xl border-r-4 border-red-500">
<svg class="w-6 h-6 text-red-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9.172 16.172a4 4 0 015.656 0M9 10h.01M15 10h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/>
</svg>
بی‌انگیزشی
</h3>
<div class="space-y-4" id="sectionA"></div>
</div>
<!-- Section B: تنظیم بیرونی -->
<div class="mb-8">
<h3 class="text-xl font-bold text-gray-800 mb-4 flex items-center gap-2 bg-gradient-to-r from-yellow-50 to-amber-50 p-4 rounded-xl border-r-4 border-yellow-500">
<svg class="w-6 h-6 text-yellow-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/>
</svg>
انگیزش بیرونی – تنظیم بیرونی
</h3>
<div class="space-y-4" id="sectionB"></div>
</div>
<!-- Section C: درون‌فکنی‌شده -->
<div class="mb-8">
<h3 class="text-xl font-bold text-gray-800 mb-4 flex items-center gap-2 bg-gradient-to-r from-orange-50 to-red-50 p-4 rounded-xl border-r-4 border-orange-500">
<svg class="w-6 h-6 text-orange-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z"/>
</svg>
انگیزش بیرونی – درون‌فکنی‌شده
</h3>
<div class="space-y-4" id="sectionC"></div>
</div>
<!-- Section D: همانندسازی‌شده -->
<div class="mb-8">
<h3 class="text-xl font-bold text-gray-800 mb-4 flex items-center gap-2 bg-gradient-to-r from-blue-50 to-indigo-50 p-4 rounded-xl border-r-4 border-blue-500">
<svg class="w-6 h-6 text-blue-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4M7.835 4.697a3.42 3.42 0 001.946-.806 3.42 3.42 0 014.438 0 3.42 3.42 0 001.946.806 3.42 3.42 0 013.138 3.138 3.42 3.42 0 00.806 1.946 3.42 3.42 0 010 4.438 3.42 3.42 0 00-.806 1.946 3.42 3.42 0 01-3.138 3.138 3.42 3.42 0 00-1.946.806 3.42 3.42 0 01-4.438 0 3.42 3.42 0 00-1.946-.806 3.42 3.42 0 01-3.138-3.138 3.42 3.42 0 00-.806-1.946 3.42 3.42 0 010-4.438 3.42 3.42 0 00.806-1.946 3.42 3.42 0 013.138-3.138z"/>
</svg>
انگیزش بیرونی – همانندسازی‌شده
</h3>
<div class="space-y-4" id="sectionD"></div>
</div>
<!-- Section E: کسب دانش -->
<div class="mb-8">
<h3 class="text-xl font-bold text-gray-800 mb-4 flex items-center gap-2 bg-gradient-to-r from-green-50 to-emerald-50 p-4 rounded-xl border-r-4 border-green-500">
<svg class="w-6 h-6 text-green-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"/>
</svg>
انگیزش درونی برای کسب دانش
</h3>
<div class="space-y-4" id="sectionE"></div>
</div>
<!-- Section F: کسب موفقیت -->
<div class="mb-8">
<h3 class="text-xl font-bold text-gray-800 mb-4 flex items-center gap-2 bg-gradient-to-r from-teal-50 to-cyan-50 p-4 rounded-xl border-r-4 border-teal-500">
<svg class="w-6 h-6 text-teal-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 3v4M3 5h4M6 17v4m-2-2h4m5-16l2.286 6.857L21 12l-5.714 2.143L13 21l-2.286-6.857L5 12l5.714-2.143L13 3z"/>
</svg>
انگیزش درونی برای کسب موفقیت
</h3>
<div class="space-y-4" id="sectionF"></div>
</div>
<!-- Section G: تجربه تحریک/هیجان -->
<div class="mb-8">
<h3 class="text-xl font-bold text-gray-800 mb-4 flex items-center gap-2 bg-gradient-to-r from-purple-50 to-pink-50 p-4 rounded-xl border-r-4 border-purple-500">
<svg class="w-6 h-6 text-purple-600" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"/>
</svg>
انگیزش درونی برای تجربه تحریک/هیجان
</h3>
<div class="space-y-4" id="sectionG"></div>
</div>
<!-- Submit Button -->
<div class="flex justify-center">
<button type="submit" class="bg-gradient-to-r from-green-600 to-green-700 text-white px-12 py-4 rounded-xl font-bold text-lg hover:from-green-700 hover:to-green-800 shadow-lg hover:shadow-xl transform hover:scale-105 transition-all flex items-center gap-3">
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"/>
</svg>
محاسبه نتیجه
</button>
</div>
</form>
<!-- Results Modal (Hidden by default) -->
<div id="resultsModal" class="hidden fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4">
<div class="bg-white rounded-2xl shadow-2xl max-w-2xl w-full max-h-[90vh] overflow-y-auto">
<div class="bg-gradient-to-r from-blue-600 to-blue-700 text-white p-6 rounded-t-2xl">
<h3 class="text-2xl font-bold text-center">نتایج پرسشنامه انگیزش تحصیلی</h3>
</div>
<div class="p-6">
<div id="resultsContent" class="space-y-4"></div>
<div class="mt-6 bg-blue-50 border-2 border-blue-300 rounded-xl p-4">
<p class="text-center text-blue-900 font-semibold mb-2">نمره کل شما:</p>
<p id="totalScore" class="text-4xl font-bold text-center text-blue-700"></p>
<p id="interpretation" class="text-center text-gray-700 mt-2"></p>
</div>
<div class="mt-6 flex gap-4">
<button onclick="saveAndReturn()" class="flex-1 bg-blue-600 text-white py-3 rounded-xl font-semibold hover:bg-blue-700 transition-colors flex items-center justify-center gap-2">
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 7H5a2 2 0 00-2 2v9a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-3m-1 4l-3 3m0 0l-3-3m3 3V4"/>
</svg>
ذخیره و بازگشت
</button>
<button onclick="closeResults()" class="flex-1 bg-gray-600 text-white py-3 rounded-xl font-semibold hover:bg-gray-700 transition-colors">
بستن
</button>
</div>
</div>
</div>
</div>
</div>
<script>
const questions = {
A: [
"گاهی نمی‌دانم چرا باید برای درس خواندن تلاش کنم.",
"احساس می‌کنم درس خواندن برایم فایده‌ای ندارد.",
"بعضی وقت‌ها فکر می‌کنم ادامه دادن درس هیچ هدف مشخصی برایم ندارد.",
"وقتی درس می‌خوانم، نمی‌دانم برای چه چیزی زحمت می‌کشم."
],
B: [
"برای اینکه والدین یا معلمانم از من ناراحت نشوند، درس می‌خوانم.",
"بیشتر برای گرفتن نمره خوب تلاش می‌کنم، نه چیز دیگر.",
"درس می‌خوانم چون از پیامدهای منفی نمره پایین می‌ترسم.",
"پیشرفت تحصیلی‌ام برایم مهم است چون دیگران از من انتظار دارند."
],
C: [
"وقتی درس نمی‌خوانم احساس گناه می‌کنم.",
"درس خواندن باعث می‌شود حس بهتری نسبت به خودم داشته باشم.",
"اگر برای امتحان آماده نباشم، از خودم ناراحت می‌شوم.",
"بعضی وقت‌ها برای اینکه احساس ارزشمندی کنم، بیشتر درس می‌خوانم."
],
D: [
"درس خواندن برایم مهم است چون می‌دانم در آینده به من کمک می‌کند.",
"یادگیری مطالب مدرسه را ارزشمند می‌دانم.",
"موفقیت در درس را بخشی از پیشرفت شخصی خودم می‌دانم.",
"برای این درس می‌خوانم که به هدف‌های آینده‌ام نزدیک‌تر شوم."
],
E: [
"از یادگرفتن مطالب جدید لذت می‌برم.",
"وقتی چیزی را واقعاً یاد می‌گیرم، احساس رضایت می‌کنم.",
"فهمیدن موضوعات سخت برایم هیجان‌انگیز است.",
"دوست دارم درباره درس‌ها بیشتر بدانم، حتی خارج از کلاس."
],
F: [
"حل کردن یک مسئله سخت به من حس موفقیت می‌دهد.",
"وقتی یک تکلیف را عالی انجام می‌دهم، احساس افتخار می‌کنم.",
"دوست دارم در درس‌ها عملکردی بالاتر از حد معمول داشته باشم.",
"تلاش می‌کنم چون می‌خواهم توانایی‌هایم را نشان بدهم."
],
G: [
"بعضی درس‌ها برایم هیجان‌انگیز و جذاب هستند.",
"یادگیری برایم لذت‌بخش است، حتی وقتی سخت باشد.",
"وقتی در فعالیت‌های آموزشی مشارکت می‌کنم، احساس انرژی و شادی می‌کنم.",
"تجربه کردن روش‌های جدید یادگیری برایم جالب و هیجان‌آور است."
]
};
const sectionNames = {
A: "بی‌انگیزشی",
B: "تنظیم بیرونی",
C: "درون‌فکنی‌شده",
D: "همانندسازی‌شده",
E: "کسب دانش",
F: "کسب موفقیت",
G: "تجربه هیجان"
};
let questionNumber = 1;
function createQuestion(text, section, index) {
const container = document.getElementById(`section${section}`);
const questionDiv = document.createElement('div');
questionDiv.className = 'question-card bg-white p-6 rounded-xl shadow-md border border-gray-200';
let html = `
<div class="mb-4">
<p class="font-semibold text-gray-800 text-lg">
<span class="inline-block bg-blue-600 text-white w-8 h-8 rounded-full text-center leading-8 ml-2">${questionNumber}</span>
${text}
</p>
</div>
<div class="grid grid-cols-7 gap-2">
`;
for (let i = 1; i <= 7; i++) {
html += `
<div class="scale-option">
<input type="radio" id="q${questionNumber}_${i}" name="q${questionNumber}" value="${i}" class="hidden" onchange="updateProgress()">
<label for="q${questionNumber}_${i}" class="block text-center py-3 px-2 rounded-lg border-2 border-gray-300 cursor-pointer hover:border-blue-400 transition-all">
<div class="font-bold text-gray-700">${i}</div>
</label>
</div>
`;
}
html += '</div>';
questionDiv.innerHTML = html;
container.appendChild(questionDiv);
questionNumber++;
}
function initializeQuestions() {
Object.keys(questions).forEach(section => {
questions[section].forEach((question, index) => {
createQuestion(question, section, index);
});
});
}
function updateProgress() {
const totalQuestions = 28;
const answeredQuestions = document.querySelectorAll('input[type="radio"]:checked').length;
const percentage = (answeredQuestions / totalQuestions) * 100;
document.getElementById('progressBar').style.width = percentage + '%';
document.getElementById('progressText').textContent = `${answeredQuestions} از ${totalQuestions} سؤال پاسخ داده شده`;
}
function calculateResults() {
const results = {};
let totalScore = 0;
let currentQ = 1;
Object.keys(questions).forEach(section => {
let sectionScore = 0;
for (let i = 0; i < 4; i++) {
const answer = document.querySelector(`input[name="q${currentQ}"]:checked`);
if (answer) {
sectionScore += parseInt(answer.value);
}
currentQ++;
}
results[section] = sectionScore;
totalScore += sectionScore;
});
return { sections: results, total: totalScore };
}
function displayResults(results) {
const content = document.getElementById('resultsContent');
content.innerHTML = '';
Object.keys(results.sections).forEach(section => {
const score = results.sections[section];
const div = document.createElement('div');
div.className = 'bg-gray-50 p-4 rounded-lg border border-gray-200';
div.innerHTML = `
<div class="flex justify-between items-center">
<span class="font-semibold text-gray-800">${sectionNames[section]}</span>
<span class="text-2xl font-bold text-blue-600">${score}/28</span>
</div>
`;
content.appendChild(div);
});
document.getElementById('totalScore').textContent = `${results.total}/196`;
let interpretation = '';
if (results.total <= 70) {
interpretation = '📉 انگیزش تحصیلی پایین - توصیه می‌شود با مشاور تحصیلی صحبت کنید';
} else if (results.total <= 140) {
interpretation = '📊 انگیزش تحصیلی متوسط - در مسیر مناسبی هستید';
} else {
interpretation = '📈 انگیزش تحصیلی بالا - عالی! انگیزه قوی برای یادگیری دارید';
}
document.getElementById('interpretation').textContent = interpretation;
document.getElementById('resultsModal').classList.remove('hidden');
}
function saveAndReturn() {
const totalText = document.getElementById('totalScore').textContent;
const scoreOnly = totalText.split('/')[0].trim();
sessionStorage.setItem('amsScore', scoreOnly);
window.location.href = 'student-dashboard.html';
}
function closeResults() {
document.getElementById('resultsModal').classList.add('hidden');
}
function goBack() {
window.location.href = 'student-dashboard.html';
}
document.getElementById('amsForm').addEventListener('submit', function(e) {
e.preventDefault();
const answeredQuestions = document.querySelectorAll('input[type="radio"]:checked').length;
if (answeredQuestions < 28) {
alert(`لطفاً به همه سؤالات پاسخ دهید. شما ${answeredQuestions} از 28 سؤال را پاسخ داده‌اید.`);
return;
}
const results = calculateResults();
displayResults(results);
});
window.onload = initializeQuestions;
</script>
</body>
</html>