Warning messages
HASH(0x872f97cc) is not an answerHash in queue evaluator
HASH(0x872f97cc) is not an answerHash in queue post_filter
Error messages
Can't call method "error_flag" on unblessed reference at /opt/webwork/pg/lib/WeBWorK/PG/Translator.pm line 1230
Call stack
The information below can help locate the source of the problem.
in WeBWorK::PG::Local::new called at line 50 of /opt/webwork/webwork2/lib/WeBWorK/PG.pm
in WeBWorK::PG::new called at line 910 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator/Problem.pm
in WeBWorK::ContentGenerator::Problem::pre_header_initialize called at line 184 of /opt/webwork/webwork2/lib/WeBWorK/ContentGenerator.pm
in WeBWorK::ContentGenerator::go called at line 382 of /opt/webwork/webwork2/lib/WeBWorK.pm
DOCUMENT();
loadMacros("PGstandard.pl",
"PGnauGraphtheory.pl"
);
COMMENT('Plots the graph in the answer.');
TEXT(&beginproblem);
$showPartialCorrectAnswers = 1;
$size = random(4,6,1); # number of vertices
$letters = join '', 'A'..'Z';
$offset = random(0,25 - $size, 1);
$labels = substr $letters, $offset, $size ;
$vertices = GRvertices_labels_size($labels,$size);
$graph = GRgraph_size_random($size,0.43);
$edges = GRedgesstr_graph_labels($graph,$labels);
$edgestex = GRtex_braces($edges);
@degrees = GRdegrees_graph($graph);
$degreesstr = join ', ' , @degrees;
##############################
$evalfunc = sub {
my $orig_in = shift;
my ($in, $pic, $view, $intex, $score, $graphin, @degreesin, $degreesinstr);
if ($orig_in eq ''){
$score = 0;
$view = '';
$message = '';
} else {
$graphin = GRgraph_size_labels_edgesstr($size,$labels,$orig_in);
$pic = GRpic_graph_labels($graphin, $labels);
$in = GRedgesstr_graph_labels($graphin,$labels);
$pic->gifName($pic->gifName()."-$in");
$view = Plot($pic);
$intex = GRtex_braces($in);
@degreesin = &GRdegrees_graph($graphin);
$degreesinstr = join ', ' , @degreesin;
$score = ($degreesinstr eq $degreesstr);
}
my$ans_hash = { score => $score,
correct_ans => $edges,
student_ans => $view,
preview_latex_string => $intex,
# original_student_ans => $orig_in,
ans_message => ($score) ? '' : $message
};
};
BEGIN_TEXT
$PAR
Construct a simple graph with vertices \( $vertices \) whose degrees are $degreesstr
$PAR
What is the edge set?
\{ ans_rule(70) \}
END_TEXT
ANS($evalfunc);
ENDDOCUMENT();
Any help will be greatly appreciated. Thanks,
Doug