Docsity

WGU D277 Front-End Web Development Practice Examination, Exams of Nursing

Toggle sidebar
bg1
WGU D277 Front-End Web
Development Practice
Examination
Course Information
Course Title
Front-End Web Development
Course Code
D277
Exam Title
Practice Examination (OA/PA Verification)
Date
_________________________
Instructor
_________________________
Student Name
_________________________
Student ID
_________________________
Time Limit
150 Minutes
Total Questions
100 Multiple Choice
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c

This document is temporarily unavailable for download

Partial preview of the text

Download WGU D277 Front-End Web Development Practice Examination and more Exams Nursing in PDF only on Docsity!

WGU D277 Front-End Web

Development Practice

Examination

Course Information

Course Title Front-End Web Development Course Code D Exam Title Practice Examination (OA/PA Verification) Date _________________________ Instructor _________________________ Student Name _________________________ Student ID _________________________ Time Limit 150 Minutes Total Questions 100 Multiple Choice

Examination Instructions

Read the following instructions carefully before beginning.

  1. Time Limit: You have 150 minutes to complete this examination. The proctor will notify you when 15 minutes remain.
  2. Answer Sheet: Record all answers on the provided Scantron/Answer Sheet or the designated electronic testing platform. Only answers marked in the designated answer area will be scored.
  3. Question Format: Each question is followed by four options (A, B, C, D). Select the single best answer for each question.
  4. Marking: Clearly mark your chosen answer. If you change an answer, erase the previous mark completely or follow the platform's change protocol. Do not write in the exam booklet margins or on the back of the answer sheet.
  5. Content Coverage: This exam assesses competency in HTML5 semantic markup, CSS styling and layout, responsive design, JavaScript fundamentals, DOM manipulation, form validation, browser developer tools, accessibility, and version control concepts relevant to front-end web development.
  6. Submission: Upon completion, raise your hand to signal the proctor. Submit all testing materials (exam booklet, answer sheet, scratch paper) before leaving the testing area.
  7. Academic Integrity: This is a closed-book examination. Unauthorized materials, electronic devices (other than the approved testing device), or communication with others is strictly prohibited and constitutes grounds for academic misconduct. SECTION 1: HTML5 SEMANTIC MARKUP & DOCUMENT STRUCTURE

reader users. D is incorrect because title is not a substitute for alt and is inconsistently supported. Q3: Which HTML element is used to define a thematic grouping of content, typically with a heading, and is a core semantic element required in the D277 performance assessment? A. B. C. D. Correct Answer: B Rationale: The element represents a thematic grouping of content, typically with a heading. The D277 rubric explicitly requires a element on each page to display the main content. A is a generic container with no semantic meaning. C is an inline generic container. D is for self-contained compositions (e.g., a blog post, forum post) that could stand alone, which is narrower than the required main content section. Q4: A developer wants to display supplementary information, such as a sidebar with related links, alongside the main content. Which semantic element is most appropriate? A. B. C. D. Correct Answer: C Rationale: The element represents content that is tangentially related to the content around it, such as sidebars, pull quotes, or related links. The D277 rubric requires an element on every page. A is for thematic grouping of main content. B is specifically for navigation. D is for footer content (copyright, contact info).

Q5: Which HTML element should be used to create an ordered list with at least three items, as required by the D277 rubric? A. B. C. D. Correct Answer: B Rationale: The element creates an ordered (numbered) list. The D277 rubric specifically requires an HTML-coded ordered list with at least three list items. A creates an unordered (bulleted) list, which is a separate rubric requirement. C creates a description list. D is not a valid HTML element. Q6: Which HTML element creates a table row in an HTML table? A. B. C. D. Correct Answer: C Rationale: The element defines a table row, which contains table cells ( for data, for headers). The D277 rubric requires a table with 3–6 columns and 3–6 rows

. A is a table data cell. B is a table header cell. D is not a valid HTML element. Q7: Which attribute on an anchor () element causes a link to open in a new browser window or tab? A. new="true" B. target="_blank" C. href="_new" D. window="new"

B. Inside the element. C. Inside the element. D. Inside the element. Correct Answer: B Rationale: The element belongs inside the <head> section of the document. It defines the title shown in the browser tab and used by search engines. The D277 rubric requires a title in the head of each document describing the page's topic. A is incorrect because the title is not visible page content. C and D are visible page regions, not metadata containers. Q11: Which element is used to embed JavaScript code directly within an HTML document? A. <javascript> B. <script> C. <js> D. <code> Correct Answer: B Rationale: The <script> element is used to embed or reference executable code, typically JavaScript. The D277 task requires JavaScript code to verify email fields match. A and C are not valid HTML elements. D is used for displaying code snippets, not executing them. Q12: What is the correct way to reference an external JavaScript file in an HTML document? A. <script href="app.js"> B. <script src="app.js"></script> C. <link rel="javascript" href="app.js"> D. <js src="app.js">

Correct Answer: B Rationale: The tag is required even when the element is empty. A uses an invalid attribute (href is for anchors/links, not scripts). C is incorrect; is for stylesheets and other resources, not JavaScript execution. D is not a valid element. Q13: Which input type is most appropriate for collecting a user's email address in a form? A. type="text" B. type="email" C. type="mail" D. type="string" Correct Answer: B Rationale: The type="email" input provides built-in browser validation for email format and triggers the appropriate mobile keyboard. The D277 task requires text fields for email address and a confirmation field. A provides no email-specific validation. C and D are not valid input types. Q14: Which attribute is used to provide placeholder text in an input field? A. value B. placeholder C. default D. hint Correct Answer: B Rationale: The placeholder attribute displays hint text in an input field before the user enters a value. The D277 task explicitly requires all form fields to contain placeholders. A sets the initial value (which is submitted), not a hint. C and D are not valid attributes for this purpose.

Correct Answer: B Rationale: The element represents a self-contained composition that is independently distributable or reusable (e.g., a forum post, magazine article, blog entry). A is for thematic grouping within a document. C is generic. D represents the dominant content of the document, but is not independently distributable. Q18: Which HTML element is used to define a description list? A. B. C. D. Correct Answer: C Rationale: The element creates a description list, which contains terms () and descriptions (). A is an unordered list. B is an ordered list. D is not a valid element. Q19: What is the primary purpose of semantic HTML elements? A. To make the code longer and more complex. B. To convey meaning about the structure and content of the page to browsers, developers, and assistive technologies. C. To apply default visual styling without CSS. D. To replace the need for JavaScript. Correct Answer: B Rationale: Semantic elements (e.g., , , , , ) describe their meaning to both the browser and the developer. They improve accessibility, SEO, and code maintainability. A is incorrect; semantic HTML often simplifies structure. C is incorrect; visual styling is CSS's responsibility. D is incorrect; semantics do not provide interactive behavior.

Q20: Which attribute provides alternative text for an image and is required by the D rubric on every page? A. title B. alt C. src D. longdesc Correct Answer: B Rationale: The alt attribute provides a textual alternative for an image. It is read by screen readers and displayed if the image fails to load. The D277 rubric explicitly requires a relevant image including alternative text on each page. A provides a tooltip, not a text alternative. C specifies the image source URL. D is a deprecated attribute. SECTION 2: CSS SELECTORS, PROPERTIES & THE BOX MODEL (Questions 21–45) Q21: What does CSS stand for? A. Creative Style Sheets B. Cascading Style Sheets C. Computer Style Sheets D. Colorful Style Sheets Correct Answer: B Rationale: CSS stands for Cascading Style Sheets. It is the language used to describe the presentation and layout of HTML documents. A , C , and D are incorrect expansions.

Rationale: The period (.) is used to target elements by their class attribute. The D rubric requires a class selector applied at least twice. A is for ID selectors. C is the universal selector. D is not a CSS selector symbol. Q25: What is the purpose of the :hover pseudo-class in CSS? A. To change the color of all text on a page. B. To apply a style when the user's mouse cursor is over an element. C. To style the first element in a list. D. To create animations that run on page load. Correct Answer: B Rationale: The :hover pseudo-class applies styles when the user points the mouse cursor over an element. The D277 rubric specifically requires a :hover pseudo-class to create a rollover effect for navigation buttons. A describes a global text color change. C describes :first-child. D describes CSS animations or transitions, not :hover. Q26: Which CSS property is used to change the text color of an element? A. background-color B. font-color C. color D. text-color Correct Answer: C Rationale: The color property sets the foreground color of an element's text content. A sets the background color behind the text. B and D are not valid CSS properties. Q27: Which CSS property is used to make text bold? A. font-style: bold; B. text-weight: bold; C. font-weight: bold; D. font-bold: true;

Correct Answer: C Rationale: The font-weight property controls the boldness (weight) of text. Setting it to bold (or 700 ) makes text heavier. A is used for italic (font-style: italic). B and D are not valid CSS properties. Q28: Which CSS property adds space outside an element's border? A. padding B. margin C. border-spacing D. spacing Correct Answer: B Rationale: In the CSS box model, margin is the space outside the border, separating the element from other elements. padding is the space inside the border, between the border and the content. A is inside the border. C is for table border spacing. D is not a valid property. Q29: In the CSS box model, what is the correct order of layers from innermost to outermost? A. Margin → Border → Padding → Content B. Content → Padding → Border → Margin C. Content → Border → Padding → Margin D. Padding → Content → Border → Margin Correct Answer: B Rationale: The CSS box model consists of (from innermost to outermost): the content area, padding (space around content, inside the border), border, and margin (space outside the border). This is foundational knowledge for layout and spacing. A , C , and D present incorrect orderings.

Rationale: The ::first-letter pseudo-element selects the first letter of the first line of a block-level element, allowing for styles like drop caps. A selects an element that is the first child of its parent. C is incorrect syntax (pseudo-elements use double colons, though single-colon syntax is legacy). D targets the entire first line. Q33: Which CSS selector represents the first-child pseudo-class? A. ::first-child B. :first-child C. :first D. .first-child Correct Answer: B Rationale: The :first-child pseudo-class selects an element that is the first child of its parent. A is incorrect syntax (pseudo-classes use single colons). C is not a valid selector. D is a class selector, not a pseudo-class. Q34: What is the correct CSS syntax to apply styles to all paragraph elements? A. p { color: blue; } B. .p { color: blue; } C. #p { color: blue; } D. *p { color: blue; } Correct Answer: A Rationale: An element selector targets all instances of an HTML element by its tag name. p { ... } applies to all

elements. The D277 rubric requires one element selector. B targets elements with class="p". C targets an element with id="p". D is invalid syntax. Q35: Which CSS property is used to set the font family for text? A. font-style B. font-family

C. text-font D. typeface **Correct Answer: B Rationale:** The font-family property specifies a prioritized list of font family names for an element. The D277 rubric requires one font-family declaration. **A** sets italic/normal. **C** and **D** are not valid CSS properties. **Q36:** What is the difference between rem and em units in CSS? A. rem is relative to the parent element's font size; em is relative to the root element's font size. B. rem is relative to the root element's font size; em is relative to the parent element's font size. C. Both are absolute units. D. rem is for margin only; em is for font size only. **Correct Answer: B Rationale:** rem (root em) is relative to the font size of the root element (), providing consistent sizing regardless of nesting. em is relative to the font size of the parent element, which can compound with nesting. **A** reverses the definitions. **C** is incorrect; both are relative units. **D** is incorrect; both can be used for various properties. **Q37:** Which CSS property is used to control the stacking order of positioned elements? A. z-index B. stack-order C. layer D. position-order **Correct Answer: A**

Q40: Which CSS property is used to float an element to the left or right, allowing other content to wrap around it? A. position B. float C. display D. align Correct Answer: B Rationale: The float property places an element on the left or right side of its container, allowing inline content (like text) to wrap around it. The D277 rubric requires a float property to position at least one HTML element to the side of another. A is for positioning schemes. C controls display type. D is not a valid CSS property. Q41: Which CSS technique is best suited for making a website responsive across different screen sizes? A. Using fixed pixel widths for all containers. B. Using media queries to apply different styles at defined breakpoints. C. Using only float for layout. D. Using tags to control line breaks. Correct Answer: B Rationale: Media queries (@media) allow CSS to apply different styles based on device characteristics such as viewport width. This is the foundation of responsive web design, which the D277 course emphasizes. A creates rigid layouts that break on small screens. C is an older technique not sufficient for modern responsive design. D is inappropriate for layout control. Q42: Which CSS property is used to create space between the content and the border of an element? A. margin B. padding

C. border-spacing D. gap Correct Answer: B Rationale: padding is the space between the content and the border, inside the element. margin is outside the border. C is for table borders. D is for flexbox/grid gaps. Q43: What is the primary purpose of CSS preprocessors like SASS or LESS? A. To improve JavaScript performance. B. To write reusable styles using variables, nesting, and functions. C. To create responsive designs without media queries. D. To manage browser compatibility issues. Correct Answer: B Rationale: CSS preprocessors extend CSS with features like variables, nesting, mixins, and functions, making styles more maintainable and reusable. They compile to standard CSS. A is unrelated. C is incorrect; preprocessors do not replace media queries. D is a partial benefit but not the primary purpose. Q44: Which CSS selector would select all

elements that are the first child of their parent? A. p:first-child B. p::first-child C. p.first-child D. p#first-child Correct Answer: A Rationale: p:first-child selects a

element that is the first child of its parent. The pseudo-class uses a single colon. B uses incorrect double-colon syntax for a pseudo- class. C selects elements with class="first-child". D selects an element with id="first- child".