Skip to content

Commit

Permalink
Merge pull request #103 from StopTakingAllTheNames/branch-QuestionTweak
Browse files Browse the repository at this point in the history
Tweak Question functionality
  • Loading branch information
ong-yinggao98 authored Oct 24, 2020
2 parents 894f5e4 + 0d12eba commit 1e359f3
Show file tree
Hide file tree
Showing 50 changed files with 1,350 additions and 468 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Reeve
![Ui](docs/images/Ui.png)

**Reeve** is a desktop application for **private tutors to better manage both administrative and academic details of their students**, optimised for use via a **Command Line Interface (CLI)** for receiving inputs while still having the benefits of a **Graphical User Interface (GUI)** for displaying information.
**Reeve** is a desktop application for **private tutors to better manage both administrative and academic details of their students**, optimised for use via a **Command Line Interface (CLI)** for receiving inputs while still having the benefits of a **Graphical User Interface (GUI)** for displaying information.

* Interested in using Reeve? Head over to the [_Quick Start_ section of the **User Guide**](UserGuide.html#quick-start)!
* Interested in developing Reeve? The [**Developer Guide**](DeveloperGuide.html) is a good place to start!
Expand Down
268 changes: 178 additions & 90 deletions docs/DeveloperGuide.md

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

**Welcome to Reeve!**

Reeve is a desktop application for **private tutors to to better manage both administrative and academic details of their students**, optimised for use via a
Reeve is a desktop application for **private tutors to to better manage both administrative and academic details of their students**, optimised for use via a
**Command Line Interface (CLI)** for receiving inputs while still having the benefits of a **Graphical User Interface (GUI)** for displaying information.

* Table of Contents
Expand All @@ -26,7 +26,7 @@ Reeve is a desktop application for **private tutors to to better manage both adm

* **`list`** : Lists all contacts.

* **`add`**`add n/Alex p/93211234 s/Commonwealth Secondary School y/Primary 6 v/Blk 33 West Coast Rd #21-214
* **`add`**`add n/Alex p/93211234 s/Commonwealth Secondary School y/Primary 6 v/Blk 33 West Coast Rd #21-214
t/1 1430-1630 f/25 d/12/12/2020` : Adds a student named `Alex` to Reeve.

* **`delete`**`3` : Deletes the 3rd contact shown in the current list.
Expand Down Expand Up @@ -80,9 +80,9 @@ Format: `add n/NAME p/PHONE s/SCHOOL y/YEAR v/CLASS_VENUE t/CLASS_TIME f/FEE d/L
</div>

Example:
* `add n/Alex p/93211234 s/Commonwealth Secondary School y/Primary 6 v/Blk 33 West Coast Rd #21-214
* `add n/Alex p/93211234 s/Commonwealth Secondary School y/Primary 6 v/Blk 33 West Coast Rd #21-214
t/1 1430-1630 f/25 d/12/12/2020`
* `add n/John Doe p/98765432 s/Woodlands Secondary School y/Secondary 2 v/347 Woodlands Ave 3, Singapore 730347
* `add n/John Doe p/98765432 s/Woodlands Secondary School y/Secondary 2 v/347 Woodlands Ave 3, Singapore 730347
t/1 1200-1400 f/30 d/24/09/2020 a/Likes chocolates a/Needs help with Algebra`

### Listing all students : `list`
Expand Down Expand Up @@ -146,13 +146,13 @@ Format: `unpaid`

Adds, resolves or remove questions from a specified student. (written by: Ying Gao)

Format: `question INDEX [a/QUESTION_ADD] [s/QUESTION_INDEX] [d/QUESTION_INDEX]`
Format: `question INDEX [a/QUESTION_ADD] [s/QUESTION_INDEX SOLUTION] [d/QUESTION_INDEX]`

* Exactly one of the optional fields must be present.
* The index and question index **must be positive integers** 1, 2, 3, …​
* The `a/` field adds a new unanswered question to the student at the specified `INDEX`.
* The `s/` field marks an unanswered question, of the student at the specified `INDEX`, at the specified
`QUESTION_INDEX` as solved.
* The `s/` field marks an unanswered question, of the student at the specified `INDEX`, at the specified
`QUESTION_INDEX` as solved with the given `SOLUTION`.
* The `d/` field deletes the question at the specified `QUESTION_INDEX` from the student at the specified `INDEX`.

Examples:
Expand Down
23 changes: 23 additions & 0 deletions docs/diagrams/AddQuestionActivityDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
@startuml
start
:User executes add question command;
:Parses the command;
if () then ([command is valid])
:AddQuestionCommand is executed;
if () then ([student exists])
if () then ([no duplicate question])
:Create student copy;
:Add question to student copy;
:Replace student with modified copy;
:Display success message;
else ([else])
:Display duplicate question error message;
endif
else ([else])
:Display invalid student error message;
endif
else ([command is invalid - missing or invalid arguments])
:Display parse error message;
endif
stop
@enduml
88 changes: 88 additions & 0 deletions docs/diagrams/AddQuestionSequenceDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
@startuml
!include style.puml

box Logic LOGIC_COLOR_T1
participant ":LogicManager" as LogicManager LOGIC_COLOR
participant ":ReeveParser" as ReeveParser LOGIC_COLOR
participant ":QuestionCommandParser" as QuestionCommandParser LOGIC_COLOR
participant "a:AddQuestionCommand" as AddQuestionCommand LOGIC_COLOR
end box

box Model MODEL_COLOR_T1
participant ":Model" as Model MODEL_COLOR
participant "q:UnsolvedQuestion" as Question MODEL_COLOR
participant "student:Student" as Student MODEL_COLOR
end box

[-> LogicManager : execute("question 1 a/How do birds fly?")
activate LogicManager

LogicManager -> ReeveParser : parseCommand("question 1 a/How do birds fly?")
activate ReeveParser

create QuestionCommandParser
ReeveParser -> QuestionCommandParser
activate QuestionCommandParser

QuestionCommandParser --> ReeveParser
deactivate QuestionCommandParser

ReeveParser -> QuestionCommandParser : parse("1 a/How do birds fly?")
activate QuestionCommandParser

create Question
QuestionCommandParser -> Question : UnsolvedQuestion("How do birds fly")
activate Question

Question --> QuestionCommandParser : q
deactivate Question

create AddQuestionCommand
QuestionCommandParser -> AddQuestionCommand
activate AddQuestionCommand

AddQuestionCommand --> QuestionCommandParser : a
deactivate AddQuestionCommand

QuestionCommandParser --> ReeveParser : a
deactivate QuestionCommandParser

QuestionCommandParser -[hidden]-> ReeveParser
destroy QuestionCommandParser

ReeveParser --> LogicManager : a
deactivate ReeveParser

LogicManager -> AddQuestionCommand : execute()
activate AddQuestionCommand

AddQuestionCommand -> Model : getPerson(1)
activate Model

Model --> AddQuestionCommand : student
deactivate Model

AddQuestionCommand -> Student : addQuestion(q)
activate Student

Student --> AddQuestionCommand : copy
deactivate Student

AddQuestionCommand -> Model : setPerson(student, copy)
activate Model

Student -[hidden]-> Model
destroy Student

Model --> AddQuestionCommand
deactivate Model

AddQuestionCommand --> LogicManager : result
deactivate AddQuestionCommand

AddQuestionCommand -[hidden]-> LogicManager
destroy AddQuestionCommand

[<-- LogicManager
deactivate LogicManager
@enduml
23 changes: 23 additions & 0 deletions docs/diagrams/DeleteQuestionActivityDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
@startuml
start
:User executes delete question command;
:Parses the command;
if () then ([command is valid])
:DeleteQuestionCommand is executed;
if () then ([student exists])
if () then ([question does not exist])
:Display invalid question error message;
else ([else])
:Create student copy;
:Delete question from student copy;
:Replace student with modified copy;
:Display success message;
endif
else ([else])
:Display invalid student error message;
endif
else ([command is invalid - missing or invalid arguments])
:Display parse error message;
endif
stop
@enduml
80 changes: 80 additions & 0 deletions docs/diagrams/DeleteQuestionSequenceDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
@startuml
!include style.puml

box Logic LOGIC_COLOR_T1
participant ":LogicManager" as LogicManager LOGIC_COLOR
participant ":ReeveParser" as ReeveParser LOGIC_COLOR
participant ":QuestionCommandParser" as QuestionCommandParser LOGIC_COLOR
participant "d:DeleteQuestionCommand" as DeleteQuestionCommand LOGIC_COLOR
end box

box Model MODEL_COLOR_T1
participant ":Model" as Model MODEL_COLOR
participant "student:Student" as Student MODEL_COLOR
end box

[-> LogicManager : execute("question 1 d/1")
activate LogicManager

LogicManager -> ReeveParser : parseCommand("question 1 d/1")
activate ReeveParser

create QuestionCommandParser
ReeveParser -> QuestionCommandParser
activate QuestionCommandParser

QuestionCommandParser --> ReeveParser
deactivate QuestionCommandParser

ReeveParser -> QuestionCommandParser : parse("1 d/1")
activate QuestionCommandParser

create DeleteQuestionCommand
QuestionCommandParser -> DeleteQuestionCommand
activate DeleteQuestionCommand

DeleteQuestionCommand --> QuestionCommandParser : s
deactivate DeleteQuestionCommand

QuestionCommandParser --> ReeveParser : s
deactivate QuestionCommandParser

QuestionCommandParser -[hidden]-> ReeveParser
destroy QuestionCommandParser

ReeveParser --> LogicManager : s
deactivate ReeveParser

LogicManager -> DeleteQuestionCommand : execute()
activate DeleteQuestionCommand

DeleteQuestionCommand -> Model : getPerson(1)
activate Model

Model --> DeleteQuestionCommand : student
deactivate Model

DeleteQuestionCommand -> Student : deleteQuestion(1)
activate Student

Student --> DeleteQuestionCommand : copy
deactivate Student

DeleteQuestionCommand -> Model : setPerson(student, copy)
activate Model

Model --> DeleteQuestionCommand
deactivate Model

Student -[hidden]-> Model
destroy Student

DeleteQuestionCommand --> LogicManager : result
deactivate DeleteQuestionCommand

DeleteQuestionCommand -[hidden]-> LogicManager
destroy DeleteQuestionCommand

[<-- LogicManager
deactivate LogicManager
@enduml
24 changes: 24 additions & 0 deletions docs/diagrams/SolveQuestionActivityDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
@startuml
start
:User executes solve question command;
:Parses the command;
if () then ([command is valid])
:SolveQuestionCommand is executed;
if () then ([student exists])
if () then ([question does not exist])
:Display invalid question error message;
else ([else])
:Create student copy;
:Create solved version of question;
:Set the student copy's question to the solved version;
:Replace student with modified copy;
:Display success message;
endif
else ([else])
:Display invalid student error message;
endif
else ([command is invalid - missing or invalid arguments])
:Display parse error message;
endif
stop
@enduml
88 changes: 88 additions & 0 deletions docs/diagrams/SolveQuestionSequenceDiagram.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
@startuml
!include style.puml

box Logic LOGIC_COLOR_T1
participant ":LogicManager" as LogicManager LOGIC_COLOR
participant ":ReeveParser" as ReeveParser LOGIC_COLOR
participant ":QuestionCommandParser" as QuestionCommandParser LOGIC_COLOR
participant "s:SolveQuestionCommand" as SolveQuestionCommand LOGIC_COLOR
end box

box Model MODEL_COLOR_T1
participant ":Model" as Model MODEL_COLOR
participant "q:SolvedQuestion" as Question MODEL_COLOR
participant "student:Student" as Student MODEL_COLOR
end box

[-> LogicManager : execute("question 1 s/1 Check textbook")
activate LogicManager

LogicManager -> ReeveParser : parseCommand("question 1 s/1 Check textbook")
activate ReeveParser

create QuestionCommandParser
ReeveParser -> QuestionCommandParser
activate QuestionCommandParser

QuestionCommandParser --> ReeveParser
deactivate QuestionCommandParser

ReeveParser -> QuestionCommandParser : parse("1 s/1 Check textbook")
activate QuestionCommandParser

create SolveQuestionCommand
QuestionCommandParser -> SolveQuestionCommand
activate SolveQuestionCommand

SolveQuestionCommand --> QuestionCommandParser : s
deactivate SolveQuestionCommand

QuestionCommandParser --> ReeveParser : s
deactivate QuestionCommandParser

QuestionCommandParser -[hidden]-> ReeveParser
destroy QuestionCommandParser

ReeveParser --> LogicManager : s
deactivate ReeveParser

LogicManager -> SolveQuestionCommand : execute()
activate SolveQuestionCommand

SolveQuestionCommand -> Model : getPerson(1)
activate Model

Model --> SolveQuestionCommand : student
deactivate Model

create Question
SolveQuestionCommand -> Question
activate Question

Question --> SolveQuestionCommand : q
deactivate Question

SolveQuestionCommand -> Student : setQuestion(q)
activate Student

Student --> SolveQuestionCommand : copy
deactivate Student

SolveQuestionCommand -> Model : setPerson(student, copy)
activate Model

Model --> SolveQuestionCommand
deactivate Model

Student -[hidden]-> Model
destroy Student

SolveQuestionCommand --> LogicManager : result
deactivate SolveQuestionCommand

SolveQuestionCommand -[hidden]-> LogicManager
destroy SolveQuestionCommand

[<-- LogicManager
deactivate LogicManager
@enduml
Binary file added docs/images/AddQuestionActivityDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/AddQuestionSequenceDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/DeleteQuestionActivityDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/DeleteQuestionSequenceDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/SolveQuestionActivityDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/SolveQuestionSequenceDiagram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 1e359f3

Please sign in to comment.