Ujian Shortcut Microsoft Word
body {
box-sizing: border-box;
margin: 0;
padding: 0;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
min-height: 100%;
overflow-x: hidden;
}
* {
box-sizing: border-box;
}
.container {
max-width: 1400px;
margin: 0 auto;
padding: 20px;
min-height: 100%;
}
.welcome-screen {
display: flex;
align-items: center;
justify-content: center;
min-height: 100%;
padding: 40px 20px;
}
.welcome-card {
background: white;
border-radius: 24px;
padding: 48px;
box-shadow: 0 20px 60px rgba(0,0,0,0.3);
max-width: 500px;
width: 100%;
text-align: center;
}
.welcome-icon {
font-size: 64px;
margin-bottom: 24px;
}
.welcome-title {
font-size: 32px;
font-weight: 700;
color: #2d3748;
margin-bottom: 12px;
}
.welcome-subtitle {
font-size: 18px;
color: #718096;
margin-bottom: 32px;
}
.input-group {
margin-bottom: 24px;
text-align: left;
}
.input-label {
display: block;
font-size: 14px;
font-weight: 600;
color: #4a5568;
margin-bottom: 8px;
}
.input-field {
width: 100%;
padding: 14px 16px;
border: 2px solid #e2e8f0;
border-radius: 12px;
font-size: 16px;
transition: all 0.3s;
}
.input-field:focus {
outline: none;
border-color: #667eea;
box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}
.btn-primary {
width: 100%;
padding: 16px;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
border: none;
border-radius: 12px;
font-size: 18px;
font-weight: 600;
cursor: pointer;
transition: transform 0.2s, box-shadow 0.2s;
}
.btn-primary:hover {
transform: translateY(-2px);
box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}
.btn-primary:disabled {
opacity: 0.6;
cursor: not-allowed;
transform: none;
}
.exam-screen {
display: none;
padding: 20px 0;
}
.exam-header {
background: white;
border-radius: 16px;
padding: 24px;
margin-bottom: 24px;
box-shadow: 0 4px 20px rgba(0,0,0,0.1);
display: flex;
justify-content: space-between;
align-items: center;
flex-wrap: wrap;
gap: 16px;
}
.exam-info h2 {
font-size: 24px;
color: #2d3748;
margin: 0 0 4px 0;
}
.exam-info p {
font-size: 14px;
color: #718096;
margin: 0;
}
.timer {
display: flex;
align-items: center;
gap: 12px;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
padding: 12px 24px;
border-radius: 12px;
color: white;
}
.timer-icon {
font-size: 24px;
}
.timer-text {
font-size: 14px;
font-weight: 600;
margin: 0;
}
.timer-value {
font-size: 28px;
font-weight: 700;
margin: 0;
}
.exam-content {
display: grid;
grid-template-columns: 280px 1fr;
gap: 24px;
}
.question-nav {
background: white;
border-radius: 16px;
padding: 24px;
box-shadow: 0 4px 20px rgba(0,0,0,0.1);
height: fit-content;
position: sticky;
top: 20px;
}
.nav-title {
font-size: 16px;
font-weight: 700;
color: #2d3748;
margin: 0 0 16px 0;
}
.nav-grid {
display: grid;
grid-template-columns: repeat(5, 1fr);
gap: 8px;
margin-bottom: 20px;
}
.nav-btn {
aspect-ratio: 1;
border: 2px solid #e2e8f0;
background: white;
border-radius: 8px;
font-size: 14px;
font-weight: 600;
color: #4a5568;
cursor: pointer;
transition: all 0.2s;
}
.nav-btn:hover {
border-color: #667eea;
color: #667eea;
}
.nav-btn.active {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
border-color: transparent;
}
.nav-btn.answered {
background: #48bb78;
color: white;
border-color: transparent;
}
.submit-btn {
width: 100%;
padding: 12px;
background: #48bb78;
color: white;
border: none;
border-radius: 8px;
font-size: 16px;
font-weight: 600;
cursor: pointer;
transition: all 0.2s;
}
.submit-btn:hover {
background: #38a169;
transform: translateY(-2px);
}
.question-panel {
background: white;
border-radius: 16px;
padding: 32px;
box-shadow: 0 4px 20px rgba(0,0,0,0.1);
min-height: 500px;
}
.question-number {
display: inline-block;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
padding: 8px 16px;
border-radius: 8px;
font-size: 14px;
font-weight: 600;
margin-bottom: 20px;
}
.question-text {
font-size: 20px;
font-weight: 600;
color: #2d3748;
margin-bottom: 32px;
line-height: 1.6;
}
.options {
display: flex;
flex-direction: column;
gap: 16px;
}
.option {
display: flex;
align-items: center;
padding: 20px;
border: 2px solid #e2e8f0;
border-radius: 12px;
cursor: pointer;
transition: all 0.2s;
}
.option:hover {
border-color: #667eea;
background: #f7fafc;
}
.option.selected {
border-color: #667eea;
background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}
.option-radio {
width: 24px;
height: 24px;
border: 2px solid #cbd5e0;
border-radius: 50%;
margin-right: 16px;
position: relative;
flex-shrink: 0;
}
.option.selected .option-radio {
border-color: #667eea;
}
.option.selected .option-radio::after {
content: '';
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 12px;
height: 12px;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
border-radius: 50%;
}
.option-label {
font-size: 16px;
color: #2d3748;
font-weight: 500;
}
.result-screen {
display: none;
padding: 40px 20px;
min-height: 100%;
align-items: center;
justify-content: center;
}
.result-card {
background: white;
border-radius: 24px;
padding: 48px;
box-shadow: 0 20px 60px rgba(0,0,0,0.3);
max-width: 600px;
width: 100%;
text-align: center;
}
.result-icon {
font-size: 80px;
margin-bottom: 24px;
}
.result-title {
font-size: 32px;
font-weight: 700;
color: #2d3748;
margin-bottom: 16px;
}
.score-display {
font-size: 72px;
font-weight: 700;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
margin-bottom: 24px;
}
.result-details {
background: #f7fafc;
border-radius: 12px;
padding: 24px;
margin-bottom: 32px;
}
.result-row {
display: flex;
justify-content: space-between;
padding: 12px 0;
border-bottom: 1px solid #e2e8f0;
}
.result-row:last-child {
border-bottom: none;
}
.result-label {
font-size: 16px;
color: #718096;
}
.result-value {
font-size: 16px;
font-weight: 600;
color: #2d3748;
}
.btn-restart {
width: 100%;
padding: 16px;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
border: none;
border-radius: 12px;
font-size: 18px;
font-weight: 600;
cursor: pointer;
transition: transform 0.2s;
}
.btn-restart:hover {
transform: translateY(-2px);
}
@media (max-width: 768px) {
.exam-content {
grid-template-columns: 1fr;
}
.question-nav {
position: static;
}
.exam-header {
flex-direction: column;
text-align: center;
}
.welcome-card, .result-card {
padding: 32px 24px;
}
}
@view-transition { navigation: auto; }
📝
Ujian Shortcut Microsoft Word
Assessment Semester Akhir
Navigasi Soal
🎉
Ujian Selesai!
0
Nama
Benar 0
Salah 0
Total Soal 10
const defaultConfig = {
exam_title: "Ujian Shortcut Microsoft Word",
exam_subtitle: "Assessment Semester Akhir",
timer_label: "Waktu Tersisa",
background_color: "#667eea",
surface_color: "#ffffff",
text_color: "#2d3748",
primary_action_color: "#667eea",
secondary_action_color: "#48bb78",
font_family: "Segoe UI",
font_size: 16
};
const questions = [
{
question: "Apa fungsi dari shortcut Ctrl + A?",
options: ["Menyalin teks", "Memilih semua teks", "Membuka file", "Mencetak dokumen"],
correct: 1
},
{
question: "Shortcut Ctrl + Z digunakan untuk?",
options: ["Menyimpan dokumen", "Membatalkan aksi terakhir", "Menutup dokumen", "Mengganti teks"],
correct: 1
},
{
question: "Apa fungsi dari Ctrl + C?",
options: ["Memotong teks", "Menyalin teks", "Menempel teks", "Menghapus teks"],
correct: 1
},
{
question: "Shortcut untuk menempel teks yang telah disalin adalah?",
options: ["Ctrl + X", "Ctrl + V", "Ctrl + C", "Ctrl + Z"],
correct: 1
},
{
question: "Ctrl + S digunakan untuk?",
options: ["Mencari teks", "Menyimpan dokumen", "Memilih semua", "Membuka dokumen"],
correct: 1
},
{
question: "Apa fungsi dari Ctrl + X?",
options: ["Menyalin teks", "Memotong teks", "Menempel teks", "Membatalkan aksi"],
correct: 1
},
{
question: "Shortcut Ctrl + B digunakan untuk?",
options: ["Membuat teks miring", "Membuat teks tebal", "Membuat garis bawah", "Mengubah warna teks"],
correct: 1
},
{
question: "Apa fungsi dari Ctrl + I?",
options: ["Membuat teks tebal", "Membuat teks miring", "Membuat garis bawah", "Menyelaraskan teks"],
correct: 1
},
{
question: "Shortcut untuk membuat garis bawah pada teks adalah?",
options: ["Ctrl + B", "Ctrl + I", "Ctrl + U", "Ctrl + L"],
correct: 2
},
{
question: "Ctrl + P digunakan untuk?",
options: ["Membuka file", "Menyimpan file", "Mencetak dokumen", "Menutup dokumen"],
correct: 2
}
];
let currentQuestion = 0;
let answers = new Array(questions.length).fill(null);
let studentName = "";
let timeLeft = 900;
let timerInterval = null;
const dataHandler = {
onDataChanged(data) {
// Data handler untuk menyimpan hasil ujian
}
};
async function initializeApp() {
if (window.dataSdk) {
const initResult = await window.dataSdk.init(dataHandler);
if (!initResult.isOk) {
console.error("Failed to initialize data SDK");
}
}
if (window.elementSdk) {
await window.elementSdk.init({
defaultConfig,
onConfigChange: async (config) => {
const examTitle = config.exam_title || defaultConfig.exam_title;
const examSubtitle = config.exam_subtitle || defaultConfig.exam_subtitle;
const timerLabel = config.timer_label || defaultConfig.timer_label;
const backgroundColor = config.background_color || defaultConfig.background_color;
const surfaceColor = config.surface_color || defaultConfig.surface_color;
const textColor = config.text_color || defaultConfig.text_color;
const primaryActionColor = config.primary_action_color || defaultConfig.primary_action_color;
const secondaryActionColor = config.secondary_action_color || defaultConfig.secondary_action_color;
const fontFamily = config.font_family || defaultConfig.font_family;
const fontSize = config.font_size || defaultConfig.font_size;
document.getElementById('examTitle').textContent = examTitle;
document.getElementById('examSubtitle').textContent = examSubtitle;
document.getElementById('headerTitle').textContent = examTitle;
document.getElementById('timerLabel').textContent = timerLabel;
document.body.style.background = `linear-gradient(135deg, ${backgroundColor} 0%, ${primaryActionColor} 100%)`;
document.body.style.fontFamily = `${fontFamily}, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif`;
document.body.style.fontSize = `${fontSize}px`;
const welcomeCard = document.querySelector('.welcome-card');
const examHeader = document.querySelector('.exam-header');
const questionNav = document.querySelector('.question-nav');
const questionPanel = document.querySelector('.question-panel');
const resultCard = document.querySelector('.result-card');
if (welcomeCard) welcomeCard.style.backgroundColor = surfaceColor;
if (examHeader) examHeader.style.backgroundColor = surfaceColor;
if (questionNav) questionNav.style.backgroundColor = surfaceColor;
if (questionPanel) questionPanel.style.backgroundColor = surfaceColor;
if (resultCard) resultCard.style.backgroundColor = surfaceColor;
document.querySelectorAll('.welcome-title, .exam-info h2, .nav-title, .question-text, .result-title').forEach(el => {
el.style.color = textColor;
});
document.querySelectorAll('.btn-primary, .btn-restart').forEach(el => {
el.style.background = `linear-gradient(135deg, ${primaryActionColor} 0%, ${backgroundColor} 100%)`;
});
document.querySelector('.submit-btn').style.backgroundColor = secondaryActionColor;
document.querySelectorAll('.timer, .question-number, .nav-btn.active').forEach(el => {
el.style.background = `linear-gradient(135deg, ${primaryActionColor} 0%, ${backgroundColor} 100%)`;
});
document.querySelector('.score-display').style.background = `linear-gradient(135deg, ${primaryActionColor} 0%, ${backgroundColor} 100%)`;
document.querySelector('.score-display').style.webkitBackgroundClip = 'text';
document.querySelector('.score-display').style.webkitTextFillColor = 'transparent';
document.querySelector('.score-display').style.backgroundClip = 'text';
},
mapToCapabilities: (config) => ({
recolorables: [
{
get: () => config.background_color || defaultConfig.background_color,
set: (value) => {
config.background_color = value;
window.elementSdk.setConfig({ background_color: value });
}
},
{
get: () => config.surface_color || defaultConfig.surface_color,
set: (value) => {
config.surface_color = value;
window.elementSdk.setConfig({ surface_color: value });
}
},
{
get: () => config.text_color || defaultConfig.text_color,
set: (value) => {
config.text_color = value;
window.elementSdk.setConfig({ text_color: value });
}
},
{
get: () => config.primary_action_color || defaultConfig.primary_action_color,
set: (value) => {
config.primary_action_color = value;
window.elementSdk.setConfig({ primary_action_color: value });
}
},
{
get: () => config.secondary_action_color || defaultConfig.secondary_action_color,
set: (value) => {
config.secondary_action_color = value;
window.elementSdk.setConfig({ secondary_action_color: value });
}
}
],
borderables: [],
fontEditable: {
get: () => config.font_family || defaultConfig.font_family,
set: (value) => {
config.font_family = value;
window.elementSdk.setConfig({ font_family: value });
}
},
fontSizeable: {
get: () => config.font_size || defaultConfig.font_size,
set: (value) => {
config.font_size = value;
window.elementSdk.setConfig({ font_size: value });
}
}
}),
mapToEditPanelValues: (config) => new Map([
["exam_title", config.exam_title || defaultConfig.exam_title],
["exam_subtitle", config.exam_subtitle || defaultConfig.exam_subtitle],
["timer_label", config.timer_label || defaultConfig.timer_label]
])
});
}
}
function startTimer() {
timerInterval = setInterval(() => {
timeLeft--;
const minutes = Math.floor(timeLeft / 60);
const seconds = timeLeft % 60;
document.getElementById('timerDisplay').textContent =
`${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`;
if (timeLeft <= 0) {
clearInterval(timerInterval);
finishExam();
}
}, 1000);
}
function renderNavigationGrid() {
const navGrid = document.getElementById('navGrid');
navGrid.innerHTML = '';
for (let i = 0; i {
currentQuestion = i;
renderQuestion();
renderNavigationGrid();
});
navGrid.appendChild(btn);
}
}
function renderQuestion() {
const question = questions[currentQuestion];
document.getElementById('questionNumber').textContent = `Soal ${currentQuestion + 1}`;
document.getElementById('questionText').textContent = question.question;
const optionsContainer = document.getElementById('optionsContainer');
optionsContainer.innerHTML = '';
question.options.forEach((option, index) => {
const optionDiv = document.createElement('div');
optionDiv.className = 'option';
if (answers[currentQuestion] === index) {
optionDiv.classList.add('selected');
}
optionDiv.innerHTML = `
${option}
`;
optionDiv.addEventListener('click', () => {
answers[currentQuestion] = index;
renderQuestion();
renderNavigationGrid();
});
optionsContainer.appendChild(optionDiv);
});
}
async function finishExam() {
clearInterval(timerInterval);
let correctAnswers = 0;
questions.forEach((q, i) => {
if (answers[i] === q.correct) {
correctAnswers++;
}
});
const score = Math.round((correctAnswers / questions.length) * 100);
document.getElementById('resultName').textContent = studentName;
document.getElementById('scoreDisplay').textContent = score;
document.getElementById('correctCount').textContent = correctAnswers;
document.getElementById('wrongCount').textContent = questions.length - correctAnswers;
document.getElementById('totalCount').textContent = questions.length;
if (score >= 80) {
document.getElementById('resultIcon').textContent = '🎉';
} else if (score >= 60) {
document.getElementById('resultIcon').textContent = '👍';
} else {
document.getElementById('resultIcon').textContent = '📚';
}
if (window.dataSdk) {
const createResult = await window.dataSdk.create({
student_name: studentName,
score: score,
total_questions: questions.length,
completed_at: new Date().toISOString()
});
if (!createResult.isOk) {
console.error("Failed to save exam result");
}
}
document.getElementById('examScreen').style.display = 'none';
document.getElementById('resultScreen').style.display = 'flex';
}
document.getElementById('startBtn').addEventListener('click', () => {
const nameInput = document.getElementById('studentName');
studentName = nameInput.value.trim();
if (!studentName) {
const messageDiv = document.createElement('div');
messageDiv.style.cssText = 'background: #fed7d7; color: #c53030; padding: 12px; border-radius: 8px; margin-top: 16px; font-size: 14px;';
messageDiv.textContent = 'Mohon masukkan nama Anda terlebih dahulu';
const existingMessage = document.querySelector('.welcome-card > div[style*="background: #fed7d7"]');
if (existingMessage) {
existingMessage.remove();
}
document.querySelector('.welcome-card').appendChild(messageDiv);
return;
}
document.getElementById('studentNameDisplay').textContent = `Siswa: ${studentName}`;
document.getElementById('welcomeScreen').style.display = 'none';
document.getElementById('examScreen').style.display = 'block';
renderNavigationGrid();
renderQuestion();
startTimer();
});
document.getElementById('submitBtn').addEventListener('click', () => {
const unanswered = answers.filter(a => a === null).length;
if (unanswered > 0) {
const confirmDiv = document.createElement('div');
confirmDiv.style.cssText = 'position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 1000;';
confirmDiv.innerHTML = `
Masih ada ${unanswered} soal yang belum dijawab. Yakin ingin menyelesaikan ujian?
`;
document.body.appendChild(confirmDiv);
document.getElementById('cancelSubmit').addEventListener('click', () => {
confirmDiv.remove();
});
document.getElementById('confirmSubmit').addEventListener('click', () => {
confirmDiv.remove();
finishExam();
});
} else {
finishExam();
}
});
document.getElementById('restartBtn').addEventListener('click', () => {
currentQuestion = 0;
answers = new Array(questions.length).fill(null);
timeLeft = 900;
document.getElementById('resultScreen').style.display = 'none';
document.getElementById('welcomeScreen').style.display = 'flex';
document.getElementById('studentName').value = '';
});
initializeApp();
(function(){function c(){var b=a.contentDocument||a.contentWindow.document;if(b){var d=b.createElement('script');d.innerHTML="window.__CF$cv$params={r:'99b3ed3b2422fe90',t:'MTc2MjU5MjkxNi4wMDAwMDA='};var a=document.createElement('script');a.nonce='';a.src='/cdn-cgi/challenge-platform/scripts/jsd/main.js';document.getElementsByTagName('head')[0].appendChild(a);";b.getElementsByTagName('head')[0].appendChild(d)}}if(document.body){var a=document.createElement('iframe');a.height=1;a.width=1;a.style.position='absolute';a.style.top=0;a.style.left=0;a.style.border='none';a.style.visibility='hidden';document.body.appendChild(a);if('loading'!==document.readyState)c();else if(window.addEventListener)document.addEventListener('DOMContentLoaded',c);else{var e=document.onreadystatechange||function(){};document.onreadystatechange=function(b){e(b);'loading'!==document.readyState&&(document.onreadystatechange=e,c())}}}})();