This is possible. Have a look at the following OPL problem:
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.
- 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
- pg/macros/PGtextevaluators.pl makes use of all 3 fields
- Several other files in the pg code tree make use of either:
Hope this helps,