Include non-obsolete location info in student profile report - #11620
Conversation
|
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:
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. |
|
@regisb thanks, but it looks like some Python test failures are due to your changes: |
d88e573 to
df50aee
Compare
|
@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 :-) |
|
@regisb I'll leave you to work that out with the T&L team. |
df50aee to
9da1d59
Compare
|
What does "break compatibility" mean in this context @regisb ? |
|
@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. |
|
Ironically, I just had a user ask about this today. Can you add some examples of before and after reports? FYI @JoeMartis |
|
@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). And here is a screenshot of what is displayed when we click the "List enrolled students' profile information" button in the course dashboard. |
|
+1 for this PR - it would really help with our OFAC efforts. |
|
FYI @scottrish is going to shop this around for feedback on the backwards compatibility concerns |
There was a problem hiding this comment.
@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?
There was a problem hiding this comment.
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.
9da1d59 to
ca93e7c
Compare
|
@jbarciauskas do you wish to move the city/country fields at the end of the excel document? |
|
@regisb Yeah I think that would address the most likely compatibility issues, right? |
|
@jbarciauskas Right. I'll make the change. |
3b1e1dc to
b5fc703
Compare
|
@regisb Where does the city field get populated from? |
|
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. |
|
@cahrens I agree that the inconsistency between "None" and "" is a bit annoying. I'll also be adding a test for users with no city/country. |
51d7c30 to
aa9d9f8
Compare
|
@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. |
There was a problem hiding this comment.
Nit: I think you could just remove this block and rely on the default behavior of the fields.
|
@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. |
aa9d9f8 to
0dea135
Compare
|
@cahrens: Your suggestions do make sense. I took them into account and updated the PR. |
0dea135 to
704b5ac
Compare
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.
704b5ac to
fe41e50
Compare
|
jenkins run js |
|
Thanks everyone, great job! |
|
Yes, thanks for the submission, @regisb! |
| 'country': _('Country'), | ||
| } | ||
|
|
||
| if is_course_cohorted(course.id): |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Thanks @cahrens. Please tag me on any changes so I can reflect updates in the doc.
There was a problem hiding this comment.
What's the issue exactly?
|
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. |
|
Ok if necessary I'll have time to work on a new pr on Tuesday. |


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.