WeBWorK Main Forum

Customize a problem by user

Re: Customize a problem by user

by Nathan Wallach -
Number of replies: 0
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.

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
  • pg/macros/PGtextevaluators.pl makes use of all 3 fields
  • Several other files in the pg code tree make use of either:
    • $main::studentName
    • $envir->{studentLogin}
Hope this helps,