        self.main.instructorEmail = 'manw@mtu.edu'
        self.answerFileDir = self.answerFile[:self.answerFile.rfind('/')]
        self.destineFile = self.answerFileDir+'/answer.gpg'
        batcmd = 'which gpg'
        if os.system(batcmd, shell=True) == 0:
            while os.path.isfile(self.destineFile):
                reply = QMessageBox.critical(self.main, '', "The file 'answer.gpg' \
                already exists. Would you like to replace it?", QMessageBox.Yes|QMessageBox.No)
                if reply == QMessageBox.No:
                    answerFilename = raw_input('Please input a new file name:')
                    self.destineFile = self.answerFileDir+'/'+answerFilename
                    print self.destineFile
                else:
                    subprocess.call('rm '+self.destineFile, shell=True)
                    break
            encryptCommand = 'gpg --output '+self.destineFile+' --encrypt --recipient '+self.main.instructorEmail+' '+self.answerFile
            if subprocess.call(encryptCommand, shell=True) == 0:
                print 'encrypted'
                command = 'gpg --output answer --decrypt ./policies/quiz/answer.gpg'
                if subprocess.call(command, shell=True) == 0:
                    print 'decrypted in encrypt'





        batcmd = 'which gpg'
        if subprocess.call(batcmd, shell=True) == 0:
            nameOnly = self.destineFile[self.destineFile.rfind('/')+1:self.destineFile.rfind('.')]
            print nameOnly
            #command = 'gpg --output '+nameOnly+' --decrypt '+self.destineFile
            command = 'gpg --output a --decrypt '+self.destineFile
            if subprocess.call(command, shell=True) == 0:
                print 'decrypted'
                QMessageBox.critical(self.main, '', "The decrypted file has been stored as '"+nameOnly+"'.")