Hi all,
I'm trying to set up a Python-CodeRunner that does not ask students to write down an entire function but to give a single line of code instead. That one line ought change a dictionary thus the dictionary needs to be declared somehow somewhere in advance. I thought the template parms might be the best place to do so and put some JSON there:
{ "noten" : [2.0, 3.0, 1.0] }
I consider this to be the equivalent to Python's
noten = [2.0, 3.0, 1.0]
So I expected to first test
(len(noten) == 2) & (noten[0] == 3.0) & (noten[1] == 1.0)
to come up with True or False but got
***Laufzeitfehler***
Traceback (most recent call last):
File "__tester__.python3", line 1, in <module>
noten.remove(2.0)
NameError: name 'noten' is not defined
Debug is
Run 1
noten.remove(2.0)
__student_answer__ = """noten.remove(2.0)"""
SEPARATOR = "#<ab@17943918#@>#"
(len(noten) == 2) & (noten[0] == 3.0) & (noten[1] == 1.0)
Providing the list along with the test case itself doesn't work neither. Being a bloody newbie I'm afraid of missing something very basic ....
Where can I declare the list?
Many thanks in advance
Christian