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: [
|
||||
{
|
||||
id: "q1",
|
||||
type: "multiple-choice",
|
||||
questionType: "multiple-choice",
|
||||
title: "Verb Tenses",
|
||||
content: "Select the appropriate tense form for the given context.",
|
||||
options: [
|
||||
|
|
@ -21,26 +21,23 @@ export const generateMockPools = (): QuestionPoolDto[] => [
|
|||
correctAnswer: "opt2",
|
||||
points: 10,
|
||||
difficulty: "easy",
|
||||
tags: ["grammar", "verbs"],
|
||||
creationTime: new Date(),
|
||||
lastModificationTime: new Date(),
|
||||
},
|
||||
{
|
||||
id: "q2",
|
||||
type: "fill-blank",
|
||||
questionType: "fill-blank",
|
||||
title: "Articles",
|
||||
content:
|
||||
'Fill in the blank: "I saw _____ elephant at the zoo yesterday."',
|
||||
correctAnswer: "an",
|
||||
points: 15,
|
||||
difficulty: "medium",
|
||||
tags: ["grammar", "articles"],
|
||||
creationTime: new Date(),
|
||||
lastModificationTime: new Date(),
|
||||
},
|
||||
],
|
||||
tags: ["grammar", "fundamentals"],
|
||||
createdBy: "admin",
|
||||
creationTime: new Date(),
|
||||
},
|
||||
];
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ const ExamInterface: React.FC = () => {
|
|||
|
||||
const currentQuestion = exam.questions[currentQuestionIndex]
|
||||
const currentAnswer = session.answers.find((a) => a.questionId === currentQuestion?.id)
|
||||
|
||||
|
||||
const navigateQuestion = (direction: 'next' | 'prev' | number) => {
|
||||
if (typeof direction === 'number') {
|
||||
setCurrentQuestionIndex(Math.max(0, Math.min(exam.questions.length - 1, direction)))
|
||||
|
|
@ -206,7 +206,7 @@ const ExamInterface: React.FC = () => {
|
|||
|
||||
{/* Header */}
|
||||
<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>
|
||||
<h1 className="text-xl font-semibold text-gray-900">{exam.title}</h1>
|
||||
<p className="text-sm text-gray-600">
|
||||
|
|
@ -228,7 +228,7 @@ const ExamInterface: React.FC = () => {
|
|||
</header>
|
||||
|
||||
{/* 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">
|
||||
{/* Question Content */}
|
||||
<div className="lg:col-span-3 space-y-6">
|
||||
|
|
|
|||
|
|
@ -272,7 +272,7 @@ const PDFTestInterface: React.FC = () => {
|
|||
|
||||
{/* Header */}
|
||||
<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>
|
||||
<h1 className="text-xl font-semibold text-gray-900">{exam.title}</h1>
|
||||
<p className="text-sm text-gray-600">
|
||||
|
|
@ -294,10 +294,10 @@ const PDFTestInterface: React.FC = () => {
|
|||
</header>
|
||||
|
||||
{/* Main Content */}
|
||||
<div className="max-w-7xl mx-auto p-4">
|
||||
<div className="grid grid-cols-1 lg:grid-cols-2 gap-6">
|
||||
<div className="mx-auto p-4">
|
||||
<div className="grid grid-cols-1 lg:grid-cols-5 gap-6">
|
||||
{/* 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">
|
||||
{exam.testDocument?.type === 'pdf' ? (
|
||||
<FaFileAlt className="w-5 h-5 text-red-600" />
|
||||
|
|
@ -327,7 +327,7 @@ const PDFTestInterface: React.FC = () => {
|
|||
</div>
|
||||
|
||||
{/* 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>
|
||||
|
||||
<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> = {
|
||||
'multiple-choice': 'Çoktan Seçmeli',
|
||||
'fill-blank': 'Boşluk Doldurma',
|
||||
|
|
@ -115,7 +115,7 @@ const getQuestionTypeLabel = (type: string): string => {
|
|||
'ordering': 'Sıralama',
|
||||
'calculation': 'Hesaplama'
|
||||
};
|
||||
return labels[type] || type;
|
||||
return labels[questionType] || questionType;
|
||||
};
|
||||
|
||||
const getDifficultyLabel = (difficulty: string): string => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue