Skip to content
Snippets Groups Projects
Commit 42391993 authored by Simon Barrett's avatar Simon Barrett
Browse files

Before Big refactor save

parent 439abd90
No related branches found
No related tags found
No related merge requests found
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
......@@ -84,7 +84,8 @@ public class Lesson {
* Sets lessonCompleted to true as the lesson has now been printed out for user to read
*/
public void printLesson() {
System.out.println("You have chosen lesson: " + lessonTitle);
System.out.println(" ");
System.out.println("You have chosen the lesson: " + lessonTitle);
System.out.println(" ");
System.out.println(lessonText);
System.out.println(" ");
......
......@@ -31,7 +31,7 @@ public class Module {
* Also prints out the user instruction based on the number of lessons in the module
*/
public void listAll() {
System.out.println("Please pick from the lessons below: ");
System.out.println("Please pick from one of the lessons below: ");
// Empty Strings declared which will be used to build the userInstruction string
String userInstruction = "";
......@@ -49,7 +49,7 @@ public class Module {
if(i != lessons.length - 1) {
numberToChooseLesson = (i + 1) + ", ";
} else {
numberToChooseLesson = (i + 1) + ") :";
numberToChooseLesson = (i + 1) + "):";
}
userInstruction = userInstruction + numberToChooseLesson;
}
......
......@@ -29,11 +29,13 @@ public class Question {
resilient to code changes
*/
System.out.println("Question " + questionNumber + ": " + question);
System.out.println(" ");
for(int i = 1; i <= answers.length; i++) {
System.out.println(i + ". " + answers[i - 1]);
}
System.out.println(" ");
System.out.println("Please type in your answer(Number from 1 to " + answers.length + "): ");
int userChoice = ScannerExtension.scanForUserIntChoice(answers.length);
......
......@@ -3,7 +3,12 @@ public class QuizSystem {
public static void main(String[] args) {
// Welcome message
System.out.println("Welcome to the MSc Software Engineering Quiz");
System.out.println(" ");
System.out.println(" + ------------------------------------------------ +");
System.out.println(" + | Welcome to the MSc Software Engineering Quiz | +");
System.out.println(" + ------------------------------------------------ +");
System.out.println(" \u00a9 Simon Barrett (C1218123) 2021");
System.out.println(" ");
System.out.println(" ");
/* This is Basic Set up:
......@@ -70,7 +75,7 @@ public class QuizSystem {
*/
public static String checkIfUserWantsToDoQuiz(Lesson chosenLesson) {
// Ask user if they want to do QUIZ
System.out.println("Would you like to do the quiz now? (y or n)");
System.out.println("Would you like to complete the quiz now? Type 'y' (yes) or 'n' (no): ");
// Check user choice
String userName = "";
String nextString = ScannerExtension.chooseYorN();
......@@ -78,15 +83,16 @@ public class QuizSystem {
chosenLesson.setQuizScore(chosenLesson.doQuiz());
chosenLesson.setQuizCompleted(true);
System.out.println("Please enter your name to record that you have completed the lesson and the quiz");
System.out.println("Please enter your name (in lowercase) to record that you have completed the lesson and the quiz: ");
userName = ScannerExtension.scanStringToLowercase();
System.out.println("Record of Completion and Score saved under username: " + userName);
System.out.println("Record of Lesson + Quiz Completion and Quiz Score saved under username: " + userName);
} else if (nextString.equals("n")) {
System.out.println("Please enter your name to record that you have completed the lesson");
System.out.println("Please enter your name (in lowercase) to record that you have completed the lesson: ");
userName = ScannerExtension.scanStringToLowercase();
System.out.println("Record of completion saved under username: " + userName);
System.out.println("Going back to the main menu");
System.out.println("Record of Lesson Completion saved under username: " + userName);
System.out.println(" ");
System.out.println(" ** Going back to the main menu **");
}
System.out.println(" ");
return userName;
......@@ -117,7 +123,10 @@ public class QuizSystem {
*/
public static boolean checkUserDecision(UserCompletionData users) {
boolean continueWithQuiz = true;
System.out.println("Type l to see a list of all lessons, data to see progress or n to exit game :");
System.out.println("What would you like to do next:");
System.out.println("See the list of lessons? Type (l)");
System.out.println("Check your progress? Type (data)");
System.out.println("Exit Game? Type (n)");
String userDecision = ScannerExtension.gameDecision();
if (userDecision.equals("data")) {
System.out.println("Please type in your name to access your data, or all to print all user data");
......
......@@ -129,7 +129,6 @@ public class ScannerExtension {
}
} else {
ArrayList<Lesson> userRecord= users.getUsers().get(userExists).getUserRecord();
UserCompletionData userCompletionData = users;
for(int i = 0; i < userRecord.size(); i++) {
System.out.println(nextString + ":" + users.printOutUserCompletionDataForLesson(userRecord.get(i)));
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment