Closed gondas33 closed 4 years ago
Hello @an4rei
Thank you for spotting this issue and for providing a quick fix. The fix will be out in version 5.5.
Hello! after few tests I realized that $assignment_type_teacher_RET can give empty results with my added sql condition(STAFF_ID) as there might be a teacher_id which is new and doesn't have the assignment_type created under his id. if this query will return empty, the sql error will come from something like(duplicate inserts):
INSERT INTO "gradebook_assignments" INSERT INTO "gradebook_assignments" (ASSIGNMENT_ID,MARKING_PERIOD_ID,"title","points","default_points","description","assigned_date",ASSIGNMENT_TYPE_ID,STAFF_ID,COURSE_PERIOD_ID) values(nextval('GRADEBOOK_ASSIGNMENTS_SEQ'),'6','asda','100','22','asdaxaxa','2019-10-22','1','4','3');
Any ideas? or should I wait until 5.5 gets released.
Thanks!
Hello @an4rei
You are right, the $sql
build part was moved after the CP assignment type logic.
Hello! Just came across a bug:
The Mass Create Assignments doesn't care about the teacher_id when it gets the data to insert an assignment for a certain assignment category. Therefore if I have something like this:
(two different course periods for the same course but different teachers). Currently your code uses:
as you can see, there is no identification related to staff, so the two variables will contain whatever the SQL query gets first as result(the sql query will normaly output two results if the LIMIT wouldnt be there)
Therefore, it makes it impossible for me to mass create assignments for the second period, all will go to the first course_period_id
Easy fix with following: