-
Notifications
You must be signed in to change notification settings - Fork 4.2k
dump_course_structure cmd: "flat" structure, csv #1805
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
|
This will be useful for reporting stats to teaching staff - they don't love getting data organized by module_id - having an easy way to lookup the display name for each module_id, as well as the order in the course, will be handy for putting reports together. |
|
@chrisndodge tests are at lms/djangoapps/courseware/tests/test_commands.py @sefk we should add tests for the new functionality too. |
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.
It would be convenient to add an example of the CSV output too.
|
You're both right on tests and docs, I'll do that, sorry about that. |
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.
I'll prefer to use the fieldnames parameter of the cvs writer, with the name of the fields in a global. Each entry in destination will then be a dictionary with the fields like so:
destination.append({
'course_id': course_id,
'position': pos,
'level': level,
...
})That way we don't have to keep the to fields and the entries in sync, and the --flat output in json works too.
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.
Didn't know about that option, indeed that sounds nicer. I'll try that thanks.
|
@sefk I added some comments. |
|
What's the status of this pull request? Is it actively being worked on, or can it be closed? |
|
@sefk ? |
|
Note that https://github.com/edx/edx-platform/pull/2008 makes modifications to the same management command, and includes moving the tests to a more approved location (i.e. in management/commands/tests). |
|
I'll add tests so this can land, it slipped my mind. Thanks for following up. |
|
Hi - just checking on the status of this PR as it hasn't seen any action in a month. |
|
Sorry, it's not good to leave a PR languishing like this. I'm going to close for now and will reopen another when I've rebased and written a test. It's not hard, just keeps getting bumped down my stack. Thanks for following up @sarina and @singingwolfboy |
For @rocha since this is adds onto your work (?). @jinpa if you care to comment on usefulness and such, please do.
This adds two options to the existing management command for dumping out a course structure, "csv" and "flat". The "flat" option is another format for listing out a course that we found helpful for ad-hoc reporting. It has convenient module_id to description mappings, and has the level so you have some notion of where
This is the output of this command:
./manage.py lms --settings=cms.dev dump_course_structure --flat Medicine/SciWrite/Fall2013 --csv | headin my dev environment:
The "position" is so you can sort reports in the order that they would be presented in the course.