Skip to content

Update quiz set and quiz edit form UI #3153

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 77 additions & 5 deletions apps/upskii/messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -3830,12 +3830,84 @@
"plural": "Quiz Sets",
"singular": "Quiz Set",
"description": "Quiz sets are used to group quizzes together for learning purposes.",
"create": "Create quiz set",
"create_description": "Create a new quiz set",
"name": "Set name",
"edit": "Edit set",
"link-quizzes": "Link Quizzes",
"link-modules": "Link modules"
"link-modules": "Link modules",
"editing": "Updating...",
"creating": "Creating...",
"create": "Create Quiz Set",
"edit": "Edit Quiz Set",
"form-sections": {
"basic": {
"title": "Basic Information",
"subtitle": "Set up the fundamental details of your quiz"
},
"timing-limit": {
"title": "Basic Information",
"subtitle": "Set up the fundamental details of your quiz"
Comment on lines +3849 to +3851

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The timing-limit section's title and subtitle are the same as the basic section. Consider a more descriptive title and subtitle specific to timing and attempt limits.

      "timing-limit": {
        "title": "Timing & Limits",
        "subtitle": "Set attempt and time limits for the quiz"
      },

},
"schedule": {
"title": "Schedule",
"subtitle": "Set availability and due dates for the quiz"
},
"settings": {
"title": "Quiz Settings",
"subtitle": "Configure quiz behavior and student permissions"
}
},
"form-description": "Configure your quiz settings, timing, and permissions to create an engaging learning experience for your students.",
"required-badge": "Required",
"form-fields": {
"name": {
"title": "Set Name",
"description": "Choose a clear, descriptive name for your quiz",
"placeholder": "e.g., Chapter 5 Assessment"
},
"attempt_limit": {
"title": "Attempt Limit",
"description": "Maximum number of times a user can attempt the quiz. Leave 0 for unlimited.",
"placeholder": "e.g., 3"
},
"time_limit_minutes": {
"title": "Time Limit (minutes)",
"description": "The time allowed to complete the quiz in minutes. Leave 0 for no time limit.",
"placeholder": "e.g, 60"
},
"available_date": {
"title": "Available From",
"description": "Date and time when the quiz becomes available to participants."
},
"due_date": {
"title": "Due Date",
"description": "Deadline for submitting the quiz."
},
"explanation_mode": {
"title": "Explanation Mode",
"description": "Choose when and how students can see answer explanations",
"placeholder": "Select explanation timing",
"select_never": "Never show answer explanations",
"select_correct_answer": "Only show explanation of correct answers",
"select_all_answer": "Show explanation of all answers"
},
"instruction": {
"title": "Instructions",
"description": "Provide detailed instructions for students using the rich text editor, displayed before starting the quiz.",
"save": "Save Instruction",
"saving": "Saving..."
},
"allow_view_results": {
"title": "Allow Immediate Results",
"description": "Enable users to see their score immediately upon submission."
},
"results_released": {
"title": "Results Released",
"description": "Mark quiz results as released, allowing detailed feedback and explanations."
},
"allow_view_old_attempts": {
"title": "Allow Review Old Attempts",
"description": "Revisit users' previous quiz attempts. Before results are released, users can view only their submitted answers. Once results are released, they'll see their answers along with detailed results and feedback."
}
}
},
"ws-quizzes": {
"plural": "Quizzes",
Expand Down Expand Up @@ -4311,4 +4383,4 @@
"users": "Users",
"teams": "Teams"
}
}
}
90 changes: 80 additions & 10 deletions apps/upskii/messages/vi.json
Original file line number Diff line number Diff line change
Expand Up @@ -3828,15 +3828,85 @@
"create_description": "Tạo một hàng chờ mới"
},
"ws-quiz-sets": {
"plural": "Bộ trắc nghiệm",
"singular": "Bộ trắc nghiệm",
"description": "Quản lý các bộ trắc nghiệm trong không gian làm việc của bạn bao gồm các câu hỏi nhiều lựa chọn dành cho mục đích học tập.",
"create": "Tạo bộ trắc nghiệm",
"create_description": "Tạo bộ trắc nghiệm mới",
"name": "Tên bộ trắc nghiệm",
"edit": "Chỉnh sửa bộ",
"link-quizzes": "Liên kết câu hỏi",
"link-modules": "Liên kết mô-đun"
"plural": "Bộ câu hỏi",
"singular": "Bộ câu hỏi",
"description": "Bộ câu hỏi được sử dụng để nhóm các câu quiz lại với nhau cho mục đích học tập.",
"create_description": "Tạo một bộ câu hỏi mới",
"link-quizzes": "Liên kết bài kiểm tra",
"link-modules": "Liên kết học phần",
"editing": "Đang cập nhật...",
"creating": "Đang tạo...",
"create": "Tạo bộ câu hỏi",
"edit": "Chỉnh sửa bộ câu hỏi",
"form-sections": {
"basic": {
"title": "Thông tin cơ bản",
"subtitle": "Thiết lập các chi tiết cơ bản cho bài kiểm tra của bạn"
},
"timing-limit": {
"title": "Thông tin cơ bản",
"subtitle": "Thiết lập các chi tiết cơ bản cho bài kiểm tra của bạn"
Comment on lines +3855 to +3857

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The timing-limit section's title and subtitle are the same as the basic section. Update these to be more descriptive for Vietnamese-speaking users.

      "timing-limit": {
        "title": "Thời gian & Giới hạn",
        "subtitle": "Thiết lập giới hạn về số lần làm bài và thời gian cho bài kiểm tra của bạn"
      },

},
"schedule": {
"title": "Lịch trình",
"subtitle": "Đặt thời gian khả dụng và thời hạn cho bài kiểm tra"
},
"settings": {
"title": "Cài đặt bài kiểm tra",
"subtitle": "Cấu hình hành vi bài kiểm tra và quyền của sinh viên"
}
},
"form-description": "Cấu hình cài đặt, thời gian và quyền của bài kiểm tra để tạo trải nghiệm học tập hấp dẫn cho sinh viên của bạn.",
"required-badge": "Bắt buộc",
"form-fields": {
"name": {
"title": "Tên bộ câu hỏi",
"description": "Chọn một tên rõ ràng, mô tả cho bài kiểm tra của bạn",
"placeholder": "Ví dụ: Kiểm tra Chương 5"
},
"attempt_limit": {
"title": "Giới hạn số lần làm bài",
"description": "Số lần tối đa người dùng có thể làm bài kiểm tra. Để 0 nếu không giới hạn.",
"placeholder": "Ví dụ: 3"
},
"time_limit_minutes": {
"title": "Giới hạn thời gian (phút)",
"description": "Thời gian cho phép hoàn thành bài kiểm tra tính bằng phút. Để 0 nếu không giới hạn thời gian.",
"placeholder": "Ví dụ: 60"
},
"available_date": {
"title": "Có hiệu lực từ",
"description": "Ngày và giờ bài kiểm tra có sẵn cho người tham gia."
},
"due_date": {
"title": "Ngày hết hạn",
"description": "Thời hạn nộp bài kiểm tra."
},
"explanation_mode": {
"title": "Chế độ giải thích",
"description": "Chọn thời điểm và cách học sinh có thể xem giải thích câu trả lời",
"placeholder": "Chọn thời điểm giải thích",
"select_never": "Không bao giờ hiển thị giải thích câu trả lời",
"select_correct_answer": "Chỉ hiển thị giải thích các câu trả lời đúng",
"select_all_answer": "Hiển thị giải thích của tất cả các câu trả lời"
},
"instruction": {
"title": "Hướng dẫn",
"description": "Cung cấp hướng dẫn chi tiết cho học sinh bằng trình soạn thảo văn bản đa dạng thức, hiển thị trước khi bắt đầu bài kiểm tra."
},
Comment on lines +3902 to +3905

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The instruction object is missing the save and saving keys, which are present in the en.json file. Add these translations for consistency.

      "instruction": {
        "title": "Hướng dẫn",
        "description": "Cung cấp hướng dẫn chi tiết cho học sinh bằng trình soạn thảo văn bản đa dạng thức, hiển thị trước khi bắt đầu bài kiểm tra.",
        "save": "Lưu Hướng dẫn",
        "saving": "Đang lưu..."
      },

"allow_view_results": {
"title": "Cho phép xem kết quả ngay lập tức",
"description": "Cho phép người dùng xem điểm của họ ngay sau khi nộp bài."
},
"results_released": {
"title": "Đã công bố kết quả",
"description": "Đánh dấu kết quả bài kiểm tra đã công bố, cho phép xem phản hồi chi tiết và giải thích."
},
"allow_view_old_attempts": {
"title": "Cho phép xem lại các lần làm bài cũ",
"description": "Cho phép người dùng xem lại các lần làm bài kiểm tra trước đó của họ. Trước khi kết quả được công bố, người dùng chỉ có thể xem các câu trả lời đã nộp của mình. Khi kết quả được công bố, họ sẽ thấy các câu trả lời cùng với kết quả chi tiết và phản hồi."
}
}
},
"ws-quizzes": {
"plural": "Câu hỏi trắc nghiệm",
Expand Down Expand Up @@ -4308,4 +4378,4 @@
"browse_courses": "Xem các khóa học",
"certified": "Được chứng nhận"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import QuizSetForm from '../../form';
import { createClient } from '@tuturuuu/supabase/next/server';

interface Props {
params: Promise<{
wsId: string;
// courseId: string;
moduleId: string;
setId: string;
}>;
}

export default async function Page({ params }: Props) {
const { wsId, moduleId, setId } = await params;
const setDetails = await getQuizSetDetails(setId);

if (!setDetails) {
return <div>Error: Quiz set not found</div>;
}

return (
<div>
<QuizSetForm wsId={wsId} moduleId={moduleId} data={setDetails} />
</div>
);
}

async function getQuizSetDetails(setId: string) {
const supabase = await createClient();

const queryBuilder = supabase
.from('workspace_quiz_sets')
.select('*')
.eq('id', setId)
.single();
const { data, error } = await queryBuilder;

if (error) {
console.error('Error fetching quiz set details:', error);
return null;
}

return data;
}
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,6 @@ export default function BeforeTakingQuizWhole({

const canViewTotalPointsOnly = quizData.resultsReleased;

console.log('Test', quizData.attempts[0]);

// const canViewOldAttemptsResults = quizData.resultsReleased;
// can view attempts with points in detailed explanation
const canViewOldAttemptsResults =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export const getQuizSetColumns = (
<QuizSetRowActions
row={row}
wsId={extraData.wsId}
courseId={extraData.courseId}
moduleId={extraData.moduleId}
/>
),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import QuizSetForm from '../form';

interface Props {
params: Promise<{
wsId: string;
moduleId: string;
}>;
}

export default async function Page({ params }: Props) {
const { wsId, moduleId } = await params;
return (
<div>
<QuizSetForm wsId={wsId} moduleId={moduleId} />
</div>
);
}
Loading
Loading