forked from nus-cs2103-AY2021S1/tp
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #103 from StopTakingAllTheNames/branch-QuestionTweak
Tweak Question functionality
- Loading branch information
Showing
50 changed files
with
1,350 additions
and
468 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.