From f0d1d68d4e9abb740e50942e5678b402e6d014f4 Mon Sep 17 00:00:00 2001 From: Chris Chudzicki Date: Fri, 28 Jun 2019 20:16:05 -0400 Subject: [PATCH] remove some explicit str() --- docs/grading_math/matrix_grader/matrix_grader.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/grading_math/matrix_grader/matrix_grader.md b/docs/grading_math/matrix_grader/matrix_grader.md index 9eae248f..9e8a7d9a 100644 --- a/docs/grading_math/matrix_grader/matrix_grader.md +++ b/docs/grading_math/matrix_grader/matrix_grader.md @@ -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. ``` @@ -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. ``` @@ -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 ```