Skip to content

Commit

Permalink
remove some explicit str()
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopherChudzicki committed Jun 29, 2019
1 parent c223155 commit f0d1d68
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions docs/grading_math/matrix_grader/matrix_grader.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,8 @@ For example, student enters `'[[1, 2],[3] ]'`, a matrix missing an entry in seco
>>> try:
... grader(None, student_input) # grade the input like edX would
... except StudentFacingError as error:
... str(error) # students see this error message
"Unable to parse vector/matrix. If you're trying to enter a matrix, this is most likely caused by an unequal number of elements in each row."
... print(error) # students see this error message
Unable to parse vector/matrix. If you're trying to enter a matrix, this is most likely caused by an unequal number of elements in each row.

```

Expand All @@ -256,8 +256,8 @@ If a student submits an answer that will raise shape-mismatch errors then an err
>>> try:
... grader(None, student_input) # grade the input like edX would
... except StudentFacingError as error:
... str(error) # students see this error message
'Cannot add/subtract a vector of length 3 with a vector of length 2.'
... print(error) # students see this error message
Cannot add/subtract a vector of length 3 with a vector of length 2.

```

Expand All @@ -280,15 +280,15 @@ True
>>> try:
... grader(None, student_input) # grade the input like edX would
... except StudentFacingError as error:
... str(error) # students see this error message
'Expected answer to be a vector, but input is a vector of incorrect shape'
... print(error) # students see this error message
Expected answer to be a vector, but input is a vector of incorrect shape

>>> student_input = '0' # scalar; should be a vector
>>> try:
... grader(None, student_input) # grade the input like edX would
... except StudentFacingError as error:
... str(error) # students see this error message
'Expected answer to be a vector, but input is a scalar'
... print(error) # students see this error message
Expected answer to be a vector, but input is a scalar

```

Expand Down

0 comments on commit f0d1d68

Please sign in to comment.