- Timestamp:
- 24 Apr 2015, 10:07:26 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/batching.py
r12873 r12882 607 607 608 608 class CourseTicketProcessor(StudentProcessorBase): 609 """A batch processor for ICourseTicket objects. 609 """The Course Ticket Processor imports course tickets, the subobjects 610 of student study levels (= course lists). 611 612 An imported course ticket contains a copy of the original course data. 613 During import only a few attributes can be set/overwritten. 614 615 Like all other student data importers, this processor also requires 616 either `student_id`, `reg_number` or `matric_number` to find the student. 617 Then it needs `level` and `code` to localize the course ticket. 618 619 `checkConversion` first searches the courses catalog for the imported 620 `code` and ensures that a course with such a code really exists 621 in the academic section. It furthermore checks if `level_session` in 622 the row corresponds with the session of the parent student 623 study level object. It fails if one of the conditions is not met. 624 625 In create mode `fcode`, `dcode`, `title`, `credits`, `passmark` and 626 `semester` are taken from the course found in the academic section. 627 These attributes can nevermore be changed, neither via the user interface 628 nor by import. 610 629 """ 611 630 grok.implements(IBatchProcessor) … … 710 729 711 730 class StudentOnlinePaymentProcessor(StudentProcessorBase): 712 """A batch processor for IStudentOnlinePayment objects. 731 """The Course Ticket Processor imports student payment tickets. The 732 tickets are located in the ``payments`` subfolder of the student 733 container. The only additional locator is `p_id`, the object id. 734 735 The `checkConversion` method checks the format of the payment identifier. 736 In create mode it does also ensures that same p_id does not exist 737 elsewhere. It must be portal-wide unique. 738 739 When adding a payment ticket, the `addEntry` method checks if the same 740 payment has already been made. It compares `p_category` and `p_session` 741 in the row with the corresponding attributes of existing payment 742 tickets in state ``paid``. If they match, a `DuplicationError` is raised. 713 743 """ 714 744 grok.implements(IBatchProcessor) … … 782 812 p_id = row['p_id'].strip('#') 783 813 # Requirement added on 19/02/2015: same payment must not exist. 784 #if not None in (obj.p_category, obj.p_session):785 814 if self.samePaymentMade(student, obj.p_category, obj.p_session): 786 815 raise DuplicationError('Same payment has already been made.') … … 846 875 847 876 class StudentVerdictProcessor(StudentStudyCourseProcessor): 848 """A special batch processor for verdicts. 849 850 Import verdicts and perform workflow transitions. 877 """The Student Verdict Processor inherits from the Student Study 878 Course Processor. It's a pure updater. Import step 2 raises a warning 879 message if a datacenter manager tries to select another mode. 880 But it does more than only overwriting study course attributes. 881 882 The Student Verdict Processor is the only processor which cannot be 883 used for restoring data. Purpose is to announce a verdict at the end of 884 each academic session. The processor does not only import a verdict, 885 it also conditions the student data so that the student can pay for the 886 next session and proceed to the next study level. 887 888 The `checkUpdateRequirements` method ensures that the imported data 889 really correspond to the actual state of the student. 890 `current_level` and `current_session` in the row must be on par 891 with the attributes of the study course object. Thus, the processor 892 does not use these values to overwrite the attributes of the study course 893 but to control that the verdict is really meant for the current session of 894 the student. The verdict is only imported if a corresponding study level 895 object exists and the student is in the right registration state, 896 either ``courses validated`` or ``courses registered``. Course registration 897 can be bypassed by setting `bypass_validation` to ``True``. 898 899 The `updateEntry` method does not only update the current verdict of 900 the student study course, it also updates the matching student study 901 level object. It saves the current verdict as `level_verdict` and sets 902 the `validated_by` and `validation_date` attributes, whereas `validated_by` 903 is taken from the row of the import file and `validation_date` is set to the 904 actual UTC datetime. Finally, the student is moved to state ``returning``. 851 905 """ 852 906 … … 893 947 obj, vals_to_set, site, filename) 894 948 parent = self.getParent(row, site) 895 # Set current_ve dict in corresponding studylevel949 # Set current_verdict in corresponding studylevel 896 950 level_string = str(obj.current_level) 897 951 obj[level_string].level_verdict = row['current_verdict']
Note: See TracChangeset for help on using the changeset viewer.