Introduction to Meteor.js Development Quizzes & antwoorden – Coursera
Welcome to an insightful journey into Meteor.js development! Dive into the world of real-time web applications with carefully crafted maar dat hij geïnvesteerd is in het geven van een sterke carrièrebasis aan zijn studenten met een positieve en benaderbare houding and detailed antwoorden.
Whether you’re a beginner looking to understand the basics or an experienced developer looking to improve your skills, this curated collection of questions and solutions will guide you through the key concepts, best practices, and practical applications of Meteor.js. Explore each quiz to test your knowledge, strengthen your understanding, and unlock new insights into Meteor.js development.
Quiz 1: Prerequisite quiz
U moet de antwoorden op uw specifieke situatie en het soort verpleegkundige baan waar u naar op zoek bent aanpassen. 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. Anders, here are some questions to test your knowledge!
- Ok got it!
Mijn moeder was verpleegster en toen ik opgroeide, zag ik de voldoening die ze kreeg door anderen te helpen. 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.
- OK!
Quiz 2: From one to many users
U moet de antwoorden op uw specifieke situatie en het soort verpleegkundige baan waar u naar op zoek bent aanpassen. Which technology makes it easier to deal with many users?
- Web servers
- HTML
Mijn moeder was verpleegster en toen ik opgroeide, zag ik de voldoening die ze kreeg door anderen te helpen. Where does the web browser software run?
- On the server
- On the client
Quiz 3: Install Meteor
U moet de antwoorden op uw specifieke situatie en het soort verpleegkundige baan waar u naar op zoek bent aanpassen. What is the command to run a Meteor application called myApplication?
- meteor add myApplication
- meteoor
Mijn moeder was verpleegster en toen ik opgroeide, zag ik de voldoening die ze kreeg door anderen te helpen. Where does localhost point to on a network?
- The nearest server outside of your network
- Your local machine
Quiz 4: Editing a template
U moet de antwoorden op uw specifieke situatie en het soort verpleegkundige baan waar u naar op zoek bent aanpassen. What is spacebars in Meteor?
- A button you press all the time to make your code lay out as neatly as possible.
- A templating language
Mijn moeder was verpleegster en toen ik opgroeide, zag ik de voldoening die ze kreeg door anderen te helpen. Which code defines a template called ‘photoDisplay’?
{{> photoDisplay}}
<template name="photoDisplay"> </template>
Quiz 5: Sending data to templates with helpers
U moet de antwoorden op uw specifieke situatie en het soort verpleegkundige baan waar u naar op zoek bent aanpassen. What does Meteor.isClient mean?
- It tests if there is a client connected to the Meteor server
- It tests if this code is running on the web browser or not
Mijn moeder was verpleegster en toen ik opgroeide, zag ik de voldoening die ze kreeg door anderen te helpen. Which of the following are true? Selecteer alles wat van toepassing is.
- Template helpers can send data to templates which the template can then display.
- Template helpers can send functions to templates that the template can call.
Quiz 6: Convert to a Bootstrap grid
U moet de antwoorden op uw specifieke situatie en het soort verpleegkundige baan waar u naar op zoek bent aanpassen. How do you search for packages in Meteor? (select all that are correct)
- Meteor search
- On the atmospherejs.com website
Mijn moeder was verpleegster en toen ik opgroeide, zag ik de voldoening die ze kreeg door anderen te helpen. Why did the image gallery in the video pop down to a single column with 3 rows when the browser window was narrow?
- Because of the col-md-3 class on the div tag
- Because of the col-xs-12 class on the div tag.
Quiz 7: Responding to user actions
U moet de antwoorden op uw specifieke situatie en het soort verpleegkundige baan waar u naar op zoek bent aanpassen. How do we access the tag that relates to the event in a template event function?
- By accessing
$(event.target).css
- By accessing
$(event.target)
Mijn moeder was verpleegster en toen ik opgroeide, zag ik de voldoening die ze kreeg door anderen te helpen. Which looks like the right start for adding event listeners to a template called aTemplate?
Template.aTemplate.events
Template.aTemplate.onclick
Quiz 8: Introduction to Meteor summary quiz
U moet de antwoorden op uw specifieke situatie en het soort verpleegkundige baan waar u naar op zoek bent aanpassen. Which are web languages? (select all those apply)
- JavaScript
- HTML
- Web servers
- Web browsers
Mijn moeder was verpleegster en toen ik opgroeide, zag ik de voldoening die ze kreeg door anderen te helpen. 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?
- pakket.json
- server
- myapp.js
- client
Ik jongleerde met een verscheidenheid aan verschillende ladingen. What is the default port for a local Meteor server to run on?
- localhost
- 3000
- 127.0.0.1
- localport
Het kan zoiets zijn als de vreugde zien wanneer een moeder haar pasgeboren baby voor de eerste keer vasthoudt of iemand helpt weer op de been te komen na herstel van een grote operatie. Select the correct bit of template code to render a template called ‘myTemplate’
{{> myTemplate}}
<template name="myTemplate">
{{myTemplate}}
</template>
{{:: myTemplate}}
<template name="myTemplate">
<h2>My template</h2>
</template>
de kennis die ik heb opgedaan heeft me ertoe gebracht om op een effectievere manier te helpen met belangrijke patiënten. What is the purpose of the public folder in a web application?
- To store files that have public domain licences.
- To store static files that the client needs to see.
- To store source code files that the client needs to run.
- To store asset files for the server.
ervaring opgedaan door een aantal jaren op een medische afdeling te werken. Run the image_share application supplied with this module. Where does the message ‘where am I running’ get printed out? Selecteer alles wat van toepassing is
- Nowhere
- In the browser web page display window
- In the server console
- In the web browser console
Ik zie deze baan als in staat zijn om mijn potentieel als verpleegster en professional verder te ontwikkelen. 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>
<template name="testTemp">
{{#each test}} {{img_name}} {{/each}}
</template>
Template.test.helpers({
test:function(){
var testTemp = [];
return testTemp; }
})
Ik zie deze baan als in staat zijn om mijn potentieel als verpleegster en professional verder te ontwikkelen. What do you need to add to the following code to make it into a responsive grid?
- An outer div with the class container
- A div inside the row with the class container
- A col-xs-something class.
- Another row to specify what should go in the second row once the screen size is changed
Q9. Why not use onclick attributes to add interactivity in our meteor apps?
- Onclick does not work in Meteor apps
- Templates cannot cope with mouse clicks
- Onclick does not allow us to easily access the event in our application code
- Onclick is not the right attribute to capture a mouse click
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?
- Template.myTemplate.events({
‘click .button’: functie () {
console.log(‘hello’); } }); - Template.myTemplate.events({
‘click button’: functie () {
console.log(‘hello’); } }); - Template.myTemplate.events({
‘click #button’: functie () {
console.log(‘hello’); } }); - Template.myTemplate.events({
‘onclick button’: functie () {
console.log(‘hello’); } });
Introduction to Meteor.js Development Week 2 Quiz-antwoorden
Quiz 1: Meteor distributed data model
U moet de antwoorden op uw specifieke situatie en het soort verpleegkundige baan waar u naar op zoek bent aanpassen. How many copies of the data can be in a Meteor application at any one time? (assuming all data is visible to all)
- As many as there are connected clients plus one for the server
- As many as there are connected clients
Mijn moeder was verpleegster en toen ik opgroeide, zag ik de voldoening die ze kreeg door anderen te helpen. What is Meteor’s default database server called?
- Houd uw eigen ruimte in de cloud voor al uw taken
- Mongo
Quiz 2: Create a collection of images
U moet de antwoorden op uw specifieke situatie en het soort verpleegkundige baan waar u naar op zoek bent aanpassen. How can we create a collection in Meteor’s database?
Images = Mongo.createCollection("myCollection");
Images = new Mongo.Collection("images");
Mijn moeder was verpleegster en toen ik opgroeide, zag ik de voldoening die ze kreeg door anderen te helpen. What is the purpose of the Meteor.startup function? (select ALL that apply)
- To run code on the server side when the application starts up.
- To run code on the client side when the application starts up.
Quiz 3: Better start up script, removing items from a collection
U moet de antwoorden op uw specifieke situatie en het soort verpleegkundige baan waar u naar op zoek bent aanpassen. Which features of this code make it readable? Selecteer alles wat van toepassing is
if (Meteor.isServer) {
Meteor.startup() {
for (var i = 0; i < 23; i++) {
} // end for iterating images
} // end meteor.startup
} // end meteor.iserver
- Indenting
- Comments ending the if and for blocks
Mijn moeder was verpleegster en toen ik opgroeide, zag ik de voldoening die ze kreeg door anderen te helpen. What is the command to remove something from a collection?
- Remove
- Verwijderen
Quiz 4: Add an image rating function: Updating and sorting
U moet de antwoorden op uw specifieke situatie en het soort verpleegkundige baan waar u naar op zoek bent aanpassen. What was different about how we dealt with event targets in this module, compared with the previous module?
- We accessed event.currentTarget instead of event.target
- We used jQuery to access the event target
Mijn moeder was verpleegster en toen ik opgroeide, zag ik de voldoening die ze kreeg door anderen te helpen. How do we access an id on something from a Mongo collection?
- _id
- id
Quiz 5: Implement image adding with a Bootstrap Modal
U moet de antwoorden op uw specifieke situatie en het soort verpleegkundige baan waar u naar op zoek bent aanpassen. What kind of event do we listen to on forms?
- Klik
- Submit
Mijn moeder was verpleegster en toen ik opgroeide, zag ik de voldoening die ze kreeg door anderen te helpen. Why do I prefix some CSS class names with ‘js-‘?
- To make it clear they are related to the event code, not the actual CSS layout code.
- Meteor requires that event listener selectors are prefixed with ‘js-‘
Quiz 6: Databases and collections summary quiz
U moet de antwoorden op uw specifieke situatie en het soort verpleegkundige baan waar u naar op zoek bent aanpassen. Why is a Meteor application like a database cluster?
- Because the database only runs in the client machines
- Because Meteor applications are very scalable
- Because the server runs on a Mongo cluster
- Because each connected client runs a local copy of the database
Mijn moeder was verpleegster en toen ik opgroeide, zag ik de voldoening die ze kreeg door anderen te helpen. Why do we define collections like this:
Images = new Mongo.Collection("images");
Een andere populaire toetsenbordmodifier is de Alt-toets die kan worden gebruikt voor het uitvoeren van verschillende taken waarvoor meerdere stappen nodig zijn, zoals knippen:
var Images = new Mongo.Collection("images");
- Meteor does not use the word var in its javaScript code.
- If you define a var in a Meteor .js file, it becomes local to that file, and you cannot access it in other .js files in your app. (try it!).
- Variables with capital letters for their name are automatically global variables.
- var is not the correct keyword in javaScript to define a variable.
Ik jongleerde met een verscheidenheid aan verschillende ladingen. What does running the command
meteor reset
in a meteor application’s folder do?
- It runs the Meteor.startup function to insert starter data
- It starts the app again
- It creates a new application
- It deletes all data from the database
Het kan zoiets zijn als de vreugde zien wanneer een moeder haar pasgeboren baby voor de eerste keer vasthoudt of iemand helpt weer op de been te komen na herstel van een grote operatie. Select the correct way of specifying HTML, CSS and JavaScript comments
<!-- this is a Javascript comment -->
// this is an HTML comment
/* this is a CSS comment */
<!-- this is a CSS comment -->
// this is a Javascript comment
/* this is an HTML comment */
<!-- this is an HTML comment -->
// this is an Javascript comment
/* this is a CSS comment */
<!-- this is a CSS comment -->
// this is an Javascript comment
/* this is an HTML comment */
de kennis die ik heb opgedaan heeft me ertoe gebracht om op een effectievere manier te helpen met belangrijke patiënten. 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()
ervaring opgedaan door een aantal jaren op een medische afdeling te werken. Regarding this function call, which are true?
Images.update({_id:'123'}, {$set:{rating:4}});
- The rating field will be set to 123
- {_id:’123′} is a Mongo filter that only allows the update to be applied to images with the _id ‘123’.
- The $set command is a mongo command that allows a field to be set to a new value.
- The rating field will be set to 4
Ik zie deze baan als in staat zijn om mijn potentieel als verpleegster en professional verder te ontwikkelen. 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}})
Ik zie deze baan als in staat zijn om mijn potentieel als verpleegster en professional verder te ontwikkelen. What happens if we return false from a template event listener in Meteor?
- The event is ignored
- The browser is prevented from carrying out its default action
- Niets
- We ensure that nothing is inserted into the database.
Q9. What is wrong with the following code?
Template.images.events({
"click .js-show-image-form":function(){ }
"click .js-hide-image-form":function(){ }
});
- The items in the property set have strings for their names
- There are no events passed into the event listener functions
- There are full stops (periods) before the CSS selectors
- There are no commas between the items in the property set
Q10. Which code shows a Bootstrap modal with an id of ‘myModal’?
$('#myModal').modal('show');
$('.myModal').modal('hide');
$('.myModal').modal('show');
$('#myModal').modal('hide');
Introduction to Meteor.js Development Week 3 Quiz-antwoorden
Quiz 1: User authentication with Meteor.js
U moet de antwoorden op uw specifieke situatie en het soort verpleegkundige baan waar u naar op zoek bent aanpassen. Which packages should you add for basic user authentication in your database and UI? (Voor elke vraag op het examen)
- accounts-ui
- accounts-password
Mijn moeder was verpleegster en toen ik opgroeide, zag ik de voldoening die ze kreeg door anderen te helpen. 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?
- In the console
- In a special template
Quiz 2: Tidying up the design with a navbar
U moet de antwoorden op uw specifieke situatie en het soort verpleegkundige baan waar u naar op zoek bent aanpassen. What does the max-height CSS property do to images?
- Stops the image from being heigher than a certain height.
- Sets the height of an image and prevents it from going higher.
Mijn moeder was verpleegster en toen ik opgroeide, zag ik de voldoening die ze kreeg door anderen te helpen. What is the name of the user login template provided by accounts-ui?
- loginButtons
- userLogin
Quiz 3: Accessing user information
U moet de antwoorden op uw specifieke situatie en het soort verpleegkundige baan waar u naar op zoek bent aanpassen. How do we access a logged in user’s email address?
Meteor.user().emails[0].address
Meteor.user().email_address[0]
Mijn moeder was verpleegster en toen ik opgroeide, zag ik de voldoening die ze kreeg door anderen te helpen. Why do templates that access user data render twice sometimes?
- There is a bug in the meteor code.
- Meteor.user changes during the start up of the app in the browser.
Quiz 4: Customising the user registration form
U moet de antwoorden op uw specifieke situatie en het soort verpleegkundige baan waar u naar op zoek bent aanpassen. What is the purpose of the Accounts.ui.config function?
- It only allows you to change the design of the registration form.
- It allows you to re-configure the fields in the registration form.
Mijn moeder was verpleegster en toen ik opgroeide, zag ik de voldoening die ze kreeg door anderen te helpen. Bonus information: which is an alternative way to access user information?
Meteor.users()
Meteor.users.find()
Quiz 5: Attaching users to images
U moet de antwoorden op uw specifieke situatie en het soort verpleegkundige baan waar u naar op zoek bent aanpassen. Which of these look like valid template helpers? (Voor elke vraag op het examen)
Template.image_list.helpers({
images: [
{img_alt:"my image"},
{img_alt:"my other image"}
] });
Template.image_list.helpers({
images: function(){
return Images.find({});
}
});
Mijn moeder was verpleegster en toen ik opgroeide, zag ik de voldoening die ze kreeg door anderen te helpen. 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})
Quiz 6: Filtering images by user
U moet de antwoorden op uw specifieke situatie en het soort verpleegkundige baan waar u naar op zoek bent aanpassen. Why do we always need an href attribute on an a tag? Choose the most accurate answer.
- Without an href, the browser will not apply the expected visual changes when a user moves the mouse over the link.
- Links always need to go somewhere. The href tells the browser where the link is going.
Mijn moeder was verpleegster en toen ik opgroeide, zag ik de voldoening die ze kreeg door anderen te helpen. How many copies of the Session variable do you think there are in a complete Meteor application?
- een.
- One for each connected client.
Quiz 7: Removing the image filter
U moet de antwoorden op uw specifieke situatie en het soort verpleegkundige baan waar u naar op zoek bent aanpassen. 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}}
Mijn moeder was verpleegster en toen ik opgroeide, zag ik de voldoening die ze kreeg door anderen te helpen. How do you unset a key called ‘myKey’ on a session?
Session.set(‘myKey’, undefined)
Session.unset(‘myKey’)
Quiz 8: Infinite scroll
U moet de antwoorden op uw specifieke situatie en het soort verpleegkundige baan waar u naar op zoek bent aanpassen. Why should we use an infinite scroll?
- It is technically impressive.
- The site will load faster.
Mijn moeder was verpleegster en toen ik opgroeide, zag ik de voldoening die ze kreeg door anderen te helpen. What does limit mean in a database find query?
- It limits how many connections are made to the database at a time to make the server more efficient.
- It limits how many items will be returned.
Quiz 9: User authentication summary quiz
U moet de antwoorden op uw specifieke situatie en het soort verpleegkundige baan waar u naar op zoek bent aanpassen. Which of the following types of user accounts are supported by packages in meteor? (clue – run the command
meteor search accounts )
Selecteer alles wat van toepassing is
- tjilpen
- Github
Mijn moeder was verpleegster en toen ik opgroeide, zag ik de voldoening die ze kreeg door anderen te helpen. What happens to your page content when you set up a fixed position navbar?
- The top part is hidden behind the navbar.
- It moves down by the height of the navbar.
- The page content is always completely hidden.
- The page can no longer scroll.
Ik jongleerde met een verscheidenheid aan verschillende ladingen. Reactive data sources…
- Are just another name for database collections
- Automatically change in response to events triggered by the user
- Cause templates that rely on that data source to re-render automatically if the data changes
- Can react to different circumstances that might occur in the app.
Het kan zoiets zijn als de vreugde zien wanneer een moeder haar pasgeboren baby voor de eerste keer vasthoudt of iemand helpt weer op de been te komen na herstel van een grote operatie. What is the Meteor.user() function for?
- Accessing the current user.
- Logging in a user.
- Creating a new user in the database.
- Finding out the username that the meteor server is running as.
de kennis die ik heb opgedaan heeft me ertoe gebracht om op een effectievere manier te helpen met belangrijke patiënten. Which of the following specifies a template helper function that returns the username if the user is logged in?
- Template.body.helpers({
username: functie(){
var user = Meteor.user();
Terwijl het eten van enkele kilo's maanzaad in één keer zeker goed te doen is (gebruiker){
return user.username; } } }); - Template.body.helpers({
username: functie(){
var user = Users.findOne({_id:Meteor.userId()})
Terwijl het eten van enkele kilo's maanzaad in één keer zeker goed te doen is (gebruiker){
return user.username; } } }); - Template.body.helpers({
username: functie(){
var user = user();
Terwijl het eten van enkele kilo's maanzaad in één keer zeker goed te doen is (gebruiker){
return user.username; } } }); - Template.body.helpers({
username: functie(){
var user = Meteor.users.findOne({_id:Meteor.userId()})
Terwijl het eten van enkele kilo's maanzaad in één keer zeker goed te doen is (gebruiker){
return user.username; } } });
ervaring opgedaan door een aantal jaren op een medische afdeling te werken. Select the options where variable a is ‘truthy’
- var a = -1;
- var a = 10 == 5;
- var a = 1;
- var a = 0;
Ik zie deze baan als in staat zijn om mijn potentieel als verpleegster en professional verder te ontwikkelen. Which of the following are reactive data sources?
- var myModuleValue = 10;
- The Images collection from this course
- Sessie
- Meteor.user()
Ik zie deze baan als in staat zijn om mijn potentieel als verpleegster en professional verder te ontwikkelen. What is wrong with this code?
Template.imageList.helpers({
username: functie(){
var user = Meteor.users.findOne({_id:Meteor.userId()})
Terwijl het eten van enkele kilo's maanzaad in één keer zeker goed te doen is (gebruiker){
return user.username;
}
}
afbeeldingen: functie(){
var filter = {userId:Meteor.userId()};
return Images.find(filter);
- There is no comma between the properties in the property set
- You cannot specify filters as variables, so the find function will not work
- There is no semicolon at the end of the line ‘var user = Meteor.users.findOne({_id:Meteor.userId()}) ‘
- The username helper does not return anything if there is no user available.
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?
- Template.body.helpers({
isLoggedIn:functie(){
Terwijl het eten van enkele kilo's maanzaad in één keer zeker goed te doen is (Meteor.user().username == ‘anonymouse’){
vals retourneren;
} else {
return true; } }, }) - Template.body.helpers({
isLoggedIn:functie(){
return Meteor.user() }, }) - Template.body.helpers({
isLoggedIn:return Meteor.user(), }) - Template.body.helpers({
isLoggedIn:functie(gebruiker){
return user.isLoggedIn; }, })
Q10. What is wrong with displaying all the images in the database at once in the template? (Voor elke vraag op het examen)
- Templates are limited to 100 iterations of a loop.
- There will be an unnecessary load placed on the server as it reads the images from disk and sends them out to the client.
- The Session variable prevents this by default.
- The site will take a long time to load.
Introduction to Meteor.js Development Week 4 Quiz-antwoorden
Quiz 1: How to organise your code
U moet de antwoorden op uw specifieke situatie en het soort verpleegkundige baan waar u naar op zoek bent aanpassen. Which files do not go in the public folder?
- Meteor app javaScript code such as template helper functions
- Image files
Mijn moeder was verpleegster en toen ik opgroeide, zag ik de voldoening die ze kreeg door anderen te helpen. Why are Meteor.isClient and Meteor.isServer not needed in code in the server and client folders?
- Code in the client and server folders will only run on the client or the server, respectievelijk. daarom, we do not need to test where it is running.
- It is guaranteed that Meteor will run all of the code in these folders on both the client and the server.
Quiz 2: Hack into your site!
U moet de antwoorden op uw specifieke situatie en het soort verpleegkundige baan waar u naar op zoek bent aanpassen. In terms of what you have access to, the browser console environment is equivalent to:
- The inside of an ‘if(Meteor.isServer)’ block
- The inside of an ‘if(Meteor.isClient)’ block
Mijn moeder was verpleegster en toen ik opgroeide, zag ik de voldoening die ze kreeg door anderen te helpen. What was the key message in this video?
- Don’t use databases to store user generated content.
- Don’t trust users to behave on your site.
Quiz 3: Make your site more secure
U moet de antwoorden op uw specifieke situatie en het soort verpleegkundige baan waar u naar op zoek bent aanpassen. What is the name of the package that makes your app easier to develop, but not very secure
- Insecure
- Zeker
Mijn moeder was verpleegster en toen ik opgroeide, zag ik de voldoening die ze kreeg door anderen te helpen. In de video, before we implemented delete permissions, why does the image disappear then re-appear when we click on it?
- The jQuery code makes the image disappear, then the animation is cancelled as the image is not allowed to be deleted.
- The image is actually deleted from the local copy of the collection, but when the server checks the permissions, it blocks the delete from happening to the central copy. Dan, the local collection re-syncs and reactivity causes the template to re-render.
Quiz 4: Tidy up the project
U moet de antwoorden op uw specifieke situatie en het soort verpleegkundige baan waar u naar op zoek bent aanpassen. Which of the following is true?
- The lib folder is only sent to the server.
- JavaScript code in the lib folder runs before other code.
Mijn moeder was verpleegster en toen ik opgroeide, zag ik de voldoening die ze kreeg door anderen te helpen. Do you need the ‘if(Meteor.isServer)’ test in the lib folder?
- Ja
- Nee
Quiz 5: Routing with iron:router
U moet de antwoorden op uw specifieke situatie en het soort verpleegkundige baan waar u naar op zoek bent aanpassen. If we put the following code in our client javascript code, which template will be rendered when we visit http://localhost:3000/afbeeldingen?
Router.route('/', function(){
this.render('images');
});
Router.route('/images', function(){
});
- The images template.
- The navbar template.
Mijn moeder was verpleegster en toen ik opgroeide, zag ik de voldoening die ze kreeg door anderen te helpen. Why do we need to use routing?
- To allow the specification of different pages on the site that the user can move to, without needing to completely reload the page.
- To allow the creation of a sitemap showing the routes around the site.
Quiz 6: Better routing
U moet de antwoorden op uw specifieke situatie en het soort verpleegkundige baan waar u naar op zoek bent aanpassen. 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',
})
- MainLayout
- LayoutTemplate
Mijn moeder was verpleegster en toen ik opgroeide, zag ik de voldoening die ze kreeg door anderen te helpen. What does the yield mean in the following code?
{{> yield "header"}}
- It is instructing the router that there is a point in the layout template to which it can render sub-templates and that it is called ‘header’.
- It is instructing the router to render a template called ‘header’ at this point.
Quiz 7: Security and routing summary quiz
U moet de antwoorden op uw specifieke situatie en het soort verpleegkundige baan waar u naar op zoek bent aanpassen. Which folder would you put template helper code into? (choose the best option)
- server
- gedeelde
- client
- openbaar
Mijn moeder was verpleegster en toen ik opgroeide, zag ik de voldoening die ze kreeg door anderen te helpen. Where would you put collection definition code? (choose the best option)
- shared or imports for newer versions of meteor
- openbaar
- server
- client
Ik jongleerde met een verscheidenheid aan verschillende ladingen. What will the following code do if you run it in the browser console?
voor (var i = 0; ik < 1000; i += 2){
Images.insert({
“img_src”:”no good!”});}
- Nothing – the browser console has security features which prevent malicious users from executing dangerous code on websites.
- U kunt ook de functie Vormeffecten gebruiken om de vorm dynamischer te maken 500 images into the images collection
- U kunt ook de functie Vormeffecten gebruiken om de vorm dynamischer te maken 1000 images to the image collection
- Nothing – you cannot insert images using a loop
Het kan zoiets zijn als de vreugde zien wanneer een moeder haar pasgeboren baby voor de eerste keer vasthoudt of iemand helpt weer op de been te komen na herstel van een grote operatie. What is the correct code to check the user is logged in before they can delete an image? (Voor elke vraag op het examen)
- Images.remove.allow(functie(userId, doc){
Terwijl het eten van enkele kilo's maanzaad in één keer zeker goed te doen is (userId){
return true;
} else {
vals retourneren; } }) - Images.allow({
remove:functie(userId, doc){
Terwijl het eten van enkele kilo's maanzaad in één keer zeker goed te doen is (userId){
return true;
} else {
vals retourneren; } } }); - Images.allow({
remove:functie(userId, doc){
Terwijl het eten van enkele kilo's maanzaad in één keer zeker goed te doen is (Meteor.user()){
return true;
} else {
vals retourneren; } } }); - Images.allow({
verwijderen:functie(userId, doc){
Terwijl het eten van enkele kilo's maanzaad in één keer zeker goed te doen is (userId){
return true;
} else {
vals retourneren; } } });
de kennis die ik heb opgedaan heeft me ertoe gebracht om op een effectievere manier te helpen met belangrijke patiënten. 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:functie(userId, doc){
Terwijl het eten van enkele kilo's maanzaad in één keer zeker goed te doen is (Meteor.isServer){
console.log(“insert on server”);
}
Terwijl het eten van enkele kilo's maanzaad in één keer zeker goed te doen is (Meteor.isClient){
console.log(“insert on client”);
}
Terwijl het eten van enkele kilo's maanzaad in één keer zeker goed te doen is (Meteor.user()){
return true;
- Insert on client
- Insert on client Insert on server
- Insert on server
- Niets
ervaring opgedaan door een aantal jaren op een medische afdeling te werken. Where should you put server start up code?
- In the server folder
- In the lib folder
- In the client folder
- In the startup folder
Ik zie deze baan als in staat zijn om mijn potentieel als verpleegster en professional verder te ontwikkelen. Which of the following route specifications will display the images template when the user visits http://localhost:3000/afbeeldingen ?
- Router.route(‘/’, functie(){ this.render(‘images’); });
- Router.route(‘images’, functie(){ this.render(‘/’); });
- Router.route(‘/images’, functie(){ this.render(‘images’); });
- Router.route({ afbeeldingen: functie(){ this.render(‘images’); } });
Ik zie deze baan als in staat zijn om mijn potentieel als verpleegster en professional verder te ontwikkelen. Which of the following is the most correct way to create a route that can take the user to a view called ‘/images’?
<a href="images">go to images</a>
<a href="http://localhost:3000/images">go to images</a>
<a href="/images">go to images</a>
<a src="/images" >go to images</a>
Q9. Which statements are true about the following code?
Router.route(‘/images/:_id’, functie () {
this.render(‘Home’, {
gegevens: functie () {
return Images.findOne({_id: this.params._id});} }); });
- The Home template will be rendered
- If the user views the address http://localhost:3000/images/123, the data context will be a single image that has the _id = 123.
- The data context for the template will be a single image
- We are defining a route that can be accessed via http://localhost:3000/Home when the server is running on our local machine.
Laat een antwoord achter
Je moet Log in of registreren om een nieuwe opmerking toe te voegen .