• No results found

1 Closed questions (5 points)

N/A
N/A
Protected

Academic year: 2021

Share "1 Closed questions (5 points)"

Copied!
8
0
0

Bezig met laden.... (Bekijk nu de volledige tekst)

Hele tekst

(1)

Name

and initials: Grade

Student-

number: Course: Web Technology

Year of 1st

enrollment: Date: 30 January 2015

The exam consists of 20 closed questions (5 points in total) and two open questions (2 points each).

You get one point for free. Please try to avoid corrections on these forms, use additional paper for draft answers.

1 Closed questions (5 points)

Each question consists of four statements, and each statement can be true or false (that is, for each question, the number of true statements can vary from 0 to 4). Indicate which statements are true:

1. Which of the following statements about the history and organization of the Web are true?

a. The Internet Protocol originates from the early nineties

b. The DNS (Domain Name Service) existed before the Web was invented

c. The notion of “hypertext”, text with links, existed before the Web was invented d. W3C members are required to implement the Web standards W3C publishes.

2. Which of the following statements about IP protocols are true?

a. IPv6 (Internet Protocol version 6) is the successor of IPv4.

b. The IPv4 address space can encode 232 addresses, while IPv6 can encode 2128 ad- dresses.

c. 201.64.109.1 is a valid IPv4 address.

d. The TCP protocol is built on top of the IP protocol.

3. Which of the following statements about the development of the Web are true?

a. The World Wide Web was originally invented by the US military.

b. Part of the succes of the initial Web can be explained by its simplicity: HTML was easy to learn by studying examples found on the Web.

c. The WHATWG (Web Hypertext Application Technology Working Group) sees the HTML specification as a “Living Standard” that needs continuous maintenance as the language evolves.

d. To implement the patented HTML5 specification, browser developers need to buy a license from WHATWG.

(2)

4. Which of the following statements about Web markup are true?

a. The tendency in HTML5 is to allow for more semantic markup than earlier versions of HTML.

b. The tendency in HTML5 is to be more strict about syntax details than earlier versions of HTML..

c. The nav element is an example of semantic markup introduced in HTML5.

d. A div element cannot have a class attribute when used as semantic markup.

5. Which of the following statements about HTML5 elements are true?

a. The new title element replaces the old h1 elements.

b. The figure element must contain an img element.

c. The article element is an alternative for the title element.

d. The content of the aside element is always placed in the margin of the document.

6. Which of the following statements about CSS are true?

a. CSS3 media queries are used to write styles rules that adapt the rendering of HTML to a wide variety of devices

b. The selector p.note indicates that the style rule should be applied to all p elements that have a class attribute with the value "note".

c. The term Responsive Web Design refers to Web forms that are designed to respond quickly (within 100ms) after submission.

d. page-break-after is a CSS property intended for screen media usage 7. Which of the following statements about JavaScript are true?

a. Using JavaScript host objects, you can close the browser window.

b. JavaScript has no “print” or “echo” statements as part of the language.

c. With JavaScript and the DOM API, you can replace the src attribute of an img element in response to a mouse click.

d. With JavaScript and the DOM API, you can remove a p element after the document has been loaded into the browser.

8. Which of the following statements about scripting are true?

a. The Document Object Model (DOM) models a document as a tree data structure.

b. The DOM API can be used in JavaScript, but not in other programming languages.

c. An event handler is a function that is called in response of a specific event.

d. A click on your mouse or pressing a key on the keyboard are good examples of such an event.

9. Which of the following statements about AJAX are true?

a. With AJAX technology, you can replace parts of the page without refreshing the entire page.

b. AJAX technology makes inaccessible sites accessible.

c. Websites no longer need to use JavaScript if they upgrade to AJAX.

d. Websites no longer need to use CSS if they stop using AJAX.

(3)

10. Which of the following statements about using AJAX are true?

a. An HTTP server responding to an AJAX request has to respond using an HTML representation

a. An HTTP server needs to allow every AJAX request, even if the JavaScript initiating the request originates from another server

a. If the HTTP server is designed to be used by an AJAX client, it should never respond to HTTP POST requests

a. A drawback of AJAX is that HTTP servers can no longer use the common HTTP response codes

11. Which of the following statements about HTTP are true?

a. The HTTP request method must be either GET or POST.

b. The HTTP POST method is the typical example of an idempotent request method c. HTTP requests are sent by the client, responses by the server.

d. HTTP is a ”stateless” network protocol.

12. Which of the following statements about RESTful architectures are true? To be able to successfully perform an operation on a Web resource, a Web client and server need to agree on:

a. the URL to access the resource,

b. the HTTP method(s) allowed on the resource,

c. the acceptable representation formats of the resource,

d. whether the server generates the resource dynamically or not.

13. Which of the following statements about cookies are true?

a. Cookies can be used to adapt sites to the personal preferences of the user.

b. Cookies are a frequent source of trojan horses.

c. Cookies can be used to remember action users performed previously.

d. Cookies can be used to pass on private and sensitive information.

14. Which of the following statements about search engines are true?

a. Precision and recall are based on human judges who decide which results are relevant and which are not

b. Zipf’s law predicts that in natural text, the most frequent word will occur roughly two times more often than the second most frequent word.

c. A user’s “information need” is defined as the “the first query term entered by the user in the system”.

d. tf.idf ranks a document higher if it contains search terms that are rare in the entire document collection.

15. Which of the following statements about accessibility are true?

a. A Web document that has been successfully validated by the W3C HTML en CSS validator also conforms to the W3C accessibility guidelines.

b. Appropriate use of the alt attribute improves the accessibility of video, audio and image content.

c. Dynamic Web content is never a Web site accessibility problem.

(4)

16. Which of the following statements about Web Accessibility are true?

a. Web sites should preferably have an explicit option to increase font size.

b. The availability of a text-only version of a Web page is sufficient for accessibility.

c. Semantic markup facilitates access of Web content using special accessibility devices, such as screen readers.

d. Closed captions help making video content accessible.

17. An evaluation study uses cookies to identify returning visitors that have visited the site. The hypothesis tested is: “Higher priced items are bought more often by frequent users than by first-time or infrequent users.” Which of the following statements about this study are true?

a. This is an example of an explorative study.

b. This is not a good hypothesis because it is not formulated as a proper question.

c. The number of previous visits is an independent variable in this study.

d. The price of the items bought is a dependent variable in this study.

18. Which of the following statements related to Web Science are correct?

a. The laws of the physical world typically also apply in the virtual world.

b. Legal issues on the Web are extra difficult due to lack of “location”.

c. Web scientists claim Web technology should be studied in the context of its social embedding.

d. The complex structure of the Web is caused by the complexity of Web protocols.

19. Net neutrality implies that:

a. the Internet should be free of regulations and political interference.

b. the Internet should be free of charge.

c. that governments and service providers treat all Internet traffic equally

d. Internet sources such as Wikipedia should take a neutral position in political debates.

20. Which of the following statements are correct according to proponents of Linked Open Data?

a. Organisation should publish the raw data underlying their graphs and figures used in the documents they publish,

b. this data should be linked to other data as documents are now linked to other documents,

c. this data should be openly licensed,

d. This data should be served using proprietary representation formats.

(5)

2 Open questions

Question 21 (2 points)

Study the HTML5 source on the next page (source 1). Identify ten (10) syntax errors, bad practices or other mistakes in this source and describe how the markup should be improved.

(For each error found and fixed: 0.2 point. For each incorrect answer: -0.2 point. Maximum 2.0 points in total)

Answer:

(6)

Source 1

1 < !DOCTYPE html>

2 <html>

3

4 <head>

5 < t i t l e>WT − Assignment <a href=” l a b 1 . html ”> 1 </a> </ t i t l e>

6 <s t y l e>

7 body { background−c o l o r : #FFFFFF ; }

8 h e a d e r { < !−− t h i s i s f o r t h e f i r s t l e v e l h e a d i n g −−>

9 f o n t −w e i g h t : b o l d ; 10 f o n t −s i z e : 40 pt ; } 11 </ s t y l e>

12 </head>

13

14 <body bgcolor=” #000000 ”

15 s t y l e=” width : 1024 px ; h e i g h t : 768 px ; ” >

16

17 < !−− t h i s i s t h e f i r s t l e v e l h e a d i n g −−>

18 <nav c l a s s=” h e a d e r ” s t y l e=” f o n t −s i z e : 30 pt ; f o n t −w e i g h t : b o l d ; ”>

19 Web Te ch nol ogy : Assignment 3 20 </nav>

21

22 <s e c t i o n>

23 <p s t y l e=” f o n t −s i z e : 0 . 8 em”>

24 The p u r p o s e o f <strong>a s s i g n m e n t 1</ strong> i s t o t e s t whether 25 e a c h <span s t y l e=” f o n t −w e i g h t : b o l d ; ”>group</span>

26 has g r a s p e d t h e key c o n c e p t s o f Web markup a t a s u f f i c i e n t l e v e l . 27 </p>

28

29 <p><a href=”myform”>S e e t h e form below</a> f o r an example :</p>

30

31 <form id=”myform” method=”HEAD” action=” h t t p : / / wt . ops . few . vu . n l / ”>

32 <input type=” t e x t ”>C a t e g o r y</ input>

33 <input type=” d a t e ”>E x p i r e d</ input>

34 </form>

35

36 <p s t y l e=” f o n t −s i z e : 0 . 8 em”>

37 You a r e e x p e c t e d t o u s e a l l l i s t e d HTML t a g s and CSS p r o p e r t i e s 38 a p p r o p r i a t e l y t o g e t a g r a d e &g t ; 5 . 0 .

39 <p s t y l e=” f o n t −s i z e : 0 . 8 em” c l a s s=” warning ”>

40 Use o f J a v a S c r i p t & AJAX i s n o t a l l o w e d i n t h i s a s s i g n m e n t ! 41 </p>

42

43 <f o o t e r>C o p y r i g h t : VU U n i v e r s i t y Amsterdam</ f o o t e r>

44 </body>

45 </ s e c t i o n>

46 </html>

(7)

Question 22 (max 2 points)

Study the fragment from the HTTP server log on the next page (Common Log Format, Source 2).

This server’s documentation states that all URLs starting with /rest/api/ are used for an API (Application Programming Interface) to a database. It also states that this API is 100% RESTful.

a) Which resource is being requested in line 1?

Does the request succeed? Explain why or why not. (max 0.5 point ) b) Which resource is being requested in line 2?

What is the most likely scenario that triggered this request? (max 0.5 point )

c) The documentation explains that a PUT on /rest/api/item5 can be used to create a new item.

However, this method is called twice, as shown in line 4 and 5. What will the effect of the second PUT method be, assuming the service is indeed 100% RESTful? Motivate your answer. (max 0.5 point )

d) The 405 response code in line 6 indicates a “Method not allowed” error. Explain whether this error is, in the general case, classified as a client-side or server-side error (max 0.25 point ). Does this general classification also apply to this specific case? Motivate your answer. (max 0.25 point )

(8)

Source 2

1 1 9 2 . 1 6 . 1 9 6 . 1 7 − − [ 3 0 / Jan / 2 0 1 5 : 1 5 : 1 5 : 0 0 +0100] ”GET / HTTP/ 1 . 1 ” 200 2326

2 1 9 2 . 1 6 . 1 9 6 . 1 7 − − [ 3 0 / Jan / 2 0 1 5 : 1 5 : 1 5 : 0 1 +0100] ”GET / j s / f o r m . j s HTTP/ 1 . 1 ” 200 1 43 91

3 1 9 2 . 1 6 . 1 9 6 . 1 7 − − [ 3 0 / Jan / 2 0 1 5 : 1 5 : 1 5 : 0 2 +0100] ”GET / r e s t / a p i / a l l i t e m s HTTP/ 1 . 1 ” 200 3431 4 1 9 2 . 1 6 . 1 9 6 . 1 7 − − [ 3 0 / Jan / 2 0 1 5 : 1 5 : 1 5 : 0 3 +0100] ”PUT / r e s t / a p i / i t e m 5 HTTP/ 1 . 1 ” 204

5 1 9 2 . 1 6 . 1 9 6 . 1 7 − − [ 3 0 / Jan / 2 0 1 5 : 1 5 : 1 5 : 0 4 +0100] ”PUT / r e s t / a p i / i t e m 5 HTTP/ 1 . 1 ” 204 6 1 9 2 . 1 6 . 1 9 6 . 1 7 − − [ 3 0 / Jan / 2 0 1 5 : 1 6 : 1 5 : 3 1 +0100] ”DELETE / r e s t / a p i / i t e m 5 HTTP/ 1 . 1 ” 405

8

Referenties

GERELATEERDE DOCUMENTEN

The handle http://hdl.handle.net/1887/19952 holds various files of this Leiden University dissertation.!. Het omslag is niet voorzien

User agent style definitions have a higher priority than author style definitions.. User style definitions always have a higher priority than author

If the HTTP server is designed to be used by an AJAX client, it should never respond to HTTP POST requests.. A drawback of AJAX is that HTTP servers can no longer use the common

The reason that this is a good idea is that most of the packages have been improved quite substantially over the past three months, in preparation for the book, and we should make

The package is primarily intended for use with the aeb mobile package, for format- ting document for the smartphone, but I’ve since developed other applications of a package that

This is the 18 November 2014 Working Group Note of the XMLHttpRequest Level 2 document. This document is produced by the Web Applications (WebApps)

An algebra task was chosen because previous efforts to model algebra tasks in the ACT-R architecture showed activity in five different modules when solving algebra problem;

It is the only journal that publishes exclusively articles on malaria and, as such, it aims to bring together knowledge from the different specialties involved in this very broad