Skip to content
This repository was archived by the owner on May 4, 2021. It is now read-only.

Commit 481e779

Browse files
authored
Merge pull request #75 from openstax/remove_duplicate_L_ids
Remove duplicate L_ids before calling SparfaAlgs
2 parents 2feda70 + d454cbf commit 481e779

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

sparfa_server/orm/models.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ def from_ecosystem_uuid_pages_responses(cls, ecosystem_uuid, pages, responses):
152152
} for page in page_dicts for exercise_uuid in page['exercise_uuids']]
153153

154154
algs, __ = SparfaAlgs.from_Ls_Qs_Cs_Hs_Rs(
155-
L_ids=[response['L_id'] for response in response_dicts],
155+
L_ids=list(set(response['L_id'] for response in response_dicts)),
156156
Q_ids=[hint['Q_id'] for hint in hints],
157157
C_ids=[page['uuid'] for page in page_dicts],
158158
hints=hints,
@@ -170,9 +170,11 @@ def from_ecosystem_uuid_pages_responses(cls, ecosystem_uuid, pages, responses):
170170
)
171171

172172
def to_sparfa_algs_with_student_uuids_responses(self, student_uuids, responses):
173+
L_ids = list(set(student_uuids))
174+
173175
G_NQxNL, G_mask_NQxNL = SparfaAlgs.convert_Rs(
174176
responses=self._response_dicts_for_algs_from_responses(responses),
175-
L_ids=student_uuids,
177+
L_ids=L_ids,
176178
Q_ids=self.Q_ids
177179
)
178180

@@ -184,7 +186,7 @@ def to_sparfa_algs_with_student_uuids_responses(self, student_uuids, responses):
184186
H_mask_NCxNQ=self.H_mask_NCxNQ,
185187
G_NQxNL=G_NQxNL,
186188
G_mask_NQxNL=G_mask_NQxNL,
187-
L_ids=student_uuids,
189+
L_ids=L_ids,
188190
Q_ids=self.Q_ids,
189191
C_ids=self.C_ids
190192
)

0 commit comments

Comments
 (0)