'.&mt('Function Plot Question').' | '
+ .''.&mt('Delete?').' '
+ .&Apache::edit::deletelist($target,$token)
+ .' | '
+ ." "
+ .&Apache::edit::end_row()
+ .&Apache::edit::start_spanning_row()
+ ."\n";
+ $result.=&Apache::edit::text_arg('Minimum x-value:','xmin',
+ $token,'4').
+ &Apache::edit::text_arg('Maximum x-value:','xmax',
+ $token,'4').
+ &Apache::edit::select_arg('x-axis visible:','xaxisvisible',
+ ['yes','no'],$token).
+ &Apache::edit::text_arg('Minimum y-value:','ymin',
+ $token,'4').
+ &Apache::edit::text_arg('Maximum y-value:','ymax',
+ $token,'4').
+ &Apache::edit::select_arg('y-axis visible:','yaxisvisible',
+ ['yes','no'],$token).
+ &Apache::edit::select_arg('Grid visible:','gridvisible',
+ ['yes','no'],$token).
+ &Apache::edit::end_row().&Apache::edit::start_spanning_row();
+ } elsif ($target eq 'modified') {
+ my $constructtag=&Apache::edit::get_new_args($token,$parstack,
+ $safeeval,'xmin','xmax','ymin','ymax',
+ 'xaxisvisible','yaxisvisible','gridvisible');
+ if ($constructtag) { $result = &Apache::edit::rebuild_tag($token); }
+
+ } elsif ($target eq 'meta') {
+ $result=&Apache::response::meta_package_write('functionplotresponse');
+ } elsif ($target eq 'web') {
# paste in the update routine to receive stuff back from the applet
$result.=&update_script($internalid);
# start the initscript for this applet
@@ -244,12 +513,41 @@ sub end_functionplotresponse {
&Apache::response::end_response;
my $result;
- my $internalid = $Apache::inputtags::part.'_'.$Apache::inputtags::response[-1];
-
-# if ($target eq 'edit') { $result=&Apache::edit::end_table(); }
- if ($target eq 'web') {
+ my $id=$Apache::inputtags::response[-1];
+ my $partid=$Apache::inputtags::part;
+ my $internalid = $partid.'_'.$id;
+
+ if ($target eq 'edit') { $result=&Apache::edit::end_table(); }
+ if ($target eq 'grade'
+ && &Apache::response::submitted()
+ && $Apache::lonhomework::type eq 'exam') {
+
+ #&Apache::response::scored_response($partid,$id);
+
+ } elsif ($target eq 'grade'
+ && &Apache::response::submitted()
+ && $Apache::lonhomework::type ne 'exam') {
+ my ($response,%coords)=&get_answer_from_form_fields($internalid);
+ $Apache::lonhomework::results{"resource.$partid.$id.submission"}=$response;
+ my %previous=&Apache::response::check_for_previous($response,$partid,$id);
+#
+# Actually grade
+#
+ my $ad='INCORRECT';
+#
+# Store grading info
+#
+ $Apache::lonhomework::results{"resource.$partid.$id.awarddetail"}=$ad;
+ &Apache::response::handle_previous(\%previous,$ad);
+ } elsif ($target eq 'web') {
+# Now is the time to render all of the stored splines
+ foreach my $label (keys(%Apache::functionplotresponse::splineorder)) {
+ $result.=&generate_spline($internalid,$label);
+ }
# close the init script
$result.=&end_init_script();
+# generate the input fields
+ $result.=$Apache::functionplotresponse::inputfields;
# actually start the |