Commit: cdb0cdeefdd625331ccae6d3fe077f66031abb21 Parent: 56d097a21000ccfda1d87be23b44987264067893 Author: Vi Grey Date: 2024-07-02 11:17 UTC Summary: Add incorrect test answer IDs and LICENSE CHANGELOG.txt | 7 +++++++ LICENSE | 24 ++++++++++++++++++++++++ src/ham-test-practice-fcc.go | 11 ++++++++++- 3 files changed, 41 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 1598a35..3bb4869 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -2,6 +2,13 @@ All notable changes to this project will be documented in this file. +## [0.0.2] - 2024-07-02 + +### Added +- Show incorrect answers at end of test +- LICENSE file + + ## [0.0.1] - 2024-06-29 ### Added diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..79ea072 --- /dev/null +++ b/LICENSE @@ -0,0 +1,24 @@ +Copyright (C) 2024, Vi Grey +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. diff --git a/src/ham-test-practice-fcc.go b/src/ham-test-practice-fcc.go index 27246f2..13d1ed3 100644 --- a/src/ham-test-practice-fcc.go +++ b/src/ham-test-practice-fcc.go @@ -9,7 +9,7 @@ import ( const ( PROGRAM = "ham-test-practice-fcc" - VERSION = "0.0.1" + VERSION = "0.0.2" ) func init() { @@ -38,10 +38,13 @@ func main() { } } var correct int + var incorrect []string for x := 0; x < questions; x++ { c := testQuestion(questionPool[x], correct, x, questions) if c { correct++ + } else { + incorrect = append(incorrect, questionPool[x].id) } fmt.Println() } @@ -49,5 +52,11 @@ func main() { fmt.Print("\x1b[2J\x1b[H") fmt.Printf("Final Score: [ %d / %d ] %d%% Correct\n", correct, questions, int(float32(correct)/float32(questions)*100)) + if len(incorrect) > 0 { + fmt.Println("Incorrect Answers:") + for _, id := range incorrect { + fmt.Println(id) + } + } } }