-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Instructor: view results: fix IndexOutOfBoundsException #8415
Comments
I have several multiple-select, multiple-answers questions. In one, the options are generated based on the students in the class. In others, options are fixed. |
Need to fix quite soon as I need to access results of that session. |
Seems like there's a discrepancy between
This issue might even be related to the issue of response deletion (both may be due to inconsistencies in the view of questions stored in the datastore). Meanwhile, I've updated |
The hot fix seem to have fixed the issue. I can see the results now. In any case, we might need a test to cover this case. |
In this method, is there any reason why And does anyone know how to insert embedded code snippets into comments? |
Yes; that's what I was wondering too. The problematic question had an empty
https://help.github.com/articles/creating-a-permanent-link-to-a-code-snippet/ |
I think it's safe to use |
Likely a bug in the code related to generating options based on students in the team. |
In this method teammates/src/main/java/teammates/common/datatransfer/questions/FeedbackMsqQuestionDetails.java Lines 119 to 128 in a1e79ad
I'm quite baffled as msqChoices is set to empty then not populated back (not in generateOptionList as well) while numOfMsqChoices is set to the size of the generated list for courseId . Am I missing something here?
|
I believe you have found the bug! This was done in #7509 (specifically, this commit). @VamsiSangam was this intentional? This leads to a non-zero |
@whipermr5 Anyone working on this issue ? |
@Shashwat-Garg Don't think so. |
I'll try to do what's left. :) |
@Shashwat-Garg Investigate why the current code was written this way #8415 (comment), and whether this solution #8415 (comment) has any side effects. |
Here's what I found: The offending line for the Exception comes from the method Inside the private int numOfMsqChoices;
private List<String> msqChoices; When the MSQ's choices are generated from the instructors' input, both fields are assigned accordingly in this method: teammates/src/main/java/teammates/common/datatransfer/questions/FeedbackMsqQuestionDetails.java Lines 113 to 118 in cd9a536
However when MSQ's choices are generated from say students in the class, or teams, etc., teammates/src/main/java/teammates/common/datatransfer/questions/FeedbackMsqQuestionDetails.java Lines 120 to 134 in cd9a536
Hence when the instructor wants to view the result of a session which contains MSQ questions with generated options(2nd scenario above), the above lines will trigger the problem in the execution of the lines below, as @whipermr5 has identified and discussed in the comments in this thread. teammates/src/main/java/teammates/common/datatransfer/questions/FeedbackMsqQuestionDetails.java Lines 482 to 487 in cd9a536
In fact, for a question that has generated options, this additional information should not be generated, and the UI below should just be shown. This is why MCQ questions do not face such Exceptions because in MCQ, teammates/src/main/java/teammates/common/datatransfer/questions/FeedbackMcqQuestionDetails.java Lines 357 to 366 in cd9a536
This is also why MSQ with choices that the instructor created manually does not cause the exception, as there is no discrepancy between TLDR: |
Is there even a use case for storing |
Sorry for the late reply. As far as I remember, when the MSQ/MCQ question has its options generated from students/teams etc., we don't store the options in the But I wanted
As explained above, I believe they differ in the case where options are generated. I may be wrong though, my knowledge of Teammates is pretty outdated 😅 |
@VamsiSangam Thanks for the reply! We've moved the discussion to #8714. Am I right in saying that |
I'm getting this error when I try to view results of an ongoing session.
The text was updated successfully, but these errors were encountered: