from django.core.exceptions import ValidationError from django.core.urlresolvers import reverse from django.db import transaction from django.http import HttpResponseRedirect from django.utils.translation import ugettext as _ from django.views.decorators.http import require_http_methods from openpyxl import load_workbook from assessments.business import score_encoding_list from assessments.business.score_encoding_export import HEADER from assessments.forms.score_file import ScoreFileForm from attribution import models as mdl_attr from base import models as mdl from base.models.enums import exam_enrollment_justification_type as justification_types col_academic_year = HEADER.index('Academic year') col_session = HEADER.index('Session') col_learning_unit = HEADER.index('Learning unit') col_offer = HEADER.index('Program') col_registration_id = HEADER.index('Registration number') col_email = HEADER.index('Email') col_score = HEADER.index('Numbered scores') col_justification = HEADER.index('Justification (A,T)') REGISTRATION_ID_LENGTH = 8 AUTHORIZED_JUSTIFICATION_ALIASES = { 'T': justification_types.CHEATING, 'A': justification_types.ABSENCE_UNJUSTIFIED }
from django.core.exceptions import ValidationError from django.core.urlresolvers import reverse from django.db import transaction from django.http import HttpResponseRedirect from django.utils.translation import ugettext as _ from django.views.decorators.http import require_http_methods from openpyxl import load_workbook from assessments.business import score_encoding_list from assessments.business.score_encoding_export import HEADER from assessments.forms.score_file import ScoreFileForm from attribution import models as mdl_attr from base import models as mdl from base.models.enums import exam_enrollment_justification_type as justification_types col_academic_year = HEADER.index('academic_year') col_session = HEADER.index('session_title') col_learning_unit = HEADER.index('learning_unit') col_offer = HEADER.index('program') col_registration_id = HEADER.index('registration_number') col_email = HEADER.index('email') col_score = HEADER.index('numbered_score') col_justification = HEADER.index('justification') REGISTRATION_ID_LENGTH = 8 AUTHORIZED_JUSTIFICATION_ALIASES = { 'T': justification_types.CHEATING, 'A': justification_types.ABSENCE_UNJUSTIFIED }
from django.core.exceptions import ValidationError from django.core.urlresolvers import reverse from django.db import transaction from django.http import HttpResponseRedirect from django.utils.translation import ugettext as _ from django.views.decorators.http import require_http_methods from openpyxl import load_workbook from assessments.business import score_encoding_list from assessments.business.score_encoding_export import HEADER from assessments.forms.score_file import ScoreFileForm from attribution import models as mdl_attr from base import models as mdl from base.models.enums import exam_enrollment_justification_type as justification_types col_academic_year = HEADER.index('academic_year') col_session = HEADER.index('Session derogation') col_learning_unit = HEADER.index('Learning unit') col_offer = HEADER.index('program') col_registration_id = HEADER.index('registration_number') col_email = HEADER.index('email') col_score = HEADER.index('Numbered scores') col_justification = HEADER.index('justification') REGISTRATION_ID_LENGTH = 8 AUTHORIZED_JUSTIFICATION_ALIASES = { 'T': justification_types.CHEATING, 'A': justification_types.ABSENCE_UNJUSTIFIED }
def test_header_not_changed(self): from assessments.business.score_encoding_export import HEADER self.assertEqual(HEADER.index('academic_year'), 0) self.assertEqual(HEADER.index('session_title'), 1) self.assertEqual(HEADER.index('learning_unit'), 2) self.assertEqual(HEADER.index('program'), 3) self.assertEqual(HEADER.index('registration_number'), 4) self.assertEqual(HEADER.index('lastname'), 5) self.assertEqual(HEADER.index('firstname'), 6) self.assertEqual(HEADER.index('email'), 7) self.assertEqual(HEADER.index('numbered_score'), 8) self.assertEqual(HEADER.index('justification'), 9) self.assertEqual(HEADER.index('end_date'), 10)