If there are two or more errors in a given step that allocate differing amounts of points with no indication as to how to recocile this, defer to the more egregious error.
E.g. If someone makes two types of errors in which one awards 2 points and the other awards 1 point, only 1 point should be awarded for this step.
If there are novel errors unaddressed by the rubric and there are no other errors to defer to, award HALF of the max number of points possible. If this results in a decimal value, keep the decimal.
Note: Please make sure to read all parts of the rubric carefully before deferring to this option. For instance, not every example of a possible typo is listed for every step. Please exercise your best judgement when awarding points.
If a subject consistently makes a typo in every instance of that variable, the first instance will be penalized a point and all following instances of that typo will be ignored.
In the example below, we see for every instance that should be "options", "opt" is used incorrectly, but consistently instead. So, only the first instance of the typo would be penalized - 1-point would be deducted for the line where opt = ["ROCK", "PAPER", "SCISSORS"]. In all the following instances of "opt", the typo alone would not result in a point deduction.
In this project we'll build Rock-Paper-Scissors! The program should do the following:
Happy coding!
Instructions: Begin by writing a multi-line comment that describes what this program will do.
3 points (max)
Multi-line comments are bookended by either three double quotations or three single quotations. Either format is fine as long as it is consistent (i.e. you cannot begin with double quotations and close with single quotations).
or
2 points
1 point
0 points
Instructions: Since the computer will select rock, paper, or scissors randomly, we will need the randint
function - which is not built-in. Use a function import to import randint
from the random
module.
3 points (max)
2 points
1 point
randint
is imported with no trace of random
.0 points
random
is mentioned with no traced of randint.Instructions: We've imported the code that we will use later. Let's move on!
Create a list called options and store "ROCK", "PAPER", and "SCISSORS" as strings.
4 points (max)
or
3 points
All components are included, with only one of the following errors:
A colon (or something else) is used instead of an equal sign.
There is a missing comma in the list.
One of the brackets is mistyped (e.g. as a parenthesis or as a squiggly bracket.)
An entry is misspelled.
2 points
All components are included but there are repeated/multiple typos/errors.
1 point
0 points
Instructions:
The user will either win or lose the game, so the program will need to print win/lose message to the user later. Create a dictionary called message with three key-value pairs:
Key "tie" points to value "Yawn it's a tie!"
Key "won" points to value "Yay you won!"
Key "lost" points to value "Aww you lost!"
4 points (max)
The dictionary, with all of the messages, is encased in squiggly brackets and stored in the variable "message". All of the following components are included:
The squiggly brackets do NOT have to be on the same line as the beginning/end of the dictionary, as long as everything is correct.
The quotations marks can be either double or single quotations as long as they are consistent. If the coder uses single quotation marks, they must include the backwards slash before the apostrophe in the word "it's". It must read: 'Yawn it\'s a tie!'
rather than 'Yawn it's a tie!'
.
The messages can also all be stored on one line as long as they are seperated by commas.
3 points
All components are included in the correct order with one minor typo/error.
A colon (or something else) is used instead of an equal sign after message
.
One of the brackets is mistyped (e.g. as a parenthesis or as a hard bracket).
There is a missing comma in the list.
There is ONE missing quotation in the list.
Any misspelling of the entry contents - all misspellings are counted as ONE typo/error as long as there are not any other types of errors.
2 points
All components are included but there are **repeated or multiple **typos/errors.
1 point
0 points
Instructions:
Let's write a function that decides who the winner is.
Create a function called decide_winner
. The function should take two parameters: user_choice
and computer_choice
.
Note: Step 5 only reders to the first line in the example below. The print statements are part of steps 6 and step 7, but are included here to show what part of the decide_winner
function will look like, if done correctly. In order to recieve full points for Step 5, all of the components in the highlighted portion must be present and in the correct order.
4 points (max)
3 points
All components are included in the correct order with one minor typo/error.
print
statements that follow are not indented (regardless of the content of the print statements).user_choice
and computer_choice
using different words.2 points
All components are included but there are repeated or multiple typos/errors.
1 point
decide_winner
.0 points
decide_winner
function, missing def
at the beginning. If def
is missing, the rest of the statement does not matter - the coder automatically receives 0 points.Instructions:
Step 6:
Let's start building the decide_winner
function.
First, print the user_choice
, the first parameter, using string formatting.
Step 7:
On the next line, print the computer_choice
, the second parameter, using string formatting.
3 points (max)
Steps 6 & 7 only refer to lines 2 and 3 in the example below. The first line is part of step 5 and included here to show how part of the decide_winner
function will look, if done correctly. In order to recieve full points, all of the components must be present and in the correct order.
2 points
All components are included in the correct order with ONE minor typo/error.
%s
inside the quotations.%
between %s
and user_choice
or computer_choice
.user_choice
or computer_choice
at the end.%s
inside the quotations.return
instead of print
.1 point
There are multiple/repeated minor errors.
or
0 points
Coder does not use or attempt the proper string formatting syntax requested by the activity.
or
There is no attempt to create print statements.
Note: Because these steps are very intertwined, this rubric separates them by concept rather than explicity step-by-step.
Concepts:
if
StatementThe if
statement is not aligned with the previous statements.
Used a single equal sign instead of two.
Used a semicolon at the end instead of a colon.
The print
statement that follows is not indented (regardless of the content of the print statement).
Used elif
instead of if
.
if
is not used at the beginning of the statement.
if
statement.elif
Statement
2 points
All components are included in the correct order with one minor typo/error.
elif
statements are not aligned with one another.
Used a single equal sign instead of two.
Used a semicolon at the end instead of a colon.
print
statement that follows is not indented (regardless of the content of the print statement).&
instead of and
.if
instead of elif
.1 point
0 points
elif
is not at the beginning of one or more of the statements.else
Statements2 points (max)
This portion of the rubric refers to the highlighted portion only. All components in the highlighted area must be included to receive full credit.
1 point
There is no colon at the end of the statement.
The print
statement that follows is not indented (regardless of the content of the print
statement).
The else
statement is not aligned eith the elif
statements.
0 points
elif
, if
) are used instead of else
.
else
statement.print
statements: the first prints "tie" and is under the if
statemeent, the middle three print "won" are under the elif
statements, and the last prints "lost" and is under the else
statement.
2 points
All components are included in the correct order with one minor typo/error. These errors can happen in one or all five of the print
statements as long as it is the same type of error committed throughout.
One of the hard brackets is mistyped (e.g. as a parenthesis or as a squiggly bracket).
One of the quotations is missing or mistyped.
The word "message" or "print" is misspelled.
Used return
instead of print
.
1 point
Anything other than hard brackets are used on both ends for one or more of the print
statements.
No quotations are used.
Combination of errors listed on the previous slide for one or more of the print
statements; inconsistent formatting throughout the print
statements.
0 points
Mismatched keys are called ("tie" should be under the if
statement, "won" should be under the elif
statements, "lost" should be under the else
statement).
Incorrect use of dictionary calls, e.g. uses numbers instead.
No keys are called within the brackets.
There is no attempt to use dictionary calls.
This part of the rubric refers to the highlighted portions only. There should be a total of six list calls with two in each row of elif
statements. These list calls have numbers inside hard brackets that refer back to the nth item in the "options" list that the coder created in step 3 (included below). The first item in the list has an index of 0, the next item has an index of 1, etc. As such, the list calls must call the correct items from the list in order to fulfill the three scenarios that a user might win against the computer (rock[0] > scissors[2], paper[1] > rock[0], scissors[2] > paper[1]). It does not matter which pairings of numbers in which elif
statement as in as long as the order of numbers within those airings are not switched around (e.g. you cannot have options[1] first and options[2] second in the same row because paper does not beat scissors.)
3 points (max)
2 points
All components are included in the correct order (including the correct number of pairings) with one minor typo/error. These errors can happen in one or all of the ist calls as long as it is the same type of error commited throughout.
1 point
elif
statements.
elif
statement uses strings/text instead of the appropriate list call format (e.g. "ROCK" is used instead of options[0]).
0 points
elif
statement use strings/text instead of the correct list call format, i.e. does not attempt to do list calls.
Instructions:
Great! We have the function that will decide who the winner is between the user and the computer, but we haven't written a function that actually starts the game. Let's do that now.
Create a new function called play_RPS()
.
3 points (max)
This part of the rubric refers to the highlighted portion only. All components in the highlighted area must be included and in the correct order in order to recieve full points. The rest of the code shows what the remaining steps will look like when completed.
Note: all of the lines following the highlighted line must be indented except for the final line play_RPS()
in order to receive full points.
2 points
All components are included in the correct order with one minor typo/error.
play_RPS()
) are not indented, regardless of the content of the statements.
1 point
0 points
def
is not used (did not properly define the function play_RPS
). If def
is missing, the rest of the statement does not matter - the coder automatically receives 0 points.
Instructions:
Inside the function, we'll have to prompt the user for their selection.
Prompt them with the message: "Enter Rock, Paper, or Scissors:".
Store their input in a variable called user_choice
.
3 points (max)
This part of rubric refers to the highlighted portion only. All components in the highlighted area must be included and in the correct order to recieve full points. The rest of the code shows what the reamining steps will liik like when completed.
2 points
All components are included in the correct order with one minor typo/error.
1 point
Missing raw_input()
function, however:
raw_input()
is on the same line as the text prompt.Combination of one or more minor errors listed previosuly.
0 points
Missing raw_input()
function and the attempt at raw_input()
is not on the same line as the text prompt.
or
Does not store anything in the variable user_choice
.
Entire statement missing.
Instructions:
Convert the user's choice to uppercase in case they type lowercase rock, paper, or scissors.
.upper()
at the end of the statement and stores result in a variable called "user_choice", but everything else is incorrect.
.upper
.upper()
is at the beginning and not the end.
user_choice
is put inside of the parentheses of .upper()
.
user_choice
.
randint
Instructions:
The computer has to play too! Remember, the computer's choice has to be random, so we'll make use of randint
to accomplish that.
Remember, this is how the randint
function works: randint(low,high)
.
On the next line, create a variable called computer_choice
. Set the variable equal to an item in options
at a random index (0 to 2).
randint
and it is stored in a variable called computer_choice
, but everything else is incorrect.
randint
, "random" or "rand" are given 0 points.
computer_choice
.
Instructions:
Great! The user has now submitted their choice and the computer has also made a random choice. It's time to determine a winner. Thankfully, we already wrote a function that can do that.
On the next line, call the decide_winner
function. Pass in user_choice
as the first argument and computer_choice
as the second argument.
Only has decide_winner
(no attempt to pass arguments or include parentheses).
User attempts to define a new function (def
is included before decide_winner
).
User attempts to return the function.
If there are combinations of multiple errors previosuly listed, award 0 points.
There is no attempt to call the function.
Instructions:
Our program won't unless we call the correct function! On the next line, call the play_RPS()
function. Make sure it's outside of any other function.
Note: This line must be flushed left with no indent. If the coder indented this line under the def play_RPS():
function along with the other statements from steps 13-17, subtract one point.
def
is included before play_RPS()
).
Marked text
Marked text
Marked text