Q1. This course is the third one in our specialisation. We assume you already know some Javascript, HTML and CSS. If you are new to all these languages, we recommend that you go back and check out the previous courses. Otherwise, here are some questions to test your knowledge!
Q2. We just want to let you know that the latest version of meteor creates a slightly different starter app than the version we use in this course. It is more complicated than the one shown in the course. We prefer the simpler starter application for teaching, so we provide you with a stripped down starter app and recommend that you start with that.
Q1. Which technology makes it easier to deal with many users?
Q2. Where does the web browser software run?
Q1. What is the command to run a Meteor application called myApplication?
Q2. Where does localhost point to on a network?
Q1. What is spacebars in Meteor?
Q2. Which code defines a template called ‘photoDisplay’?
{{> photoDisplay}}
</template name="photodisplay">
Q1. What does Meteor.isClient mean?
Q2. Which of the following are true? Select all that apply.
Q1. How do you search for packages in Meteor? (select all that are correct)
Q2. Why did the image gallery in the video pop down to a single column with 3 rows when the browser window was narrow?
Q1. How do we access the tag that relates to the event in a template event function?
$(event.target).css
$(event.target)
Q2. Which looks like the right start for adding event listeners to a template called aTemplate?
Template.aTemplate.events
Template.aTemplate.onclick
Q1. Which are web languages? (select all those apply)
Q2. Run the following command to create a new meteor application:
1
meteor create myapp
Look in the folder that has been created. Which files or folders can you see?
Q3. What is the default port for a local Meteor server to run on?
Q4. Select the correct bit of template code to render a template called ‘myTemplate’
{{> myTemplate}}
</template name="mytemplate">
{{myTemplate}}
{{:: myTemplate}}
</template name="mytemplate">
Q5. What is the purpose of the public folder in a web application?
Q6. Run the image_share application supplied with this module. Where does the message ‘where am I running’ get printed out? Select all that apply
Q7. Which code defines a template helper function that can pass an array called test into a template called testTemp?
Template.testTemp.helpers({
test:function(){
var test = []; return test; } })
</template name="testtemp">
{{test}}
</template name="testtemp">
{{#each test}} {{img_name}} {{/each}}
Template.test.helpers({
test:function(){
var testTemp = [];
return testTemp; }
})
Q8. What do you need to add to the following code to make it into a responsive grid?
Q9. Why not use onclick attributes to add interactivity in our meteor apps?
Q10. Which code defines a template event listener for a template named myTemplate that will print ‘hello’ when the user clicks on any button in the template?
Q1. How many copies of the data can be in a Meteor application at any one time? (assuming all data is visible to all)
Q2. What is Meteor’s default database server called?
Q1. How can we create a collection in Meteor’s database?
Images = Mongo.createCollection("myCollection");
Images = new Mongo.Collection("images");
Q2. What is the purpose of the Meteor.startup function? (select ALL that apply)
Q1. Which features of this code make it readable? Select all that apply
if (Meteor.isServer) {
Meteor.startup() {
for (var i = 0; i < 23; i++) {
} // end for iterating images
} // end meteor.startup
} // end meteor.iserver
Q2. What is the command to remove something from a collection?
Q1. What was different about how we dealt with event targets in this module, compared with the previous module?
Q2. How do we access an id on something from a Mongo collection?
Q1. What kind of event do we listen to on forms?
Q2. Why do I prefix some CSS class names with ‘js-‘?
Q1. Why is a Meteor application like a database cluster?
Q2. Why do we define collections like this:
Images = new Mongo.Collection("images");
instead of:
var Images = new Mongo.Collection("images");
Q3. What does running the command
meteor reset
in a meteor application’s folder do?
Q4. Select the correct way of specifying HTML, CSS and JavaScript comments
// this is an HTML comment
/* this is a CSS comment */
// this is a Javascript comment
/* this is an HTML comment */
// this is an Javascript comment
/* this is a CSS comment */
// this is an Javascript comment
/* this is an HTML comment */
Q5. Which of the following is the correct way to access a collection in Meteor?
Meteor.Images.find({});
Mongo.find("images", {})
Images.find({})
Images.find().count()
Q6. Regarding this function call, which are true?
Images.update({_id:'123'}, {$set:{rating:4}});
Q7. Which of the following statements will retrieve the images with the lowest rated one coming first?
Images.find({}).sort({rating:1});
Images.find({}, {sort:{rating:1}})
Images.find({}, {sort:{rating:-1}})
Images.find({_id:'123'}, {sort:{rating:1}})
Q8. What happens if we return false from a template event listener in Meteor?
Q9. What is wrong with the following code?
Template.images.events({
"click .js-show-image-form":function(){ }
"click .js-hide-image-form":function(){ }
});
Q10. Which code shows a Bootstrap modal with an id of ‘myModal’?
$('#myModal').modal('show');
$('.myModal').modal('hide');
$('.myModal').modal('show');
$('#myModal').modal('hide');
Q1. Which packages should you add for basic user authentication in your database and UI? (select all that apply)
Q2. When a password reset email is sent from a Meteor server running on your own computer, where is the content of the email printed out?
Q1. What does the max-height CSS property do to images?
Q2. What is the name of the user login template provided by accounts-ui?
Q1. How do we access a logged in user’s email address?
Meteor.user().emails[0].address
Meteor.user().email_address[0]
Q2. Why do templates that access user data render twice sometimes?
Q1. What is the purpose of the Accounts.ui.config function?
Q2. Bonus information: which is an alternative way to access user information?
Meteor.users()
Meteor.users.find()
Q1. Which of these look like valid template helpers? (select all that apply)
Template.image_list.helpers({
images: [
{img_alt:"my image"},
{img_alt:"my other image"}
] });
Template.image_list.helpers({
images: function(){
return Images.find({});
}
});
Q2. Which is the correct way to insert an image into a database collection?
Images.insert(img_alt, img_src, userId)
Images.insert({img_alt: img_alt, img_src: img_src, userId: userId})
Q1. Why do we always need an href attribute on an a tag? Choose the most accurate answer.
Q2. How many copies of the Session variable do you think there are in a complete Meteor application?
Q1. You are provided with a helper function as follows:
Template.image_list.helpers({
greaterThan5:function(input){
console.log(input);
if (input > 5){
return true;
} else {
return false; } } });
Which is the correct syntax for an if block in a template that uses this helper?
{{#if greaterThan5 10}} 10 is greater than 5 {{/if}}
{{#if greaterThan5(10)}} 10 is greater than 5 {{/if}}
Q2. How do you unset a key called ‘myKey’ on a session?
Session.set(‘myKey’, undefined)
Session.unset(‘myKey’)
Q1. Why should we use an infinite scroll?
Q2. What does limit mean in a database find query?
Q1. Which of the following types of user accounts are supported by packages in meteor? (clue – run the command
meteor search accounts )
Select all that apply
Q2. What happens to your page content when you set up a fixed position navbar?
Q3. Reactive data sources…
Q4. What is the Meteor.user() function for?
Q5. Which of the following specifies a template helper function that returns the username if the user is logged in?
Q6. Select the options where variable a is ‘truthy’
Q7. Which of the following are reactive data sources?
Q8. What is wrong with this code?
Template.imageList.helpers({
username: function(){
var user = Meteor.users.findOne({_id:Meteor.userId()})
if (user){
return user.username;
}
}
images: function(){
var filter = {userId:Meteor.userId()};
return Images.find(filter);
Q9. Which is the correct way to specify a template helper function that returns true if the user is logged in, which can be used in a template if block?
Q10. What is wrong with displaying all the images in the database at once in the template? (select all that apply)
Q1. Which files do not go in the public folder?
Q2. Why are Meteor.isClient and Meteor.isServer not needed in code in the server and client folders?
Q1. In terms of what you have access to, the browser console environment is equivalent to:
Q2. What was the key message in this video?
Q1. What is the name of the package that makes your app easier to develop, but not very secure
Q2. In the video, before we implemented delete permissions, why does the image disappear then re-appear when we click on it?
Q1. Which of the following is true?
Q2. Do you need the ‘if(Meteor.isServer)’ test in the lib folder?
Q1. If we put the following code in our client javascript code, which template will be rendered when we visit http://localhost:3000/images?
Router.route('/', function(){
this.render('images');
});
Router.route('/images', function(){
this.render('navbar');
});
Q2. Why do we need to use routing?
Q1. What should the name attribute of the main layout template be set to if I configure the router using the following code:
Router.configure({
layoutTemplate:'MainLayout',
})
Q2. What does the yield mean in the following code?
{{> yield "header"}}
Q1. Which folder would you put template helper code into? (choose the best option)
Q2. Where would you put collection definition code? (choose the best option)
Q3. What will the following code do if you run it in the browser console?
for (var i = 0; i < 1000; i += 2){
Images.insert({
“img_src”:”no good!”});}
Q4. What is the correct code to check the user is logged in before they can delete an image? (select all that apply)
Q5. What will the following code print in the browser console when a user tries to insert an image. assuming they are logged in?
Images.allow({
insert:function(userId, doc){
if (Meteor.isServer){
console.log(“insert on server”);
}
if (Meteor.isClient){
console.log(“insert on client”);
}
if (Meteor.user()){
return true;
Q6. Where should you put server start up code?
Q7. Which of the following route specifications will display the images template when the user visits http://localhost:3000/images ?
Q8. Which of the following is the most correct way to create a route that can take the user to a view called ‘/images’?
go to images
go to images
go to images
go to images</a src="https:>
Q9. Which statements are true about the following code?
Router.route(‘/images/:_id’, function () {
this.render(‘Home’, {
data: function () {
return Images.findOne({_id: this.params._id});} }); });
I hope this Introduction to Meteor.js Development Coursera Quiz Answers would be useful for you to learn something new from the Course. If it helped you, don’t forget to bookmark our site for more Quiz Answers.
Former Vice President Phelekezela Mphoko has died aged 84, presidency spokesman George Charamba has confirmed.…
The Zimbabwe School Examinations Council (ZIMSEC) opened its online portal for Grade 7 results…
2024 ZIMSEC Grade 7 Results Now Out The Zimbabwe School Examinations Council (ZIMSEC) has officially…
We’re bringing free WiFi to different parts of Zimbabwe to help you access eduzim.co.zw for…
Sadza is a simple, hearty dish that forms the backbone of many Zimbabwean meals. It's…
Caesar Salad A classic Caesar salad is a simple yet flavorful dish with crisp romaine…