<jupyter_start><jupyter_text>This is a Google Colab implementation of [NITC-DSS-Automatic-Teacher-Evaluation](https://github.com/afeedh/NITC-DSS-Automatic-Teacher-Evaluation) by [<NAME>](https://github.com/afeedh)Please contact me if you face any problem: <EMAIL>You can run each cell by pressing shift + enter.**NOTE: None of your details are stored.**---**Run the below cell first to install neccessary packages.**<jupyter_code>!apt update
!apt install chromium-chromedriver
!pip install selenium
from selenium import webdriver
options = webdriver.ChromeOptions()
options.add_argument('--headless')
options.add_argument('--no-sandbox')
options.add_argument('--disable-dev-shm-usage')<jupyter_output><empty_output><jupyter_text>**After the installation is complete, run the below cell and give the inputs as asked.**<jupyter_code>from selenium.webdriver.common.keys import Keys
import time
import sys


class dss_bot:
    def __init__(self, username, password):
        self.username = username
        self.password = password
        self.bot = webdriver.Chrome(options=options)


    def login(self):
        bot = self.bot
        bot.get('http://dss.nitc.ac.in/nitcreg/RegLogin.aspx')
        email = bot.find_element_by_id('txtuname')
        password = bot.find_element_by_id('txtpassword')
        email.clear()
        password.clear()
        email.send_keys(self.username)
        password.send_keys(self.password)
        password.send_keys(Keys.RETURN)
    def not_a_number(grade):
      if grade not in [1,2,3,4,5]:
        grade = int(input("Enter only one number from 1 to 5: "))
        grade = not_a_number(grade)
      else: return grade

    def do_stuff(self):
        bot = self.bot
        bot.get('http://dss.nitc.ac.in/nitcreg/tlogin.aspx')
        html= bot.find_element_by_xpath(".//html")

        if ('completed' in html.text):
            print("You've already completed the teacher evaluation")
            sys.exit()
            
        selects = bot.find_elements_by_id('ddlcourse')
        for select in selects:
            options = [x for x in select.find_elements_by_tag_name("option")]
        print("Total number of subjects:",len(options))
        print("Type number: \n1 for Excellent, \n2 for very good,\n3 for good, \n4 for fair, \n5 for poor\n")
        while(len(options) > 0):
          try:
            bot.find_element_by_id('Button3').click()
            alert = bot.switch_to.alert
            alert.accept()
            select_box = bot.find_element_by_id('ddlteacher')
            options = [x for x in select_box.find_elements_by_tag_name("option")]
            for element in options:
                print ("\nTeacher name:",element.text)
                grade = int(input("Enter rating: "))
                if(grade not in [1,2,3,4,5]):
                  grade = not_a_number(grade) 
                rating = {1:'Excellent',2:'Very Good',3:'Good',4:'Fair',5:'Poor'}
            bot.find_element_by_id('Button1').click()
            selects = bot.find_elements_by_tag_name('select')
            for select in selects:
                options = [x for x in select.find_elements_by_tag_name("option")]
                for option in options:
                    if (option.text == rating[grade]):
                        option.click()
                    elif(option.text == '90'):
                        option.click()
                    elif(option.text == 'Yes'):
                        option.click() 
                   
            bot.find_element_by_id('Button1').click()
          except:
            print('\nEvaluation complete.')
            break



username = input("Enter your username:")
print("\n")
password = input("Enter your password:")
print("\n")
x = dss_bot(username,password) 
x.login()
x.do_stuff()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1219832109129066, 'fraction_numerical': 0.007345225603357817, 'mean_word_length': 2.4506787330316744, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 12, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '95536', 'license': 'MIT', 'n_tokens_mistral': 1176, 'n_tokens_neox': 1112, 'n_words': 255, 'path': 'DSS_NITC_Teacher_Evaluation.ipynb', 'repo_name': 'lokeshtarala/NITC_DSS_Automated_Teacher_Evaluation', 'size': '3833'}