Question Entity ve düzenlemeler
This commit is contained in:
parent
0dc6c7b521
commit
0f9fe71e6b
4 changed files with 12 additions and 15 deletions
|
|
@ -9,7 +9,7 @@ export const generateMockPools = (): QuestionPoolDto[] => [
|
||||||
questions: [
|
questions: [
|
||||||
{
|
{
|
||||||
id: "q1",
|
id: "q1",
|
||||||
type: "multiple-choice",
|
questionType: "multiple-choice",
|
||||||
title: "Verb Tenses",
|
title: "Verb Tenses",
|
||||||
content: "Select the appropriate tense form for the given context.",
|
content: "Select the appropriate tense form for the given context.",
|
||||||
options: [
|
options: [
|
||||||
|
|
@ -21,26 +21,23 @@ export const generateMockPools = (): QuestionPoolDto[] => [
|
||||||
correctAnswer: "opt2",
|
correctAnswer: "opt2",
|
||||||
points: 10,
|
points: 10,
|
||||||
difficulty: "easy",
|
difficulty: "easy",
|
||||||
tags: ["grammar", "verbs"],
|
|
||||||
creationTime: new Date(),
|
creationTime: new Date(),
|
||||||
lastModificationTime: new Date(),
|
lastModificationTime: new Date(),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "q2",
|
id: "q2",
|
||||||
type: "fill-blank",
|
questionType: "fill-blank",
|
||||||
title: "Articles",
|
title: "Articles",
|
||||||
content:
|
content:
|
||||||
'Fill in the blank: "I saw _____ elephant at the zoo yesterday."',
|
'Fill in the blank: "I saw _____ elephant at the zoo yesterday."',
|
||||||
correctAnswer: "an",
|
correctAnswer: "an",
|
||||||
points: 15,
|
points: 15,
|
||||||
difficulty: "medium",
|
difficulty: "medium",
|
||||||
tags: ["grammar", "articles"],
|
|
||||||
creationTime: new Date(),
|
creationTime: new Date(),
|
||||||
lastModificationTime: new Date(),
|
lastModificationTime: new Date(),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
tags: ["grammar", "fundamentals"],
|
tags: ["grammar", "fundamentals"],
|
||||||
createdBy: "admin",
|
|
||||||
creationTime: new Date(),
|
creationTime: new Date(),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -150,7 +150,7 @@ const ExamInterface: React.FC = () => {
|
||||||
|
|
||||||
const currentQuestion = exam.questions[currentQuestionIndex]
|
const currentQuestion = exam.questions[currentQuestionIndex]
|
||||||
const currentAnswer = session.answers.find((a) => a.questionId === currentQuestion?.id)
|
const currentAnswer = session.answers.find((a) => a.questionId === currentQuestion?.id)
|
||||||
|
|
||||||
const navigateQuestion = (direction: 'next' | 'prev' | number) => {
|
const navigateQuestion = (direction: 'next' | 'prev' | number) => {
|
||||||
if (typeof direction === 'number') {
|
if (typeof direction === 'number') {
|
||||||
setCurrentQuestionIndex(Math.max(0, Math.min(exam.questions.length - 1, direction)))
|
setCurrentQuestionIndex(Math.max(0, Math.min(exam.questions.length - 1, direction)))
|
||||||
|
|
@ -206,7 +206,7 @@ const ExamInterface: React.FC = () => {
|
||||||
|
|
||||||
{/* Header */}
|
{/* Header */}
|
||||||
<header className="bg-white border-b border-gray-200 px-4 py-3">
|
<header className="bg-white border-b border-gray-200 px-4 py-3">
|
||||||
<div className="max-w-7xl mx-auto flex items-center justify-between">
|
<div className="mx-auto flex items-center justify-between">
|
||||||
<div>
|
<div>
|
||||||
<h1 className="text-xl font-semibold text-gray-900">{exam.title}</h1>
|
<h1 className="text-xl font-semibold text-gray-900">{exam.title}</h1>
|
||||||
<p className="text-sm text-gray-600">
|
<p className="text-sm text-gray-600">
|
||||||
|
|
@ -228,7 +228,7 @@ const ExamInterface: React.FC = () => {
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
{/* Main Content */}
|
{/* Main Content */}
|
||||||
<div className="max-w-7xl mx-auto p-4">
|
<div className="mx-auto p-4">
|
||||||
<div className="grid grid-cols-1 lg:grid-cols-4 gap-6">
|
<div className="grid grid-cols-1 lg:grid-cols-4 gap-6">
|
||||||
{/* Question Content */}
|
{/* Question Content */}
|
||||||
<div className="lg:col-span-3 space-y-6">
|
<div className="lg:col-span-3 space-y-6">
|
||||||
|
|
|
||||||
|
|
@ -272,7 +272,7 @@ const PDFTestInterface: React.FC = () => {
|
||||||
|
|
||||||
{/* Header */}
|
{/* Header */}
|
||||||
<header className="bg-white border-b border-gray-200 px-4 py-3 sticky top-0 z-40">
|
<header className="bg-white border-b border-gray-200 px-4 py-3 sticky top-0 z-40">
|
||||||
<div className="max-w-7xl mx-auto flex items-center justify-between">
|
<div className="mx-auto flex items-center justify-between">
|
||||||
<div>
|
<div>
|
||||||
<h1 className="text-xl font-semibold text-gray-900">{exam.title}</h1>
|
<h1 className="text-xl font-semibold text-gray-900">{exam.title}</h1>
|
||||||
<p className="text-sm text-gray-600">
|
<p className="text-sm text-gray-600">
|
||||||
|
|
@ -294,10 +294,10 @@ const PDFTestInterface: React.FC = () => {
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
{/* Main Content */}
|
{/* Main Content */}
|
||||||
<div className="max-w-7xl mx-auto p-4">
|
<div className="mx-auto p-4">
|
||||||
<div className="grid grid-cols-1 lg:grid-cols-2 gap-6">
|
<div className="grid grid-cols-1 lg:grid-cols-5 gap-6">
|
||||||
{/* Document Viewer */}
|
{/* Document Viewer */}
|
||||||
<div className="bg-white border border-gray-200 rounded-lg p-6">
|
<div className="lg:col-span-3 bg-white border border-gray-200 rounded-lg p-4">
|
||||||
<div className="flex items-center space-x-2 mb-4">
|
<div className="flex items-center space-x-2 mb-4">
|
||||||
{exam.testDocument?.type === 'pdf' ? (
|
{exam.testDocument?.type === 'pdf' ? (
|
||||||
<FaFileAlt className="w-5 h-5 text-red-600" />
|
<FaFileAlt className="w-5 h-5 text-red-600" />
|
||||||
|
|
@ -327,7 +327,7 @@ const PDFTestInterface: React.FC = () => {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Answer Key */}
|
{/* Answer Key */}
|
||||||
<div className="bg-white border border-gray-200 rounded-lg p-6">
|
<div className="lg:col-span-2 bg-white border border-gray-200 rounded-lg p-4">
|
||||||
<h3 className="text-lg font-semibold text-gray-900 mb-4">Cevap Anahtarı</h3>
|
<h3 className="text-lg font-semibold text-gray-900 mb-4">Cevap Anahtarı</h3>
|
||||||
|
|
||||||
<div className="space-y-6 max-h-96 overflow-y-auto">
|
<div className="space-y-6 max-h-96 overflow-y-auto">
|
||||||
|
|
|
||||||
|
|
@ -104,7 +104,7 @@ export const QuestionRenderer: React.FC<QuestionRendererProps> = ({
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const getQuestionTypeLabel = (type: string): string => {
|
const getQuestionTypeLabel = (questionType: string): string => {
|
||||||
const labels: Record<string, string> = {
|
const labels: Record<string, string> = {
|
||||||
'multiple-choice': 'Çoktan Seçmeli',
|
'multiple-choice': 'Çoktan Seçmeli',
|
||||||
'fill-blank': 'Boşluk Doldurma',
|
'fill-blank': 'Boşluk Doldurma',
|
||||||
|
|
@ -115,7 +115,7 @@ const getQuestionTypeLabel = (type: string): string => {
|
||||||
'ordering': 'Sıralama',
|
'ordering': 'Sıralama',
|
||||||
'calculation': 'Hesaplama'
|
'calculation': 'Hesaplama'
|
||||||
};
|
};
|
||||||
return labels[type] || type;
|
return labels[questionType] || questionType;
|
||||||
};
|
};
|
||||||
|
|
||||||
const getDifficultyLabel = (difficulty: string): string => {
|
const getDifficultyLabel = (difficulty: string): string => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue