Skip to content

Commit

Permalink
Merge pull request #107 from OxfordRSE/fix-complete-tick-on-duplicate…
Browse files Browse the repository at this point in the history
…-events

Prevent problems with same tag being erroneuously ticked off with filter for section
  • Loading branch information
martinjrobins authored Nov 16, 2023
2 parents 661a824 + c5b9d12 commit 5d37c62
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion components/EventProblems.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const EventProblems: React.FC<Props> = ({ material, event }) => {
if (filteredProblems) {userProblems[user.userEmail] = filteredProblems;}
});


return (
<Table className='border dark:border-gray-700'>
<Table.Head>
Expand Down Expand Up @@ -85,7 +86,7 @@ const EventProblems: React.FC<Props> = ({ material, event }) => {
)}
</Table.Cell>
{ students?.map((user, i) => {
const problemStruct = userProblems[user.userEmail].find((p) => p.tag === problem)
const problemStruct = userProblems[user.userEmail].find((p) => p.tag === problem && p.section === eventItem.section)
const problemStr = `difficulty: ${problemStruct?.difficulty} notes: ${problemStruct?.notes}`
return (
<Table.Cell key={`${user.userEmail}-${problem}-${eventItem.section}-${problem}`} align='center' className="whitespace-nowrap font-medium text-gray-900 dark:text-white p-0">
Expand Down

0 comments on commit 5d37c62

Please sign in to comment.