## WeBWorK Main Forum

### Customize a problem by user

by Michael Shulman -
Number of replies: 1
Is there any way for a WW problem to obtain information about the logged-in user (e.g. name, username, student id #), so as to use it in customizing a problem non-randomly? If such an ability doesn't already exist, would it be possible to write my own PG macro to do it?
which makes use of $studentLogin to access student identity data and then set a seed for Rserve. Uncommenting the "warn" line in this file shows that the$studentName and $studentID fields are also accessible. Technical background: • webwork2/lib/WeBWorK/PG.pm puts these three data fields into the PG %envir hash. • pg/macros/PG_CAPAmacros.pl makes use of$main::studentName
• $main::studentName •$envir->{studentLogin}