{"id":18447891,"url":"https://github.com/simonstnn/questionnaire","last_synced_at":"2026-03-15T01:07:23.350Z","repository":{"id":236343565,"uuid":"792404492","full_name":"SimonStnn/questionnaire","owner":"SimonStnn","description":"Questionnaire program for Object Oriented Programming Evaluatie 4","archived":false,"fork":false,"pushed_at":"2024-05-15T09:28:46.000Z","size":12847,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-17T19:32:17.491Z","etag":null,"topics":["csharp","dotnet","wpf"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SimonStnn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-26T15:45:50.000Z","updated_at":"2024-05-15T09:39:40.000Z","dependencies_parsed_at":"2024-05-12T21:35:09.777Z","dependency_job_id":null,"html_url":"https://github.com/SimonStnn/questionnaire","commit_stats":null,"previous_names":["simonstnn/questionnaire"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimonStnn%2Fquestionnaire","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimonStnn%2Fquestionnaire/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimonStnn%2Fquestionnaire/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimonStnn%2Fquestionnaire/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SimonStnn","download_url":"https://codeload.github.com/SimonStnn/questionnaire/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242967694,"owners_count":20214280,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csharp","dotnet","wpf"],"created_at":"2024-11-06T07:14:39.350Z","updated_at":"2025-12-24T01:45:23.298Z","avatar_url":"https://github.com/SimonStnn.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eQuestionnaire\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\nQuestionnaire program for Object Oriented Programming Evaluatie 4\n\u003c/p\u003e\n\n## Table of Contents\n\n- [Table of Contents](#table-of-contents)\n- [Author](#author)\n- [Assignment](#assignment)\n- [Setup and Usage](#setup-and-usage)\n- [Questionnaire Library](#questionnaire-library)\n  - [UML Diagram](#uml-diagram)\n  - [Answer](#answer)\n    - [Atributes](#atributes)\n    - [Constructor](#constructor)\n    - [Methods](#methods)\n  - [Question](#question)\n    - [Atributes](#atributes-1)\n    - [Properties](#properties)\n    - [Constructor](#constructor-1)\n    - [Methods](#methods-1)\n  - [Example](#example)\n- [Scoreboard Library](#scoreboard-library)\n  - [UML Diagram](#uml-diagram-1)\n  - [Scoreboard](#scoreboard)\n    - [Attributes](#attributes)\n    - [Properties](#properties-1)\n    - [Constructor](#constructor-2)\n    - [Methods](#methods-2)\n  - [PlayerScore](#playerscore)\n    - [Attributes](#attributes-1)\n    - [Constructor](#constructor-3)\n    - [Methods](#methods-3)\n  - [Example](#example-1)\n- [Console Application](#console-application)\n  - [Demo](#demo)\n  - [The questions and answers](#the-questions-and-answers)\n  - [Scoreboard](#scoreboard-1)\n- [Questionnaire The Game - WPF Application](#questionnaire-the-game---wpf-application)\n  - [Demo](#demo-1)\n  - [Questions](#questions)\n  - [Results](#results)\n- [Future Improvements](#future-improvements)\n  - [Console Application](#console-application-1)\n  - [WPF Application](#wpf-application)\n\n## Author\n\nThis application was created by [Simon Stijnen](https://github.com/SimonStnn). Student at [Vives University Of Applied Sciences](https://www.vives.be/nl/over-vives/campussen/vives-brugge-xaverianenstraat). Studying [Electronics - ICT](https://www.vives.be/nl/technology/elektronica-ict).\n\n\u003e 25/04/2024 -\n\n## Assignment\n\nThis project is the 4th assignment for the Object Oriented Programming course. The assignment details can be found in the [assignment PDF](./Permanente%20evaluatie%204%20-%202024%20-%20versie%20a.pdf).\n\n## Setup and Usage\n\nTo run this application you need to have the [.NET 6.0 SDK](https://dotnet.microsoft.com/download/dotnet/6.0) and [Visual Studio](https://visualstudio.microsoft.com/) installed on your machine.\n\nOnce these are installed you can start by cloning the repository\n\n```bash\ngit clone https://github.com/SimonStnn/questionnaire.git\n```\n\nThen open the solution in Visual Studio and run the console application or the WPF application.\n\n## Questionnaire Library\n\n### UML Diagram\n\n```mermaid\nclassDiagram\ndirection LR\nclass Answer {\n  +Text: string\n  +IsCorrect: boolean\n  +Answer(text: string, isCorrect: bool)\n  +ToString() string\n}\n\nclass Question {\n  -possibleAnswer: List~Answer~\n  +\u003c\u003c get/set \u003e\u003eText: string\n  +\u003c\u003c get/set \u003e\u003eImageUrl: string\n  +\u003c\u003c get \u003e\u003eAnswers: List~Answer~\n  +Question(text: string)\n  +Add(answer: Answer)\n  +GetAnswer(index: int) Answer\n  +ToString() string\n}\n\nAnswer --o Question\n```\n\n### Answer\n\n#### Atributes\n\n- `Text`: The text of the answer\n- `IsCorrect`: If the answer is correct or not\n\n#### Constructor\n\n- `Answer(text: string, isCorrect: bool)`: Creates a new answer with the given text and if it is correct or not\n\n#### Methods\n\n- `ToString() string`: Returns the text of the answer\n\n### Question\n\n#### Atributes\n\n- `possibleAnswer`: A list of possible answers\n\n#### Properties\n\n- `Text`: The text of the question\n- `ImageUrl`: The url of the image of the question\n- `Answers`: The list of possible answers\n\n#### Constructor\n\n- `Question(text: string)`: Creates a new question with the given text\n\n#### Methods\n\n- `Add(answer: Answer)`: Adds a possible answer to the question\n- `GetAnswer(index: int): Answer`: Returns the answer at the given index\n- `ToString() string`: Returns the text of the question\n\n### Example\n\nCreating a question with some answers\n\n```csharp\nQuestion question = new(\"What is 2 + 2?\");\nquestion.Add(new(\"3\", false));\nquestion.Add(new(\"4\", true));\nquestion.Add(new(\"5\", false));\n```\n\nCheck if an answer is correct\n\n```csharp\nAnswer answer = question.GetAnswer(1);\n\nif (answer.IsCorrect)\n    Console.WriteLine(\"Correct!\");\nelse\n    Console.WriteLine(\"Incorrect!\");\n```\n\n## Scoreboard Library\n\n### UML Diagram\n\n```mermaid\nclassDiagram\ndirection RL\nclass Scoreboard {\n  -scoreList: List~PlayerScore~\n  -saveFile: string\n  +\u003c\u003c get \u003e\u003ePlayerScores: List~PlayerScore~\n  +Scoreboard()\n  +Scoreboard(saveFile: string)\n  +AddPlayer(player: PlayerScore)\n  +AddPlayer(name: string, score: int)\n  +SortScoreboard()\n  +Clear(clearSaveFile: bool = true)\n  -SaveFileExists() bool\n  +DeleteSaveFile()\n  +Load() List~PlayerScore~\n  +Save()\n  +ToString() string\n}\n\nclass PlayerScore {\n  -name: string\n  -score: int\n  +Name: string\n  +Score: int\n  +PlayerScore(name: string, score: int)\n  +ToString() string\n}\n\nPlayerScore --o Scoreboard\n```\n\n### Scoreboard\n\n#### Attributes\n\n- `scoreList`: A list of `PlayerScore` objects\n- `saveFile`: The file to save the scoreboard to\n\n#### Properties\n\n- `PlayerScores`: The list of `PlayerScore` objects\n\n#### Constructor\n\n- `Scoreboard()`: Creates a new scoreboard\n- `Scoreboard(saveFile: string)`: Creates a new scoreboard with the given save file\n\n#### Methods\n\n- `SaveFileExists() bool`: Checks if the save file exists\n- `AddPlayer(player: PlayerScore)`: Adds a player to the scoreboard\n- `AddPlayer(name: string, score: int)`: Adds a player to the scoreboard\n- `SortScoreboard()`: Sorts the scoreboard by score\n- `Clear(clearSaveFile: bool = true)`: Clears the scoreboard\n- `DeleteSaveFile()`: Deletes the save file\n- `Load() List~PlayerScore~`: Loads the scoreboard from the save file\n- `Save()`: Saves the scoreboard to the save file\n- `ToString() string`: Returns the scoreboard as a string\n\n### PlayerScore\n\n#### Attributes\n\n- `name`: The name of the player\n- `score`: The score of the player\n- `Name`: The name of the player\n- `Score`: The score of the player\n\n#### Constructor\n\n- `PlayerScore(name: string, score: int)`: Creates a new player score\n\n#### Methods\n\n- `ToString() string`: Returns the player score as a string\n\n### Example\n\nLoading the scoreboard and adding some players\n\n```csharp\nScoreboard scoreboard = new(\"scoreboard.json\"); // Custom save file location\n// Load the scoreboard\nscoreboard.Load();\n\n// Add players to the scoreboard\nscoreboard.AddPlayer(\"John\", 5);\nscoreboard.AddPlayer(\"Jane\", 7);\n\n// Sort the scoreboard\nscoreboard.SortScoreboard();\n// Save the scoreboard\nscoreboard.Save();\n```\n\nClearing the scoreboard\n  \n```csharp\nScoreboard scoreboard = new();\nscoreboard.Load();\n\n// Clear the scoreboard\nscoreboard.Clear();\n// Save file was deleted and scoreboard is empty\n```\n\n## Console Application\n\nThe console application will use the [Questionnaire](#questionnaire-library) and [Scoreboard](#scoreboard-library) libraries to create a simple quiz game. The game will ask the user a series of questions and keep track of the score. At the end of the game, the user's score will be saved to a file and displayed on the scoreboard.\n\n### Demo\n\n\u003c!-- ./resources/videos/ConsoleAppDemo.mp4 --\u003e\n\u003chttps://github.com/SimonStnn/fractions/assets/113850648/8c0a8c47-445f-41c6-941b-4244761aee33\u003e\n\n\u003e Demo video of the console application\n\n### The questions and answers\n\nThe questions are propmted to the user as green text. And below each question, the possible answers are displayed. The user can use the arrow keys to navigate between the answers and press enter to select an answer. The selected answer is displayed as a blue text.\n\n### Scoreboard\n\nWhen the game is played again, the score from previous players is displayed on the scoreboard at the end.\n\n![Scoreboard](./resources/images/ConsoleAppScoreboard.png)\n\nIn this case there are two players, `Simon` and `Kenrie`, both with a low score of `4/10`.\n\n## Questionnaire The Game - WPF Application\n\nThe WPF application will use the [Questionnaire](#questionnaire-library) and [Scoreboard](#scoreboard-library) libraries to create a more interactive quiz game. The game will have a GUI where the user can answer questions and see their score in real-time. At the end of the game, the user's score will be saved to a file and displayed on the scoreboard.\n\n### Demo\n\n\u003c!-- ./resources/videos/WPFTheGameDemo.mp4 --\u003e\n\u003chttps://github.com/SimonStnn/fractions/assets/113850648/3c1a6ece-e65c-42cf-be56-9d4570dfe133\u003e\n\n\u003e Demo video of the WPF application\n\n### Questions\n\nA question is displayed at the top of the window, and the possible ansers are below that. For each possible answer a button is provided.\n\n![Question](./resources/images/WPFQuestion.png)\n\n### Results\n\nThe results of the game are displayed in a new page. The user can see what they answered and what the correct answer was.\n\n![Results](./resources/images/WPFResults.png)\n\nHere we can see that the user answered the first question correctly and the second incorrectly. The users answers are marked by the ckecked checkbox. If the user answered the question correctly, the text is green, otherwise it is red and the correct answer is green.\n\n## Future Improvements\n\n### Console Application\n\n- Add some colors to the scoreboard\n\n### WPF Application\n\n- Add a timer to the game\n- Improve the design of the application\n- Add a welcome page\n- Add a way to select a theme and difficulty for the questions\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonstnn%2Fquestionnaire","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimonstnn%2Fquestionnaire","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonstnn%2Fquestionnaire/lists"}