feat: p0 and p1
This commit is contained in:
2
tutorial/test_cases/q3/CONFIG
Normal file
2
tutorial/test_cases/q3/CONFIG
Normal file
@ -0,0 +1,2 @@
|
||||
max_points: "1"
|
||||
class: "PassAllTestsQuestion"
|
3
tutorial/test_cases/q3/select_shop1.solution
Normal file
3
tutorial/test_cases/q3/select_shop1.solution
Normal file
@ -0,0 +1,3 @@
|
||||
# This is the solution file for test_cases/q3/select_shop1.test.
|
||||
# The result of evaluating the test must equal the below when cast to a string.
|
||||
result: "<FruitShop: shop1>"
|
21
tutorial/test_cases/q3/select_shop1.test
Normal file
21
tutorial/test_cases/q3/select_shop1.test
Normal file
@ -0,0 +1,21 @@
|
||||
class: "EvalTest"
|
||||
success: "shopSmart(order, shops) selects the cheapest shop"
|
||||
failure: "shopSmart(order, shops) must select the cheapest shop"
|
||||
|
||||
# Python statements initializing variables for the test below.
|
||||
preamble: """
|
||||
import shop
|
||||
|
||||
dir1 = {'apples': 2.0, 'oranges':1.0}
|
||||
shop1 = shop.FruitShop('shop1',dir1)
|
||||
dir2 = {'apples': 1.0, 'oranges': 5.0}
|
||||
shop2 = shop.FruitShop('shop2',dir2)
|
||||
shops = [shop1, shop2]
|
||||
|
||||
order = [('apples',1.0), ('oranges',3.0)]
|
||||
ans = shopSmart.shopSmart(order, shops)
|
||||
"""
|
||||
|
||||
# A python expression to be evaluated. This expression must return the
|
||||
# same result for the student and instructor's code.
|
||||
test: "ans"
|
3
tutorial/test_cases/q3/select_shop2.solution
Normal file
3
tutorial/test_cases/q3/select_shop2.solution
Normal file
@ -0,0 +1,3 @@
|
||||
# This is the solution file for test_cases/q3/select_shop2.test.
|
||||
# The result of evaluating the test must equal the below when cast to a string.
|
||||
result: "<FruitShop: shop2>"
|
21
tutorial/test_cases/q3/select_shop2.test
Normal file
21
tutorial/test_cases/q3/select_shop2.test
Normal file
@ -0,0 +1,21 @@
|
||||
class: "EvalTest"
|
||||
success: "shopSmart(order, shops) selects the cheapest shop"
|
||||
failure: "shopSmart(order, shops) must select the cheapest shop"
|
||||
|
||||
# Python statements initializing variables for the test below.
|
||||
preamble: """
|
||||
import shop
|
||||
|
||||
dir1 = {'apples': 2.0, 'oranges':1.0}
|
||||
shop1 = shop.FruitShop('shop1',dir1)
|
||||
dir2 = {'apples': 1.0, 'oranges': 5.0}
|
||||
shop2 = shop.FruitShop('shop2',dir2)
|
||||
shops = [shop1, shop2]
|
||||
|
||||
order = [('apples',3.0)]
|
||||
ans = shopSmart.shopSmart(order, shops)
|
||||
"""
|
||||
|
||||
# A python expression to be evaluated. This expression must return the
|
||||
# same result for the student and instructor's code.
|
||||
test: "ans"
|
3
tutorial/test_cases/q3/select_shop3.solution
Normal file
3
tutorial/test_cases/q3/select_shop3.solution
Normal file
@ -0,0 +1,3 @@
|
||||
# This is the solution file for test_cases/q3/select_shop3.test.
|
||||
# The result of evaluating the test must equal the below when cast to a string.
|
||||
result: "<FruitShop: shop3>"
|
23
tutorial/test_cases/q3/select_shop3.test
Normal file
23
tutorial/test_cases/q3/select_shop3.test
Normal file
@ -0,0 +1,23 @@
|
||||
class: "EvalTest"
|
||||
success: "shopSmart(order, shops) selects the cheapest shop"
|
||||
failure: "shopSmart(order, shops) must select the cheapest shop"
|
||||
|
||||
# Python statements initializing variables for the test below.
|
||||
preamble: """
|
||||
import shop
|
||||
|
||||
dir1 = {'apples': 2.0, 'oranges':1.0}
|
||||
shop1 = shop.FruitShop('shop1',dir1)
|
||||
dir2 = {'apples': 1.0, 'oranges': 5.0}
|
||||
shop2 = shop.FruitShop('shop2',dir2)
|
||||
dir3 = {'apples': 1.5, 'oranges': 2.0}
|
||||
shop3 = shop.FruitShop('shop3',dir3)
|
||||
shops = [shop1, shop2, shop3]
|
||||
|
||||
order = [('apples',10.0), ('oranges',3.0)]
|
||||
ans = shopSmart.shopSmart(order, shops)
|
||||
"""
|
||||
|
||||
# A python expression to be evaluated. This expression must return the
|
||||
# same result for the student and instructor's code.
|
||||
test: "ans"
|
Reference in New Issue
Block a user