Web App Development 2 - Quizzes
1. Which of the following HTML TAGS is used at the start of a list item element?
<div>
</li>
<li>
<ul>
2. What command would you issue to download an existing GitHub repository (that you have not downloaded before)?
push
pull
rebase
clone
3. Which of the following design philosophies does Django adhere to?
Implicit is better than explicit
All of the above
Tight coupling
Don’t repeat yourself
4. Suppose that Question is a model that is used to represent a multiple-choice question. Which of the following commands will print a list of the Question objects that are stored in the database?
print Question.objects.filter()
print Question.objects.get()
print Question.objects.list()
print Question.objects.all()
5. Suppose that the following URLconf is added to urls.py in the mysite project:url(r'^polls/',include('polls.urls')),What happens when the user navigates to https://wad2.pythonanywhere.com/polls/extra?
Django automatically issues a 404 error
Django passes control over to a view called “pollsâ€
Django tries to match “polls/extra†in polls/urls.py
Django tries to match "extra" in polls/urls.py
6. What effect does the following URLconf have?url(r'^(?P<question_id>[0-9]+)/results/$', views.results, name='showresults')
A URL ending “?P35/results/†will map to the showresults view, with “35†being stored in the variable “question_idâ€
A URL ending “35/results/†will map to the results view, with “35†being stored in the variable “question_idâ€
A URL ending “35/results/†will map to the showresults view, with “35†being stored in the variable “resultsâ€
A URL ending “3+/results/†will map to the results view, with “3+†being stored in the variable “resultsâ€
7. Suppose that a view wishes to pass on a variable to a template, which should display the value of the variable. How should the view do this?
Call the HttpResponseRedirect function, passing the template name and the variable name
Call the render function, passing the request object, the template name and a context dictionary containing the variable and its value
Call the HttpResponse function, passing the template name and the variable name
Call the request function, passing the render object, the template name and the variable name
8. Which of the following is not an assertion from the class Django.Test.Testcase?
assertContains
assertQuerysetEqual
assertBool
assertEqual
9. Which of the following are good strategies for creating tests in Django?
Create a separate testing class for each model and view
Write a test for a view before creating a view
All of the above
Don’t worry about tests that become redundant
10. Which option from the following list best describes a 1-tier architecture?
Difficult to design but easy to maintain
Difficult to design but scalable
Easy to design but not scalable
Easy to design and good for web applications
11. Building web applications involves an array of challenges and complexities; these include:
The hypertext structure, the demand by users for instant availability, the variety of devices and the different web frameworks
The composition of the development team, the immature and legacy technologies and the low expectations of users
The variety of devices, the simplicity of the HTTP protocol and the composition of the development team.
The lack of an accepted development methodology, the hypertext structure and the homogeneous user populations
12. Which of the following are HTTP methods for sending data?
CONNECT and POST
CONNECT and PUT
PUSH and GET
GET and POST
13. Which of the following are good choices of URL? Choose all that apply.
http://search.autotrader.co.uk/es-uk/www/cars/FORD+KA/Ne-2-4-5-6-7-8-27-44-49-53-61-64-67-103-133-146,N-19-29-4294966844-4294967194/advert.action?
http://bling.com/blog/2011/05/20/full/text/gold?chains
http://mobile.yahoo.com/onesearch;_ylt=AjpRL9DUfGFuHlra8WMMmjdWtQcJ
http://www.technorati.com/technology/gadgets/
http://www.expertsexchange.com
14. What are the main components of Entity-Relationship diagrams?
Entities, Relationships and Types
Tables, primary keys and fields
Models, fields and connectors
Entities, Relationships and Attributes
15. Consider the following ER Diagram:
What line of code should be in the Course model?
students = models.PrimaryKey(Student)
students = models.ManyToManyField(Student)
students = models.OneToOneField(Student)
students = models.ForeignKey(Student)
16. Consider the following HTML and CSS code:
How will "Test message" be displayed?
Black border, red text and white background
No border, red text and white background
No border, black text and blue background
Black border, black text and white background
17. Consider the following HTML and CSS code:
How will "WAD2" be displayed?
Coloured red with no border
Coloured yellow with a black border
Coloured blue with a green border
Coloured red with a green border
18. Consider the following HTML and JavaScript code:
What will the document.write method print out?
null
para
WAD2
yellow
19. In the example event handling web page involving 5 nested div blocks, how many event listeners are triggered when the user clicks on the div block labelled 5?HTML:
JS:
1
10
5
2
20. Consider the following HTML and JavaScript code:
What should be inserted at point *****?
document.getElementById(‘para’).innerHTML = Date()
document.getElementByTagName(‘para’).value = Date()
document.getElementById(‘#para’).innerHTML = Date()
document.getElementById(‘.para’).value = Date()
21. Consider the following JavaScript code:
What will be returned if getReturnVal() is called?
true
false
undefined
null
22. What is the correct jQuery code to set the background colour of all p elements to red?
$("p").style("background-color", "red");
$("p").manipulate("background-color","red");
$("p").layout("background-color", "red");
$("p").css("background-color", "red");
23. Which of the following XML fragments is well-formed?
<car registration=â€ABC123â€><address/><owner>John Smith</owner><postcode=â€G1 1XYâ€/></car>
<car registration=â€ABC123â€></address><postcode=â€G1 1XYâ€/></car>
<car registration=â€ABC123â€><owner>John Smith</owner><postcode=â€G1 1XYâ€></car>
<car registration=â€ABC123â€><owner>John Smith</owner></car>
24. Consider the XHTML code below. Is it well-formed?
All of the above
<comedy answer>
Yes
No
25. Asynchronous JavaScript and eXtensible Markup Language (also known as AJAX) is a useful combination of technologies, which enables a web app to (select the statement that best applies):
make requests by reloading the page, to receive and work with data from the server, using XML, JSON and plain text data
make requests without reloading the page, to receive and work with data from the server, using only XML data
make requests without reloading the page, to receive and work with data from the server, using XML, JSON and plain text data
make requests by reloading the page, to receive and work with data from the server, using only XML data
26.
Consider the above HTML and JavaScript code contained in Parser.html. What text will be displayed when Parser.html is opened in a browser?
"Everyday Italian"
None
"title"
All contents of the variable text
27. Which of the following statements best describes the differences between a DOM parser and a SAX parser?
DOM uses more memory, SAX tends to be faster, DOM is easier to code
DOM uses less memory, SAX tends to be faster, DOM is harder to code
DOM uses less memory, SAX tends to be slower, DOM is harder to code
DOM uses more memory, SAX tends to be slower, DOM is easier to code
28. When using HTTP, two communication methods are commonly used. Select the statement that best describes what each method does.
GET sends data packaged as part of the message, POST appends data to the URL as key-value pairs
POST appends data to the URL as key-value pairs, PUSH sends the data as part of the message
GET appends data to the URL as key-value pairs, POST sends data packaged as part of the message
PUSH sends the data as part of the message, GET appends data to the URL as key-value pairs
29. Web Application Frameworks have both benefits and drawbacks. Which of the following statements best describes the benefits and drawbacks:
steep learning curve, enables rapid development, typically poorly documented, and introduces code bloat
enables rapid development, decreases code bloat, reduces boiler plate code and decreases performance
enables rapid development, reduces boilerplate code, introduces code bloat, and increased performance
increases reliability, increased security, increased performance, and typically poorly documented
30. Most web application frameworks make use of the Model View Controller design pattern (or some variant of this). What are the advantages and disadvantages of the MVC pattern? Select the statement that best applies:
easier to maintain, decreases the development overheads, provides reusable views and models, requires knowledge of design patterns
provides reusable models, but not reusable views, requires knowledge of design patterns, debugging can be problematic
decreases the development overheads, requires knowledge of design patterns, provides reusable views, harder to maintain
easier to maintain, helps enforce logical separation of concerns, provides reusable models, debugging can be problematic
Submit Quiz