wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Summary of Questions & Answers (Midterm WPR)

Total questions: 100

Worksheet time: 53mins

Name
Class
Date
1.

What is the correct HTML for creating a hyperlink?

2.

Which middleware in Express.js helps in handling JSON data from POST requests?

a)

express.urlencoded()

b)

express.parse()

c)

express.data()

d)

express.json()

3.

In the context of the GET method, what type of data format can the response typically be returned as?

a)

HTML/XML

b)

CSV/JSON

c)

TXT/CSV

d)

XML/JSON

4.

What does the

a)

Content to display if scripting is disabled

b)

Script to be run if scripting is enabled

c)

No script content allowed in the document

d)

No script content is allowed in the section

5.

How to send a urlencoded POST request with fetch?

a)

fetch(URL, {method: 'POST', 'Content-Type': 'application': 'x-www-form-urlencoded'})

b)

fetch(URL, {method: 'POST', 'Content-Type': 'application/x-www-form-urlencoded'})

c)

fetch(URL, {method: 'POST', headers: {'Content-Type': 'application/x-www-form-urlencoded'}})

d)

fetch(URL, {method: 'POST', headers: {'Content-Type': 'application/x-www-form-urlencoded'}})

6.

Which property specifies the space inside the border of an element?

a)

content-spacing

b)

margin

c)

spacing

d)

padding

7.

Use the correct Math method to get the square root of 9. Fill in the blank: ________

a)

sqrt(9)

b)

pow(9,2)

c)

abs(9)

d)

round(9)

8.

Write the CSS to add a background color of #ececec for all

elements.

a)

h1{background-color:#ececec;}

b)

h1{color:#ececec;}

c)

h1{background:#ececec;}

d)

h1{background-color:h1;}

9.

How do you specify the spacing between columns in a multi-column layout?

a)

gap

b)

column-space

c)

column-spacing

d)

column-gap

10.

How do you make an element's text not wrap and stay on one line?

a)

white-space: no-wrap;

b)

text-wrap: nowrap;

c)

text-overflow: nowrap;

d)

white-space: nowrap;

11.

What value is logged to the console?

a)

36

b)

12

c)

18

d)

24

12.

What is the configuration file that contains a Node.js project's dependencies?

a)

package.json

b)

config.json

c)

manifest.json

d)

pom.xml

13.

The next() function in Express middleware is used to:

a)

Pass control to the next middleware function

b)

Send a response to the client

c)

Terminate the server process

d)

Log request details

14.

What is the output if the button is not clicked within 5 seconds?

a)

Option A

b)

Option B

15.

How do you create a transition effect in CSS?

a)

transform

b)

transition-effect

c)

transition

d)

animation

16.

Which property is used to control the order of flex items?

a)

item-order

b)

order

c)

flex-order

d)

flex-item-order

17.

Which tag is used to define a section that contains content aside from the main content in HTML5?

a)

b)

c)

d)

18.

Which tag pair configures a structural area on a web page?

a)

b)

c)

d)

19.

What key feature of Node.js is crucial for building REST APIs?

a)

Access to the DOM

b)

Managing HTTP requests and server-side functionality

c)

Handling client-side events

d)

File management

20.

In browser JavaScript, what object is assumed to exist and it is not necessary to include it as an object when referring to its methods and properties?

a)

window

b)

document

c)

console

d)

navigator

21.

How do you send a status of 404 and a message "Not Found" in Express?

a)

res.status(404).send('Not Found')

b)

res.send(404, 'Not Found')

c)

res.sendStatus(404, 'Not Found')

d)

res.statusCode(404).send('Not Found')

22.

In an e-commerce application, the POST request is typically used for:

a)

Placing an order

b)

Deleting an account

c)

Updating user information

d)

Fetching product details

23.

Complete the following statement to print out the average age. console.log(obj["average-age"] );

a)

average-age

b)

avg-age

c)

mean-age

d)

averageAge

24.

How can you connect a module to another in Node.js?

a)

Tunnel

b)

Pipeline

c)

Expose

d)

Exports

25.

Which tag pair is used to link web pages to each other?

a)

b)

c)

d)

26.

Which of the following will assign the value 5 to the variable productCost?

a)

productCost = 5;

b)

productCost == 5;

c)

productCost := 5;

d)

productCost => 5;

27.

How do you run a Node.js file from the command line?

a)

node

b)

npm run

c)

run

d)

node start

28.

Which property is used to change the font of an element?

a)

font-weight

b)

font-style

c)

font-face

d)

font-family

29.

What value is logged to the console?

a)

6

b)

3

c)

12

d)

0

30.

In JavaScript, how do you display an alert box with the text "Hello World"?

a)

alert ("Hello World");

b)

msg ("Hello World");

c)

alertBox ("Hello World");

d)

msgBox ("Hello World");

31.

Which of the following configures a background color of #00CED1 for a web page using CSS?

a)

body {background-color: #00CED1;}

b)

document {bgcolor: #00CED1;}

c)

document {background: #00CED1;}

d)

body {bgcolor: #00CED1;}

32.

Finish the following code to send a POST request using fetch (do not add any unnecessary spaces) let params = new FormData(id("input-form")); fetch (url, { })

a)

method: "POST", body: params

b)

method: "GET", body: params

c)

method: "POST", params: body

d)

body: params, method: "GET"

33.

Which of the following modules is used to create a HTTP server?

a)

fs

b)

express

c)

multer

d)

nodemon

34.

How do you make an element take up only the minimum width it needs?

a)

width: auto;

b)

width: max-content;

c)

width: min-content;

d)

width: fit-content;

35.

Execute myFunction when user clicks on the

a)

addEventListener

b)

setTimeout

c)

querySelector

d)

getElementById

36.

What is the output of the code above?

a)

3 1 2

b)

1 2 3

c)

2 3 1

37.

How do you make an image responsive in CSS?

a)

max-height: 100%;

b)

width: 200px;

c)

border: 1px solid;

d)

font-size: 2em;

38.

Convert the text into an UPPERCASE text: let txt = "Hello World!"; txt = txt.__________ ; Fill in the blank to convert the text to uppercase.

a)

toUpperCase()

b)

toLowerCase()

c)

capitalize()

d)

makeUpperCase()

39.

How to send a urlencoded POST request with fetch?

a)

fetch (URL, {method: 'POST', 'Content-Type': '{application,}})

b)

fetch (URL, {'method': 'POST','Content-Type': 'application,})

c)

fetch (URL, {'method': 'POST', headers: [Content-Type: application]})

d)

fetch (URL, {'method': 'POST', headers: {'Content-Type': 'application'}})

40.

In the context of the GET method, what type of data format can the response typically be returned as?

a)

TXT/CSV

b)

HTML/XML

c)

XML/JSON

d)

CSV/JSON

41.

Which CSS selector will target only the last list item?

a)

ul:nth-child(last) {}

b)

ul:last-child {}

c)

ul li:last-child {}

d)

ul:last-child(li) {}

42.

What key feature of Node.js is crucial for building REST APIs?

a)

Access to the DOM

b)

Managing HTTP requests and server-side functionality

c)

Handling client-side events

d)

File management

43.

Inline elements are normally displayed without starting a new line.

a)

True

b)

False

44.

What is the correct HTML for inserting an image?

a)

My Image

b)

My Image

c)

My Imageimage.gif

d)

My Image

45.

In HTML, which attribute is used to specify that an input field must be filled out?

a)

placeholder

b)

validate

c)

formvalidate

d)

required

46.

Which HTML tag is used to define an internal style sheet?

a)