Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question Level Student Statistics Table (Part 2: Attempt Count) #7084

Merged
merged 9 commits into from
Apr 4, 2024

Conversation

bivanalhar
Copy link
Contributor

@bivanalhar bivanalhar commented Feb 2, 2024

Background

As a continuation from the previous PR #7077 which implements the Marks per Question table, this PR focuses on implementing the table for Attempt Count.

This PR is related with the issue #4567

More Details

While Marks per Question table enlists the grades obtained by each student for each questions in an assessment, this table serves the number of attempts that each student has done for each questions. Practically, we want to see how many attempts student has tried for each question, and whether or not student finally is successful in attempting the question (by getting CORRECT verdict from our system)

This feature is aimed mainly for Autogradable questions (MCQ, MRQ, Programming, and some Text Response Question), in which student usually tries to submit the answer multiple times to see if their answers meet the criteria defined by the problem setter through test-cases (in case of Programming and Text Response) or are correct (for MCQ, MRQ). For other question types, we still display the number of attempts given (for the sake of consistency), however we give different colors for this kind of questions, to tell user that the question is not automatically graded by the system.

Table

Slightly different than the Marks per Question Table, here are the explanation for each cell's color box:

  • Green indicates that the attempt is successful (either the code gives pass verdict to 100% of the test cases or the answers are completely correct)
  • Red indicates that the attempt is unsuccessful (either the code gives pass verdict to partial or none of the test cases or the answers are not completely correct)
  • Gray indicates that the question is not autograded, and hence cannot tell if the attempt is successful or not by the system.
Screenshot 2024-02-03 at 12 22 29 AM

Performance Improvement

Within this PR, we also recognised that while going towards the Assessment Statistics Summary (table and chart), the waiting time is quite long (around 3-5 seconds). This problem was not yet visited in the previous PR, but then the problem exacerbated when we found that accessing this page while having the Attempt Count Table took almost 1 minute.

Upon investigation, we found out that the bottleneck is due to the performance of doing Preloading in Rails, which basically loads all the information from a specific model, including all the attributes that we don't use for displaying the statistics table.

For this reason, we decided to move out all the implementation for getting all Answer information (attempt count, marks in each question, etc.) into using SQL. This migration dramatically decreases the total rendering time into only around 2-3 seconds.

To-Do Next

Future Improvement

  • Modularise the API for assessment statistics so that each component has their own API call for fetching data from DB (in the vision that if the tab was first visited after quite long period of time, we can prompt the API to be called again, without needing to reload the whole table)

@bivanalhar bivanalhar force-pushed the bivan/teacher-statistics-attempt-count branch from d143200 to d63d6a8 Compare February 2, 2024 17:13
@ekowidianto ekowidianto changed the base branch from master to bivan/teacher-statistics-3 February 5, 2024 01:35
@bivanalhar bivanalhar force-pushed the bivan/teacher-statistics-attempt-count branch 3 times, most recently from cf78d0f to 82fc95c Compare February 7, 2024 03:37
@bivanalhar bivanalhar force-pushed the bivan/teacher-statistics-attempt-count branch from 82fc95c to d506041 Compare February 7, 2024 03:42
@bivanalhar bivanalhar force-pushed the bivan/teacher-statistics-attempt-count branch 2 times, most recently from 7e23d61 to f7643b4 Compare March 15, 2024 02:53
@bivanalhar bivanalhar force-pushed the bivan/teacher-statistics-3 branch 2 times, most recently from dab21cb to fe59d81 Compare March 27, 2024 02:00
Base automatically changed from bivan/teacher-statistics-3 to master April 1, 2024 04:11
@ekowidianto
Copy link
Member

@bivanalhar Can help to rebase this and all subsequent related PRs?

- modify redux to support marks per question
- change the flow of the pages
- combine ancestor info and marks per question into main statistics
- remove all unnecessary controllers
- use SQL to fetch all answers with all its relevant information
- autograded definition to be at least one question autogradable
- instead of sending group as list of names, now it's list of strings
@bivanalhar bivanalhar force-pushed the bivan/teacher-statistics-attempt-count branch 2 times, most recently from ca9bdb6 to 0313c8d Compare April 2, 2024 06:35
for performance efficiency while getting statistics
@bivanalhar bivanalhar force-pushed the bivan/teacher-statistics-attempt-count branch from 0313c8d to a6cf1cd Compare April 2, 2024 06:36
@bivanalhar
Copy link
Contributor Author

bivanalhar commented Apr 2, 2024

@bivanalhar Can help to rebase this and all subsequent related PRs?

@ekowidianto I have rebased this PR.. as for the subsequent related PR, I think better if the review of this PR is finished first, since if there is a change in this PR, I need to rebase it again later after you finished reviewing.

Copy link
Member

@ekowidianto ekowidianto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Add Legends to show what the colors mean for both Marks Per Question and Attempt Count Pages. As a user, I have no idea what green means when I see it.
  • I still see a lot of N+1 and it took >10 seconds for the page to load.

client/app/lib/components/core/BarChart.jsx Outdated Show resolved Hide resolved
- accessing attribute from null object should return null instead of throwing error
- remove memo from BarChart
- resolve n+1 problem in generating group's name
- adding legend to the colors used in statistics table
@bivanalhar
Copy link
Contributor Author

  • Add Legends to show what the colors mean for both Marks Per Question and Attempt Count Pages. As a user, I have no idea what green means when I see it.

Legends are added. I thought the term lowerGrade and higherGrade is sufficient to explain, but nevertheless I have put more explanation for those terms

  • I still see a lot of N+1 and it took >10 seconds for the page to load.

Apologies for the insight. I think this also got lost in the midst of rebasing, since I remembered previously I utilised the hash I have made for groups. I have reverted it back to using hash to retrieve groups name

@benleong
Copy link
Contributor

benleong commented Apr 3, 2024

" it took >10 seconds for the page to load."

When you see this during testing, you should know something is wrong. You need to do better.

@ekowidianto
Copy link
Member

ekowidianto commented Apr 3, 2024

Legends are added. I thought the term lowerGrade and higherGrade is sufficient to explain, but nevertheless I have put more explanation for those terms

What I mean is as a teacher (user) who goes to the page and view the colors, they would not know what the colors mean. I mentioned as a "user", not "developer" and I also said "legend" not "comments".

@bivanalhar
Copy link
Contributor Author

Legends are added. I thought the term lowerGrade and higherGrade is sufficient to explain, but nevertheless I have put more explanation for those terms

What I mean is as a teacher (user) who goes to the page and view the colors, they would not know what the colors mean. I mentioned as a "user", not "developer" and I also said "legend" not "comments".

apologies for the misunderstanding. I have created the reusable component so that user can add in Legends to the Table as well, and I have applied it to both Attempt Count and Marks per Question

@bivanalhar
Copy link
Contributor Author

" it took >10 seconds for the page to load."

When you see this during testing, you should know something is wrong. You need to do better.

Understand and well-noted, Prof. Actually I didn't catch this long-timing issue when I did the testing but it's because I used the course with not that many students inside (I used CS2109 instead of CS1010). This is entirely the mistake from my part and I promise I will use the course with most number of data in the future

@bivanalhar bivanalhar force-pushed the bivan/teacher-statistics-attempt-count branch from 064e905 to 4138a9c Compare April 3, 2024 10:09
@ekowidianto ekowidianto merged commit 8f857bf into master Apr 4, 2024
12 of 13 checks passed
@ekowidianto ekowidianto deleted the bivan/teacher-statistics-attempt-count branch April 4, 2024 01:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants