(sql)
| 870 | |
| 871 | |
| 872 | def eval_hardness(sql): |
| 873 | count_comp1_ = count_component1(sql) |
| 874 | count_comp2_ = count_component2(sql) |
| 875 | count_others_ = count_others(sql) |
| 876 | |
| 877 | if count_comp1_ <= 1 and count_others_ == 0 and count_comp2_ == 0: |
| 878 | return "easy" |
| 879 | elif (count_others_ <= 2 and count_comp1_ <= 1 and count_comp2_ == 0) or \ |
| 880 | (count_comp1_ <= 2 and count_others_ < 2 and count_comp2_ == 0): |
| 881 | return "medium" |
| 882 | elif (count_others_ > 2 and count_comp1_ <= 2 and count_comp2_ == 0) or \ |
| 883 | (2 < count_comp1_ <= 3 and count_others_ <= 2 and count_comp2_ == 0) or \ |
| 884 | (count_comp1_ <= 1 and count_others_ == 0 and count_comp2_ <= 1): |
| 885 | return "hard" |
| 886 | else: |
| 887 | return "extra" |
| 888 | |
| 889 | |
| 890 | def get_hardness(idx): |
no test coverage detected