'Compares two lists of positions with flag rules. Order of
correct/user arguments is matter only in \'anyof\' flag.
Rules description:
\'exact\' means 1-1 ordered relationship::
[el1, el2, el3] is \'exact\' equal to [el5, el6, el7] when
el1 == el5, el2 == el6, el3 == el7.
Equality function is custom, see below.
\'anyof\' means subset relationship::
user = [el1, el2] is \'anyof\' equal to correct = [el1, el2, el3]
when
set(user) <= set(correct).
\'anyof\' is ordered relationship. It always checks if user
is subset of correct
Equality function is custom, see below.
Examples:
- many draggables per position:
user [\'1\', \'2\', \'2\', \'2\'] is \'anyof\' equal to [\'1\', \'2\', \'3\']
- draggables can be placed in any order:
user [\'1\', \'2\', \'3\', \'4\'] is \'anyof\' equal to [\'4\', \'2\', \'1\', 3\']
\'unordered_equal\' is same as \'exact\' but disregards on order
Equality functions:
Equality functon depends on type of element. They declared in
PositionsCompare class. For position like targets
ids ("t1", "t2", etc..) it is string equality function. For coordinate
positions ([1, 2] or [[1, 2], 15]) it is coordinate_positions_compare
function (see docstrings in PositionsCompare class)
Args:
correst, user: lists of positions
Returns: True if within rule lists are equal, otherwise False.'

def compare_positions(self, correct, user, flag):

    if (flag == 'exact'):
        if (len(correct) != len(user)):
            return False
        for (el1, el2) in zip(correct, user):
            if (PositionsCompare(el1) != PositionsCompare(el2)):
                return False
    if (flag == 'anyof'):
        for u_el in user:
            for c_el in correct:
                if (PositionsCompare(u_el) == PositionsCompare(c_el)):
                    break
            else:
                return False
    if (flag == 'unordered_equal'):
        if (len(correct) != len(user)):
            return False
        temp = correct[:]
        for u_el in user:
            for c_el in temp:
                if (PositionsCompare(u_el) == PositionsCompare(c_el)):
                    temp.remove(c_el)
                    break
            else:
                return False
    return True
