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

Quiz feature #62

Merged
merged 9 commits into from
Oct 24, 2020
Merged

Conversation

joshruien
Copy link

First iteration of the quiz feature for v1.3

joshruien and others added 6 commits October 14, 2020 13:59
* 'master' of https://github.com/joshruien/tp:
  Add testing for ListCommand
  update for CheckStyleTest
  Add testcases for Find command
  Add ability to hide answers
  change find format
  update TestCases
  files left out
  UserGuide update for find function
  javadoc
  update Find function
  find tag function
  find question and find answer
  Change URL of HelpCommand window
  Change ClearCommand success message
* branch-quiz:
  Implement quiz select random question
Includes Quiz command, Answer command and Exitquiz command
@joshruien joshruien added the enhancement New feature or request label Oct 23, 2020
@joshruien joshruien added this to the v1.3 milestone Oct 23, 2020
@joshruien joshruien self-assigned this Oct 23, 2020
@@ -73,4 +73,8 @@ shadowJar {
archiveName = 'medmoriser.jar'
}

run {
enableAssertions = true

Choose a reason for hiding this comment

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

Thanks for this, totally missed out the requirement for tp

* Creates an AnswerCommand
* @param answer The user's input answer.
*/
public AnswerCommand(String answer){

Choose a reason for hiding this comment

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

may want to change the parameter to userAnswer for consistency

*/
public class QuizCommand extends Command {

public static boolean isQuiz = false;

Choose a reason for hiding this comment

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

I'm not sure if the isQuiz state should be placed in the command. Do you think it would be possible to put it under a new class that controls the system's state? @jonfoocy what do you think about this?

Copy link
Author

Choose a reason for hiding this comment

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

I'm not very sure about this either, I just added a getter and setter for isQuiz and made it a private static boolean.

Choose a reason for hiding this comment

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

Good point actually I did the same thing for my implementation of the ListCommand. Maybe we can extract it and put it in the UiManager component?

Copy link

@yongmingyang yongmingyang left a comment

Choose a reason for hiding this comment

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

Just minor changes to some of the parameter names, and I'm not sure if the state of isQuiz should be extracted and placed in another class rather than the QuizCommand, what do you think about this? Great job though!

@codecov-io
Copy link

Codecov Report

Merging #62 into master will decrease coverage by 3.55%.
The diff coverage is 29.89%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master      #62      +/-   ##
============================================
- Coverage     72.12%   68.57%   -3.56%     
- Complexity      440      442       +2     
============================================
  Files            74       79       +5     
  Lines          1324     1394      +70     
  Branches        138      148      +10     
============================================
+ Hits            955      956       +1     
- Misses          335      396      +61     
- Partials         34       42       +8     
Impacted Files Coverage Δ Complexity Δ
...n/java/seedu/medmoriser/commons/core/Messages.java 0.00% <ø> (ø) 0.00 <0.00> (ø)
...seedu/medmoriser/logic/commands/AnswerCommand.java 0.00% <0.00%> (ø) 0.00 <0.00> (?)
...edu/medmoriser/logic/commands/ExitQuizCommand.java 0.00% <0.00%> (ø) 0.00 <0.00> (?)
...a/seedu/medmoriser/logic/commands/HelpCommand.java 50.00% <0.00%> (-50.00%) 2.00 <1.00> (ø)
...eedu/medmoriser/logic/parser/AddCommandParser.java 86.66% <ø> (ø) 5.00 <0.00> (ø)
...u/medmoriser/logic/parser/AnswerCommandParser.java 0.00% <0.00%> (ø) 0.00 <0.00> (?)
...eedu/medmoriser/logic/parser/MedmoriserParser.java 80.00% <0.00%> (-20.00%) 12.00 <0.00> (ø)
...edu/medmoriser/logic/parser/QuizCommandParser.java 0.00% <0.00%> (ø) 0.00 <0.00> (?)
...a/seedu/medmoriser/logic/commands/QuizCommand.java 8.33% <8.33%> (ø) 2.00 <2.00> (?)
...va/seedu/medmoriser/logic/commands/AddCommand.java 85.71% <50.00%> (-14.29%) 8.00 <0.00> (ø)
... and 11 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 26ec8a6...c4b3d84. Read the comment docs.

Copy link

@yongmingyang yongmingyang left a comment

Choose a reason for hiding this comment

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

Good to go!

Copy link

@jonfoocy jonfoocy left a comment

Choose a reason for hiding this comment

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

LGTM!

@jonfoocy jonfoocy merged commit 355a0ff into AY2021S1-CS2103T-W15-1:master Oct 24, 2020
@joshruien joshruien linked an issue Oct 24, 2020 that may be closed by this pull request
@yongmingyang yongmingyang added this to To review (for merging) in Team Project Oct 26, 2020
@yongmingyang yongmingyang moved this from To review (for merging) to Done in Team Project Oct 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

Successfully merging this pull request may close these issues.

Quiz Feature
4 participants