Skip to content
This repository has been archived by the owner on May 10, 2022. It is now read-only.

Let instructors view all responses to one exercise #341

Open
jpslav opened this issue May 16, 2014 · 3 comments
Open

Let instructors view all responses to one exercise #341

jpslav opened this issue May 16, 2014 · 3 comments
Assignees

Comments

@jpslav
Copy link
Member

jpslav commented May 16, 2014

Currently, when an educator wants to review student work in Tutor, their only option is to visit a page that lists all of the responses from one student for one exercise.

It has often been requested that we add a page that shows the responses from everyone in the class for one particular exercise. Such a page would let an educator quickly scan through the responses to see if there were any trends in them.

All of the data is available to make this happen, we just need to add the page.

First a quick word about relevant models. An Assignment record in the database has_many AssignmentExercises (each of which connect that Assignment to a particular Exercise). An AssignmentExercise has_many StudentExercises, each of which represent one Student's work for a particular Exercise.

A StudentAssignment is a linking of an Assignment with a particular Student (a way to get all of the StudentExercises for that particular Student).

Right now, the page mentioned above that shows all of the work for one student and one assignment makes use of the StudentAssignment. The URL is localhost:3000/student_assignments/27218, where the number at the end is the db ID of the student assignment in question.

The page we want to add is focused on a particular AssignmentExercise, since we want to see all StudentExercises for that AssignmentExercise in one page. AssignmentExercise has a has_many relation to StudentExercise objects, so getting the data should be straightforward.

The approach is as follows:

  1. There is no controller for assignment exercises yet. Create it in app/controllers/assignment_exercises_controller.rb. It should have one method (one "action") called "show".
  2. You'll need to set up a route in config/routes.rb that will take an incoming URL and "route" it to this controller action. resources :assignment_exercises, only: [:show] should do the trick. (shortcut for `get 'assignment_exercises/:id', to: 'assignment_exercises#show')
  3. You'll need a view file (the HTML template to render). Create app/views/assignment_exercises/show.html.erb and put some dummy text in there like "Howdy Lakshmi!".
  4. At this point you should be able to navigate to localhost:3000/assignment_exercises/23892 and see "Howdy Lakshmi!"
  5. Now, in the "show" method in the controller, you'll need to query the AssignmentExercise object (storing it in an @assignment_exercise variable) and freak out if the current_user doesn't have permission to read it. See here for an example.
  6. Note that the AssignmentExercise model doesn't yet have the permission methods that StudentAssignment does. You'll need something like this in app/models/assignment_exercise.rb to restrict access only to class educators.
  7. Now in the view (the show.html.erb template file from above), you can iterate through the assignment exercise's student exercises with something like <% @assignment_exercise.student_exercises.each do |student_exercise| %> html stuff here <% end %>.

Notes:

  1. We should make sure we have obvious links to these pages from the other instructor views. One idea is to make links out of the exercise numbers in the student result grids on the assignment page. We can also make the exercise numbers on the existing StudentAssignment summary page link to this new page.
  2. For research purposes, we often split a class into multiple cohorts of students. Each cohort gets a different set of problems each week. An AssignmentExercise is attached to a Cohort, and different cohorts' different assignment exercises can refer to different Exercises. (that is confusing but @kjdav can explain). The bottom line is that if an instructor wants to see all of the responses to Exercise 42 (available via an Assignment's AssignmentExercise 87), then saying AssignmentExercise.find(87).student_exercises is only going to return the work for exercise 42 in one of the possibly several cohorts in a class. If we want to be more advanced and show all work related to exercise 42 regardless of which cohort or assignment it was worked by students, we'd need a more complex query which we can discuss.
  3. We'll need to chat about all of this of course, because this is a lot all at the beginning :-)

cc @Dantemss @kjdav

navilan added a commit to navilan/ost that referenced this issue May 19, 2014
- Add permissions to assignment exercise model.
- Add links in the assignment page for the new view.
- Add assignment exercise controller with a single show action.
- Add assignment exercise view.

Notes:

- This commit introduces a lot of redundancy between student
  exercise and the assignment exercise.  Need to refactor to
  partials for better reuse.

- Assignment exercises are bunched for a particular cohort,
  need to make it accessible for all cohorts.

- The table border rendering is flaky in FF nightly.
navilan added a commit to navilan/ost that referenced this issue May 19, 2014
Based on discussions with @kjdav:

- Make Exercise section non-collapsible.
- Add multiple choices.
- Add correct solution.
- Refactor into partials for reuse in other places.

Notes:

- Once this pull request is merged the other areas like
  student exercises can use the partials here for rendering
  related content.
navilan added a commit to navilan/ost that referenced this issue May 19, 2014
Given that this feature is geared towards educators, the link to
assignment exercise for researches can be removed.  Once we figure
out what the researches can/cannot see, it can be reinstated.
navilan added a commit to navilan/ost that referenced this issue May 20, 2014
- Create a partial layout for section containers.
- Create paritals for question, choices and correct
  answer under exercise.
- Create a blurb partial for exercise.
- Set permissions for assignment exercise (educator || researcher).
- Add links to student assignment to get to the assignment
  exercises page.
- Add the assignment exercises controller and view.
navilan added a commit to navilan/ost that referenced this issue May 20, 2014
- Ensure that multiple choices are laid out in columnar fashion.
- Add mark_correct variable to toggle correct answer tagging
  in the HTML element with a class.  This is needed to make sure
  correct answer is not revealed through view source :)
navilan added a commit to navilan/ost that referenced this issue May 20, 2014
- Add link to the class.
- Add link to the assignment.
- Add a helper class for getting previous and next assignments.
- Add prev / next links in nav.
navilan added a commit to navilan/ost that referenced this issue May 20, 2014
- Sort students by their status (registered, auditing, dropped).
- Use the sorted list to organize the responses.
- Create a partial to render the reponse list per group.
navilan added a commit to navilan/ost that referenced this issue May 20, 2014
navilan added a commit to navilan/ost that referenced this issue May 21, 2014
- Remove the assignment_exercise helper object.
- Add peers scope to container instance.
- Add prev / next method to container instance.
- Use prev / next in the sidebar nav.
navilan added a commit to navilan/ost that referenced this issue May 21, 2014
- Use tips from the most excellent @Dantemss.
- Add a scope `by_student` to student_exercises along with
  requisite relations.
- Use an app level group by to avoid sending out 3 queries.
@navilan navilan mentioned this issue May 22, 2014
14 tasks
navilan added a commit to navilan/ost that referenced this issue May 22, 2014
- Use inline join to the user table to get rid of
  the redundant joins introduced by rails' merge
  method.

- present_user => user.
navilan added a commit to navilan/ost that referenced this issue May 22, 2014
- Added comments for weird code bits.
- Changed scope name from by_student to visible_by_student.
- Changed to do/end from braces.
- Changed present_user => user.
navilan added a commit to navilan/ost that referenced this issue May 22, 2014
- The peers scope was incorrectly using an assignment instead of
  a query.  Used a method instead of scope.
- Corrected typo "availble"
- Changed navigation items from "Go to x" to "x"
- Removed the Exercise link from feedback nav.
- Reordered class and assignment in AE nav as in other pages.
- "Your free responses" title cased.
@navilan
Copy link
Contributor

navilan commented May 22, 2014

@kjdav / @jpslav : I just went through the styling for the feedback exercises page and saw a few things that I'd like to change. Not sure if its prudent right now to change things as there seems to be a pending UX review.

But here is what I'd like to change:

  1. Remove left padding on sections. Essentially the headers are there to separate sections - no need to indent all content. It inhibits readability and also reduces available space for displaying content.
  2. Remove the right side bar and use bread crumbs in the body (I think you folks also liked that approach in one of the other threads we have been having).

Should I wait on these changes or just do them to see how it looks?

navilan added a commit to navilan/ost that referenced this issue May 22, 2014
I owe @Dantemss several beers and my sanity.

- Separate scopes for visible and by_student.
- Use fully qualified objects to avoid duplicate joins.
- Remove hardcoded query.
@jpslav
Copy link
Member Author

jpslav commented May 22, 2014

Wait. UX team to evaluate later this summer.

navilan added a commit to navilan/ost that referenced this issue May 23, 2014
- Add support for prev/next in BasicInstance.
- Use sifters to encapsulate column names.
- Add a peers method to the BasicInstance that is essentially
  just an identity method.
@navilan
Copy link
Contributor

navilan commented Jun 11, 2014

This can also be closed in light of #348.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants