preview test: midterm 1 - cs.colostate.edu · preview test: midterm 1 5/11/14, ... for writing out...

21
5/11/14, 1:58 PM Preview Test: Midterm 1 Page 1 of 21 https://ramct.colostate.edu/webapps/assessment/take/launch.jsp?cour…ent_id=_48205_1&course_id=_23769_1&content_id=_1737253_1&step=null Go To Student View Edit Mode is: ON ON 2 CT- Exams Preview Test: Midterm 1 H Preview Test: Midterm 1 Preview Test: Midterm 1 Description First Midterm Exam of the Course Instructions This is exam is to be taken in one sitting and you have 50 minutes to complete the exam. It is to be taken without the aid of any external sources such as books, notes, calculators, other open browser windows, etc. When you complete this exam you will not be shown any feedback. In particular you will not see a score. My experience now with these exams is human checking is important, and scores, given answers and correct answers will all be released once the exam is checked. That process will take several days. Timed Test This test has a time limit of 2 hours.This test will save and submit automatically when the time expires. Warnings appear when half the time, 5 minutes, 1 minute, and 30 seconds remain.[The timer does not appear when previewing this Test] Multiple Attempts Not allowed. This test can only be taken once. Force Completion This test can be saved and resumed at any point until time has expired. The timer will continue to run if you leave the test. Save All Answers Save All Answers Save and Submit Save and Submit Below are four IP addresses. Select those that must be local area net addresses. There may be more than one address to select. 192.168.0.1 1. 129.82.46.233 192.168.128.138 1. 129.82.46.1 Question 1 5 points Save Answer Save Answer Below are six tags, five of which are commonly used in HTML. One is not. Select the imposter - in other words the tag that is not part of standard HTML. <body> <p> <div> <head> <ul> <start> Question 2 5 points Save Answer Save Answer Select below the heading that generally will appear in the largest font. Question 3 5 points Save Answer Save Answer ? Question Completion Status:

Upload: dangnhu

Post on 11-Jun-2018

217 views

Category:

Documents


0 download

TRANSCRIPT

5/11/14, 1:58 PMPreview Test: Midterm 1

Page 1 of 21https://ramct.colostate.edu/webapps/assessment/take/launch.jsp?cour…ent_id=_48205_1&course_id=_23769_1&content_id=_1737253_1&step=null

Go To Student View Edit Mode is: ONON•2014SP-CT-310-001

Exams Preview Test: Midterm 1H

Preview Test: Midterm 1Preview Test: Midterm 1

Description First Midterm Exam of the CourseInstructions This is exam is to be taken in one sitting and you have 50 minutes to complete the exam. It is to be

taken without the aid of any external sources such as books, notes, calculators, other open browserwindows, etc.When you complete this exam you will not be shown any feedback. In particular you will not see a score. My experience now with these exams is human checking is important, and scores, given answers andcorrect answers will all be released once the exam is checked. That process will take several days.

Timed Test This test has a time limit of 2 hours.This test will save and submit automatically when the time expires.Warnings appear when half the time, 5 minutes, 1 minute, and 30 seconds remain.[The timer does not appearwhen previewing this Test]

MultipleAttempts

Not allowed. This test can only be taken once.

ForceCompletion

This test can be saved and resumed at any point until time has expired. The timer will continue to run if you leavethe test.

Save All AnswersSave All Answers Save and SubmitSave and Submit

Below are four IP addresses. Select those that must be local area net addresses. There may be more than oneaddress to select.

192.168.0.1

1. 129.82.46.233192.168.128.138

1. 129.82.46.1

Question 1 5 points Save AnswerSave Answer

Below are six tags, five of which are commonly used in HTML. One is not. Select the imposter - in other words thetag that is not part of standard HTML.

<body><p><div><head><ul><start>

Question 2 5 points Save AnswerSave Answer

Select below the heading that generally will appear in the largest font.Question 3 5 points Save AnswerSave Answer

??

Question Completion Status:

5/11/14, 1:58 PMPreview Test: Midterm 1

Page 2 of 21https://ramct.colostate.edu/webapps/assessment/take/launch.jsp?cour…ent_id=_48205_1&course_id=_23769_1&content_id=_1737253_1&step=null

<h3>Let us get started</h3><h1>Let us get started</h1><h2>Let us get started</h2><h4>Let us get started</h4>

Below are examples, all but one of which is flawed, for writing out a larger than normal 'Clifford' in red text. Selectthe correct version.

<span style="color=red;font-size=120%">Clifford</span><span style="font-color:red;size:120%">Clifford</span>

<span style="color:red;font-size:120%">Clifford</span><span style="font-color=red;size=120%">Clifford</span><span style="color:red,font-size:120%">Clifford</span><span style="font-color=red;font-size=120%">Clifford</span>

Question 4 5 points Save AnswerSave Answer

The following page when loaded displays a larger red box containing a smaller blue box. How many pixels wide isthe larger red box. Enter you answer as an integer - do not append units. Note code is available both as a screenshot and an attached plain txt file.

Question 5 5 points Save AnswerSave Answer

5/11/14, 1:58 PMPreview Test: Midterm 1

Page 3 of 21https://ramct.colostate.edu/webapps/assessment/take/launch.jsp?cour…ent_id=_48205_1&course_id=_23769_1&content_id=_1737253_1&step=null

Plain text file: exam01q05text.txt

There are six examples of perhaps the simplest PHP example - a Hello World Page. However, only one actuallyworks. Which one?

<body><?php $mess = 'Hello World'; echo '<p>$mess</p>\n';?></body><body><?php string $mess = 'Hello World'; echo "<p>$mess</p>\n";?></body><body><?php $mess <- 'Hello World'; echo "<p>$mess</p>\n";?></body>

<body><?php $mess = 'Hello World'; write "<p>$mess</p>\n";?></body><body> <?php $mess = 'Hello World'; echo "<p>$mess</p>\n"; ?> </body><body><?php mess = 'Hello World'; echo "<p>mess</p>\n";?></body>

Question 6 5 points Save AnswerSave Answer

Which of the options below will actually result in displaying the client browsers IP Address?Question 7 5 points Save AnswerSave Answer

5/11/14, 1:58 PMPreview Test: Midterm 1

Page 4 of 21https://ramct.colostate.edu/webapps/assessment/take/launch.jsp?cour…ent_id=_48205_1&course_id=_23769_1&content_id=_1737253_1&step=null

$ipad = $_SESSION['IP_ADDR'];echo "<p>$ipad</p>\n";$ipad = $_SESSION['REMOTE_ADDR'];echo "<p>$ipad</p>\n";$ipad = $_GET['REMOTE_ADDR'];echo "<p>$ipad</p>\n";$ipad = $_SERVER['REMOTE_ADDR']; echo "<p>$ipad</p>\n";

Here is a very simple page implementing a Parrot that Parrots whatever is entered. You are seeing lines 11 through21 and line numbers are included. Much of the contents of line 18 has been obscured with 'X's. Enter belowprecisely what is being hidden. Please include spaces where appropriate. Finally, the number of 'X's is a hint - youranswer should match in overall character length what has been obscured.

Plain text attachement: exam01q08text.txt

Question 8 5 points Save AnswerSave Answer

When following page what is displayed in the final paragraph. Enter your answer precisely without surrounding formatting- just what appears in the browser.

Question 9 5 points Save AnswerSave Answer

5/11/14, 1:58 PMPreview Test: Midterm 1

Page 5 of 21https://ramct.colostate.edu/webapps/assessment/take/launch.jsp?cour…ent_id=_48205_1&course_id=_23769_1&content_id=_1737253_1&step=null

Plain text attachment: exam01q09text.txt

Consider the following PHP source for a page body. Enter precisely below what appears within the final paragraphtags displayed on the resulting page.

Plain text attachement: exam01q10test.txt

Question 10 5 points Save AnswerSave Answer

Consider a friend asking your help. Here is what they tell you in email:

“I am stumped, on my laptop I see a root localhost page and my site lives one level down in the directory‘bob’. Yet, when I type ‘localhost/bob/index.html I see a giant 'Forbidden' message. How can I test mycode on my laptop when I cannot view my pages? Also, if I type almost the same url but with 'file' at thefront and a full filename path I see the page just fine. What gives?"

Pick the most likely answer from the options belowThe server is not running.The file does not begin with proper <html> tag.The file is not present. The file is present but not world readable, hence not readable by the server.The machine 'localhost' is describing another machine - not your friends laptop.Your friend mistyped the name of his file.

Question 11 5 points Save AnswerSave Answer

5/11/14, 1:58 PMPreview Test: Midterm 1

Page 6 of 21https://ramct.colostate.edu/webapps/assessment/take/launch.jsp?cour…ent_id=_48205_1&course_id=_23769_1&content_id=_1737253_1&step=null

This question concerns elements shared between multiple pages written in PHP. You are shown first a screen shotof the page displayed. Next, as an attachement, the source code for the included header. Finally, as an attachementyou have the code for the page itself. In the header, to places have been obscured with XXXXX and YYYYY. Enterwhat shoul appear in those two obscured portions of the code.

Attachment for the header file: exam01q12head.txt Attachment for the main page: exam01q12body.txt What code replaces XXXXX

What code replaces YYYYY

Question 12 5 points Save AnswerSave Answer

This question is a continuation of the previous question. Here you are shown the source for a second page'exam01q13.php' with one two lines obscured. Enter in the blanks provided what is being obscured. Here is ascreenshot and then the attached file with the page body.

Question 13 5 points Save AnswerSave Answer

5/11/14, 1:58 PMPreview Test: Midterm 1

Page 7 of 21https://ramct.colostate.edu/webapps/assessment/take/launch.jsp?cour…ent_id=_48205_1&course_id=_23769_1&content_id=_1737253_1&step=null

Page body with two parts obscured: exam01q13body.txt What code replaces XXXXXXXXXXXXXXXXXXXXX

What code replaces YYYYYY

The next series of questions are in fact one question divided into parts. You are to consider the PHP page thatcreates a table of states, capitals and populations, and answer a series of questions regarding specific lines of code.Here is a screen shot of the complete PHP page.

Question 14 2 points Save AnswerSave Answer

5/11/14, 1:58 PMPreview Test: Midterm 1

Page 8 of 21https://ramct.colostate.edu/webapps/assessment/take/launch.jsp?cour…ent_id=_48205_1&course_id=_23769_1&content_id=_1737253_1&step=null

exam01q14attachment.txt Select below the best answer to the question:What is line 8, which reads 'text-align: right;' doing?

Establishing iteration over all the state member variables.

5/11/14, 1:58 PMPreview Test: Midterm 1

Page 9 of 21https://ramct.colostate.edu/webapps/assessment/take/launch.jsp?cour…ent_id=_48205_1&course_id=_23769_1&content_id=_1737253_1&step=null

Getting the names of the member variables stored with each instance of a state.Causing the elements in the table to align along the right border of the table.Defining the built in function used to create new instances of the class state.Establishing iteration over all the state member variable values for a state.Getting the values for the member variables for a particular state object.

This series of questions is in fact one question divided into parts. You are to consider the PHP page that creates atable of states, capitals and populations, and answer a series of questions regarding specific lines of code. Here is ascreen shot of the complete PHP page.

Question 15 2 points Save AnswerSave Answer

5/11/14, 1:58 PMPreview Test: Midterm 1

Page 10 of 21https://ramct.colostate.edu/webapps/assessment/take/launch.jsp?cou…nt_id=_48205_1&course_id=_23769_1&content_id=_1737253_1&step=null

exam01q14attachment.txt Select below the best answer to the question:What is line 18, which reads 'function __construct($n, $c, $p)' doing?

Establishing iteration over all the state member variables.

5/11/14, 1:58 PMPreview Test: Midterm 1

Page 11 of 21https://ramct.colostate.edu/webapps/assessment/take/launch.jsp?cou…nt_id=_48205_1&course_id=_23769_1&content_id=_1737253_1&step=null

Defining the built in function used to create new instances of the class state.Getting the names of the member variables stored with each instance of a state.Causing the elements in the table to align along the right border of the table.Establishing iteration over all the state member variable values for a state.Getting the values for the member variables for a particular state object.

This series of questions is in fact one question divided into parts. You are to consider the PHP page that creates atable of states, capitals and populations, and answer a series of questions regarding specific lines of code. Here is ascreen shot of the complete PHP page.

Question 16 2 points Save AnswerSave Answer

5/11/14, 1:58 PMPreview Test: Midterm 1

Page 12 of 21https://ramct.colostate.edu/webapps/assessment/take/launch.jsp?cou…nt_id=_48205_1&course_id=_23769_1&content_id=_1737253_1&step=null

exam01q14attachment.txt Select below the best answer to the question:What is line 32, which reads '$keys = array_keys ( get_object_vars ( $a [1] ) );' doing?

Getting the values for the member variables for a particular state object.

5/11/14, 1:58 PMPreview Test: Midterm 1

Page 13 of 21https://ramct.colostate.edu/webapps/assessment/take/launch.jsp?cou…nt_id=_48205_1&course_id=_23769_1&content_id=_1737253_1&step=null

Establishing iteration over all the state member variable values for a state.Getting the names of the member variables stored with each instance of a state.Establishing iteration over all the state member variables.Defining the built in function used to create new instances of the class state.Causing the elements in the table to align along the right border of the table.

This series of questions is in fact one question divided into parts. You are to consider the PHP page that creates atable of states, capitals and populations, and answer a series of questions regarding specific lines of code. Here is ascreen shot of the complete PHP page.

Question 17 2 points Save AnswerSave Answer

5/11/14, 1:58 PMPreview Test: Midterm 1

Page 14 of 21https://ramct.colostate.edu/webapps/assessment/take/launch.jsp?cou…nt_id=_48205_1&course_id=_23769_1&content_id=_1737253_1&step=null

exam01q14attachment.txt Select below the best answer to the question:What is line 33, which reads 'foreach ( $keys as $k ) {' doing?

Defining the built in function used to create new instances of the class state.

5/11/14, 1:58 PMPreview Test: Midterm 1

Page 15 of 21https://ramct.colostate.edu/webapps/assessment/take/launch.jsp?cou…nt_id=_48205_1&course_id=_23769_1&content_id=_1737253_1&step=null

Getting the names of the member variables stored with each instance of a state.Establishing iteration over all the state member variables.Establishing iteration over all the state member variable values for a state.Getting the values for the member variables for a particular state object.Causing the elements in the table to align along the right border of the table.

This series of questions is in fact one question divided into parts. You are to consider the PHP page that creates atable of states, capitals and populations, and answer a series of questions regarding specific lines of code. Here is ascreen shot of the complete PHP page.

Question 18 2 points Save AnswerSave Answer

5/11/14, 1:58 PMPreview Test: Midterm 1

Page 16 of 21https://ramct.colostate.edu/webapps/assessment/take/launch.jsp?cou…nt_id=_48205_1&course_id=_23769_1&content_id=_1737253_1&step=null

exam01q14attachment.txt Select below the best answer to the question:What is line 41, which reads '$vals = array_values ( get_object_vars ( $s ) );' doing?

Getting the values for the member variables for a particular state object.

5/11/14, 1:58 PMPreview Test: Midterm 1

Page 17 of 21https://ramct.colostate.edu/webapps/assessment/take/launch.jsp?cou…nt_id=_48205_1&course_id=_23769_1&content_id=_1737253_1&step=null

Establishing iteration over all the state member variables.Getting the names of the member variables stored with each instance of a state.Causing the elements in the table to align along the right border of the table.Establishing iteration over all the state member variable values for a state.Defining the built in function used to create new instances of the class state.

Copy ofThis series of questions is in fact one question divided into parts. You are to consider the PHP page that creates atable of states, capitals and populations, and answer a series of questions regarding specific lines of code. Here is ascreen shot of the complete PHP page.

Question 19 2 points Save AnswerSave Answer

5/11/14, 1:58 PMPreview Test: Midterm 1

Page 18 of 21https://ramct.colostate.edu/webapps/assessment/take/launch.jsp?cou…nt_id=_48205_1&course_id=_23769_1&content_id=_1737253_1&step=null

exam01q14attachment.txt Select below the best answer to the question:What is line 42, which reads 'foreach ( $vals as $v ) {' doing?

Establishing iteration over all the state member variables.

5/11/14, 1:58 PMPreview Test: Midterm 1

Page 19 of 21https://ramct.colostate.edu/webapps/assessment/take/launch.jsp?cou…nt_id=_48205_1&course_id=_23769_1&content_id=_1737253_1&step=null

Getting the values for the member variables for a particular state object.Establishing iteration over all the state member variable values for a state.Defining the built in function used to create new instances of the class state.Causing the elements in the table to align along the right border of the table.Getting the names of the member variables stored with each instance of a state.

Here is the PHP for a page that implements a simple guess a number game. Code in two places has been obscuredwith Xs and Ys. Provide precisely the missing code in the blanks below. Here is the code:

exam01q20attachment(1).txt Enter the proper code for blank XXXXXXXXXXX .

Enter the proper code for blank YYYYY

Question 20 5 points Save AnswerSave Answer

5/11/14, 1:58 PMPreview Test: Midterm 1

Page 20 of 21https://ramct.colostate.edu/webapps/assessment/take/launch.jsp?cou…nt_id=_48205_1&course_id=_23769_1&content_id=_1737253_1&step=null

Is it possible that the following two statements by a unix systems administrator are simultaneously true.“I have no idea what you are using for a password.”“I know with certainty that you are using the same password as ‘Bob’.”

True False

Question 21 5 points Save AnswerSave Answer

Below are four statements concerning the procedure of salting passwords. Alas, only two are reasonablestatements. Select those two from among the four shown.

Salting passwords dramatically reduces the changes of hash collisions, and hence the annoying accident of onefriend discovering they can log into anothers frineds account using their own password. The most important aspect of password salting is keeping the salt a secret. The strength of salting passwordslies primarily in this additional level of 'security through obscurity'. Given enough time and energy, and precise knowledge of the salt used, the rainbow table attach may becustomized and launched against a specific target. Adding even a simple salt, for example the phrase 'passthemonkeyplease' or even 'frzif' to the front of apassword before passing it along to be hashed will change the hash and mean that it cannot be discovered bylooking up that hash code in any common rainbow tables built off typically words, phrases and passwords.

Question 22 5 points Save AnswerSave Answer

In this question and the next several you are being asked what best describes specific commonly used thingsassociated with authentication.Google Mail Account

Something you knowSomething you haveSomething you areNot useful for authentication

Question 23 1 points Save AnswerSave Answer

What best describes the following in terms of authentication.Fingerprint

Something you knowSomething you haveSomething you areNot useful for authentication

Question 24 1 points Save AnswerSave Answer

What best describes the following in terms of authentication.Password

Something you knowSomething you haveSomething you areNot useful for authentication

Question 25 1 points Save AnswerSave Answer

5/11/14, 1:58 PMPreview Test: Midterm 1

Page 21 of 21https://ramct.colostate.edu/webapps/assessment/take/launch.jsp?cou…nt_id=_48205_1&course_id=_23769_1&content_id=_1737253_1&step=null

Click Save and Submit to save and submit. Click Save All Answers to save all answers.

Save All AnswersSave All Answers Save and SubmitSave and Submit

The following snippet of PHP code is the essence of the login action presented in the fourth example of our lectureon authentication. Select from below the best English summary of what this code does and how. Here is the code ina screenshot

Code as an attachement: exam01q26text.txt The code first checks to see if a user name has been submitted to this page. If so, it sanitizes both the enteredname and password. Next, if the name is different from the currently logged in user name, the stored saltedhash of the users password is compared to a salted hashed version of the password entered by the user. IFthese match, then the session start time is reset to zero and the user name is changed. This change of username for the session is the indication of successful login. The code first checks to see if a user name has been submitted to this page. If so, it sanitizes both the enteredname and password. Next, if the name matches the currently logged in user name, the stored salted hash ofthe users password is compared to a salted hashed version of the password entered by the user. If thesematch, then the session start time is reset to zero and the user name is changed. This change of user name forthe session is the indication of successful login. The code first checks to see if a password has been submitted to this page. If so, it sanitizes both the enteredname and password. Next, if the name is different from the currently logged in user name, the stored saltedhash of the users password is compared to a hashed version of the password entered by the user. If thesematch, then the session start time is reset to zero and the user name is changed. This change of user name forthe session is the indication of successful login. The code first checks to see if a user name has been submitted to this page. If so, it sanitizes both the enteredname and password. Next, if the name is different from the currently logged in user name, the stored hash ofthe users password is compared to a hashed version of the password entered by the user. If these match, thenthe session start time is reset to zero and the user name is changed. This change of user name for the sessionis the indication of successful login.

Question 26 5 points Save AnswerSave Answer

Save and Submit