-
Notifications
You must be signed in to change notification settings - Fork 14
100 - CSV Download of gradebook #250
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
base: develop
Are you sure you want to change the base?
Conversation
…xes to update page, edit form, etc
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.
Looks good overall. I made some cleanup suggestions.
let updatedTime = new Date(date) | ||
updatedTime.setHours(updatedTime.getHours() + 4) // jank fix, but makes due dates appear correctly :D | ||
return updatedTime.toLocaleString('en-us', { |
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.
As we discussed, this needs to be updated to display the time to the local timezone. The database should store everything in UTC time, and the browser should display it in the local timezone.
const link = document.createElement("a"); | ||
link.setAttribute("href", encodedUri); | ||
link.setAttribute("download", `${courseName.replace(" ", '').toLowerCase() ?? 'class'}_gradebook`); | ||
document.body.appendChild(link); | ||
link.click(); | ||
document.body.removeChild(link); |
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.
This might be okay for now, but there must be a better way to do this than temporarily creating a link and simulating it being clicked.
const link = document.createElement("a"); | ||
link.setAttribute("href", encodedUri); | ||
link.setAttribute("download", `${course?.number.replace(" ", '').toLowerCase() ?? 'class'}_gradebook`); | ||
document.body.appendChild(link); | ||
link.click(); | ||
document.body.removeChild(link); |
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.
There's a lot of duplicate code here (from the student gradebook page). It would be good to abstract common logic out to a utility function.
@@ -68,7 +68,7 @@ const TextProblemModal = ({ open, onClose }: Props) => { | |||
await RequestService.post(`/api/course/${courseId}/assignment/${assignmentId}/non-container-auto-graders/`, graderFormData) | |||
.then(() => { | |||
console.log("GRADER CREATED") | |||
window.location.reload() | |||
//window.location.reload() |
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.
Cleanup
@@ -277,19 +276,18 @@ const AssignmentDetailPage = () => { | |||
</div> | |||
</div> | |||
|
|||
|
|||
|
|||
{submissions.length != 0 && |
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.
{submissions.length != 0 && | |
{submissions.length !== 0 && |
Added support for downloading gradebooks to csv files, and fixed some text field styling in various places across the site, made submissions clickable from anywhere on the card, updated due date printing to show time correctly.
Proposed changes
Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request.
If it fixes a bug or resolves a feature request, be sure to link to that issue using #{issue_number}.
Types of changes
What types of changes does your code introduce?
Put an
x
in the boxes that applyChecklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any ofthem, don't hesitate to ask. This is simply a reminder of what we are going to look for before merging your code.