Skip to content

Include non-obsolete location info in student profile report - #11620

Merged
cahrens merged 1 commit into
openedx:masterfrom
openfun:regisb/include_geo_data_in_student_profile_report
May 11, 2016
Merged

Include non-obsolete location info in student profile report#11620
cahrens merged 1 commit into
openedx:masterfrom
openfun:regisb/include_geo_data_in_student_profile_report

Conversation

@regisb

@regisb regisb commented Feb 22, 2016

Copy link
Copy Markdown
Contributor

The student profile report that can be downloaded from the course staff
dashboard included the "location" field (which is obsolete) and the
mailing address, which is seldom completed. Here, we add the "country"
and "city" fields to the csv report. Note that this breaks compatibility
with earlier reports.

@openedx-webhooks

Copy link
Copy Markdown

Thanks for the pull request, @regisb! I've created OSPR-1155 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.

@openedx-webhooks openedx-webhooks added open-source-contribution PR author is not from Axim or 2U needs triage labels Feb 22, 2016
@nedbat

nedbat commented Feb 22, 2016

Copy link
Copy Markdown
Contributor

@regisb thanks, but it looks like some Python test failures are due to your changes: Country(code=None) is not JSON serializable

@openedx-webhooks openedx-webhooks added community manager review waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. and removed needs triage community manager review labels Feb 22, 2016
@regisb
regisb force-pushed the regisb/include_geo_data_in_student_profile_report branch from d88e573 to df50aee Compare February 23, 2016 10:58
@regisb

regisb commented Feb 23, 2016

Copy link
Copy Markdown
Contributor Author

@nedbat Hmmmm... the fact that the we need JSON-dumpable data makes this PR more complex than I thought. It's probably the reason why the country code was not sent in the profile report in the first place :-)
Is this feature acceptable, despite the added complexity?

@nedbat

nedbat commented Feb 23, 2016

Copy link
Copy Markdown
Contributor

@regisb I'll leave you to work that out with the T&L team.

@openedx-webhooks openedx-webhooks added product review PR requires product review before merging and removed waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. labels Feb 23, 2016
@regisb
regisb force-pushed the regisb/include_geo_data_in_student_profile_report branch from df50aee to 9da1d59 Compare February 23, 2016 12:34
@jbarciauskas

Copy link
Copy Markdown
Contributor

What does "break compatibility" mean in this context @regisb ?

@regisb

regisb commented Feb 23, 2016

Copy link
Copy Markdown
Contributor Author

@jbarciauskas If people have written scripts that parse the user reports, e.g: Excel macros, then these scripts will probably fail because of the added columns.

@pdpinch

pdpinch commented Feb 23, 2016

Copy link
Copy Markdown
Contributor

Ironically, I just had a user ask about this today.

Can you add some examples of before and after reports?

FYI @JoeMartis

@regisb

regisb commented Feb 24, 2016

Copy link
Copy Markdown
Contributor Author

@pdpinch In the attached screenshot, I generated the report for a course with one student coming from South Georgia and the South Sandwich Islands (code=GS).

user profiles

And here is a screenshot of what is displayed when we click the "List enrolled students' profile information" button in the course dashboard.

user profiles - dashboard

@JoeMartis

Copy link
Copy Markdown

+1 for this PR - it would really help with our OFAC efforts.

@jbarciauskas

Copy link
Copy Markdown
Contributor

FYI @scottrish is going to shop this around for feedback on the backwards compatibility concerns

Comment thread lms/djangoapps/instructor/views/api.py Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@regisb would it be possible to reorder this so that we don't move the "goals" position, but are just strictly adding columns to the end?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Sure. But note that this query_features array does not determine the order of the columns in the Excel document. The values of PROFILE_FEATURES in instructor_analytics/basic.py do.

@regisb
regisb force-pushed the regisb/include_geo_data_in_student_profile_report branch from 9da1d59 to ca93e7c Compare March 31, 2016 11:53
@regisb

regisb commented Mar 31, 2016

Copy link
Copy Markdown
Contributor Author

@jbarciauskas do you wish to move the city/country fields at the end of the excel document?

@jbarciauskas

Copy link
Copy Markdown
Contributor

@regisb Yeah I think that would address the most likely compatibility issues, right?

@regisb

regisb commented Mar 31, 2016

Copy link
Copy Markdown
Contributor Author

@jbarciauskas Right. I'll make the change.

@regisb
regisb force-pushed the regisb/include_geo_data_in_student_profile_report branch 2 times, most recently from 3b1e1dc to b5fc703 Compare March 31, 2016 14:34
@scottrish

Copy link
Copy Markdown

@regisb Where does the city field get populated from?

@openedx-webhooks openedx-webhooks added open edx community review and removed product review PR requires product review before merging labels Apr 20, 2016
@cahrens

cahrens commented May 9, 2016

Copy link
Copy Markdown

I am asking for one more test case to cover when city and country are not present. Otherwise, I am 👍 on this PR.

@catong, I think we should wait to merge this until https://openedx.atlassian.net/browse/DOC-2946 is ready, since this change will need to be flagged in the release for compatibility reasons. We can coordinate when this one is ready to merge.

@openedx-webhooks openedx-webhooks added waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. and removed engineering review labels May 9, 2016
@regisb

regisb commented May 10, 2016

Copy link
Copy Markdown
Contributor Author

@cahrens I agree that the inconsistency between "None" and "" is a bit annoying. None is a python-specific value, so IMHO it doesn't make much sense to include it in a csv file. If we need to keep this value for backwards compatibility reasons, it should be relatively easy to print undefined countries as "None" by patching the extract_attr function. I can fix this behaviour either way, just let me know if I should make changes or create a different PR.

I'll also be adding a test for users with no city/country.

@regisb
regisb force-pushed the regisb/include_geo_data_in_student_profile_report branch from 51d7c30 to aa9d9f8 Compare May 10, 2016 09:43
@openedx-webhooks openedx-webhooks added engineering review and removed waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. labels May 10, 2016
@cahrens

cahrens commented May 10, 2016

Copy link
Copy Markdown

@regisb My team discussed "None" vs. "", and decided we are fine with the current implementation (inconsistency between City and Country). So no further work is needed on that end.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nit: I think you could just remove this block and rely on the default behavior of the fields.

@cahrens

cahrens commented May 10, 2016

Copy link
Copy Markdown

@regisb Thanks for the additional test point. It could be simplified somewhat, but it's up to you whether or not you wish to do that. Just let me know if you'd like to make any more changes before I merge.

@regisb
regisb force-pushed the regisb/include_geo_data_in_student_profile_report branch from aa9d9f8 to 0dea135 Compare May 10, 2016 15:06
@regisb

regisb commented May 10, 2016

Copy link
Copy Markdown
Contributor Author

@cahrens: Your suggestions do make sense. I took them into account and updated the PR.

@regisb
regisb force-pushed the regisb/include_geo_data_in_student_profile_report branch from 0dea135 to 704b5ac Compare May 10, 2016 15:45
The student profile report that can be downloaded from the course staff
dashboard included the "location" field (which is obsolete) and the
mailing address, which is seldom completed. Here, we add the "country"
and "city" fields to the csv report. To do so, we need to be able to
dump the new fields to JSON so we convert the user fields to unicode
when needed.

Note that this breaks compatibility with earlier reports.
@regisb
regisb force-pushed the regisb/include_geo_data_in_student_profile_report branch from 704b5ac to fe41e50 Compare May 10, 2016 16:25
@cahrens

cahrens commented May 10, 2016

Copy link
Copy Markdown

jenkins run js

@cahrens
cahrens merged commit 8340703 into openedx:master May 11, 2016
@regisb
regisb deleted the regisb/include_geo_data_in_student_profile_report branch May 11, 2016 13:45
@regisb

regisb commented May 11, 2016

Copy link
Copy Markdown
Contributor Author

Thanks everyone, great job!

@cahrens

cahrens commented May 11, 2016

Copy link
Copy Markdown

Yes, thanks for the submission, @regisb!

'country': _('Country'),
}

if is_course_cohorted(course.id):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bummer, I didn't expand below this to notice that if the course is cohorted, the cohorts column is added to the end (and the same with teams). Therefore, City and Country will not be the last two columns in the spreadsheet if either cohorts or teams are present.

We may need to revert this PR for the release. I will follow up with product.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @cahrens. Please tag me on any changes so I can reflect updates in the doc.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

What's the issue exactly?

@cahrens

cahrens commented May 14, 2016

Copy link
Copy Markdown

I described it above-- City and Country will not be the last two columns if either cohorts or teams are enabled. But those are optional columns, so it's a bit funky. I need to talk with folks here on Monday about what is desired.

@regisb

regisb commented May 14, 2016

Copy link
Copy Markdown
Contributor Author

Ok if necessary I'll have time to work on a new pr on Tuesday.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

engineering review open-source-contribution PR author is not from Axim or 2U

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants