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

XBlock Reporting: Display a popup after requesting a report #18244

Closed

Conversation

akovari
Copy link
Contributor

@akovari akovari commented May 22, 2018

This feature implements a popup for generating / downloading the xblock report. It will poll for the generation task status and after it's completed, it will show a button to download the report directly in the modal window.

Dependencies: https://github.com/edx/edx-platform/pull/18170

Screenshots:
screenshot-2018-5-21 instructor dashboard your platform name here

Sandbox URL: TBD - sandbox is being provisioned.

Merge deadline: None

Testing instructions:

  1. Make sure ENABLE_GRADE_DOWNLOADS is enabled in lms/djangoapps/instructor/settings/common.py
  2. Go to Instructor Dashboard -> Data Downloads
  3. In section "Select a problem to generate a CSV file that lists all student answers to the problem. You also select a section or chapter to include results of all problems in that section or chapter."
  • Pick a course block
  • Click "Create a report of problem responses"
  • Observe the modal window

Reviewers

  • xitij2000
  • edX reviewer[s] TBD

@openedx-webhooks
Copy link

Thanks for the pull request, @akovari! I've created OSPR-2433 to keep track of it in JIRA. JIRA is a place for product owners to prioritize feature reviews by the engineering development teams.

Feel free to add as much of the following information to the ticket:

  • supporting documentation
  • edx-code email threads
  • timeline information ("this must be merged by XX date", and why that is)
  • partner information ("this is a course on edx.org")
  • any other information that can help Product understand the context for the PR

All technical communication about the code itself will still be done via the GitHub pull request interface. As a reminder, our process documentation is here.

If you like, you can add yourself to the AUTHORS file for this repo, though that isn't required. Please see the CONTRIBUTING file for more information.

@openedx-webhooks openedx-webhooks added needs triage open-source-contribution PR author is not from Axim or 2U labels May 22, 2018
@@ -32,6 +32,7 @@ export default class Main extends React.Component {
<BlockBrowserContainer onSelectBlock={(blockId) => {
this.hideDropdown();
onSelectBlock(blockId);
blockIdChanged(blockId);
Copy link
Contributor

Choose a reason for hiding this comment

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

There is already a redux event for this, so prefer loose coupling and listen to that event instead.


export default combineReducers({
problemReport,
});
Copy link
Contributor

Choose a reason for hiding this comment

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

This reducer is doing nothing.

inProgress: action.inProgress,
succeeded: action.succeeded,
reportPath: action.reportPath
};
Copy link
Contributor

Choose a reason for hiding this comment

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

The success action here will not clear out the error message, you should add error: null or similar here.

reportPath: action.reportPath
};
case problemResponsesPopupActions.ERROR:
return {...state, error: action.error};
Copy link
Contributor

Choose a reason for hiding this comment

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

Like the above, this should clear out succeeded.

courseId: PropTypes.string.isRequired,
excludeBlockTypes: PropTypes.arrayOf(PropTypes.string).isRequired,
endpoint: PropTypes.string.isRequired
};
Copy link
Contributor

Choose a reason for hiding this comment

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

This isn't needed if you listen to the redux event.

} else if (this.props.message != null) {
msg = (
<div
className={`msg ${this.props.succeeded ? "msg-success" : "msg-warning"}`}>{this.props.message}</div>
Copy link
Contributor

Choose a reason for hiding this comment

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

Use the classnames library here.

{msg}
<p>
Once it's ready, you can view or download it using the buttons below. You can also close this popup
now, and download the report later, from the "Reports Available for Download" area below.
Copy link
Contributor

Choose a reason for hiding this comment

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

This needs to be translatable as well.

window.open(`/media/${this.props.reportPath}`, '_blank');
}

render() {
Copy link
Contributor

Choose a reason for hiding this comment

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

You can break this method down into getButtons, getBody, getProgress etc.

credentials: 'same-origin',
method: 'get',
headers: HEADERS
});
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't hardcode this URL either, pass it in like you did with "endpoint".

inProgress: PropTypes.bool.isRequired,
succeeded: PropTypes.bool.isRequired,
reportPath: PropTypes.string,
};
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be a static functional component.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@mduboseedx
Copy link
Contributor

@edx/educator-product Could you take a look at the UI and language for this PR? Thanks

@openedx-webhooks openedx-webhooks added product review PR requires product review before merging and removed needs triage labels May 22, 2018

export default combineReducers({
task,
});
Copy link
Contributor

Choose a reason for hiding this comment

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

You don't need this since there is a single reducer :-)

@akovari akovari force-pushed the adam/instructor_report_popup branch from 4e1bae4 to 3a5bf36 Compare May 30, 2018 18:11
@xitij2000
Copy link
Contributor

jenkins run all

@xitij2000 xitij2000 force-pushed the adam/instructor_report_popup branch 3 times, most recently from e63420e to 4dd91f0 Compare June 14, 2018 03:54
@xitij2000 xitij2000 force-pushed the adam/instructor_report_popup branch from 4dd91f0 to dcaa4ac Compare July 5, 2018 11:25
}/>
);

const buttons = (reportPath === null && !error)
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this be (reportPath !== null && !error) ? i.e. Doesn't reportPath get set once the report is available?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yup, sorry. I think I made an amended commit for this but forgot to push it.

@xitij2000 xitij2000 force-pushed the adam/instructor_report_popup branch from dcaa4ac to 900d73d Compare July 8, 2018 14:23
@xitij2000 xitij2000 force-pushed the adam/instructor_report_popup branch 4 times, most recently from 1c09600 to 65fcf58 Compare July 17, 2018 21:26
@xitij2000 xitij2000 force-pushed the adam/instructor_report_popup branch from 65fcf58 to f65bc4a Compare September 12, 2018 13:15
Co-authored-by: Adam Kovari <adam@opencraft.com>
Co-authored-by: Eugeny Kolpakov <eugeny.kolpakov@gmail.com>
Co-authored-by: Kshitij Sobti <kshitij@sobti.in>
@xitij2000 xitij2000 force-pushed the adam/instructor_report_popup branch from f65bc4a to b6dae78 Compare September 12, 2018 13:56
@xitij2000
Copy link
Contributor

jenkins run bokchoy

@edx-status-bot
Copy link

Your PR has finished running tests. The following contexts failed:

  • jenkins/js
  • jenkins/bokchoy

@xitij2000
Copy link
Contributor

@mduboseedx Just checking in to see if this could get a rough review of the UI and language (as you suggested above) so we can make any adjustments.

@mduboseedx
Copy link
Contributor

@xitij2000 I'm checking with product. Sorry for the delay here.

@marcotuts
Copy link
Contributor

Hello @xitij2000

Can I ask why this is implemented as a modal / pop-up instead of improving the task list / queue currently rendered at the bottom of the reports / certificates /emails page?

1.) My preference would be to make improvements to this management view for asynchronous reports / requests so that then the value would be rippled across multiple places. I'm not comfortable initially incorporating this modal / blocking approach for conveying report status.
2.) Another option would be to seek to incorporate improvements to edx-ace to build in a class of signals / notifications for reports that would eventually be displayed in a notifications tray. This is preferable for asynchronous actions / events, even more so than option #1, but it is also perhaps much further into the future than what is possible incrementally. today.

Look forward to your thoughts on this. In its current form, I don't think this is something we'd like to merge into the core experience.

@bradenmacdonald
Copy link
Contributor

bradenmacdonald commented Nov 8, 2018

@marcotuts Really quickly: the list at the bottom often has dozens and dozens of reports with long and confusing names (and small font), and it may include reports requested by other users. So it can be hard and slow to find the one you want in the list. By making this a popup that only shows the report you just requested, there's no work required to hunt and find your report in the list, check that it's ready, then download it. It's right in your face.

I think this makes it far, far easier to use from a user's perspective. I expect users would leave this open in a spare tab on their browser until they see that it's complete, so it wouldn't be "blocking" work anymore than leaving the report page open and continuously reviewing the list of reports would be.

Option 2 sounds great, but we don't have any budget to make either of those other things happen at this point.

@marcotuts
Copy link
Contributor

@bradenmacdonald - Is there a path to making that first report in the bottom grouped / rendered differently to show you "your reports" by default and have a toggle to view "all report"?

We could make that area far more useful for all users without hopefully introducing another modal UI pattern for the reports workflow. I can try to suggest / how we might visually bridge the gap between the new modal you are proposing and how that simplified view might look if incorporated into an updated "Reports Queue" area that improves on the current one.

Totally understood that option 2 isn't reasonable necessarily within the scope here.

@xitij2000
Copy link
Contributor

@marcotuts As @bradenmacdonald mentioned above, while this is a modal, it doesn't really block users from using another tab, or even just navigating away. Perhaps that is something that can be made even clearer in the language on the modal? Currently I think it's pretty clear that you can dismiss the popup and find the report later. Or perhaps the popup can not darken the background?

I don't think the user who requested the report is currently tracked, so a your-reports vs all-reports toggle would need a bigger change than is in scope here.

@marcotuts
Copy link
Contributor

As proposed I'm not comfortable adding this modal on top of the current patterns / views. I'm marking this closed and we can revisit other cleanups to this hopefully soon, but it sounds like not in scope for the current effort.

@marcotuts marcotuts closed this Nov 26, 2018
@bradenmacdonald
Copy link
Contributor

@marcotuts We had shown that modal to Shelby in March and she was fine with it, which is why we implemented it as shown. Hopefully the meetings and other process changes you've discussed with me and Gabriel can help avoid these sort of situations :/ Since at this point, we won't have any budget to follow up on this or re-implement it: is this report generation workflow UI something edX might be able to improve before the next named release?

@pomegranited pomegranited deleted the adam/instructor_report_popup branch January 14, 2019 05:21
@xitij2000
Copy link
Contributor

@marcotuts Sorry for the delay here, but I had an alternative proposal for the UI, which would be more inline rather than a popup. It would work as follows:

  • User clicks on generate report button
  • There is a spinner next to the button with text like "report is being generated"
  • When the report is generated, the spinner becomes a checkmark, and the text is replaced with a link to the report
  • The link just takes you to the reports list at the bottom of the page but highlights the report you wanted.
  • In case of an error, the error can also be displayed inline next to the generate report button.

Would a UI like the above fit in better?

@marcotuts
Copy link
Contributor

Ah, apologies for missing this. If we could avoid the use of the modal interrupt but provide improved visibility into the report's download progress that would be great. At a high level your proposal for changes @xitij2000 sounds great, and if that isn't too much effort to change that would be great! Let us know when this would be ready for engineering review, or if after review the changes you described prove to be much larger than expected. Thanks!

@marcotuts
Copy link
Contributor

Ah I can't reopen this branch as it was deleted, it looks like this would need to be separately reopened - @xitij2000 .

@xitij2000
Copy link
Contributor

I will create a new PR for this with the approach I outlined above.

@openedx-webhooks openedx-webhooks added rejected and removed product review PR requires product review before merging labels Jan 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
open-source-contribution PR author is not from Axim or 2U rejected
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants