Exemplo n.º 1
0
    def getCaptcha(self):
        vecA = matrices.randMatrix(self.dim, 1, min=0, max=5)
        vecB = matrices.randMatrix(1, self.dim, min=0, max=5)

        symbolic = vecA * vecB
        crnum = random.choice(range(0, self.dim))
        
        result = symbolic[:,crnum]
        symbolic[:,crnum] = sympy.symbols(['a','b','c'])
        
        return (VecMulChallenge(vecA, vecB, symbolic, desc="Enter the missing column"),
                VectorResponse(result))
Exemplo n.º 2
0
 def getCaptcha(self):
     matrix = matrices.randMatrix(self.dim, self.dim, min=-3, max=3)
     result = matrix.det()
     return (DetMatrixChallenge(matrix), IntegerResponse(result))