Automate AKTU AI Quiz
#todo GUI is ready, working perfectly fine
from tkinter import *
from functools import partial
def validateLogin(username, password):
print("username entered :", username.get())
print("password entered :", password.get())
user_name_aktu_prutor = username.get()
password_aktu_prutor = password.get()
# ::::::::::::: TODO AUTOMATING AI QUIZZES ::::::::::::
# todo schedule of quizzes
# 24-01-2022 17:00:00 26-01-2022 17:00:00 AI 7 # AI 7 ke button ka XPATH //*[@id="post-24"]/div[3]/a[7]
# 27-01-2022 17:00:00 29-01-2022 17:00:00 AI 8 # //*[@id="post-24"]/div[3]/a[8]
# 31-01-2022 17:00:00 02-02-2022 17:00:00 AI 9 # //*[@id="post-24"]/div[3]/a[9]
# 03-02-2022 17:00:00 05-02-2022 17:00:00 AI 10 # //*[@id="post-24"]/div[3]/a[10]
import datetime # for using time, like start an action at 13:00 etc..
import time # for adding wait time, like wait for 5sec now
import selenium # for launching a web page jaha sb automation hoga
import re, regex # for searching # yeah yeah.. we will get back to beautifulsoup as well, if needed
import os # for file related modification
import pyautogui # for automating the boring stuff #todo thank u.. Al Sweigart !!
from selenium import webdriver
import chromedriver_autoinstaller
from selenium.webdriver.chrome.service import Service
# todo check if assignment dene ka samay hua hai ya nahi
# getting time and date
current_date = datetime.datetime.now()
print(current_date)
# for e.g., it will be like, current_date = '2022-01-22 12:59:27.438300' #milli sec rhne dete hain
# implementing regex over it
current_date = datetime.datetime.now() # isme newline hai, islie regex direct laga paa rhe hain, nahi to pehle wo remove krna prta
print(current_date)
# for e.g., it will be like, current_date = 2022-01-22 12:59:27.438300, isko string me badalne ke liye
current_date = str(current_date)
# implementing regex over it
# getting date
dateRegex = re.compile(r'[-]\d\d\s') # ['-22 ']
timeRegex = re.compile(
r'\s\d+[:]\d+[:]\d+') # it will be like 130916 which means 13:09:16, hm log semicolon hata rahe hain, taaki time compare ho paaye
monthRegex = re.compile(r'[-]\d\d[-]') # ['-01-']
ymonth = monthRegex.findall(current_date)
our_month = ymonth[0] # -01-
original_string = our_month
characters_to_remove = "-"
new_string = original_string
for character in characters_to_remove:
new_string = new_string.replace(character, "")
our_month = int(new_string) # todo MONTH IS READY.....// like 01
ydate = dateRegex.findall(current_date)
our_date = ydate[0] # isme se -hatana hoga
our_date = int(our_date)
our_date = our_date * -1 # todo DATE IS READY.....// like 22
ytime = timeRegex.findall(current_date)
our_time = ytime[0] # removing semicolon from our_time
original_string = our_time
characters_to_remove = ":"
new_string = original_string
for character in characters_to_remove:
new_string = new_string.replace(character, "")
our_time = float(new_string) # todo TIME IS READY like 134533 // ab easily compare ho jayega time
chromedriver_autoinstaller.install()
driver = webdriver.Chrome(service=Service())
# -------------------------------------------------------------------- starting ..
# todo username of aktu prutor (basically the official college email address like [email protected])
# user_name_aktu_prutor =' [email protected]' #todo::: check line 9
# password_aktu_prutor = 'raman@GCET21'
url = "https://aktu.prutor.ai/"
driver.get(url)
time.sleep(3)
driver.find_element_by_xpath('//*[@id="header"]/div[2]/div/div[2]/ul/li[1]/a').click()
time.sleep(3)
# typing username
driver.find_element_by_xpath('//*[@id="user_login"]').click()
time.sleep(1)
pyautogui.write(user_name_aktu_prutor) # todo thank you al sweigart !
time.sleep(2)
# typing password
driver.find_element_by_xpath('//*[@id="user_pass"]').click()
time.sleep(1)
pyautogui.write(password_aktu_prutor)
time.sleep(2)
'''
# arre ye kar denge to agli bar thora gadbad ho jayega
# clicking remember me
driver.find_element_by_xpath('//*[@id="rememberme"]').click()
time.sleep (1)
'''
# clicking login
driver.find_element_by_xpath('//*[@id="wp-submit"]').click()
time.sleep(5)
# clicking on profile
driver.find_element_by_xpath('//*[@id="header"]/div[2]/div/div[2]/ul/li[1]/a/span').click()
time.sleep(5)
# clicking on all my quizzes
driver.find_element_by_xpath('//*[@id="post-24"]/div[2]/ul/li[3]/a').click()
time.sleep(5)
# checking assignment ka time hai ya nahi
# 24-01-2022 17:00:00 26-01-2022 17:00:00 AI 7 # AI 7 ke button ka XPATH //*[@id="post-24"]/div[3]/a[7]
# 27-01-2022 17:00:00 29-01-2022 17:00:00 AI 8 # //*[@id="post-24"]/div[3]/a[8]
# 31-01-2022 17:00:00 02-02-2022 17:00:00 AI 9 # //*[@id="post-24"]/div[3]/a[9]
# 03-02-2022 17:00:00 05-02-2022 17:00:00 AI 10 # //*[@id="post-24"]/div[3]/a[10]
todo:::::::::::::::::::::::::: ASSIGNMENT 7 below month is jan
if our_month == 1:
if our_date == 24:
if our_time >= 170010:
print('assignment 7 time!')
# clicking on assignment no 7
driver.find_element_by_xpath('//*[@id="post-24"]/div[3]/a[7]').click()
time.sleep(7)
# todo our code for selecting answers by XPATH of correct options
#option1
driver.find_element_by_xpath('//*[@id="Q007001"]/div[4]/label/span').click()
time.sleep(0.5)
#driver.find_element_by_xpath('').click()
driver.find_element_by_xpath('//*[@id="Q007002"]/div[2]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q007003"]/div[3]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q007004"]/div[4]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q007005"]/div[1]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q007006"]/div[4]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q007007"]/div[4]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q007008"]/div[1]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q007009"]/div[2]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q007010"]/div[4]/label/span').click()
time.sleep(0.5)
#submit button_abhi ke liye on kia hoon
driver.find_element_by_xpath('//*[@id="quiz-all"]/center/button').click()
time.sleep(0.5)
'''
driver.find_element_by_xpath('//*[@id="post-24"]/div[3]/a[7]').click()
driver.find_element_by_xpath('//*[@id="post-24"]/div[3]/a[7]').click()
driver.find_element_by_xpath('//*[@id="post-24"]/div[3]/a[7]').click()
driver.find_element_by_xpath('//*[@id="post-24"]/div[3]/a[7]').click()
driver.find_element_by_xpath('//*[@id="post-24"]/div[3]/a[7]').click()
driver.find_element_by_xpath('//*[@id="post-24"]/div[3]/a[7]').click()
driver.find_element_by_xpath('//*[@id="post-24"]/div[3]/a[7]').click()
driver.find_element_by_xpath('//*[@id="post-24"]/div[3]/a[7]').click()
driver.find_element_by_xpath('//*[@id="post-24"]/div[3]/a[7]').click()
driver.find_element_by_xpath('//*[@id="post-24"]/div[3]/a[7]').click()
'''
else:
print('kindly try later, please see assignment timings')
if our_date == 25:
print('assignment 7 time!')
# clicking on assignment no 7
driver.find_element_by_xpath('//*[@id="post-24"]/div[3]/a[7]').click()
time.sleep(7)
# todo our code for selecting answers by XPATH of correct options
# option1
driver.find_element_by_xpath('//*[@id="Q007001"]/div[4]/label/span').click()
time.sleep(0.5)
# driver.find_element_by_xpath('').click()
driver.find_element_by_xpath('//*[@id="Q007002"]/div[2]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q007003"]/div[3]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q007004"]/div[4]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q007005"]/div[1]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q007006"]/div[4]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q007007"]/div[4]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q007008"]/div[1]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q007009"]/div[2]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q007010"]/div[4]/label/span').click()
time.sleep(0.5)
# submit button_abhi ke liye on kia hoon
driver.find_element_by_xpath('//*[@id="quiz-all"]/center/button').click()
time.sleep(3.5)
if our_date == 26:
if our_time <= 165600:
print('assignment 7 time!')
# clicking on assignment no 7
driver.find_element_by_xpath('//*[@id="post-24"]/div[3]/a[7]').click()
time.sleep(7)
# todo our code for selecting answers by XPATH of correct options
# option1
driver.find_element_by_xpath('//*[@id="Q007001"]/div[4]/label/span').click()
time.sleep(0.5)
# driver.find_element_by_xpath('').click()
driver.find_element_by_xpath('//*[@id="Q007002"]/div[2]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q007003"]/div[3]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q007004"]/div[4]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q007005"]/div[1]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q007006"]/div[4]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q007007"]/div[4]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q007008"]/div[1]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q007009"]/div[2]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q007010"]/div[4]/label/span').click()
time.sleep(0.5)
# submit button_abhi ke liye on kia hoon
driver.find_element_by_xpath('//*[@id="quiz-all"]/center/button').click()
time.sleep(3.5)
else:
print('kindly try later, please see assignment timings')
todo:::::::::::::::::::::::::: ASSIGNMENT 8 below, month is jan
if our_month == 1:
if our_date == 27:
if our_time >= 170010:
print('assignment 8 time!')
# clicking on assignment no 8
driver.find_element_by_xpath('//*[@id="post-24"]/div[3]/a[8]').click()
time.sleep(7)
# todo our code for selecting answers by XPATH of correct options
# option1
driver.find_element_by_xpath('//*[@id="Q008001"]/div[1]/label/span').click()
time.sleep(0.5)
# driver.find_element_by_xpath('').click()
driver.find_element_by_xpath('//*[@id="Q008002"]/div[1]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q008003"]/div[2]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q008004"]/div[4]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q008005"]/div[2]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q008006"]/div[2]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q008007"]/div[3]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q008008"]/div[1]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q008009"]/div[1]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q008010"]/div[4]/label/span').click()
time.sleep(0.5)
# submit button_abhi ke liye on kia hoon
driver.find_element_by_xpath('//*[@id="quiz-all"]/center/button').click()
time.sleep(3.5)
else:
print('kindly try later, please see assignment timings')
if our_date == 28:
print('assignment 8 time!')
driver.find_element_by_xpath('//*[@id="post-24"]/div[3]/a[8]').click()
time.sleep(7)
# todo our code for selecting answers by XPATH of correct options
# option1
driver.find_element_by_xpath('//*[@id="Q008001"]/div[1]/label/span').click()
time.sleep(0.5)
# driver.find_element_by_xpath('').click()
driver.find_element_by_xpath('//*[@id="Q008002"]/div[1]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q008003"]/div[2]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q008004"]/div[4]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q008005"]/div[2]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q008006"]/div[2]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q008007"]/div[3]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q008008"]/div[1]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q008009"]/div[1]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q008010"]/div[4]/label/span').click()
time.sleep(0.5)
# submit button_abhi ke liye on kia hoon
driver.find_element_by_xpath('//*[@id="quiz-all"]/center/button').click()
time.sleep(3.5)
if our_date == 29:
if our_time <= 165600:
print('assignment 8 time!')
driver.find_element_by_xpath('//*[@id="post-24"]/div[3]/a[8]').click()
time.sleep(7)
# todo our code for selecting answers by XPATH of correct options
# option1
driver.find_element_by_xpath('//*[@id="Q008001"]/div[1]/label/span').click()
time.sleep(0.5)
# driver.find_element_by_xpath('').click()
driver.find_element_by_xpath('//*[@id="Q008002"]/div[1]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q008003"]/div[2]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q008004"]/div[4]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q008005"]/div[2]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q008006"]/div[2]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q008007"]/div[3]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q008008"]/div[1]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q008009"]/div[1]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q008010"]/div[4]/label/span').click()
time.sleep(0.5)
# submit button_abhi ke liye on kia hoon
driver.find_element_by_xpath('//*[@id="quiz-all"]/center/button').click()
time.sleep(3.5)
else:
print('kindly try later, please see assignment timings')
todo:::::::::::::::::::::::::: ASSIGNMENT 9-1st day below - month is jan
if our_month == 1:
if our_date == 29:
if our_time >= 170010:
print('assignment 9 time!')
# clicking on assignment no 9
driver.find_element_by_xpath('//*[@id="post-24"]/div[3]/a[9]').click()
time.sleep(7)
# todo our code for selecting answers by XPATH of correct options
# option1
driver.find_element_by_xpath('//*[@id="Q009001"]/div[1]/label/span').click()
time.sleep(0.5)
# driver.find_element_by_xpath('').click()
driver.find_element_by_xpath('//*[@id="Q009002"]/div[1]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q009003"]/div[3]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q009004"]/div[1]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q009005"]/div[2]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q009006"]/div[3]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q009007"]/div[1]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q009008"]/div[3]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q009009"]/div[3]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q009010"]/div[2]/label/span').click()
time.sleep(0.5)
# submit button_abhi ke liye on kia hoon
driver.find_element_by_xpath('//*[@id="quiz-all"]/center/button').click()
time.sleep(3.5)
else:
print('kindly try later, please see assignment timings')
todo:::::::::::::::::::::::::: ASSIGNMENT 9-remaining days below - month is feb
if our_month == 2:
if our_date == 1:
print('assignment 9 time!')
# clicking on assignment no 9
driver.find_element_by_xpath('//*[@id="post-24"]/div[3]/a[9]').click()
time.sleep(7)
# todo our code for selecting answers by XPATH of correct options
# option1
driver.find_element_by_xpath('//*[@id="Q009001"]/div[1]/label/span').click()
time.sleep(0.5)
# driver.find_element_by_xpath('').click()
driver.find_element_by_xpath('//*[@id="Q009002"]/div[1]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q009003"]/div[3]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q009004"]/div[1]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q009005"]/div[2]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q009006"]/div[3]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q009007"]/div[1]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q009008"]/div[3]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q009009"]/div[3]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q009010"]/div[2]/label/span').click()
time.sleep(0.5)
# submit button_abhi ke liye on kia hoon
driver.find_element_by_xpath('//*[@id="quiz-all"]/center/button').click()
time.sleep(3.5)
else:
print('kindly try later, please see assignment timings')
if our_month == 2:
if our_date == 2:
if our_time <= 165510:
print('assignment 9 time!')
# clicking on assignment no 9
driver.find_element_by_xpath('//*[@id="post-24"]/div[3]/a[9]').click()
time.sleep(7)
# todo our code for selecting answers by XPATH of correct options
# option1
driver.find_element_by_xpath('//*[@id="Q009001"]/div[1]/label/span').click()
time.sleep(0.5)
# driver.find_element_by_xpath('').click()
driver.find_element_by_xpath('//*[@id="Q009002"]/div[1]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q009003"]/div[3]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q009004"]/div[1]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q009005"]/div[2]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q009006"]/div[3]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q009007"]/div[1]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q009008"]/div[3]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q009009"]/div[3]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q009010"]/div[2]/label/span').click()
time.sleep(0.5)
# submit button_abhi ke liye on kia hoon
driver.find_element_by_xpath('//*[@id="quiz-all"]/center/button').click()
time.sleep(3.5)
else:
print('kindly try later, please see assignment timings')
todo:::::::::::::::::::::::::: ASSIGNMENT 10 below, month is feb
if our_month == 2:
if our_date == 3:
if our_time >= 170010:
print('assignment 10 time!')
# clicking on assignment no 8
driver.find_element_by_xpath('//*[@id="post-24"]/div[3]/a[10]').click()
time.sleep(7)
# todo our code for selecting answers by XPATH of correct options
# option1
driver.find_element_by_xpath('//*[@id="Q010001"]/div[4]/label/span').click()
time.sleep(0.5)
# driver.find_element_by_xpath('').click()
driver.find_element_by_xpath('//*[@id="Q010002"]/div[1]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q010003"]/div[4]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q010004"]/div[4]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q010005"]/div[2]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q010006"]/div[1]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q010007"]/div[1]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q010008"]/div[1]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q010009"]/div[3]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q010010"]/div[4]/label/span').click()
time.sleep(0.5)
# submit button_abhi ke liye on kia hoon
driver.find_element_by_xpath('//*[@id="quiz-all"]/center/button').click()
time.sleep(3.5)
else:
print('kindly try later, please see assignment timings')
if our_date == 4:
print('assignment 10 time!')
driver.find_element_by_xpath('//*[@id="post-24"]/div[3]/a[10]').click()
time.sleep(7)
# todo our code for selecting answers by XPATH of correct options
# option1
driver.find_element_by_xpath('//*[@id="Q010001"]/div[4]/label/span').click()
time.sleep(0.5)
# driver.find_element_by_xpath('').click()
driver.find_element_by_xpath('//*[@id="Q010002"]/div[1]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q010003"]/div[4]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q010004"]/div[4]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q010005"]/div[2]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q010006"]/div[1]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q010007"]/div[1]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q010008"]/div[1]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q010009"]/div[3]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q010010"]/div[4]/label/span').click()
time.sleep(0.5)
# submit button_abhi ke liye on kia hoon
driver.find_element_by_xpath('//*[@id="quiz-all"]/center/button').click()
time.sleep(3.5)
if our_date == 5:
if our_time <= 165600:
print('assignment 10 time!')
driver.find_element_by_xpath('//*[@id="post-24"]/div[3]/a[10]').click()
time.sleep(7)
# todo our code for selecting answers by XPATH of correct options
# option1
driver.find_element_by_xpath('//*[@id="Q010001"]/div[4]/label/span').click()
time.sleep(0.5)
# driver.find_element_by_xpath('').click()
driver.find_element_by_xpath('//*[@id="Q010002"]/div[1]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q010003"]/div[4]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q010004"]/div[4]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q010005"]/div[2]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q010006"]/div[1]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q010007"]/div[1]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q010008"]/div[1]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q010009"]/div[3]/label/span').click()
time.sleep(0.5)
driver.find_element_by_xpath('//*[@id="Q010010"]/div[4]/label/span').click()
time.sleep(0.5)
# submit button_abhi ke liye on kia hoon
driver.find_element_by_xpath('//*[@id="quiz-all"]/center/button').click()
time.sleep(3.5)
else:
print('kindly try later, please see assignment timings')
driver.close()
return
#window
tkWindow = Tk()
tkWindow.geometry('550x180')
tkWindow.title('auto-AI')
#username label and text entry box
usernameLabel0 = Label(tkWindow, text="Automate your AKTU AI Quizzes!").grid(row=0, column=2)
usernameLabel = Label(tkWindow, text="User Name ([email protected])").grid(row=1, column=1)
username = StringVar()
usernameEntry = Entry(tkWindow, textvariable=username).grid(row=1, column=2)
#password label and password entry box
passwordLabel = Label(tkWindow,text="Password (at aktu.prutor)").grid(row=2, column=1)
password = StringVar()
passwordEntry = Entry(tkWindow, textvariable=password, show='*').grid(row=2, column=2)
validateLogin = partial(validateLogin, username, password)
#login button
loginButton = Button(tkWindow, text="Start", command=validateLogin).grid(row=6, column=2)
usernameLabel002 = Label(tkWindow, text="Make sure Caps Lock is switched OFF .").grid(row=7, column=2)
usernameLabel00 = Label(tkWindow, text="dont click or press anywhere while app is running").grid(row=8, column=2)
usernameLabel003 = Label(tkWindow, text="Version 1.0.0 Valid for Jan-Feb 2022").grid(row=9, column=2)
usernameLabel004 = Label(tkWindow, text="press alt+ctrl+del to terminate app while running").grid(row=9, column=2)
tkWindow.mainloop()