|
1 | 1 | # import necessary packages |
2 | | -from .buggy_code_checker import * |
3 | | -from .get_personalized_solution import * |
4 | | -from .evaluate_fixed_code import * |
5 | | -from .generate_parsons_blocks import * |
6 | | -from .personalize_parsons import * |
7 | | -from .token_compare import * |
8 | | -from .get_parsons_code_distractors import * |
| 2 | +from .buggy_code_checker import student_code_checker |
| 3 | +from .evaluate_fixed_code import ( |
| 4 | + clean_student_code, |
| 5 | + code_distractor_unittest_evaluation, |
| 6 | + unittest_evaluation, |
| 7 | +) |
| 8 | +from .generate_parsons_blocks import generate_Parsons_block |
| 9 | +from .get_parsons_code_distractors import generate_code_with_distrator |
| 10 | +from .get_personalized_solution import get_example_solution, get_fixed_code |
| 11 | +from .personalize_parsons import compare_code, personalize_Parsons_block |
| 12 | +from .token_compare import code_similarity_score |
9 | 13 |
|
10 | 14 |
|
11 | 15 | def get_parsons_help(api_token, language, dict_buggy_code, personalize_level): |
@@ -149,7 +153,7 @@ def request_fixed_code_from_openai( |
149 | 153 | if not unittest_result: |
150 | 154 | return example_solution.lstrip(), "example_solution" |
151 | 155 |
|
152 | | - if unittest_result == True: |
| 156 | + if unittest_result: |
153 | 157 | similarity_personalized = code_similarity_score( |
154 | 158 | cleaned_buggy_code, cleaned_fixed_code, language |
155 | 159 | ) |
@@ -248,7 +252,7 @@ def generate_personalized_fixed_code( |
248 | 252 | default_test_code, |
249 | 253 | unittest_case=unittest_code, |
250 | 254 | ) |
251 | | - if unittest_result != True: |
| 255 | + if not unittest_result: |
252 | 256 | # If the code is not correct, we will TRY to get an example solution first |
253 | 257 | example_solution = generate_example_solution( |
254 | 258 | api_token, |
@@ -358,7 +362,7 @@ def generate_multi_personalized_Parsons_blocks( |
358 | 362 | unittest_code, |
359 | 363 | ) |
360 | 364 | # If the code with distractors passes the unittest, we will remove the distractor from the distractors list |
361 | | - if unittest_flag == True: |
| 365 | + if unittest_flag: |
362 | 366 | distractors.pop(distractor_correct_line) |
363 | 367 |
|
364 | 368 | if Parsons_type == "Correct": |
|
0 commit comments