-
Notifications
You must be signed in to change notification settings - Fork 60
Instructor Tool: Drop-down for "Root block ID" section, pagination improvements (OC-783) #47
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
Conversation
|
@e-kolpakov Please review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@itsjeyd beforeSend is probably ok to do such type of processing in general, but there's a 3rd party instance that uses problem builders and have global beforeSend adding csrf and authentication data to AJAX requests. So, since ajax call arguments take precedence of global config this would cause that global beforeSend skipped - as a result the requests would fail due to auth or csrf protection.
I might be wrong because I observed that about half a year from now, but judging by up-to-date code it should still behave like that. So I'm suggesting rewriting this block without using beforeSend or making sure global beforeSend is called.
Let me know if you need more info - can't speak openly here as we have a NDA with those 3rd party - and it's better safe than sorry in such case :)
|
@itsjeyd Instructor Tool is not editable: "Error: Unable to find view u'studio_view' on block InstructorToolBlockWithMixins ...". It just missing |
|
@itsjeyd I'm afraid I can't review anything here yet - I've got the following exception thrown right after I visit the module with Problem Builder and Instructor Tool. |
problem_builder/instructor_tool.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@itsjeyd crashes here with the traceback I've sent earlier. Works if replaced to block.scope_ids.usage_id
|
@itsjeyd actually I kind of sidestepped the issue and got it working, but not committing it since you'll need to verify it anyway. There are other issues though:
So, it is a bit inconsistent (should probably use Title or Question field, whichever is not empty) and includes XBlocks that are essentially answers, not questions |
|
@itsjeyd maybe it's something on my side, but it doesn't show me MRQ question answers at all. |
|
@e-kolpakov Thanks for your comments! I'll address them in separate comments.
It's not supposed to. Data export only works for MCQs ( |
|
@itsjeyd long block names break styling: |
|
@itsjeyd MRQ - ok, acknowledged. Custom choices in MCQ still shown in dropdown, so screeshot is more or less valid :) |
Could you let me know the steps that lead up to this error? Do you get this when you add an Instructor Tool block to a course in studio?
|
|
@itsjeyd if you click on "Edit" button for Instructor Tool it will display a popup message with exception. |
I can't reproduce this. If I change |
Thanks for these pointers. I tried extending |
|
@e-kolpakov Thanks again for your feedback. The latest commits should address all of your comments (I used both my own test course and the course you uploaded to JIRA to check). Please have another look at this PR :) |
results have been inserted into the DOM.
"question" attribute.
For example, ResultView should not manipulate the status area (but it should maintain meta info about result sets).
InstructorToolBlockWithMixins" error that gets thrown when trying to edit Instructor Tool blocks in Studio.
it works for non-eligible blocks with empty "Question title" (display_name).
This ensures that export results correctly reflect changes to answers associated with Long Answer blocks.
46dab9e to
51d02cf
Compare
|
@e-kolpakov Compatibility issues with latest changes from master have been fixed. Please review :) |
|
@itsjeyd Thanks for fixing it! Btw, now that I can review on the sandbox, I noticed a couple of issues with the questions titles:
Otherwise it looks really good, and seem to work well. Good job on this! |
if "question" attribute is not set to a meaningful value.
|
@antoviaque Thanks! :) I addressed your comments. CC @e-kolpakov |
|
@itsjeyd one last thing - looks like "Problem Type" malfunction slightly:
Probably it is caused by the fact that Rating questions inherit from MCQs. |
problem_builder/instructor_tool.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@itsjeyd nit: could be more concise and DRY:
for attribute in ('question', 'name', 'display_name'):
if getattr('block', attribute, None):
return getattr('block', attribute, None)
return get_block_id(block)
Not insisting on this though.
|
@itsjeyd and one more thing - it might make sense to add unit test coverage for all those issues found during the review. So far there's only one new integration test that tests happy-path (which is totally correct), but there're lots of minor things that went wrong, and CI build didn't catch them as there are no tests for them. |
|
@itsjeyd Thank you for fixing it! Looks much better on the sandbox now : ) |
|
@e-kolpakov Thanks for the review!
I was aware of this but I assumed it was a feature, not a bug :) -- the reason being that this is how "Problem types" worked from the beginning, and the task(s) said nothing about changing this behavior. (The only change I made as part of #45 was to turn "Problem types" from a multi-select into a dropdown.) So before I go ahead and work on this I'd like to just confirm with @antoviaque that the current behavior is buggy? |
|
@itsjeyd That's fine as is - I can see arguments going both ways, so we can leave as is, and address it later in a dedicated task if this proves to be a problem for the clients. |
|
@itsjeyd 👍 than |
Instructor Tool: Drop-down for "Root block ID" section, pagination improvements (OC-783)
previous PR (#47). The new tests check if: - preferred block attrs are used when building block tree for current course - block tree excludes pb-choice blocks - blocks are correctly marked as (in)eligible - new-style keys are handled correctly - student_view passes calls rendering method with correct template args - author_view and studio_view show appropriate messages
|
@itsjeyd FYI, this PR seems to be causing me trouble as I'm reviewing #57 for you. When I try to view my existing Instructor Tool block, it tries to load my existing results but fails - it just shows a spinner and hangs forever. The browser console shows an AJAX error because the Eventually I figured out why: I have an existing result in This is a pretty minor bug, and you likely don't need to fix it, but I wanted to record this here in case any one else runs into it. |





This PR improves UX for the "Instructor Tool" XBlock by introducing a dropdown menu for constraining the set of exported answers to a specific block in the course outline:
It also enables client-server communication for pagination functionality introduced in #45. This means that instead of transferring all results to the client when the export process finishes and paginating them there, at most
PAGE_SIZEitems (currently: 15) are transferred at a time. This is not a user-facing change (except for the fact that navigating between result pages takes a little bit longer now that the client has to communicate with the server to obtain more data).Testing
From Studio:
pb-instructor-toolto advanced modules.From the LMS: