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

Create a way for instructors to export pdf of students in a group with average grades in a class #1944

Open
Nenad-Stoj opened this issue Jun 24, 2024 · 1 comment
Assignees

Comments

@Nenad-Stoj
Copy link
Contributor

This was a request from the last global meeting, Olivier had asked if there was a way to export the students with and average grade per skill in a pdf file. This isn't a possibility currently, however I think it is something good to implement as partner organizations often ask for details. I looked into a potential solution for this with the wicked_pdf gem.

@Nenad-Stoj Nenad-Stoj self-assigned this Jun 24, 2024
@tomca32
Copy link
Member

tomca32 commented Jul 7, 2024

We should probably go with the browser generating the pdf so we don't burden our servers with it.

Let's do a barebones proof of concept with this ticket.

We should create another menu option in the main menu in the sidebar called reports. Menu is done in the SidebarComponent in our app so we need another entry there with an svg icon that can be downloaded from Tailwind UI. Find an icon that makes sense for reports, like idk a piece of paper or something.

We need a new route in routes.rb. This route should only have :index (/reports) and :show (/reports/:id) routes. In the index route we will put a dropdown that lets you select a group, once you select it you will be redirected to the show route which should generate the report as an html page with no sidebar or header.

So in routes.rb we will need resources :reports, only: %i[index show]
We need a reports_controller.rb with index and show routes.

We will also need another layout in views/layouts so that we don't render a sidebar menu for the show route.
You can render with a different layout by calling render layout: "reports" if there is reports.html.erb in the layouts directory.

In the show route we will render the report that includes some basic information about the group:

  • Date of first lesson and the group average on first lesson
  • Date of last lesson and the group average on that day
  • Date of "middle" lesson (a mid point) and the average on that day
  • Graph of the last 30 lessons
  • Graph of group lifetime (all lessons)
  • Table with student average marks on first, middle, and last lesson

Once the webpage is generated we should just automatically open up the browsers print menu via javascript window.print();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In progress
Development

No branches or pull requests

2 participants