Problem Description Earned Max 1 HTML / CSS Tracing 20 2 CSS 20 3 PHP 20 4 JS / Ajax / JSON 20 5 SQL 20 X Extra Credit 1 TOTAL Total Points 100

Similar documents
Problem Description Earned Max 1 HTML / CSS Tracing 20 2 CSS 20 3 PHP 20 4 JS / Ajax / JSON 20 5 SQL 20 X Extra Credit 1 TOTAL Total Points 100

CSE 154, Autumn 2012 Final Exam, Thursday, December 13, 2012

Problem Description Earned Max 1 CSS 2 PHP 3 PHP/JSON 4 Ajax 5 Regular Expressions 6 SQL TOTAL Total Points 100

CSc 337 LECTURE 15: REVIEW

Problem Description Earned Max 1 HTML/CSS Tracing 15 2 HTML/CSS Coding 15 3 JavaScript/DOM 15 TOTAL Day's Total Points 45

Problem Description Earned Max 1 CSS 20 2 PHP 20 3 SQL 10 TOTAL Total Points 50

Problem Description Earned Max 1 HTML/CSS Tracing 15 2 HTML/CSS Coding 15 3 JavaScript/DOM 20 TOTAL Day's Total Points 50

Problem Description Earned Max 1 PHP 20 2 JS 20 3 JS / Ajax / JSON 20 4 SQL 20 X Extra Credit 1 TOTAL Total Points 100

Problem Description Earned Max 1 PHP 25 2 JavaScript/DOM 25 3 Regular Expressions 25 4 SQL 25 TOTAL Total Points 100

Problem Description Earned Max 1 HTML/CSS Interpretation 30 2 HTML/CSS Programming 30 3 JavaScript Programming 40 X Extra Credit +1 TOTAL 100

Problem Description Earned Max 1 PHP 25 2 JavaScript / DOM 25 3 Regular Expressions 25 TOTAL Total Points 100. Good luck! You can do it!

CSE 154: Web Programming Autumn 2018

CSE 154: Web Programming Autumn 2018

Problem Description Earned Max 1 HTML/CSS 20 2 Javascript/DOM 20 3 Ajax/XML 20 5 PHP 20 4 SQL 20 X Extra Credit +1 TOTAL 100

CSE 154: Web Programming Autumn 2018

G I F T U N I V E R S I T Y

CSE 154: Web Programming Autumn 2018

Problem Description Earned Max 1 HTML / CSS Tracing 20 2 PHP 20 3 JS 20 4 JS / Ajax / JSON 20 5 SQL 20 X Extra Credit 1 TOTAL Total Points 100

a) <div id="coffee"> <p>*('o')*</p> <ul> <li>aaa</li> <li id="c">bbb</li> <li>ccc</li> </ul> </div>

Sample midterm extra questions

Perfect Student Midterm Exam March 20, 2007 Student ID: 9999 Exam: 7434 CS-081/Vickery Page 1 of 5

Question 1. (5 points) CSS

University of Washington, CSE 154 Section 10: Practice Final Exam Problems

Welcome Please sit on alternating rows. powered by lucid & no.dots.nl/student

Adding CSS to your HTML

a) <div id="coffee"> <p>*('o')*</p> <ul> <li>aaa</li> <li id="c">bbb</li> <li>ccc</li> </ul> </div>

Appendix D CSS Properties and Values

Wanted! Introduction. Step 1: Styling your poster. Activity Checklist. In this project, you ll learn how to make your own poster.

CSE 142, Autumn 2008 Midterm Exam, Friday, October 31, 2008

First Name Last Name CS-081 March 23, 2010 Midterm Exam

CSCI311 Spring 2017 Final Exam Instructor: Sarah Carruthers

CSE 154: Web Programming Autumn 2018

Introduction to Multimedia. MMP100 Spring 2016 thiserichagan.com/mmp100

What do we mean by layouts?

University of Washington, CSE 154 Homework Assignment 8: Baby Names

UNIVERSITY OF TORONTO Faculty of Arts and Science APRIL 2016 EXAMINATIONS. CSC309H1 S Programming on the Web Instructor: Ahmed Shah Mashiyat

Introduction to WEB PROGRAMMING

UNIVERSITY OF TORONTO SCARBOROUGH WINTER 2016 EXAMINATIONS. CSC B20H3 Duration 3 hours. No Aids Allowed

Proper_Name Final Exam December 21, 2005 CS-081/Vickery Page 1 of 4

University of Washington, CSE 190 M Homework Assignment 9: Remember the Cow (To-Do List)

CSE 154 Practice Exam from 16au

Lecture B3 Style : Algorithmic Thinking. Computing and Art : Nature, Power, and Limits CC 3.12: Fall 2007

<body bgcolor=" " fgcolor=" " link=" " vlink=" " alink=" "> These body attributes have now been deprecated, and should not be used in XHTML.

WEBSITE PROJECT 2 PURPOSE: INSTRUCTIONS: REQUIREMENTS:

Styles, Style Sheets, the Box Model and Liquid Layout

CSE 142, Autumn 2007 Midterm Exam, Friday, November 2, 2007

University of Washington, CSE 190 M Homework Assignment 8: Baby Names

Student, Perfect Final Exam May 25, 2006 ID: Exam No CS-081/Vickery Page 1 of 6

Session 4. Style Sheets (CSS) Reading & References. A reference containing tables of CSS properties

UNIVERSITY OF TORONTO Faculty of Arts and Science DECEMBER 2015 EXAMINATIONS. CSC309H1 F Programming on the Web Instructor: Ahmed Shah Mashiyat

Student, Perfect CS-081 Final Exam May 21, 2010 Student ID: 9999 Exam ID: 3122 Page 1 of 6 Instructions:

1 of 7 11/12/2009 9:29 AM

Page Layout. 4.1 Styling Page Sections 4.2 Introduction to Layout 4.3 Floating Elements 4.4 Sizing and Positioning

Make a Website. A complex guide to building a website through continuing the fundamentals of HTML & CSS. Created by Michael Parekh 1

Note: The screenshots in this document were taken on Windows in Firefox, which may differ from your system.

CSE 142, Summer 2013 Midterm Exam, Friday, July 26, 2013

What is the Box Model?

University of Washington, CSE 154 Homework Assignment 7: To-Do List

GIMP WEB 2.0 MENUS WEB 2.0 MENUS: HORIZONTAL NAVIGATION BAR CREATING AN HTML LIST

(Simple) JavaScript Framework Homework

Ministry of Higher Education and Scientific Research

CIS 3308 Web Application Programming Syllabus

Lab 2: Movie Review. overview.png background.png rottenbig.png rbg.png fresh.gif rotten.gif critic.gif

2005 WebGUI Users Conference

COSC 2206 Internet Tools. CSS Cascading Style Sheets

Introduction to HTML & CSS. Instructor: Beck Johnson Week 2

Lecture : 3. Practical : 2. Course Credit. Tutorial : 0. Total : 5. Course Learning Outcomes

Reading 2.2 Cascading Style Sheets

Mark Scheme. Edexcel Level 2 Certificate in Digital Applications. Unit 5: Coding for the Web

Web Engineering CSS. By Assistant Prof Malik M Ali

TAG STYLE SELECTORS. div Think of this as a box that contains things, such as text or images. It can also just be a

CSS Selectors. element selectors. .class selectors. #id selectors

Teach Yourself HTML5 & CSS 3: Week 5 Task 13 - Anchors Part 3

The most important layout aspects that can be done with tables are:

Transact Qualified Front End Developer

Guidelines for doing the short exercises

UNIVERSITI TEKNOLOGI MALAYSIA TEST 1 SEMESTER II 2012/2013

CSE 142, Autumn 2010 Midterm Exam, Friday, November 5, 2010

Create a three column layout using CSS, divs and floating

CSE 142, Autumn 2010 Final Exam Wednesday, December 15, Name:

CSE 142, Winter 2007 Final Exam. Name:

COMP519 Web Programming Lecture 6: Cascading Style Sheets: Part 2 Handouts

Table of Contents. MySource Matrix Content Types Manual

When you complete this chapter, you will be able to:

HTML and CSS a further introduction

CSE 142, Autumn 2011 Midterm Exam: Friday, November 4, 2011

Zen Garden. CSS Zen Garden

Responsive web design (RWD) CSS3 Media queries. Mobile vs desktop web sites. Web Development 1 CS1115/CS5002

CSS: The Basics CISC 282 September 20, 2014

Exercise 1: Understand the CSS box model

Cascading Style Sheets for layout II CS7026

CSS MOCK TEST CSS MOCK TEST III

CSS worksheet. JMC 105 Drake University

CSE 373, Winter 2013 Final Exam, Tuesday, March 19, Good luck! You can do it!

COMP1000 Mid-Session Test 2017s1

CSE 143, Winter 2010 Midterm Exam Wednesday February 17, 2010

Dreamweaver: Web Forms

Exploring Computer Science Web Final - Website

CSE 143, Winter 2010 Final Exam Thursday, March 18, 2010

DIG 3110 Web Design & Interactive Media

Transcription:

CSE 154, Autumn 2012 Final Exam, Thursday, December 13, 2012 Name: Quiz Section: Student ID #: TA: Rules: You have 110 minutes to complete this exam. You may receive a deduction if you keep working after the instructor calls for papers. This test is open-book/notes. You may use any paper resources other than practice exams. You may not use any computing devices, including calculators, cell phones, or music players. Unless otherwise indicated, your code will be graded on proper behavior/output, not on style. Please do not abbreviate code, such as writing ditto marks ("") or dot-dot-dot marks (...). You may write $ for document.getelementbyid and $$ for document.queryselectorall. You may not use JavaScript frameworks such as jquery or Prototype when solving problems. If you enter the room, you must turn in an exam and will not be permitted to leave without doing so. You must show your Student ID to a TA or instructor for your submitted exam to be accepted. Good luck! You can do it! Problem Description Earned Max 1 HTML / CSS Tracing 20 2 CSS 20 3 PHP 20 4 JS / Ajax / JSON 20 5 SQL 20 X Extra Credit 1 TOTAL Total Points 100 1 of 9

1. HTML / CSS Tracing Draw a picture of how the following HTML/CSS code will look when the browser renders it on-screen. Assume that the HTML is wrapped in a valid full page with a head and body. Indicate a non-white background by shading lightly or by drawing diagonal lines like <div> <span>1</span> <div id="div">2 2</div> </div> <span class="div">3 3 3</span> <div> <div class="div">4 4 4 4</div> <div id="span">5 5 5 5 5</div> <div class="span">6 6 6 6 6 6</div> </div>. It is possible that some CSS rules shown will not apply to any elements. div { border: 2px solid black; padding: 1em; } CSS body > div { margin: auto; width: 50%; } div #div, p { background-color: yellow; text-decoration: underline; } span div, span.div { border: 2px dashed black; } div > div.div { float: left; } #div,.span { clear: left; } span#span { background-color: yellow; } HTML 2 of 9

2. CSS Write the CSS code necessary to recreate the following appearance on-screen, exactly as shown. The page uses the same HTML code as in the previous problem. You are not allowed to modify the HTML. <div> <span>1</span> <div id="div">2 2</div> </div> <span class="div">3 3 3</span> <div> <div class="div">4 4 4 4</div> <div id="span">5 5 5 5 5</div> <div class="span">6 6 6 6 6 6</div> </div> All text now uses a monospace font at the default size. All borders shown are 2px thick and black in color. The element with "2 2" now has a yellow background. The elements with "3 3 3", "4 4 4 4", and "5 5 5 5 5" are now each exactly one fourth (1/4) of the page width. The element "2 2" now has bold text, and the element "5 5 5 5 5" now has italic text. 3 of 9

3. PHP Write the PHP code for a web page filter.php that filters lines of text from a file. The page should contain a short form with a text box where the user can type a word. The page also displays the current contents of the file text.txt as a pre-formatted block. The form submits back to the same page, filter.php, as a POST request. When the word is submitted, your code should examine the contents of text.txt and remove any lines from the file that contain the given word, case-insensitively. Write the changes to the file so that any future viewings of the page will see the changes. You can write just the code dealing with the page's body; you don't need to output a head section or a complete page. Match the exact word, not other words that contain it as a substring. For example, if the user submits the word "me" you would filter out lines containing the word "me", but not lines that just contain a word such as "men" or "game". The following screenshots show the page as the user types the word "one" and after clicking Submit: If the user makes a POST but somehow does not submit the query parameter for the word, or if the word they submit does not consist entirely of upper/lowercase letters, issue an HTTP 400 error and do not display the rest of the page. Use the browser's default styling; you do not need to write any CSS for this problem. 4 of 9

3. PHP (additional writing space) 5 of 9

4. JavaScript / Ajax / JSON Write the JavaScript code for a basic vocabulary quiz built using Ajax and JSON that allows the user to try to guess the definitions to randomly chosen words from the server. The quiz data comes from a web service named word.php, located on your web server in the same directory as your code. Contact this service with a GET parameter of part for a part of speech such as noun or adjective. It outputs JSON data about a random dictionary word and several possible definitions for the word (at least 2 definitions, of which exactly 1 is correct) in the following format. For example, a request to word.php?part=noun might return: {"word": "neophyte", "part": "noun", "choices": [ {"definition": "a person who excels in telling anecdotes", "correct": false}, {"definition": "evenness of mind especially under stress", "correct": false}, {"definition": "a new convert; proselyte", "correct": true}, {"definition": "degree of mixture with base metals; fineness", "correct": false}, {"definition": "rigor, severity", "correct": false} ] } When the page loads, contact the web service with Ajax. Display the random word and its part of speech in the "word" area. Display all of the possible definitions as buttons in the "choices" area. When the user clicks a button to guess the definition, display an alert message of either "You are correct" or "You are incorrect" appropriately, and then once the alert box is closed, start a new quiz by fetching a new word and displaying it and its definitions to the user. At any time the user can change the part of speech from the select box, which should affect any future words. The relevant existing HTML in the page is the following: <h1>vocab-it</h1> <fieldset> <legend>part of speech:</legend> <select id="part"> <option>noun</option> <option>verb</option> <option>adjective</option> </select> </fieldset> <div id="word"></div> <div id="choices"></div> <div id="result"></div> For the example JSON shown above, the page would look as follows. The three screenshots show the page's initial state, the state after a button is clicked, and then the state after the alert box is closed and a new word is fetched. You may assume that the JSON data is valid in the format described previously, and that the.php service is reachable. You do not need to handle any Ajax errors. Do not use any JavaScript libraries such as jquery or Prototype. Write your answer on the next page. 6 of 9

4. JavaScript / Ajax / JSON (writing space) 7 of 9

5. Regular Expressions a) Write a regular expression to match a phone number. Phone numbers consist of 7 digits. These can have a dash between the first three and last four. They can also be proceeded by a three number area code which also may be separated from the following with a dash. Valid: Invalid: 1231231234 a23-234-2345 123-1231234 12345678 1231234 hello1231234world 123-123-1234 123123-1234 b) Write a regular expression to match a UW course number like CSE 154. Courses start with 3-4 uppercase characters, sometimes a space and then a three digit number. Valid: Invalid: CSE 154 CS 154 ART322 CSE 190lab c) Write a regular expression to match a username. Usernames must be between 6 and 18 characters long, can contain letters, numbers, dashes (-) and underscores (_). They must start with a letter. Valid: qwerty AbcDefghi123 Invalid: 123abcd 12qwertyuiopasdfghjkl [abc] A single character of: a, b, or c. Any single character [^abc] Any single character except: a, b, or c \s Any whitespace character [a-z] Any single character in the range a-z \S Any non-whitespace character [a-za-z] Any single character in the range a-z or A-Z \d Any digit ^ Start of line \D Any non-digit $ End of line \w Any word character (letter, number, underscore) \A Start of string \W Any non-word character \z End of string (...) Capture everything enclosed a+ One or more of a (a b) a or b a{3} Exactly 3 of a a? Zero or one of a a{3,} 3 or more of a a* Zero or more of a a{3,6} Between 3 and 6 of a 8 of 9

X. Extra Credit What is a fun web site that you think the TAs should look at while we are grading your exam? And why? (This is just for fun; any URL you write on this page will receive credit.) 9 of 9