Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 24 additions & 22 deletions SpecRunner.html
Original file line number Diff line number Diff line change
@@ -1,30 +1,32 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Jasmine Spec Runner v3.4.0</title>
<head>
<meta charset="utf-8" />
<title>Jasmine Spec Runner v3.4.0</title>

<link rel="shortcut icon" type="image/png" href="test/lib/jasmine-3.4.0/jasmine_favicon.png">
<link rel="stylesheet" href="test/lib/jasmine-3.4.0/jasmine.css">
<link
rel="shortcut icon"
type="image/png"
href="test/lib/jasmine-3.4.0/jasmine_favicon.png"
/>
<link rel="stylesheet" href="test/lib/jasmine-3.4.0/jasmine.css" />

<script src="test/lib/jasmine-3.4.0/jasmine.js"></script>
<script src="test/lib/jasmine-3.4.0/jasmine-html.js"></script>
<script src="test/lib/jasmine-3.4.0/boot.js"></script>
<script src="test/lib/jasmine-3.4.0/jasmine.js"></script>
<script src="test/lib/jasmine-3.4.0/jasmine-html.js"></script>
<script src="test/lib/jasmine-3.4.0/boot.js"></script>

<!-- include source files here... -->
<script src="instanceArray.js"></script>
<script src="sayName.js"></script>
<script src="arrayProperty.js"></script>
<script src="quizApp.js"></script>
<!-- include source files here... -->
<script src="instanceArray.js"></script>
<script src="sayName.js"></script>
<script src="arrayProperty.js"></script>
<script src="quizApp.js"></script>

<!-- include spec files here... -->
<script src="test/spec/instanceArraySpec.js"></script>
<script src="test/spec/sayNameSpec.js"></script>
<script src="test/spec/arrayPropertySpec.js"></script>
<script src="test/spec/quizAppSpec.js"></script>
<!-- include spec files here... -->
<script src="test/spec/instanceArraySpec.js"></script>
<script src="test/spec/sayNameSpec.js"></script>
<script src="test/spec/arrayPropertySpec.js"></script>
<script src="test/spec/quizAppSpec.js"></script>
</head>

</head>

<body>
</body>
<body></body>
</html>
14 changes: 12 additions & 2 deletions arrayProperty.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
//Just like you can add methods to your own constructor, you can also add methods and properties to built in classes in JavaScript like Arrays and Objects.

//Add a reverse method to the String 'class' so that every instance of String can call reverse and reverse itself.

//code here

//code here
String.prototype.reverse = function(str) {
str = this;
return str
.split("")
.reverse()
.join("");
};

var str = "Kobe";
console.log(str.reverse());
34 changes: 21 additions & 13 deletions instanceArray.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,45 @@
2) Oscar, oscar@boom.camp, 'iLoveSoccer'
*/

var User = function(name, email, pw){
var User = function(name, email, pw) {
this.name = name;
this.email = email;
this.pw = pw;
}
};

//Create an Array called 'users' that will store all our instances of User.

//code here

//code here
var users = [];

//Now create and push into your users array 3 separate instances of User using the data from above in that exact order

//code here
//code here
users[0] = new User("Aodhan", "aodhan@boom.camp", "iLoveJS");
users[1] = new User("Greg", "greg@boom.camp", "iLovePython");
users[2] = new User("Oscar", "oscar@boom.camp", "iLoveSoccer");

console.log('Aodhan\'s information is ');
console.log("Aodhan's information is ");
//Console.log all of Aodhan information

//code here
//code here
console.log(users[0].name + " " + users[0].email + " " + users[0].pw);

console.log('Oscar\'s information is ');
console.log("Oscar's information is ");
//Now console.log all of Oscars information

//code here

//code here
console.log(users[2].name + " " + users[2].email + " " + users[2].pw);

//Now create another instance of User using your own information and then add that to your users array.

//code here
//code here
users[3] = new User("Noe", "noe.restum@boom.camp", "iLoveOof");

console.log('All my users names are ');
console.log("All my users names are ");
//Now loop through your users Array and console.log every users name.

//code here
//code here
for (i in users) {
console.log(users[i].name);
}
82 changes: 64 additions & 18 deletions quizApp.js
Original file line number Diff line number Diff line change
@@ -1,48 +1,94 @@
//We're going to create the JS for a basic quiz application.
//We're going to create the JS for a basic quiz application.

//Let's think about the nature of this quiz app first. We're going to be creating lots of user objects, and we're
//also going to be creating lots of Question objects. Those would make two perfectly good constructors.
//also going to be creating lots of Question objects. Those would make two perfectly good constructors.

//Create a QuizUser constructor that accepts name, email, password, and totalScore parameters and set them appropriatly

//code here

//code here
class QuizUser {
constructor(name, email, password, totalScore) {
this.name = name;
this.email = email;
this.password = password;
this.totalScore = totalScore;
}
}

//Create a Question constructor that accepts title, answersArray, rightAnswer, and difficulty parameters

//code here

//code here
class Question {
constructor(title, answersArray, rightAnswer, difficulty) {
this.title = title;
this.answersArray = answersArray;
this.rightAnswer = rightAnswer;
this.difficulty = difficulty;
}
}

//Create a quizUsers Array which is going to hold all of our users.

//code here

//code here
var quizUsers = [];

//Let's say three people signed up for our service, create 3 instances of User and add each to the users Array

//code here

//code here
quizUsers[0] = new QuizUser("Aodhan", "aodhan@boom.camp", "23_23", "100");
quizUsers[1] = new QuizUser("Oscar", "oscar@boom.camp", "23_24", "99");
quizUsers[2] = new QuizUser("Noe", "noe.restum@boom.camp", "23_23", "89");

//Create a questions Array which is going to hold all of our questions

//code here

//code here
var questions = [];

//Now, let's say we wanted to create a quiz about JavaScript. Create three instances of Question which contain the following data
//title: 'T/F: Inheritance is achieved in JavaScript through Prototypes?'
//title: 'T/F: JavaScript is just a scripting version of Java'
//title: "T/F: In Javascript, == doesn't check 'type' but just the value - where === checks type and value"
//Fill in the rest of the required data as you see appropriate.

//code here

//code here
questions.push(
new Question(
"T/F: Inheritance is achieved in JavaScript through Prototypes?",
["T", "F"],
"F",
1
)
);
questions.push(
new Question(
"T/F: JavaScript is just a scripting version of Java",
["T", "F"],
"F",
1
)
);
questions.push(
new Question(
"T/F: In Javascript, == doesn't check 'type' but just the value - where === checks type and value",
["T", "F"],
"T",
1
)
);

//Now push all of your instances of Question into the questions Array

//code here
//code here

console.log('My users Array and my questions arrray are ...');
console.log("My users Array and my questions arrray are ...");
//Now loop console.log your users array and your questions array and verify that they're both holding the right data.

//code here

//code here
for (i in quizUsers) {
console.log(
quizUsers[i].name,
quizUsers[i].email,
quizUsers[i].password,
quizUsers[i].totalScore
);
}
18 changes: 13 additions & 5 deletions sayName.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
//Create a Person constructor that accepts name and age as parameters and sets those properties accordingly in the Constructor.

//code here

//code here
function Person(name, age) {
this.name = name;
this.age = age;
}

//Now create three instances of Person with data you make up

//code here

//code here
const instructor = new Person("Aodhan", 28);
const instructor1 = new Person("Oscar", 24);
const instructor2 = new Person("Noe", 20);

//Now add a sayName method on your Person class that will alert the name of whatever Person instance called it.

//code here
//code here
Person.prototype.sayName = function() {
alert(this.name);
};
4 changes: 2 additions & 2 deletions user.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"name": "",
"email": ""
"name": "Noe Philip Gabriel M. Restum",
"email": "noe.restum@boom.camp"
}