03 Web & Data

IMPORTANT:

Pt. A: Cardinality + Data is made and handed in as groups:

  • https://ek.itslearning.com/LearningToolElement/ViewLearningToolElement.aspx?LearningToolElementId=1411233

Pt. B: Web is made an handed in individually

  • I skal aflevere jeres koden i et github repository. Fx i en main.js eller måske laver i en js fil for hver opgave. Det er op til jer.

    I må rigtig gerne gøre så i deployer jeres redesignede website.

  • https://ek.itslearning.com/LearningToolElement/ViewLearningToolElement.aspx?LearningToolElementId=1433524

Groups can be seen in the bottom.

  • Deadline: 12/10-2025.

Cardinality

  1. Describe Cardinality:

    • What is cardinality in the context of database design?

    • How do different types of cardinality (1:1, 1:N, N:N) affect relationships between entities?

      • What does the tables look like?

  2. Identify Relationships and Cardinality: Consider the following database schema representing a simple book publishing system. Identify the relationships and specify their cardinality between the following entities:

    Schema:

    • Author: (Author_ID, Name, Date_of_Birth, Nationality)

    • Book: (ISBN, Title, Publication_Date, Author_ID, Language, Genre)

    • Book_Publisher: (Book_publisher_ID, ISBN, Publisher)

    • Publisher: (Publisher_ID, Name, Country, Founded_Year)

    • Review: (Review_ID, Score, Comment, Date, ISBN, User_ID)

    • User: (User_ID, Username, Email, Country)

    Questions:

    • What is the cardinality between Author and Book? Can a book have multiple authors? Can an author write more than one book?

    • What is the cardinality between Book and Publisher? Can a book be published by more than one publisher? Can a publisher publish multiple books?

    • What is the cardinality between Book and Review? Can a book have multiple reviews? Can a user review multiple books?

    • What is the cardinality between User and Review? Can a user leave multiple reviews? Can a review belong to more than one user?

Data

Escape Room Game Design and Player Analytics Platform

Project Overview: Design a MySQL database for an escape room business that allows game designers to manage different escape room scenarios, track team progress through rooms, record success rates, and analyze player behaviors. The database supports managing different escape room experiences, logging player actions, tracking team completions, and providing analytics on game difficulty and player performance.

Entities & Relationships

  1. Escape Rooms:

    • RoomID, Title, Theme (e.g., "Haunted Mansion", "Alien Invasion"), DifficultyLevel, Duration (in minutes).

    • Each room can have multiple Puzzles and can host multiple Teams.

  2. Puzzles:

    • PuzzleID, RoomID, PuzzleName, Description, PuzzleType (e.g., "Logic", "Search", "Riddle"), DifficultyRating.

    • Puzzles are linked to Escape Rooms.

  3. Teams:

    • TeamID, TeamName, StartTime, EndTime, CompletionStatus (e.g., "Solved", "Timed Out").

    • Teams can play different escape rooms, and each team consists of multiple Players.

  4. Players:

    • PlayerID, Name, Nickname, Email.

    • Players join Teams, and their performance is tracked during the game.

  5. Team Progress:

    • ProgressID, TeamID, PuzzleID, StartTime, EndTime, SolvedStatus (e.g., "Solved", "Failed").

    • Tracks team progress on each puzzle to determine which were solved and how long each took.

  6. Hints:

    • HintID, PuzzleID, HintText, UsageCount.

    • Tracks the hints available for each puzzle and how often they were requested.

  7. Player Actions:

    • ActionID, PlayerID, PuzzleID, ActionType (e.g., "Attempt", "HintRequest"), ActionTimestamp.

    • Records significant actions performed by each player during the game for deeper analytics.

      • The escape room host will record actions when observing the players

  • Populate the tables with data and write 3 query examples that queries the database and provides insight in the data.

  • Export an EER diagram showcasing the database design

Web

01 - Rekonstrurer hjemmeside - HTML og CSS

Tag en hjemmeside du bruger dagligt og rekonstruer den vha html og css. Husk også mobil!

I opgavebesvarelsen husk at tilføje screenshot/screnshots af hjemmesiden

Hvor meget i detaljen du går er op til dig selv. Det vigtigste er at layoutet stemmer nogenlunde overens. Om i lige får den rigtige skygge, farve eller animation er ikke så relevant. Fokus er på layoutdelen

02 - Startup name generator

Let's create a function that can generate startup names:

Create a function called getStartupName. When called it should return a random startup name. Here is how it should work:

  1. Inside the function there should be two arrays with starutp words

  2. Use the two arrays to get a random word from each array and return the new startup name with the two words

Here is an example with the following two arrays:

Example outputs

Hint: to figure out how to get a random number. Try asking google or ChatGPT

03 - Treasure Hunter

Scenario: You are on a small island, and there's a treasure box hidden somewhere! Your job is to move around the island to find it.

Instructions:

  1. Island Setup:

    • The island is represented by a 1D array of 5 elements.

    • One of these elements is the hidden treasure (T), and the rest are empty (-).

Example:

Objectives:

  1. Log out how many moves there are in the island - level 1

  2. For each move log the following out - level 2 If there is a treasure log out: Treasure found at move 3 :) If there is not a treasure log out: No treasure found :(

  3. Log out how many treasures there are in the island - level 3

Example output:

The following array should output the following:

Another example:

04 - Student Grades Analysis

Objective: In this exercise, students will create a program that analyzes student grades, determines the highest and lowest grades, and calculates the average grade.

Instructions:

  1. Create an array that holds 8 grades (integers between 0 and 100) representing the scores of different students - level 1

  2. Log out how many grades there are - level 1

  3. Classify and log each grade into one of the following categories - level 2

    • A if the grade is 90 or above.

    • B if the grade is between 80 and 89.

    • C if the grade is between 70 and 79.

    • D if the grade is between 60 and 69.

    • F if the grade is below 60.

  4. Evaluate overall class performance - level 2

    • If the average grade is 90 or above, the class performance is Excellent.

    • If the average grade is between 80 and 89, the performance is Good.

    • If the average grade is between 70 and 79, the performance is Satisfactory.

    • If the average grade is below 70, the performance is Needs Improvement.

  5. Optional - Determine - level 3

    • The highest grade in the array.

    • The lowest grade in the array.

    • The average grade.

  6. Output:

    • The highest grade with its category.

    • The lowest grade with its category.

    • The average grade.

    • A list of all grades with their corresponding categories.

Example of Expected Output:

For the following input:

The expected output should be:

06 - Dice Rolling Championship

Scenario: Two players compete in a dice rolling championship! Each player takes turns rolling a dice, and after 10 rounds, the player with the highest total score wins.

Instructions:

Level 1 - Player Setup

  1. Get Player Names:

    • Use prompt() to ask for Player 1's name

    • Use prompt() to ask for Player 2's name

    • Log both names to the console to confirm

Example output:

Level 2 - Single Round

  1. Simulate One Round:

    • Create a function that generates a random dice roll (1-6)

    • When the player presses a key (use prompt() with a message like "Press Enter to roll"), generate a random number

    • Log the result for both players

Example output:

Hint: Use Math.random() and Math.floor() to generate random numbers between 1 and 6

Level 3 - Track Scores

  1. Keep Score:

    • Create variables to track each player's total score

    • After each round, add the dice roll to the player's total

    • Log the current totals after each round

Example output:

Level 4 - Complete Game (10 Rounds)

  1. Full Game Loop:

    • Use a loop to run exactly 10 rounds

    • Each round should:

      • Display the round number

      • Let Player 1 roll (wait for Enter press via prompt())

      • Let Player 2 roll (wait for Enter press via prompt())

      • Show both rolls and updated totals

    • After 10 rounds, announce the winner

Example output:

Extensions - optional

  1. Best of Three:

    • Play 3 complete games (3 sets of 10 rounds)

    • Track wins for each player

    • Declare an overall champion

  2. Dice Roll History:

    • Store all dice rolls in an array

    • At the end, show statistics:

      • Highest single roll for each player

      • Lowest single roll for each player

      • Average roll per player

  3. Bonus Rounds:

    • If there's a tie after 10 rounds, enter sudden death mode

    • Players keep rolling until someone wins a round

  4. Multiplayer:

    • Extend the game to support 3-4 players

    • Use an array to store player names and scores

  5. Group 1

    1. Johanne Schledermann

    2. Stephanie Skjøtt

    3. Peter Reedtz

  6. Group 2

    1. Ali Hussein Ibrahim

    2. kagi0001

    3. vial0001

  7. Group 3

    1. Jacob

    2. Mohsen

    3. Kenadid Kablalah

  8. Group 4

    1. Kai Thelonious Brooklyn

    2. Maja Samer

    3. Nikolaj Birkelund

  9. Group 5

    1. Freja Johnna

    2. Beyza

    3. Christoffer Bohnzen

  10. Group 6

    1. Oliver Baasch

    2. Rosalina Hoff

    3. Benjamin Skak Vestergaard

  11. Group 7

    1. Mathias Hartung

    2. Oliver Fritz

    3. Astrid Sofie

  12. Group 8

    1. Magnus Egemose

    2. Loui Fatum

    3. Nina Lind

  13. Group 9

    1. Jannik Wæver

    2. Sylvester Erbs

    3. Sebastian Herler

  14. Group 10

    1. Simon

    2. Amira

    3. Baldur Thorkildshøj

  15. Group 11

    1. Elliot Theodor Lyhne

    2. Oscar Bertram Merino

    3. thmo0003

  16. Group 12

    1. Mariam

    2. Carla Isabel

    3. Mathilde Louise Farnø

  17. Group 13

    1. Frederik Egede

    2. Mathias Albin

    3. Sebastian Sigurd Sandby

  18. Group 14

    1. Pin Yuan

    2. seho0004

    3. Hjalte-Emil Schultz

  19. Group 15

    1. Noah Prang

    2. Jonas Mørk

    3. Storm Dyva

  20. Group 16

    1. Gustav Felix Anker

    2. Sofia Rosa

    3. Victor Bischoff

Last updated