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

List students that have submissions but are unenrolled #1070

Open
Sumukh opened this issue Feb 10, 2017 · 8 comments
Open

List students that have submissions but are unenrolled #1070

Sumukh opened this issue Feb 10, 2017 · 8 comments

Comments

@Sumukh
Copy link
Member

Sumukh commented Feb 10, 2017

It's useful to see if you forgot to enroll someone - since otherwise they don't appear in the course stats

Here's some rough code that does what this going for

from server.constants import STUDENT_ROLE
from server.models import Backup, User, Enrollment, Assignment

assign = Assignment.query.get(assignment_id)
enrolled_students = set(e.user_id for e in (Enrollment.query
                        .filter(Enrollment.course_id == assign.course_id)
                        .all()))
submissions = (Backup.query.filter_by(assignment_id=assignment_id)
                     .group_by(Backup.submitter_id).with_entities(Backup.submitter_id).all())
submitters = set(s.submitter_id for s in submissions)
difference = submitters.difference(enrolled_students)
users = User.query.filter(User.id.in_(difference))

@knrafto knrafto changed the title List students that have submissions but are unenrolled List students that have backups but are unenrolled Feb 10, 2017
@knrafto
Copy link
Contributor

knrafto commented Feb 10, 2017

We should be careful to not include staff members in the result (i.e. don't filter by STUDENT_ROLE)

@knrafto knrafto changed the title List students that have backups but are unenrolled List students that have submissions but are unenrolled Feb 10, 2017
@knrafto
Copy link
Contributor

knrafto commented Feb 10, 2017

Sorry for the title changes. Should it be backups or only submissions? We also don't want to spend resources composition grading if a student is not officially taking the course.

@Sumukh
Copy link
Member Author

Sumukh commented Feb 10, 2017

Backups - the idea here is to be a spot check for course staff to make sure they haven't forgotten to enroll some people. 184 asked for this like so:

can we see submissions from students who are not enrolled? because there's sometimes a mismatch between bcourses and what they actually login with, or with their berkeley email

Re Composition: I agree that we should not be auto enrolling users (and then giving composition feedback).

This job is just about giving some visibility to the fact that there are students working on the assignment who might not be enrolled - those users are hidden otherwise to course staff.

@wrobe0709
Copy link
Contributor

Hi, I've been working on this issue but am getting stuck at combining the "un-enrolled but submitting" student data with the enrolled student data. I'm working in server/controllers/admin.py in assignment_stats(). Using your code as a guideline I've got the following so far:

    assign = Assignment.query.get(aid)
    enrolled_students = set(e.user_id for e in (Enrollment.query
                        .filter(Enrollment.course_id == assign.course_id)
                        .all()))
    submissions = (Backup.query.filter_by(assignment_id=aid)
                     .group_by(Backup.submitter_id).with_entities(Backup.submitter_id).all())
    submitters = set(s.submitter_id for s in submissions)
    difference = list(submitters.difference(enrolled_students))
    for not_enrolled in difference:
        print(User.query.filter_by(id=not_enrolled).all())

The last 2 lines there are just printing out the users that are un-enrolled but have submitted the assignment. I'm able to get those users successfully. I've successfully got the details from their submitted assignments using Assignment.user_status() and passing in the user object.

Could you point me in the right direction as to what function/model to edit to include these un-enrolled users?

@Sumukh
Copy link
Member Author

Sumukh commented Mar 22, 2017

@wrobe0709 If I understood correctly you'd like to know where to display this info? I'd suggest either using the job interface or making a brand new view (I'd prefer creating a new view in admin.py)

I think all you need to display is the user's email.

Steps:

  • Create a new route in admin.py
  • A new template in staff/course/assign
  • Render the emails within the template

@wrobe0709
Copy link
Contributor

@Sumukh Yes, I'm wondering where to display the info. Ok, you're steps make sense.

Would this then be another option on the sidebar of the assignment that says something like "Un-enrolled Submissions"? Basically, where would the staff member see this information?

@Sumukh
Copy link
Member Author

Sumukh commented Mar 22, 2017

Yeah. If you don't mind expanding the scope slightly, I actually think this makes more sense on a course level instead of a per assignment (since instructors would want to see this at once instead of checking each assignment)

You'd have to change the submission query to look more like this:

Backup.query.join(Backup.assignment).filter(Assignment.course_id == cid) ...

If you do decide to do that - you could add a link under the course dashboard actions (just like the assignment actions you referenced) (and the route could be something like /course/<int:id>/unenrolled)

@wrobe0709
Copy link
Contributor

Ok. I think that makes more sense too. I'll start on that. Thanks for the info.

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

No branches or pull requests

3 participants