WeBWorK Main Forum

events that cause entry in answer.log

events that cause entry in answer.log

by Joel Trussell -
Number of replies: 1
what event(s) cause the entry in the answer_log file.
for active problems I assume the main evens are submit, preview, check answers

for an inactive problem, i.e., one that is past due and can be used for practice, I'd guess check answer, but what about "get a new version of the problem"?

Other events?


In reply to Joel Trussell

Re: events that cause entry in answer.log

by Michael Gage -
One place from the Problem page (actually ProblemUtil.pm)

if ( defined($answer_log ) and defined($pureProblem)) {
if ($submitAnswers && !$authz->hasPermissions($effectiveUser, "dont_log_past_answers")) {


and when a GatewayQuiz is graded. (line 1699 in GatewayQuiz.pm)

Those are the only places where writeCourseLog( is called to enter results into answer_log()
the activity_log is another story:

# We only write to the activity log if it has been defined and if
# we are in a specific course. The latter check is to prevent attempts
# to write to a course log file when viewing the top-level list of
# courses page.
WeBWorK::Utils::writeCourseLog($ce, 'activity_log',
$self->prepare_activity_entry) if ( $r->urlpath->arg("courseID") and

it is written to with every course page displayed if it is turned on . By default it is turned off. From defaults.config:

# Log for almost every click. By default it is the empty string, which
# turns this log off. If you want it turned on, we suggest
# "$courseDirs{logs}/activity.log"
# When turned on, this log can get quite large.
$courseFiles{logs}{activity_log} = '';