Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop wwclientsup7 #657

Merged
merged 69 commits into from Jan 24, 2016
Merged

Develop wwclientsup7 #657

merged 69 commits into from Jan 24, 2016

Conversation

mgage
Copy link
Sponsor Member

@mgage mgage commented Nov 22, 2015

Pull this after develop_wwclients5.

You will need develop_clients7 to test the new features in the pg
develop_translator_upd PR. Those features include various debugging checkboxes available to administrators.

CourseEnvironment::new is often called without a specific courseName and this causes spurious errors when database.con is read. database.conf requires courseName to be defined, although it is not used unless course specific database calls are made.
Fake courseName is "foobar_course"
Still don't have the right javaScript for replacing the ToolTips
There were some things, notably the tool tips, which Problem::attemptsResult did but attemptsTable did not.
The {text} output from the renderProblem command and from other commands must be handled differently. For the renderProbelm command this is printed directly (to the screen).  For all the other commands the {text} output (which is not usually empty) is included in a JSON hash which is then returned as output.  I added an explicit flag that alerts the content() subroutine as to whether it is handling a renderProblem command or one of the other commands.
…_ref}->{problemSeed}

 $envir->{inputs_ref}->{problemSeed}
 $envir->{inputs_ref}->{displayMode}
…_ref}->{problemSeed}

 $envir->{inputs_ref}->{problemSeed}
 $envir->{inputs_ref}->{displayMode}

and other cleanup including changing encodedSource to encoded_source
…_ref}->{problemSeed}

 $envir->{inputs_ref}->{problemSeed}
 $envir->{inputs_ref}->{displayMode}
…sup7-debug

Conflicts:
	lib/WeBWorK/ContentGenerator/Problem.pm
	lib/WebworkClient.pm
	t/testAttemptsTable.pl
I think this might be corrections for some bad choices of what to keep during an earlier merge.
sendXMLRPC.pl only renders .pg files. (it skips .gif files, files with Header in the name, files with -text in the name
…endXMLRPC.pl instead of renderProblem.pl

But sendXMLRPC.pl can traverse directory trees itself.  check2_problems_in_dir.sh is probably not needed although it does time the tree traversal.
…), other improvements.

Improvements to figuring out the correct answer.  The options allow additional debugging data to be printed.
@mgage
Copy link
Sponsor Member Author

mgage commented Jan 3, 2016

Starting at the top the first commits finish the process of separating the presentation of attemptsTables into a separate module. You can use the file webwork2/t/testattemptsTables.pl ot check that it works -- but you still need to make sure it is hooked up right. (We finished most of this in debugging wwclients5)

There is good (ok pretty good) POD documentation for attemptsTable.

There is a struggle to determine where one should look for displayMode and for problemSeed (also some other problem variables but these two are the worst). Is it envir->{displayMode}, envir->{inputs_ref}->{displayMode} or just $displayMode? Each way of accessing the render (renderViaXMLRPC, instructorXMLRPC, the html files, renderProblem. had a different way of addressing this. Often they defined the value in several variable but then they were not always in sync. After some
false starts (some of the commits reverse previous ones) I'm pretty sure we want $envir->{displayMode} to be the single central value. When you call the renderer from an html page you have no choice but to define displayMode in an inputs_ref -- but you quickly store it in $envir->{displayMode} and delete the inputs_ref version. (Particularly with problemSeed most use cases do not want to allow the user to change the problemSeed from the webpage they are submitting. ) Inside a PG problem you can safely
assume that displayMode and problemSeed have been safely derived from $envir->{displayMode}, etc.
but elsewhere is a grey area.

this takes us up to about commit 9e84b8d

The main thing to test is that none of these changes affect the way that problems are evaluated. There will be good testing mechanisms for this in a bit. I think we already accomplished this part.

@@ -1704,7 +1704,7 @@ sub importSetsFromDef {

debug("$set_definition_file: reading set definition file");
# read data in set definition file
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of the changes to this file are the result of a bad merge. This removes the work done to make reduced credit dates imported and exported by to set def files (and other various bugs). As far as I can tell they should all be reverted to develop in your pull.

Copy link
Sponsor Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't work much, if at all on this file, so merging it back to the develop version shouldn't be too hard. I can do it by hand using the bbedit merge tool -- is there a slicker way?

Copy link
Sponsor Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably a result of merge at af84d97 -- it did not go easily.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you are certain that none of these changes were intended you can just open the develop version in a text editor, switch to this branch, and then save it again. But you should double check that nothing here was intentional.

Copy link
Sponsor Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok. I can do it essentially that way but a bit more safely.
Take care,

Mike

On Jan 2, 2016, at 9:00 PM, Geoff Goehle notifications@github.com wrote:

In lib/WeBWorK/ContentGenerator/Instructor/ProblemSetList2.pm https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openwebwork_webwork2_pull_657-23discussion-5Fr48689396&d=BQMCaQ&c=kbmfwr1Yojg42sGEpaQh5ofMHBeTl9EI2eaqQZhHbOU&r=C6Pt5AGtImanmAdcooarL-JZO8M5dSFPfs3VweYXYkE&m=YQx3VYTdqGXCWEMeGOCfFWpNGhh2txXlRuyhdjDNNH0&s=xUke83O2PGK6I6UduPJl0GcMdSdR0bSm8n5cep-TqaM&e=:

@@ -1704,7 +1704,7 @@ sub importSetsFromDef {

    debug("$set_definition_file: reading set definition file");
    # read data in set definition file

If you are certain that none of these changes were intended you can just open the develop version in a text editor, switch to this branch, and then save it again. But you should double check that nothing here was intentional.


Reply to this email directly or view it on GitHub https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openwebwork_webwork2_pull_657_files-23r48689396&d=BQMCaQ&c=kbmfwr1Yojg42sGEpaQh5ofMHBeTl9EI2eaqQZhHbOU&r=C6Pt5AGtImanmAdcooarL-JZO8M5dSFPfs3VweYXYkE&m=YQx3VYTdqGXCWEMeGOCfFWpNGhh2txXlRuyhdjDNNH0&s=OQcdnhawPoZV3bXKQ00R8OX68PK4-kldLE-gbaIAPz0&e=.

Copy link
Sponsor Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file ProblemSetList2.pm has been reverted to the develop version

@mgage
Copy link
Sponsor Member Author

mgage commented Jan 3, 2016

Next we start building sendXMLRPC. Originally I was just going to enhance renderProblem.pl which takes a file, renders it and returns the output either through less or as HTML through a browser.

I eventually figured out that what I was doing for this and for the embedded html iframes and for opaque moodle clients had a lot of overlap. So what has evolved at this point is sendXMLRPC which has problems rendered at a (possibly remote) server and standalonePGrenderer (separate project) which is very similar to sendXMLRPC but ties into PG directly to do it's rendering. standalonePGrenderer works but is not finished so you can ignore it for now if you wish -- but explains some of the design choices for sendXMLRPC.

The pod docs for this seem to have been added in wwclient8 -- but they are essentially the same as the readme for standalonePGproblemrenderer https://github.com/mgage/standaloneProblemRenderer

@mgage
Copy link
Sponsor Member Author

mgage commented Jan 3, 2016

Next --

there are some additions of some switches that appear on a problem page if you have admin privileges (==20). These allow you to see debugging info for the problem easily -- e.g. answerHash table, the resourceTable constructed by alias, and so forth. These won't doing anything yet until you update PG --that's where the real work is going on.

I've pulled the format templates for webwork-in-iframes, sendXMLRPC et. al. into a separate directory WebworkClient/ which makes it easier to add new formats.

By the way you need to construction the "credentials" file to use sendXMLRPC it usually has password information so you don't want it in the main source code except for demo sites which you are willing to allow to be spammed.


=cut


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't suppose we can just use the PG pretty print? Its not a huge deal either way.

Copy link
Sponsor Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe, but I’d like to wait on that. My long range hope is that we can get a version of this
that uses only pg and as few other files as possible and can package for CPAN
as an editor for writing PG problems. I’ve spent some time disentangling things
that were included just because they were there and it was easy to grab it from another file.
Often that’s a good thing, but it can also cause problems.

By the way I haven’t yet quite figured out how to refactor this writeRenderLogEntry
function — but it seemed like something that could wait.

On Jan 2, 2016, at 9:14 PM, Geoff Goehle notifications@github.com wrote:

In lib/WebworkClient.pm https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openwebwork_webwork2_pull_657-23discussion-5Fr48689462&d=BQMCaQ&c=kbmfwr1Yojg42sGEpaQh5ofMHBeTl9EI2eaqQZhHbOU&r=C6Pt5AGtImanmAdcooarL-JZO8M5dSFPfs3VweYXYkE&m=1wFplF0Tw2a0ZNsN9kntdYLpomI6h3XCDvuTTQcWoTw&s=j-9AQq86Tl4g2GB0eXS5wJRfWqwGLkeQ3V7GDh4zUNE&e=:

sub writeRenderLogEntry($$$) {
my ($function, $details, $beginEnd) = @_;
$beginEnd = ($beginEnd eq "begin") ? ">" : ($beginEnd eq "end") ? "<" : "-";
WeBWorK::Utils::writeLog($seed_ce, "render_timing", "$$ ".time." $beginEnd $function [$details]");
}

+=item pretty_print_self
+
+=cut
+
+
I don't suppose we can just use the PG pretty print? Its not a huge deal either way.


Reply to this email directly or view it on GitHub https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_openwebwork_webwork2_pull_657_files-23r48689462&d=BQMCaQ&c=kbmfwr1Yojg42sGEpaQh5ofMHBeTl9EI2eaqQZhHbOU&r=C6Pt5AGtImanmAdcooarL-JZO8M5dSFPfs3VweYXYkE&m=1wFplF0Tw2a0ZNsN9kntdYLpomI6h3XCDvuTTQcWoTw&s=dsjUb5mpt34AK5omTEwKdduBwtOk7Hhi-ZvSLbARmcw&e=.

@goehle
Copy link
Member

goehle commented Jan 3, 2016

  • There seems to be double encoding of some characters (like " or ). Try an enter \ into an answer blank.
  • (next iteration) Using "Show Auxiliary Resources" creates a knowls link in the warning, but the link opens up way at the bottom of the page below all of the other debugging info.
  • (next iteration) The PGinfo option is a little strange in that it requires you to manually add a macro and prints out the info in a different place than the other options.
  • Fix the encoding hack in pg by reordering encode to be after record.
  • Fix doc issue (replace script with image/pdf) -- what does this refer to???
  • Fix how comments are rendered in Problem.pm by reverting back to how it is in develop.
  • Fix pretty_print_tex -- part of pg
  • Fix images and alias -- part of pg
  • There is a problem with PGresponse when the item doesn't exist.
  • embedCSV and embedPDF dont work in latex. -- postpone briefly-- part of pg in any case.

@mgage
Copy link
Sponsor Member Author

mgage commented Jan 4, 2016

The problems with the Answer Hash are because the pretty_print is being called outside of the safe compartment -- we'll need to stringify everything and test it. This will probably show up in PGinfo also when we move it to be printed like the others.

This needs to be fixed but I'd rather it didn't hold up everything else. The basic delivery of the information is there and we just need to adjust the interaction with mathobjects. I'll have to think about it a bit -- we could just stringify everything in PGcore when it is exported but that might affect the answer processing so we want to look carefully to find the time when it is safe to stiringigy PGcore and its contents.

".",
"$courseURLs{html}",
"$webworkURLs{htdocs}",
];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 1065 and 1070 say # paths to search for applets. I wouldn't make a fuss but its in defaults.config so it might actually get read by someone.

Copy link
Sponsor Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. this is fixed. These are now default paths to search for html files, image files and pdf files

@goehle
Copy link
Member

goehle commented Jan 22, 2016

New list of things to do:

The lines in the output_hidden_info routine concerning templates should remain.  They are
used by the WW embedded in HTML calls.
@mgage
Copy link
Sponsor Member Author

mgage commented Jan 23, 2016

I've reverted the parts of Problem.pm that needed it.

echo '' > "$WEBWORK_ROOT/DATA/bad_problems.txt"
echo "Results sent to"
echo "$WEBWORK_ROOT/DATA/bad_problems.txt"
time find $1 -name "*.pg" -exec /Volumes/WW_test/opt/local/bin/perl $WEBWORK_ROOT/clients/sendXMLRPC.pl -C -B {} ';' #tail -f /Volumes/WW_test/opt/webwork/webwork2/DATA/bad_problems.txt;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a hard coded path to perl and should probably just rely on the path or a config variable.

Copy link
Sponsor Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok -- although this .sh file becomes redundant once the new sendXMLRPC is stable. It's functionality is embedded in the new sendXMLRPC.

Changed references in sendXMLRPC
Removed overrides for command HTML and HASH open commands.  They were commented
out because they weren't yet operational and I'm not sure whether they should be in the credentials
file in any case.
…nputs" } check to make sure that $rh_inputs->string can be found if $rh_inputs is a MathObject.
goehle added a commit that referenced this pull request Jan 24, 2016
@goehle goehle merged commit 849eafc into openwebwork:develop Jan 24, 2016
@goehle goehle mentioned this pull request Apr 20, 2016
41 tasks
@mgage mgage deleted the develop_wwclientsup7 branch June 7, 2016 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants