Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update docs #103

Merged
merged 5 commits into from
Oct 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion data/main/topics.json
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@
]
},
{
"topic": "Code Quality",
"topic": "Code_Quality",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch! Sorry for that error!

"questions": [
{
"description": "What does SLAP stand for?",
Expand Down
20 changes: 8 additions & 12 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
## Introduction

E-Duke-8 helps CS2113/T students learn and understand software engineering and OOP principles through a gamified
platform and enhance their learning experience. It also consolidates key concepts for easy revision.
platform and enhances their learning experience. It also consolidates key concepts for easy revision.

## Quick Start

1. Ensure that you have Java 11 or above installed.
2. Download the latest version of `E-Duke-8` from [here](https://github.com/AY2021S1-CS2113T-F12-3/tp/releases).
3. Copy the files to the folder you want to use as the eduke8 folder for the application.
4. Run E- Duke 8.
5. Type a command in the terminal and press Enter to execute it. e.g. typing help and pressing Enter will list all the commands that you can use in this application. Here is a list of commands you can try:
4. Run E-Duke-8.
5. Type a command in the terminal and press Enter to execute it. e.g. typing 'help' and pressing Enter will list all the commands that you can use in this application. Here is a list of commands you can try:
- about : Provides product information.
- topics : Lists the topics involved in CS2113T.
- textbook : Links to the CS2113T website.
- quiz : Starts a quiz. Eg. quiz n/30 t/TOPIC_1 will start a quiz based on content in topic 1.
- quiz : Starts a quiz. Eg. quiz t/OOP n/5 will start a quiz with five questions based on OOP concepts.
- hint : Shows a hint to the current question
- exit : Exits the app.

Expand All @@ -25,21 +25,17 @@ platform and enhance their learning experience. It also consolidates key concept

ℹ️ Notes about the command format:
- Words in UPPER_CASE are the parameters to be supplied by the user.
- e.g. in add n/NAME, NAME is a parameter which can be used as add n/John Doe.
- e.g. in add t/TOPIC, TOPIC is a parameter which can be used as quiz t/OOP.
- Items in square brackets are optional.
- e.g n/NAME [t/TAG] can be used as n/John Doe t/friend or as n/John Doe.
- Items with …​ after them can be used multiple times including zero times.
- e.g. [t/TAG]…​ can be used as (i.e. 0 times), t/friend, t/friend t/family etc.
- Parameters can be in any order.
- e.g. if the command specifies n/NAME p/PHONE_NUMBER, p/PHONE_NUMBER n/NAME is also acceptable.
- e.g quiz t/TOPIC [t/TOPIC] can be used as quiz t/OOP t/Requirements or as quiz t/OOP.

### Loading data

Data is loaded from the .txt files in the E-Duke-8 folder for use in quizzes and notes. This is part of the setup and is to be done prior to the running of the app.

### Viewing Product Information : `about`
### Viewing product Information : `about`

Shows a message explaining the purpose of using eduke8.
Shows a message explaining the purpose of using E-Duke-8.

[to be replaced by graphics]

Expand Down
10 changes: 3 additions & 7 deletions src/main/java/seedu/eduke8/Eduke8.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,9 @@ private void runCommandLoopUntilExit() {
while (!isExit) {
String userInput = ui.getInputFromUser();

try {
Command command = menuParser.parseCommand(topicList, userInput);
command.execute(topicList, ui);
isExit = command.isExit();
} catch (Eduke8Exception e) {
ui.printError(e.getMessage());
}
Command command = menuParser.parseCommand(topicList, userInput);
command.execute(topicList, ui);
isExit = command.isExit();
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/main/java/seedu/eduke8/exception/ExceptionMessages.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ public class ExceptionMessages {
+ System.lineSeparator() + "quiz t/<topic> n/<number of questions>" + System.lineSeparator()
+ "(Topics available can be found using the \"topics\" command)";
public static final String ERROR_QUIZ_COMMAND_NOT_IMPLEMENTED = "Oh! This command has yet to be implemented. "
+ System.lineSeparator()
+ "Stay tune for Version 2.0!";
+ System.lineSeparator() + "Stay tune for Version 2.0!";
public static final String ERROR_QUIZ_ANSWER_NOT_INDEX = "Please choose the answer using its index (1,2,3 or 4)!";
public static final String ERROR_QUIZ_ANSWER_INDEX_OUT_OF_BOUNDS =
"Please choose only options 1, 2, 3 or 4";
public static final String ERROR_QUIZ_INVALID_QUESTION_NUMBER = "The number of quiz questions"
+ " must be more than 1!";
public static final String ERROR_QUIZ_INSUFFICIENT_TOPIC_QUESTIONS =
"There is not enough questions in the topic for the quiz!";
public static final String ERROR_QUIZ_ANSWER_INDEX_OUT_OF_BOUNDS =
"Please choose only options 1, 2, 3 or 4";

}
17 changes: 5 additions & 12 deletions src/main/java/seedu/eduke8/parser/MenuParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public MenuParser() {
}

@Override
public Command parseCommand(DisplayableList topicList, String userInput) throws Eduke8Exception {
public Command parseCommand(DisplayableList topicList, String userInput) {
assert topicList != null;

LOGGER.log(Level.INFO, "Begin parsing command.");
Expand All @@ -51,17 +51,10 @@ public Command parseCommand(DisplayableList topicList, String userInput) throws
case "quiz":
int numOfQuestions = 0;
String topicName = "";
if (commandArr.length == 3) {
try {
numOfQuestions = Integer.parseInt(commandArr[2].substring(2));
topicName = commandArr[1].substring(2);
} catch (NumberFormatException nfe) {
return new IncorrectCommand("Oops! The number of questions has been entered "
+ "incorrectly.\nPlease enter the command again: quiz t/<topic> n<numberofquestions>\n"
+ "Remember that the number of questions has to be typed in numeric form!");
}
} else {
LOGGER.log(Level.WARNING, "Parsing Error: Wrong number of fields used in quiz command.");
try {
numOfQuestions = Integer.parseInt(commandArr[2].substring(2));
topicName = commandArr[1].substring(2);
} catch (NumberFormatException | IndexOutOfBoundsException e) {
return new IncorrectCommand(ERROR_QUIZ_WRONG_FORMAT);
}
LOGGER.log(Level.INFO, "Parsing complete: quiz command chosen.");
Expand Down
45 changes: 45 additions & 0 deletions text-ui-test/EXPECTED.TXT
Original file line number Diff line number Diff line change
Expand Up @@ -101,5 +101,50 @@ This is the end of the quiz!
Hope you have learnt something new!
-------------------------------------------------------------------
-------------------------------------------------------------------
Invalid command! The command for quiz is as follows:
quiz t/<topic> n/<number of questions>
(Topics available can be found using the "topics" command)
-------------------------------------------------------------------
-------------------------------------------------------------------
Invalid command! The command for quiz is as follows:
quiz t/<topic> n/<number of questions>
(Topics available can be found using the "topics" command)
-------------------------------------------------------------------
-------------------------------------------------------------------
Invalid command! The command for quiz is as follows:
quiz t/<topic> n/<number of questions>
(Topics available can be found using the "topics" command)
-------------------------------------------------------------------
-------------------------------------------------------------------
Error! There is no such topic listed in our storage. Please try again.
-------------------------------------------------------------------
-------------------------------------------------------------------
Error! There is no such topic listed in our storage. Please try again.
-------------------------------------------------------------------
-------------------------------------------------------------------
Error! There is no such topic listed in our storage. Please try again.
-------------------------------------------------------------------
-------------------------------------------------------------------
Error! There is no such topic listed in our storage. Please try again.
-------------------------------------------------------------------
-------------------------------------------------------------------
Start of quiz:
You have chosen to complete 1 question.
The topic chosen is: OOP
-------------------------------------------------------------------
1. What is encapsulation?

1) A
2) B
3) C
4) D
-------------------------------------------------------------------
-------------------------------------------------------------------
Great Job! That is the correct answer! Keep it up!
-------------------------------------------------------------------
This is the end of the quiz!
Hope you have learnt something new!
-------------------------------------------------------------------
-------------------------------------------------------------------
Bye bye. Hope you had a fruitful revision and see you soon!
-------------------------------------------------------------------
9 changes: 9 additions & 0 deletions text-ui-test/input.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,13 @@ quiz t/OOP n/1
a
7
1
quiz n/2 t/OOP
quiz
quiz t/
quiz t/ n/1
quiz n/1 t/2
quiz t/2 n/1
quiz t/OOPS n/1
quiz t/OOP n/1 n/1
1
exit