Created
October 25, 2019 20:01
-
-
Save edo0xff/74ca88687edc3d999e0fb63022433f15 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
def calificacionParaSidiumPendejo(calf_obtenida, calf_total): | |
calf_obtenida = math.ceil(float(calf_obtenida)) | |
return math.ceil((calf_obtenida*100.0)/float(calf_total)) | |
def calificacionQueDeberiaSerAlv(regla_de_tres, porcentaje_asignado): | |
return (float(regla_de_tres)*float(porcentaje_asignado))/100.0 | |
def printCalfArray(array): | |
total = 0 | |
for criterio, calf, asignado in array: | |
total += calf | |
print " > %s:\t%s%% (%s%%)" %(criterio, calf, asignado) | |
return total | |
# ("NOMBRE", valor_asignado_en_sidium, total_reactivos) | |
criterios = ( | |
("EXAMEN", 40, ( | |
("EXAMEN PRACTICO", 20, 28), | |
("EXAMEN TEORICO", 20, 20) | |
)), | |
("PRACTICAS", 30, 600), | |
("TAREAS", 20, 400), | |
("EXPOSICION", 10, 1) | |
) | |
c = 1 | |
try: | |
while 1: | |
sidium = [] | |
real = [] | |
print "#%s" %(c) | |
print "+++++++" | |
c += 1 | |
for criterio, porcentaje_asignado, reactivos in criterios: | |
if type(reactivos) == int: | |
calf_obtenida = raw_input("%s (%s): " %(criterio, reactivos)) | |
sidium_calf = calificacionParaSidiumPendejo(calf_obtenida, reactivos) | |
else: | |
calf_obtenida = 0 | |
print "%s" %(criterio) | |
for sub_criterio, sub_porcentaje_asignado, sub_reactivos in reactivos: | |
sub_calf_obtenida = raw_input(" %s (%s): " %(sub_criterio, sub_reactivos)) | |
sub_calf = calificacionParaSidiumPendejo(sub_calf_obtenida, sub_reactivos) | |
sub_real = calificacionQueDeberiaSerAlv(sub_calf, sub_porcentaje_asignado) | |
calf_obtenida += sub_calf | |
print " -- %s%%" %(sub_real) | |
sidium_calf = calf_obtenida / len(reactivos) | |
real_calf = calificacionQueDeberiaSerAlv(sidium_calf, porcentaje_asignado) | |
sidium.append((criterio, sidium_calf, 100)) | |
real.append((criterio, real_calf, porcentaje_asignado)) | |
print "\nSIDIUMB" | |
print "=======" | |
printCalfArray(sidium) | |
print "\nCALIFICACION" | |
print "============" | |
t = printCalfArray(real) | |
print "\n FINAL: %s" %(t) | |
print "" | |
raw_input("Enter para continuar...") | |
except KeyboardInterrupt: | |
print "\n Bye xd" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment