Giter Club home page Giter Club logo

toohak's Introduction

Toohak

Project Toohak: a free, open-source, socket-based LAN version of Kahoot! (the online quiz game). This project is in no way affiliated or endorsed by Kahoot!. Toohak differs from Kahoot! in the following major ways (note that this may not be an exhaustive list):

  • Kahoot! works over the internet and is accessed via a website. Toohak is a socket-based Java application that is designed to primarily work over local area networks (LAN) such as a home or school network. Virtual LANs used as peer-to-peer networks can also be used.
  • Toohak is a standalone application and must be downloaded on the machines to be used. It also requires Java to be installed. Kahoot! does not require users to download anything.
  • Kahoot! is available on mobile devices. Toohak, currently, is not.
  • Quizzes created with Toohak are saved locally as files. Kahoot! saves user quizzes on their servers.
  • The features of the two platforms differ.

Scoring (subject to change)

Players earn more points by answering faster than their opponents. To be exact, every time a player answers correctly, the points obtained by the next player to answer correctly will be 90% of those points. Higher amounts increase the stakes, but are also more tolerant because slower players get more points. The first person to correctly answer a 1000 point question will receive 1000 points. The second player to do so receives 900. The third receives 810. The fourth receives 729, and so on.

Quiz editing

Quizzes can be created using the quiz editor. Here, you can specify the quiz name and enter question details. Enter the question, the time limit, and the maximum number of points obtainable from answering that question. The recommended score for a question is 1000 points.

You may optionally select an image to embed in the question. The image data is embedded into the quiz file. The image will appear in the quiz even if modified or removed from your computer. This also means that you may send quiz files to other people without sending the relevant images. Note that this will increase the size of the quiz file. It's also worth noting that this means that removing an image from a quiz requires editing that quiz in the quiz editor.

You must provide at least 2 answers to each question, at least one of which must be correct. The answers may be placed in any of the boxes, even if the alphabetically preceding box is empty. Only non-empty answers can be selected in-game. The correct answer(s) must be among the non-empty answers.

Click "Add Question" to add the question to the end of the quiz. Select a question in the table and press "Edit Question" to edit it. This will remove that question from the quiz and load its contents into the quiz editor interface. Click "Add Question" to add it back after making any necessary modifications. Note that this will move the question to the end of the quiz.

Server mode

When you click "Host game" you will be asked to select a quiz file. The IP address shown should be your address on the local network. If your device has more than one network card or interface, this might not be correct. If people are having trouble connecting, please check your network settings in case the shown address is incorrect.

You may kick users from the game before the quiz begins, but not during (might change in the future).

The button on the right adapts to match the current game state.

  • While waiting for players, clicking it begins the game. No new players may join.
  • While waiting for answers, it skips the remaining time and ends the question. Players who have already answered still get points if they answered correctly. The leaderboard is updated to show the new rankings. The center view switches to show information about what answers were chosen. The length of each bar is determined by the relative popularity of the correponding answer. The most popular answer is always maximum length.
  • After the end of a question, it loads the next question. The center view switches back to the leaderboard.
  • If there are no more questions, the button shuts down the server.

Client mode

Enter the IP address of the game host and a username/nickname. Click "Connect" to join the game. When a question is received from the game host, the question, relevant image, and potential answers are presented. Click an answer to submit.

When time runs out or all players have answered, you will be given the following information:

  • Whether your answer was correct
  • All acceptable answers
  • Your ranking
  • If you aren't in first place, the difference between your score and that of the person ahead of you

When the game ends, click "Back to Main" to exit the client and return to the main menu.

Legal

Toohak source code available under GPLv3. See LICENSE for full GPL text. See the comments at the beginning of each source file for details regarding the license of that particular file.

Commons CSV library available under the Apache 2.0 license. See 'APACHE LICENSE.txt' for full license text.

Based on work by Matthew Chen and Arc676/Alessandro Vinciguerra available under the MIT License.

Music available under CC0.

Screenshots

Main Menu

Connected Client

Server View

Quiz Editor

toohak's People

Contributors

arc676 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

toohak's Issues

Wrapping labels

The answer labels can be made to wrap text automatically based on their width if HTML tags are pre- and appended to the text and displayed with a JLabel instead of drawing with graphics.

By replacing the question text with a label as well, it should become more clear to read and gives the additional benefit of automatic text wrapping.

To do:

  • Replace g.drawString with JLabel members
  • Use HTML tags when setting answer labels
  • JLabel location might have to adapt to their contents to prevent overlap
  • Draw button background behind labels
  • Set font color for labels for readability

Embed audio?

It would be nice if it were possible to embed audio into questions. It could be useful for quizzes for learning languages or music identification (or various other things).

Several implementation questions though:

  1. Where will the audio be saved?
  2. Will the audio be played by the host device or by the clients?

Question 1

If the audio is saved as part of the quiz, then the audio data will have to be serialized.

Advantages:

  • Sharing quizzes doesn't require sharing resource files. This is already the case for image data.
  • Can send audio data over network to clients

Disadvantages:

  • Increased file size for quizzes
  • Increased complexity

If the audio data is not serialized, other questions arise:

  1. Where will the audio be stored? How will Toohak know where to access them? What if they move?
  2. What will the implications be for sharing quizzes?
  3. Will it still be possible to send audio data to clients?

Question 2

One of the primary advantages of Toohak over Kahoot is that all the necessary information for answering a question is sent to the clients. Although the leaderboard is only visible on the server (for now, anyway), clients don't have to be physically near the server to play. If this is to continue to be the case, then the audio data must be transmitted to the clients. This could incur extreme latency and server-side overhead. The alternative is to simply not support audio data questions for when people aren't actually near the server, but this would be a compromise when questions and images are already independent of physical location.

Additionally, if the audio data is played client side and the players are close to one another, then they'll all be playing the audio over each other, which would be detrimental to the experience.

Suggested solution

One potential solution that should be simple to implement is the following:

  • Audio files must be stored in the same directory as the quiz file
  • Search for audio files in the same directory as the quiz file when needed (the path is retrieved when the quiz file is loaded)
  • Play audio server-side (compromise as stated for question 2)
  • Sharing quizzes would require sharing audio files
  • No need for serializing, en/decoding audio, or transmitting audio data

Move to JavaFX

Switching to JavaFX instead of Swing might solve the Windows font size issue, where all text in labels and buttons are rendered smaller on Windows due to different font size calculations.

How to compile

Hello.

Update :
Before I was try to execute the codes, not the compiled jar file. Running the jar file, downloaded from the released page, works.

Now I am trying to edit the codes to replace the g.drawstring to JLabel. May I know how to compile it with the changes?

Previous Post :
I'm downloaded the files and tried to run it but it gives an error :
Screen Shot 2019-06-27 at 2 11 54 PM

I tried to search for the error in the console but couldn't find it.

I also tried using the terminal with java -jar commons-cvs-1.5.jar and outputs an error :
no main manifest attribute, in commons-csv-1.5.jar

Am I doing something wrong?

My java version is java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

Embed video?

Embedding video in questions would be a significant accomplishment. Kahoot allows video to be added to questions by providing a YouTube link. However, a primary goal of Toohak is the ability for quizzes to be played without the influence of latency or an internet connection at all.

However, videos are big and complex. Similar to the audio issue in #1, the implementation could take several forms. The same questions are raised (see the audio issue), but also the following new ones:

  1. Where would the video be played? Does the server window size need to increase or just be adaptive?
  2. What about video looping?
  3. What if users don't have a local copy of the video they want to embed?

A potential solution is to simply add an additional tab to the server's tabbed view and provide playback controls, but this greatly increases complexity and takes processing time away from actually hosting the quiz. Additionally, it would require that the users be close to the server machine and that the server screen be visible. This goes against the goal of allowing users to play without physical proximity to the server.

Transmitting video data to the clients is an unlikely solution. The data would have to be compressed as much as possible and serialized, which could incur serious latency and overheads. A potential solution for the latency is to send all multimedia data to clients before the quiz begins, but the complexity issue remains.

Results log in CSV

Kahoot! provides a spreadsheet with the results of the quiz after it completes. This should include what each person answered for each question and assorted additional information.

The implementation can use Apache's CSV library, available under the Apache 2.0 license. This license should be compatible with GPLv3.

How to use?

Hi,

I'm not a developer but I want to try your software, ¿Could you please help me to know how to use on a LAN network?

Regards!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.