Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
Java Coursework
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Simon Barrett
Java Coursework
Commits
b12e1e66
Commit
b12e1e66
authored
3 years ago
by
Simon Barrett
Browse files
Options
Downloads
Patches
Plain Diff
Starting from here
parent
3d428160
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Lesson.java
+2
-6
2 additions, 6 deletions
src/Lesson.java
src/QuizSystem.java
+2
-0
2 additions, 0 deletions
src/QuizSystem.java
with
4 additions
and
6 deletions
src/Lesson.java
+
2
−
6
View file @
b12e1e66
...
...
@@ -34,12 +34,7 @@ public class Lesson {
return
lessonTitle
;
}
/**
* This method also sets lesson complete to true as it
* @return String containing Lesson Text
*/
public
String
getLessonText
()
{
this
.
lessonCompleted
=
true
;
return
lessonText
;
}
...
...
@@ -68,6 +63,8 @@ public class Lesson {
this
.
quizScore
=
quizScore
;
}
public
void
replace
(
boolean
lessonCompleted
,
boolean
quizCompleted
,
int
quizScore
){
this
.
lessonCompleted
=
lessonCompleted
;
this
.
quizCompleted
=
quizCompleted
;
...
...
@@ -91,7 +88,6 @@ public class Lesson {
* @return total correct user answers
*/
public
int
doQuiz
()
{
this
.
quizCompleted
=
true
;
int
correctAnswers
=
0
;
int
questionsAnswered
=
0
;
...
...
This diff is collapsed.
Click to expand it.
src/QuizSystem.java
+
2
−
0
View file @
b12e1e66
...
...
@@ -34,6 +34,7 @@ public class QuizSystem {
// User takes the LESSON
System
.
out
.
println
(
chosenLesson
.
getLessonText
());
chosenLesson
.
setLessonCompleted
(
true
);
// Ask user if they want to do QUIZ
System
.
out
.
println
(
"Would you like to do the quiz now? (y or n)"
);
...
...
@@ -43,6 +44,7 @@ public class QuizSystem {
if
(
nextString
.
equals
(
"y"
))
{
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"
);
userName
=
ScannerExtension
.
scanString
();
System
.
out
.
println
(
"Record of completion and Score saved under username: "
+
userName
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment