Esempio n. 1
0
    Answer_Type='1',
    Topic_Number='03020101',
    Variation='v2',
    Question=Question,
    ContributorMail="*****@*****.**",                           
    Correct_Answer_1=Corr_op,
    Wrong_Answer_1=wrong_op1,
    Wrong_Answer_2=wrong_op2,
    Wrong_Answer_3=wrong_op3,
    Solution_text=Solution
    )
    return database_dict
    value = int(input("Choose one option :"))
    if value==ra+1 :
            print("\n Right Option")
            print(">--------------------------------<")
            sol()
    elif value !=ra+1 and value<5 and value > 0:
            print("\n Wrong Option")
            print(">--------------------------------<")
            sol()
    else:
            print("Invalid Choice")
subtraction()
putInCsv(
                '03020101',
                10,
                subtraction,
                "v1_2"
                )
Esempio n. 2
0
    #check_answer(ans_key)
    generate_solution(var1, var2, object, name, variable, key)


#main()
def newMain():
    var1, var2, object, name, variable, key = generate_expression()
    question = print_expression(var1, var2, object, name, variable, key)
    option = generate_options()
    #print(option)
    c_ans, w_ans1, w_ans2, w_ans3 = print_option(option[0], option[1],
                                                 option[2], option[3], var1,
                                                 var2, variable)
    solution = generate_solution(var1, var2, object, name, variable, key)
    # print(solution)

    database_dict = database_fn(Answer_Type='text',
                                Topic_Number='030202',
                                Variation='v1',
                                Question=question,
                                Correct_Answer_1=c_ans,
                                Wrong_Answer_1=w_ans1,
                                Wrong_Answer_2=w_ans2,
                                Wrong_Answer_3=w_ans2,
                                ContributorMail='*****@*****.**',
                                Solution_text=solution)
    return database_dict


putInCsv('030202', 5, newMain, 'v1_3')
Esempio n. 3
0
            print(sol6())
        elif value != ra + 1 and value < 5 and value > 0:
            print("\nYour answer is incorrect!")
            print(">------------- SOLUTION --------------<")
            print(sol6())
        else:
            print("invalid choice")

    if x >= 0 and x <= 2:
        sol = sol5()

    elif x > 2 and x <= 5:
        sol = sol6()

    database_dict = database_fn(Question_Type='text',
                                Answer_Type='1',
                                Topic_Number='030102',
                                Variation=3,
                                Question=question,
                                Correct_Answer_1=o3,
                                Wrong_Answer_1=o1,
                                Wrong_Answer_2=o2,
                                Wrong_Answer_3=o4,
                                ContributorMail='*****@*****.**',
                                Solution_text=sol)
    return database_dict


#main_function()
putInCsv('030102', 20, main_function, 'v3_3')
Esempio n. 4
0
def sol():
    shape = "equal" if x == y else "different"
    answer = "Yes" if x == y else "No"
    return f"Since they are {shape} shapes, the correct answer is {answer}."


def main_function():
    changeGlobals()
    question = getQuestion()
    Correct_Answer_1 = getCorrectAnswer()
    Wrong_Answer_1, Wrong_Answer_2, Wrong_Answer_3 = getWrongAnswers()
    imagePath = generate_image()
    solution = sol()

    database_dict = database_fn(Answer_Type='text',
                                Topic_Number='030102',
                                Variation=5,
                                Question=question,
                                Correct_Answer_1=Correct_Answer_1,
                                Wrong_Answer_1=Wrong_Answer_1,
                                Wrong_Answer_2=Wrong_Answer_2,
                                Wrong_Answer_3=Wrong_Answer_3,
                                Question_IAV=imagePath,
                                ContributorMail='*****@*****.**',
                                Solution_text=solution)

    return database_dict


putInCsv('030102', 5, main_function, __file__)
Esempio n. 5
0
    wrong_op1 = op[sq[0]]
    Question = ques
    wrong_op2, wrong_op3 = op[sq[1]], op[sq[2]]
    database_dict = database_fn("text",
                                Answer_Type='1',
                                Topic_Number='03020101',
                                Variation='v3',
                                Question=Question,
                                ContributorMail="*****@*****.**",
                                Correct_Answer_1=Corr_op,
                                Wrong_Answer_1=wrong_op1,
                                Wrong_Answer_2=wrong_op2,
                                Wrong_Answer_3=wrong_op3,
                                Solution_text=Solution)
    return database_dict

    value = int(input("Choose one option: "))
    if value == ra + 1:
        print("\nRight option!")
        print(">---------------------------<")
        sol()
    elif value != ra + 1 and value < 5 and value > 0:
        print("\nWrong Option!")
        sol()
    else:
        print("Invalid Choice!")


multiplication()
putInCsv('03020101', 10, multiplication, "v1_3")
Esempio n. 6
0
    Question = ques
    wrong_op2, wrong_op3 = op[sq[1]], op[sq[2]]
    database_dict = database_fn("text",
                                Answer_Type='1',
                                Topic_Number='030101',
                                Variation='v1',
                                Question=Question,
                                ContributorMail="*****@*****.**",
                                Correct_Answer_1=Corr_op,
                                Wrong_Answer_1=wrong_op1,
                                Wrong_Answer_2=wrong_op2,
                                Wrong_Answer_3=wrong_op3,
                                Solution_text=Solution)
    return database_dict
    value = int(input("Choose one option : "))

    if value == ra + 1:
        print("\nright option")
        print(">--------------------------<")
        sol()
    elif value != ra + 1 and value < 5 and value > 0:
        print("\nwrong option")
        print(">--------------------------<")
        sol()
    else:
        print("invalid choice")


main()
putInCsv('030102', 20, main, "v1_1")
Esempio n. 7
0
    Question = ques
    wrong_op2, wrong_op3 = op[sq[1]], op[sq[2]]
    database_dict = database_fn("text",
                                Answer_Type='1',
                                Topic_Number='03020101',
                                Variation='v1',
                                Question=Question,
                                ContributorMail="*****@*****.**",
                                Correct_Answer_1=Corr_op,
                                Wrong_Answer_1=wrong_op1,
                                Wrong_Answer_2=wrong_op2,
                                Wrong_Answer_3=wrong_op3,
                                Solution_text=Solution)
    return database_dict
    value = int(input("Choose one option : "))

    if value == ra + 1:
        print("\nright option")
        print(">--------------------------<")
        sol()
    elif value != ra + 1 and value < 5 and value > 0:
        print("\nwrong option")
        print(">--------------------------<")
        sol()
    else:
        print("invalid choice")


division()
putInCsv('03020101', 10, division, "v1_4")
Esempio n. 8
0
                         ((r1 / a) * r10))) + ' litres of ' + i + ' ') + "\n"

        return sol

    if value == ra + 1:
        print("\nYour answer is Correct!")
        print(">------------- SOLUTION -------------<")
        print(sol())
    elif value != ra + 1 and value < 5 and value > 0:
        print("\nYour answer is incorrect!")
        print(">------------- SOLUTION --------------<")
        print(sol())
    else:
        print("invalid choice")

    database_dict = database_fn(Answer_Type='1',
                                Topic_Number='030203',
                                Variation='v3_12',
                                Question=question,
                                Correct_Answer_1=o3,
                                Wrong_Answer_1=o1,
                                Wrong_Answer_2=o2,
                                Wrong_Answer_3=o4,
                                ContributorMail='*****@*****.**',
                                Solution_text=sol())
    return database_dict


#main_function()
putInCsv('030203', 15, main_function, 'v3_12')
Esempio n. 9
0
File: v4_1.py Progetto: mkale42/coep
    cop = random.choice(eq)
    #print("Ques :If "+cop+", will it form an equation? - True or False ? \n")
    ques = "If " + cop + ", will it form an equation? - True or False ? \n"
    #print("1.True \n2.False")
    #val=int(input("\nChoose a option : "))
    if cop in eq:
        Solution = "If " + cop + ", it will not form an equation because in this situation the LHS will not be equal to RHS"
        Corr_op = "False"
        wrong_op1 = "True"
    #if cop in nteq:
    #Solution = cop+" will not form a equation because in this situation the LHS will not be equal to RHS"
    #Corr_op = "False"
    #wrong_op1="True"
    Question = ques
    wrong_op2, wrong_op3 = "", ""
    database_dict = database_fn("text",
                                Answer_Type='1',
                                Topic_Number='030101',
                                Variation=4,
                                Question=Question,
                                ContributorMail="*****@*****.**",
                                Correct_Answer_1=Corr_op,
                                Wrong_Answer_1=wrong_op1,
                                Wrong_Answer_2=wrong_op2,
                                Wrong_Answer_3=wrong_op3,
                                Solution_text=Solution)
    return database_dict


putInCsv('030101', 10, main, "v4_1")
Esempio n. 10
0
    else:
        question2(exp)


def main():
    e0, e1 = generate_expression()
    name, p, e, key = print_questions([e0, e1])
    correct_option = print_options([e0, e1])
    #take_input(correct_option)
    print_solution([e0, e1, name, p, e, key])

    database_dict = database_fn(Answer_Type='1',
                                Topic_Number='030202',
                                Variation='v1',
                                Question=Question,
                                Correct_Answer_1=Correct_op,
                                Wrong_Answer_1=Wrong_op1,
                                Wrong_Answer_2=Wrong_op2,
                                Wrong_Answer_3=Wrong_op3,
                                ContributorMail='*****@*****.**',
                                Solution_text=Solution)
    return database_dict


#if you want N questions in your csv file pass N as the value for Number of Iteraions
putInCsv(Topic_Number='030202',
         Number_Of_Iterations=10,
         Main_Function=main,
         Filename='v1_4')

main()
Esempio n. 11
0
            ans.append('AnCtB')
            coptstr += f'{A} is nearer to {C} than {B}'
            Coptions.remove(coptstr)
        elif (x - y < y):
            ans.append('BnCtA')
            coptstr += f'{B} is nearer to {C} than {A}'
            Coptions.remove(coptstr)


def main_function():
    changequestion()
    Question = getQuestion()
    Corr_op = getCorrOption()
    wrong_op1, wrong_op2, wrong_op3 = getWrongOptions()
    Solution = soln()

    database_dict = database_fn(Answer_Type='text',
                                Topic_Number='030102',
                                Variation=7,
                                Question=Question,
                                Correct_Answer_1=Corr_op,
                                Wrong_Answer_1=wrong_op1,
                                Wrong_Answer_2=wrong_op2,
                                Wrong_Answer_3=wrong_op3,
                                ContributorMail='*****@*****.**',
                                Solution_text=Solution)
    return database_dict


putInCsv('030102', 10, main_function, 'v7_1')
Esempio n. 12
0
        return sol

    if value == ra + 1:
        print("\nYour answer is Correct!")
        print("********** SOLUTION **********")
        sol()
    elif value != ra + 1 and value < 5 and value > 0:
        print("\nYour answer is incorrect!")
        print("********** SOLUTION **********")
        sol()
    else:
        print("invalid choice!..")

    database_dict = database_fn(Answer_Type='v3_15',
                                Topic_Number='030203',
                                Variation=7,
                                Question=question,
                                Correct_Answer_1=o3,
                                Wrong_Answer_1=o1,
                                Wrong_Answer_2=o2,
                                Wrong_Answer_3=o4,
                                ContributorMail='*****@*****.**',
                                Solution_text=sol())
    return database_dict


putInCsv(Topic_Number='030203',
         Number_Of_Iterations=18,
         Main_Function=main_function,
         Filename='v3_15')
Esempio n. 13
0
    return 'Solution'


#When this main_function runs 1 time it creates one Question and its solution
def main_function():

    Question = getQuestion()
    Corr_op = getCorrOption()
    wrong_op1, wrong_op2, wrong_op3 = getWrongOptions()
    Solution = getSolution()

    #this database_fn
    #for understanding the parameters used refer to the DST_Lot_2 Excel sheet shared in the Readme file
    #all the attributes mentioned in DST_lot_2 file are implemented in this function.
    database_dict = database_fn(Answer_Type='1',
                                Topic_Number='01010101',
                                Variation='v1',
                                Question=Question,
                                Correct_Answer_1=Corr_op,
                                Wrong_Answer_1=wrong_op1,
                                Wrong_Answer_2=wrong_op2,
                                Wrong_Answer_3=wrong_op3,
                                Solution_text=Solution)
    return database_dict


#if you want N questions in your csv file pass N as the value for Number of Iteraions
putInCsv(Topic_Number='01010101',
         Number_Of_Iterations=10,
         Main_Function=main_function,
         Filename=__file__)
Esempio n. 14
0
        Topic_Number='030101',
        Variation='v1',
        Question=Question,
        ContributorMail="*****@*****.**",                           
        Correct_Answer_1=Corr_op,
        Wrong_Answer_1=wrong_op1,
        Wrong_Answer_2=wrong_op2,
        Wrong_Answer_3=wrong_op3,
        Solution_text=Solution
        )
        return database_dict
        value = int(input("Choose one option : "))
            
        if value==ra+1:
            print("\nright option")
            print(">--------------------------<")
            sol()
        elif value!=ra+1 and value<5 and value>0:
            print("\nwrong option")
            print(">--------------------------<")
            sol()
        else :
            print("invalid choice")
main()
putInCsv(
                '030101',
                20,
                main,
                "v7_1"
                )
Esempio n. 15
0
        sol=sol+("<br/>Therefore, according to the question, LHS is equal to RHS")
        sol=sol+("<br/>Thus, "+ cop +" will form an equation")
        Solution = sol
        Corr_op = "True"
        wrong_op1="False"
    if cop in nteq:

        
        sol=("Since, we know that, an equation is defined as a mathematical statement consisting of two algebraic expressions having the same value")
        sol=sol+("<br/>So, in an equation there is always an '=' sign and the expression on the right hand side of the '=' sign is called the RHS.\nThe expression on the left hand side of the '=' sign is called the LHS.")
        sol=sol+("<br/>Therefore, according to the question, LHS is equal to RHS")
        sol=sol+("<br/>Thus, "+ cop +" will not form an equation")
        Solution = sol
        Corr_op = "False"
        wrong_op1="True"
    database_dict= database_fn(
    'text',
    Answer_Type='1',
    Topic_Number='030101',
    Variation=6,
    Question=ques_f,
    Correct_Answer_1=Corr_op,
    Wrong_Answer_1=wrong_op1,
    ContributorMail='*****@*****.**',
    Solution_text=Solution
    )
    return database_dict            


putInCsv('030101',10,main_function,'v6_1')
Esempio n. 16
0
def substraction():
    #x - 3 = 5,solve for x
    def hard():
        r1 = random.randint(2, 12)
        if r1 % 2 != 0:
            r1 = r1 + 1
        r2 = random.randint(4, 21)
        if r2 % 2 != 0:
            r2 = r2 + 1
        r3 = random.randint(0, 35)
        if r3 % 2 != 0:
            r3 = r3 + 1
        y = (r3 + r2)
        x = y / r1

        ques = "Solve for x, ", latex(
            str(r1) + "x - " + str(r2) + " = " + str(r3))
        op = [0, 0, 0, 0]
        sq = [0, 1, 2, 3]
        o1 = ((r3 - r2) / r1)
        o2 = (r2 + r3 - r1)
        o3 = x
        o4 = (r3 + r2) * r1
        ra = random.randint(0, 3)
        op[ra] = o3
        sq.remove(ra)
        op[sq[0]] = o1
        op[sq[1]] = o2
        op[sq[2]] = o4
        for i in range(1, 5):
            print(i, ". ", op[i - 1])

        def sol():
            sol = ("solution: \n")
            sol = sol + (latex(str(r1) + "x - " + str(r2) + " = " +
                               str(r3))) + "\n"
            sol = sol + str(
                latex(str(r1) + "x = " + str(r3) + " + " + str(r2)) +
                " (adding " + str(r2) + " to both sides)") + "\n"
            sol = sol + str(latex(str(r1) + "x = " + str(y))) + "\n"
            sol = sol + str(
                latex("x = " + to_frac(str(y), str(r1))) + " (dividing by " +
                str(r1) + " in both sides)") + "\n"
            sol = sol + str(latex("x = " + str(x))) + "\n"
            return sol

        solution = sol()
        Question = ques
        Corr_op = op[ra]
        wrong_op1, wrong_op2, wrong_op3 = op[sq[0]], op[sq[1]], op[sq[2]]
        Solution = solution
        database_dict = database_fn(
            "text",
            Answer_Type='1',
            Topic_Number='030203',
            Variation='v1',
            Question=Question,
            ContributorMail="*****@*****.**",
            Correct_Answer_1=Corr_op,
            Wrong_Answer_1=wrong_op1,
            Wrong_Answer_2=wrong_op2,
            Wrong_Answer_3=wrong_op3,
            Solution_text=solution)
        return database_dict
        #print(" option 1 : ","%.3f" % o1,"\n","option 2 : ",o2,"\n","option 3 : ",o3,"\n","option 4 : ",o4,"\n")

        value = int(input("Choose one option : "))

        if value == ra + 1:
            print("\nright option")
            print(">--------------------------<")
            sol()
        elif value != ra + 1 and value < 5 and value > 0:
            print("\nwrong option")
            print(">--------------------------<")
            sol()
        else:
            print("invalid choice")
        '''elif value==2:
            print("\nwrong option")
            print(">--------------------------<")
            sol()
        elif value==3:
             print("\nright option")
             print(">--------------------------<")
             sol()
        elif value==4:
             print("\nwrong option")
             print(">--------------------------<")
             sol()
        else :
            print("\nInvalid Choice")'''

    def easy():
        r1 = random.randint(2, 12)
        if r1 % 2 != 0:
            r1 = r1 + 1
        r2 = random.randint(4, 21)
        if r2 % 2 != 0:
            r2 = r2 + 1
        r3 = random.randint(21, 35)
        if r3 % 2 != 0:
            r3 = r3 + 1
        r1 = 2
        y = (r3 + r2)
        x = y / r1

        print("Ques: Solve for x, ", r1, "x - ", r2, " = ", r3)

        o1 = ((r3 - r2) / r1)
        o2 = (r2 + r3 - r1) * (-1)
        o3 = x
        o4 = (r3 + r2) * r1

        print(" option 1 : ", int(o1), "\n", "option 2 : ", int(o2), "\n",
              "option 3 : ", int(o3), "\n", "option 4 : ", int(o4), "\n")

        value = int(input("Choose one option : "))

        def sol():
            print("solution: \n")
            print(r1, "x - ", r2, " = ", r3)
            print(r1, "x = ", r3, " + ", r2, "(adding ", r2, " to both sides)")
            print(r1, "x = ", y)
            print("x = ", y, "/", r1, "(dividing by ", r1, " on both sides)")
            print("x = ", x)

        if value == 1:
            print("\nwrong option")
            print(">--------------------------<")
            sol()
        elif value == 2:
            print("\nwrong option")
            print(">--------------------------<")
            sol()
        elif value == 3:
            print("\nright option")
            print(">--------------------------<")
            sol()
        elif value == 4:
            print("\nwrong option")
            print(">--------------------------<")
            sol()
        else:
            print("\nInvalid Choice")

    print("1.easy")
    print("2.hard")
    ch = int(input("choose level:"))
    if ch == 1:
        easy()
    elif ch == 2:
        putInCsv('030203', 10, hard, "v1")
    else:
        print("invalid choice")
Esempio n. 17
0
    Question = ques
    wrong_op2, wrong_op3 = "", ""

    database_dict = database_fn("text",
                                Answer_Type='1',
                                Topic_Number='030203',
                                Variation='v2',
                                Question=Question,
                                ContributorMail="*****@*****.**",
                                Correct_Answer_1=Corr_op,
                                Wrong_Answer_1=wrong_op1,
                                Wrong_Answer_2=wrong_op2,
                                Wrong_Answer_3=wrong_op3,
                                Solution_text=Solution)
    return database_dict
    value = str(input("Enter Yes/No: "))  #input answer

    if (value.capitalize() == ans):
        print("\nRight answer!")
        print(">---------------------------<")
        sol()

    else:
        print("\nWrong answer!")
        print(">---------------------------<")
        sol()


multiplication()
putInCsv('030203', 10, multiplication, "v2_4")
Esempio n. 18
0
        opt_list.append(format_dict(dic))
    return opt_list


def main():
    rows = generate_table()
    Question, corr_op = print_questions(rows)
    options_str, optn = print_options(corr_op)
    Solution = print_solution(rows, corr_op)

    optn.remove(corr_op)
    correct_option_string = format_dict(corr_op)
    wop1, wop2, wop3 = get_formatted_options(optn)

    database_dict = database_fn(Answer_Type='1',
                                Topic_Number='030102',
                                Variation='v9',
                                Question=Question,
                                Correct_Answer_1=correct_option_string,
                                Wrong_Answer_1=wop1,
                                Wrong_Answer_2=wop2,
                                Wrong_Answer_3=wop3,
                                Solution_text=Solution)
    return database_dict


putInCsv(Topic_Number='030102',
         Number_Of_Iterations=15,
         Main_Function=main,
         Filename='v9_1')
Esempio n. 19
0
    Question = ques
    wrong_op2, wrong_op3 = "", ""
    database_dict = database_fn("text",
                                Answer_Type='1',
                                Topic_Number='030203',
                                Variation='v2',
                                Question=Question,
                                ContributorMail="*****@*****.**",
                                Correct_Answer_1=Corr_op,
                                Wrong_Answer_1=wrong_op1,
                                Wrong_Answer_2=wrong_op2,
                                Wrong_Answer_3=wrong_op3,
                                Solution_text=Solution)
    return database_dict

    value = str(input("Enter Yes/No: "))  #input answer

    if value.capitalize() == ans:
        print("\nRight option!")
        print(">---------------------------<")
        sol()

    else:
        print("\nWrong Option!")
        print(">---------------------------<")
        sol()


subtraction()
putInCsv('030203', 10, subtraction, "v2_2")