WeBWorK Main Forum

How extract all homework scores from Webwork (for a student) in a COMMAND LINE script? (e.g. to send scores in an email to parents)

Re: How extract all homework scores from Webwork (for a student) in a COMMAND LINE script? (e.g. to send scores in an email to parents)

by Robert Mařík -
Number of replies: 0
Another (different) way could be the direct sql access. Something like the lines below may do the job. You may need to remove the "where ... " clause which selects just students (logins start with x at our uni). And of course: adjust the name of the course. I use adminer from https://www.adminer.org to access the database. It is only one php script and much lighter than php admin. For security reason I use the user which has only read privileges.

SELECT x.user_id, sum(x.status*ifnull(x.value, y.value)) as score
FROM `AM-2021-Marik_problem_user` as x
left join `AM-2021-Marik_problem` as y
on x.set_id = y.set_id and x.problem_id = y.problem_id
where user_id like "x%"
group by user_id
order by score desc