31 lines
756 B
Python
31 lines
756 B
Python
#!/usr/bin/env python
|
|
# encoding: utf-8
|
|
|
|
from recopytex.database.filesystem.loader import CSVLoader
|
|
from recopytex.lib.dataframe import column_values_to_column
|
|
|
|
LOADER = CSVLoader("./test_config.yml")
|
|
|
|
|
|
def get_tribes():
|
|
return LOADER.get_tribes()
|
|
|
|
|
|
def get_exams(tribe):
|
|
return LOADER.get_exams([tribe])
|
|
|
|
|
|
def get_record_scores(exam):
|
|
return LOADER.get_exam_scores(exam)
|
|
|
|
|
|
def get_unstack_scores(exam):
|
|
flat_scores = LOADER.get_exam_scores(exam)
|
|
kept_columns = [col for col in LOADER.score_columns if col != "score"]
|
|
return column_values_to_column(flat_scores, "student_name", "score", kept_columns)
|
|
|
|
|
|
def get_students_from_exam(exam):
|
|
flat_scores = LOADER.get_exam_scores(exam)
|
|
return flat_scores["student_name"].unique()
|