CoolFace
Apppublic

eaglelandsonce/DatabricksJeopardy

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes
index.html233 linesDownload Raw Back to root
1<!DOCTYPE html>2<html lang="en">3<head>4    <meta charset="UTF-8">5    <meta name="viewport" content="width=device-width, initial-scale=1.0">6    <title>Databricks Jeopardy</title>7    <style>8        body {9            font-family: Arial, sans-serif;10            display: flex;11            flex-direction: column;12            align-items: center;13            background-color: #f0f0f0;14        }15        h1 {16            color: #0078D4;17        }18        #game-board {19            display: grid;20            grid-template-columns: repeat(5, 1fr);21            gap: 10px;22            margin-bottom: 20px;23        }24        .card {25            width: 150px;26            height: 100px;27            background-color: #0078D4;28            color: #ffffff;29            display: flex;30            justify-content: center;31            align-items: center;32            font-size: 16px;33            font-weight: bold;34            cursor: pointer;35            transition: background-color 0.3s;36            text-align: center;37        }38        .card:hover {39            background-color: #005a9e;40        }41        .card.disabled {42            background-color: #cccccc;43            cursor: default;44        }45        #question-display {46            width: 80%;47            text-align: center;48            margin-bottom: 20px;49        }50        #score {51            font-size: 24px;52            font-weight: bold;53            color: #0078D4;54        }55        .answer-btn {56            margin: 5px;57            padding: 10px;58            font-size: 16px;59            cursor: pointer;60        }61    </style>62</head>63<body>64    <h1>Databricks Jeopardy</h1>65    <p><strong>Question Reference:</strong> <a href="https://learn.microsoft.com/en-us/azure/databricks/introduction/" target="_blank">Databricks Documentation</a></p>66    <div id="game-board"></div>67    <div id="question-display"></div>68    <div id="score">Score: 0</div>69 70    <script>71        const categories = ['Databricks Overview', 'Data Lakehouse', 'ML & AI', 'Security & Governance', 'DevOps & CI/CD'];72        const questions = [73            [74                {75                    q: "What is Azure Databricks primarily used for?",76                    a: ["Data storage", "Data analytics and AI", "Web hosting"],77                    correct: 178                },79                {80                    q: "How does Databricks integrate with cloud services?",81                    a: ["Proprietary storage systems", "Managed cloud infrastructure and storage integration", "Local data storage only"],82                    correct: 183                },84                {85                    q: "Which programming languages can be used in Databricks notebooks?",86                    a: ["Python, R, Scala, SQL", "Java, HTML", "C++"],87                    correct: 088                }89            ],90            [91                {92                    q: "What is a data lakehouse?",93                    a: ["A new data storage type", "A unified platform combining data lakes and data warehouses", "A web development tool"],94                    correct: 195                },96                {97                    q: "Which technology is essential for Databricks’ ETL process?",98                    a: ["Delta Lake", "Kafka", "Hadoop"],99                    correct: 0100                },101                {102                    q: "How does Databricks help with data engineering?",103                    a: ["By using SQL only", "Combining Apache Spark with Delta Lake and custom tools", "Manually building ETL processes"],104                    correct: 1105                }106            ],107            [108                {109                    q: "Which libraries are included in Databricks Runtime for Machine Learning?",110                    a: ["TensorFlow", "Hugging Face Transformers", "Both"],111                    correct: 2112                },113                {114                    q: "How does Databricks integrate with generative AI models?",115                    a: ["By training models from scratch", "By using pre-trained models and tools like Hugging Face", "Databricks does not support AI"],116                    correct: 1117                },118                {119                    q: "What is MLflow used for in Databricks?",120                    a: ["Logging errors", "Tracking and managing ML models", "Scheduling tasks"],121                    correct: 1122                }123            ],124            [125                {126                    q: "What tool in Databricks manages data governance?",127                    a: ["Delta Live Tables", "Unity Catalog", "MLflow"],128                    correct: 1129                },130                {131                    q: "How does Unity Catalog support data security?",132                    a: ["With SQL-based access controls", "By encrypting all data", "By restricting user access to clusters"],133                    correct: 0134                },135                {136                    q: "What is Delta Sharing used for?",137                    a: ["Backup of Delta tables", "Secure data sharing within and outside the organization", "Optimizing SQL queries"],138                    correct: 1139                }140            ],141            [142                {143                    q: "What is Databricks Jobs used for?",144                    a: ["Managing notebooks and scheduling tasks", "Building websites", "Creating clusters"],145                    correct: 0146                },147                {148                    q: "How does Databricks integrate with version control systems?",149                    a: ["By using Unity Catalog", "Through Git integration", "By manually tracking code versions"],150                    correct: 1151                },152                {153                    q: "Which tool allows Databricks users to automate their CI/CD pipelines?",154                    a: ["Terraform", "Jobs", "Azure DevOps and Git"],155                    correct: 2156                }157            ]158        ];159 160        let score = 0;161        let timeoutId;162        const gameBoard = document.getElementById('game-board');163        const questionDisplay = document.getElementById('question-display');164        const scoreDisplay = document.getElementById('score');165 166        function createBoard() {167            for (let i = 0; i < 5; i++) {168                for (let j = 0; j < 3; j++) {169                    const card = document.createElement('div');170                    card.className = 'card';171                    card.textContent = `${categories[i]} $${(j + 1) * 100}`;172                    card.onclick = () => showQuestion(i, j, card);173                    gameBoard.appendChild(card);174                }175            }176        }177 178        function showQuestion(category, difficulty, cardElement) {179            if (cardElement.classList.contains('disabled')) return;180            if (timeoutId) {181                clearTimeout(timeoutId);182                timeoutId = null;183            }184            const question = questions[category][difficulty];185            let answerHtml = question.a.map((answer, index) => 186                `<button class="answer-btn" onclick="checkAnswer(${category}, ${difficulty}, ${index})">${answer}</button>`187            ).join('');188            questionDisplay.innerHTML = `189                <h2>${categories[category]} for $${(difficulty + 1) * 100}</h2>190                <p>${question.q}</p>191                ${answerHtml}192            `;193            cardElement.classList.add('disabled');194            cardElement.style.backgroundColor = '#cccccc';195            cardElement.style.cursor = 'default';196        }197 198        function checkAnswer(category, difficulty, selectedAnswer) {199            const buttons = document.querySelectorAll('.answer-btn');200            buttons.forEach(btn => btn.disabled = true);201            const question = questions[category][difficulty];202            const isCorrect = selectedAnswer === question.correct;203            const value = (difficulty + 1) * 100;204            if (isCorrect) {205                score += value;206                questionDisplay.innerHTML += `<p style="color: green;">Correct! You earned $${value}.</p>`;207            } else {208                score -= value;209                questionDisplay.innerHTML += `<p style="color: red;">Sorry, that's incorrect. You lost $${value}. The correct answer was: ${question.a[question.correct]}</p>`;210            }211            scoreDisplay.textContent = `Score: ${score}`;212            timeoutId = setTimeout(() => {213                clearQuestion();214                checkGameCompletion();215            }, 2000);216        }217 218        function clearQuestion() {219            questionDisplay.innerHTML = '';220        }221 222        function checkGameCompletion() {223            const remainingCards = document.querySelectorAll('.card:not(.disabled)');224            if (remainingCards.length === 0) {225                questionDisplay.innerHTML = `<h2>Game Over!</h2><p>Your final score is $${score}.</p>`;226            }227        }228 229        createBoard();230    </script>231</body>232</html>233