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

Make course dashboard more robust against bad courses (eg ErrorDescriptor) #399

Closed
wants to merge 3 commits into from

Conversation

ichuang
Copy link
Contributor

@ichuang ichuang commented Jul 14, 2013

Currently, when bad course data is loaded, producing an ErrorDescriptor, this crashes the course dashboard, because the dashboard views assumes the course descriptor has valid methods like has_ended() and attributes like course.current_test_center_exam.

This PR modifies student.views and dashboard.html to not crash on bad courses.

%>




Copy link
Contributor

Choose a reason for hiding this comment

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

dead whitespace

@ichuang
Copy link
Contributor Author

ichuang commented Jul 16, 2013

Great idea to show staff the error message; changed code to do this.

I prefer not to use an isinstance(course, ErrorDescriptor) test, because this would need to import error_module. The dashboard html file is already importing too much python IMHO. All the crufty logic about certificates really doesn't belong in this file.

@chrisndodge
Copy link
Contributor

Hi Ike,

I most likely have to work in this code soon. I was originally thinking that in the views.py, you could enumerate through the course array and filter out the ErrorDescriptors into a separate array, pass it into the .html template rendering, and then have a separate enumerator in the .html to display all the error'ed courses (say at the bottom) for is_staff people. That would help keep the .html template cleaner (don't need all that conditional logic in the template).

So, if you want, I can implement these protections as part of the work I need to do on the Dashboard.

It's up to you. Let me know what you want to do.

@singingwolfboy
Copy link
Contributor

@ichuang @chrisndodge What's the status of this pull request?

@ichuang
Copy link
Contributor Author

ichuang commented Aug 7, 2013

It's in production at MIT, but I gather not merged in or used by edX. It's
been quite helpful to a bunch of our courses, who have to import tar.gz
files, since they need , and other advanced
x-modules, which are not supported by Studio.

On Wed, Aug 7, 2013 at 4:30 PM, David Baumgold notifications@github.comwrote:

@ichuang https://github.com/ichuang @chrisndodgehttps://github.com/chrisndodgeWhat's the status of this pull request?


Reply to this email directly or view it on GitHubhttps://github.com/edx/edx-platform/pull/399#issuecomment-22281492
.

@chrisndodge
Copy link
Contributor

@singingwolfboy I'll get back to this PR.

course_target = reverse('info', args=[course.id])
try:
course_target = reverse('info', args=[course.id])
except Exception as err:
Copy link
Contributor

Choose a reason for hiding this comment

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

Might it be possible to use isinstance(ErrorDescriptor) to test if a given module is an error module rather than seeing if the reverse() blows up?

@chrisndodge
Copy link
Contributor

@ichuang can I take a pass on this branch and alter a few things?

@ichuang
Copy link
Contributor Author

ichuang commented Aug 8, 2013

absolutely - go for it.

On Thu, Aug 8, 2013 at 9:59 AM, chrisndodge notifications@github.comwrote:

@ichuang https://github.com/ichuang can I take a pass on this branch
and alter a few things?


Reply to this email directly or view it on GitHubhttps://github.com/edx/edx-platform/pull/399#issuecomment-22325139
.

@chrisndodge
Copy link
Contributor

Ike, I'm looking at this again. I'm having trouble reproducing the original error. If I (on master):

  1. define a XML course
  2. register for it as both a student and admin
  3. change the course so that that XML course fails on import
  4. log in a student: I see the failed course not display in dashboard (no 500 error)
  5. log in as admin: I see a dump of the failed course in a special admin section of the page

Might have the original problem been fixed on master outside of your PR?

@ichuang
Copy link
Contributor Author

ichuang commented Sep 4, 2013

Yes - it's quite possible.

On Wed, Sep 4, 2013 at 10:50 AM, chrisndodge notifications@github.comwrote:

Ike, I'm looking at this again. I'm having trouble reproducing the
original error. If I (on master):

  1. define a XML course
  2. register for it as both a student and admin
  3. change the course so that that XML course fails on import
  4. log in a student: I see the failed course not display in dashboard (no
    500 error)
  5. log in as admin: I see a dump of the failed course in a special admin
    section of the page

Might have the original problem been fixed on master outside of your PR?


Reply to this email directly or view it on GitHubhttps://github.com/edx/edx-platform/pull/399#issuecomment-23795316
.

@chrisndodge
Copy link
Contributor

Closing as 'inadvertently fixed'. We can re-open this if we notice this behavior again.

@chrisndodge chrisndodge closed this Sep 4, 2013
chrisrossi pushed a commit to jazkarta/edx-platform that referenced this pull request Mar 31, 2014
…_effects

Feature/fix replication side effects
@benpatterson benpatterson deleted the feature/ichuang/more-robust-dasahboard branch January 21, 2015 13:15
diegomillan pushed a commit to eduNEXT/edx-platform that referenced this pull request Sep 14, 2016
…ltrics-xblock-sha

Update SHA of qualtrics xblock
xavierchan pushed a commit to xavierchan/edx-platform-1 that referenced this pull request May 20, 2019
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.

3 participants