Commit 34a3930f authored by David Paul's avatar David Paul
Browse files

Update exercises after student feedback

parent 5922d5c5
......@@ -46,14 +46,14 @@ exercise.code = "weight = {} #TODO: Initialise weight with correct values\navai
exercise.tests = [Test("Weight calculation", "Overall weight: 310\n")]
exercise.checks = [Check("You should use a for loop to loop over all keys in one of the dictionaries", "for "),
Check("You should calculate the value", "310", True),
Check("You need to specify the correct weights in a dictionary", "\"pencil\":(\\s)+10"),
Check("You need to specify the correct weights in a dictionary", "\"pen\":(\\s)+20"),
Check("You need to specify the correct weights in a dictionary", "\"paper\":(\\s)+4"),
Check("You need to specify the correct weights in a dictionary", "\"eraser\":(\\s)+80"),
Check("You need to specify the correct availability in a dictionary", "\"pen\":(\\s)+3"),
Check("You need to specify the correct availability in a dictionary", "\"pencil\":(\\s)+5"),
Check("You need to specify the correct availability in a dictionary", "\"eraser\":(\\s)+2"),
Check("You need to specify the correct availability in a dictionary", "\"paper\":(\\s)+10")]
Check("You need to specify the correct weights in a dictionary", "[\"']pencil[\"']:(\\s)+10"),
Check("You need to specify the correct weights in a dictionary", "[\"']pen[\"']:(\\s)+20"),
Check("You need to specify the correct weights in a dictionary", "[\"']paper[\"']:(\\s)+4"),
Check("You need to specify the correct weights in a dictionary", "[\"']eraser[\"']:(\\s)+80"),
Check("You need to specify the correct availability in a dictionary", "[\"']pen[\"']:(\\s)+3"),
Check("You need to specify the correct availability in a dictionary", "[\"']pencil[\"']:(\\s)+5"),
Check("You need to specify the correct availability in a dictionary", "[\"']eraser[\"']:(\\s)+2"),
Check("You need to specify the correct availability in a dictionary", "[\"']paper[\"']:(\\s)+10")]
exercises.append(exercise)
# Exercise 5
......@@ -76,7 +76,7 @@ exercise.tests = [Test("a", "Enter a word/phrase to check: a\na is a palindrome\
Test("racecar", "Enter a word/phrase to check: racecar\nracecar is a palindrome\n", "racecar"),
Test("Anna", "Enter a word/phrase to check: Anna\nAnna is not a palindrome\n", "Anna")]
exercise.checks = [Check("You should use len to check the length of the string", "len\\("),
Check("You need to make a recursive call to is_palindrome", "return(\\s)+is_palindrome\\("),
Check("You need to make a recursive call to is_palindrome", "return(\\s)+(.)*is_palindrome\\("),
Check("You need a base case in your recursive function", "return(\\s)+[^i][^s]")]
exercises.append(exercise)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment