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: 3

Thank you, great script.

However does not work 6 years later in 2020. It produces the error message related to missing maketext method.

If someone is interested, it is sufficient to add the maketext method to the FakeRequest package near the and of the wwScoreGetter script. I updated in this way the script in WeBWorK wiki and with this fix it should work again (if you customize the part related to the course names as with the original script).

I find this script useful since I can automatically in cron produce (anonymized) reports on progress of students. In this way the students can compare his or her results with classmates. cron, wwScoreGetter and Rmarkdown produce nice statistics easily and automatically. Thank you again.

In reply to Robert Mařík

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 Jack Dockery -
Could I get a working copy of the script?
In reply to Jack Dockery

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 -

I think that you still need to modify the script according to the fact what is your course name and which hw you want to include.

So feel free to modify the parts of https://webwork.maa.org/wiki/WwScoreGetter according to your needs. Also use the wrapper earlier on this page.


In reply to Robert Mařík

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 -
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