def give_mcq(course_id, quiz_id): curse=service.get_quiz_data(quiz_id) print("in app route") print(curse) data=curse['questions'] qno=0 global global_answer global_answer=None global_answer=ConcreteBasicGiveQuiz(curse['quiz_name']) print(global_answer.question_list) return render_template('OnlineClassroom/post_and_comment/give_mcq.html', **locals())
def next_mcq(quiz_id,qno,course_id,question): if request.method=="POST": answerdata = request.form curse = service.get_quiz_data(quiz_id) data=curse['questions'] qno=int(qno) qno+=1 print('answerdata') print(answerdata) answer=Answer(question,answerdata['radioName1']) global global_answer global_answer = ConcreteGiveCodiment(global_answer, answer) return render_template('OnlineClassroom/post_and_comment/give_mcq.html', **locals())
def quiz_result(quiz_id,course_id,question): if request.method=="POST": answerdata = request.form curse = service.get_quiz_data(quiz_id) data=curse['questions'] print('answerdata') print(answerdata) answer=Answer(question,answerdata['radioName1']) global global_answer global_answer = ConcreteGiveCodiment(global_answer, answer) list=global_answer.add_more_question() for answer in list: print(answer.get_question(),answer.get_answer()) score=calculate_score(data,list) return render_template('OnlineClassroom/post_and_comment/quiz_result.html',**locals())
def next_mcq(quiz_id, qno, course_id, question): if request.method == "POST": answerdata = request.form flag_is_answered = service.check_is_answer_selected(answerdata) if flag_is_answered == -1: flash("Please Choose an Option.") return redirect('/re_next_mcq/' + str(quiz_id) + '/' + str(qno) + '/' + str(course_id)) curse = service.get_quiz_data(quiz_id) data = curse['questions'] qno = int(qno) qno += 1 # print('answerdata') # print(answerdata) answer = Answer(question, answerdata['radioName1']) global global_answer global_answer = ConcreteGiveCodiment(global_answer, answer) return render_template('OnlineClassroom/post_and_comment/give_mcq.html', **locals())
def quiz_result(quiz_id, qno, course_id, question): if request.method == "POST": answerdata = request.form flag_is_answered = service.check_is_answer_selected(answerdata) if flag_is_answered == -1: flash("Please Choose an Option.") return redirect('/re_next_mcq/' + str(quiz_id) + '/' + str(qno) + '/' + str(course_id)) curse = service.get_quiz_data(quiz_id) data = curse['questions'] # print('answerdata') # print(answerdata) answer = Answer(question, answerdata['radioName1']) global global_answer global_answer = ConcreteGiveCodiment(global_answer, answer) list = global_answer.add_more_question() # for answer in list: # print(answer.get_question(),answer.get_answer()) score = calculate_score(data, list) return render_template('OnlineClassroom/post_and_comment/quiz_result.html', **locals())
def re_next_mcq(quiz_id, qno, course_id): curse = service.get_quiz_data(quiz_id) qno = int(qno) data = curse['questions'] return render_template('OnlineClassroom/post_and_comment/give_mcq.html', **locals())