CSTools-UCD / moodle-trace-generator

MIT License
0 stars 1 forks source link

TypeError: Builder.__init__() takes 6 positional arguments but 8 were given #2

Open mesantama opened 10 months ago

mesantama commented 10 months ago

python3 main.py ../vocali.py here <parser.python.flowchart.PythonFlowCreator object at 0x7f46d2ce3bd0> Traceback (most recent call last): File "/home/anto/moodle-trace-generator-main/main.py", line 205, in generate_code_question(quiz_root, code_parser, flow_parser, arg_code_file, arg_question_name, image_gen, arg_file_questions, arg_line_questions, arg_reduced, arg_feedback_animations, arg_display_constants, arg_line_numbers, File "/home/anto/moodle-trace-generator-main/main.py", line 69, in generate_code_question builder = Builder(parser, flowchart_parser, image_generator, omit_ert, display_const, animate_fb, code_list) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: Builder.init() takes 6 positional arguments but 8 were given

sean-russell commented 10 months ago

Hi,

It has been quite some time since I tested the command line interface. I will spend a little time in the next week updating the code and resolving this and let you know when it is updated.

mesantama commented 10 months ago

alternatively to command line interface, there is another way to use moodle-trace-generator? thanks

sean-russell commented 10 months ago

I usually run the code as a web application. It can be a little limited sometimes because it is running on a very old server and I was never overly concerned with creating the most efficient application... But you can try it out here: http://cstools.ucd.ie/trace/quiz/create/

mesantama commented 10 months ago

http://cstools.ucd.ie/trace/quiz/create/ -> ERR_CONNECTION_REFUSED

sean-russell commented 9 months ago

The server should be back up running again, I have also updated the command line to work with the newer code.

mesantama commented 9 months ago

Hallo, using the site http://cstools.ucd.ie/trace/quiz/create/ for this code:

a = 10 b = 12 * a + 23

I obtain the question in xml format and importing in moodle I receive:

Analysis of questions present in the import file.

Eccezione - Cannot access offset of type string on string

More information

Debug information: Error code: generalexceptionmessage Stack trace: line 958 of /question/format/xml/format.php: TypeError thrown line 1043 of /question/format/xml/format.php: call to qformat_xml->import_category() line 999 of /question/format/xml/format.php: call to qformat_xml->import_question() line 987 of /question/format/xml/format.php: call to qformat_xml->import_questions() line 351 of /question/format.php: call to qformat_xml->readquestions() line 121 of /question/import.php: call to qformat_default->importprocess()

Probable problem in moodle version?

Using line command for same code: python3 main.py code.py Traceback (most recent call last): File "/home/anto/moodle-trace-generator-main/main.py", line 216, in generate_code_question(quiz_root, code_parser, flow_parser, arg_code_file, image_gen, arg_input_dict, cfg) File "/home/anto/moodle-trace-generator-main/main.py", line 71, in generate_code_question image = image_generator.get_code_image(source_code) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/anto/moodle-trace-generator-main/imagecreator/image_generator.py", line 94, in get_code_image self._add_code_text(text_group, source) File "/home/anto/moodle-trace-generator-main/imagecreator/python_generator.py", line 66, in _add_code_text token_tspan = self._get_tspan_token(token_type, token) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/anto/moodle-trace-generator-main/imagecreator/python_generator.py", line 43, in _get_tspan_token raise Exception("token not supported {} {}".format(token, token_type)) Exception: token not supported Token.Text.Whitespace

what am I doing wrong?