# IRC log for #webwork, 2013-06-25

All times shown according to UTC.

Time Nick Message
02:47 _ilbot joined #webwork
02:47 Topic for #webwork is now WeBWorK (http://webwork.maa.org) is an open-source online homework system for math and sciences courses. WeBWorK is supported by the MAA and the NSF. | Release notes: http://goo.gl/Ry5HN | Channel logged at http://goo.gl/jELTn
05:15 _ilbot joined #webwork
05:15 Topic for #webwork is now WeBWorK (http://webwork.maa.org) is an open-source online homework system for math and sciences courses. WeBWorK is supported by the MAA and the NSF. | Release notes: http://goo.gl/Ry5HN | Channel logged at http://goo.gl/jELTn
07:30 _ilbot joined #webwork
07:30 Topic for #webwork is now WeBWorK (http://webwork.maa.org) is an open-source online homework system for math and sciences courses. WeBWorK is supported by the MAA and the NSF. | Release notes: http://goo.gl/Ry5HN | Channel logged at http://goo.gl/jELTn
08:44 _ilbot joined #webwork
08:44 Topic for #webwork is now WeBWorK (http://webwork.maa.org) is an open-source online homework system for math and sciences courses. WeBWorK is supported by the MAA and the NSF. | Release notes: http://goo.gl/Ry5HN | Channel logged at http://goo.gl/jELTn
09:12 _ilbot joined #webwork
09:12 Topic for #webwork is now WeBWorK (http://webwork.maa.org) is an open-source online homework system for math and sciences courses. WeBWorK is supported by the MAA and the NSF. | Release notes: http://goo.gl/Ry5HN | Channel logged at http://goo.gl/jELTn
13:20 mgage joined #webwork
14:50 mgage joined #webwork
16:02 goehle joined #webwork
16:59 mgage goehle: hi
16:59 goehle hey
17:00 mgage catching up on things -- are you coming to Vancouver? I don't see you listed on the google doc and I suddenly couldn't remember.
17:02 goehle hey
17:02 goehle no, I wont be
17:03 goehle baby around the corner and all of that
17:03 mgage ok -- that's what I thought -- but I wanted to double check.
17:03 mgage hope all goes well with the baby -- when is it expected?
17:03 goehle july 27
17:03 goehle so just over a month
17:05 mgage kk -- I'll have some news of some new stuff -- but first I have to make sure everything is set for this event.  I'm in Seattle at the moment -- just finished Sage days and I'll be traveling up to Vancouver on Thursday
17:06 goehle sounds like you are keeping busy
17:06 goehle how is Brewery coming along?
17:09 mgage I'm keeping busy -- David and his girlfriend have moved back to Baltimore, and David has a job. (they even bought a car -- since they'll need one for the commute next year).  So between that and his thesis I suspect David has his hands full.
17:09 mgage He'll be at Vancouver so something will probably be done then.
17:09 mgage Will you be around in case we need online remote consults?
17:09 goehle I will be around
17:23 ionparticle joined #webwork
17:41 Paul_Pearson joined #webwork
18:06 Paul_Pearson joined #webwork
18:43 Paul_Pearson joined #webwork
18:46 mgage joined #webwork
18:57 Paul_Pearson mgage ?
18:57 Paul_Pearson I am working on the pdf hardcopy output from draggableProof.pl
18:58 Paul_Pearson I have the problem text displayed nicely.
18:58 Paul_Pearson I do not have the student answers displaying at all.
18:58 Paul_Pearson And, the correct answers are a comma separated list.
18:58 Paul_Pearson I'll send you an email with pdf attachment so you can see what I mean.
19:02 Paul_Pearson Here are my questions:
19:02 Paul_Pearson 1. How do I get and display the student answer in the pdf hardcopy?
19:05 Paul_Pearson 2. Currently, the correct answer is typeset as an itemized list with one item (one circular bullet) and the text uses latex \verb (?) or something equivalent.  The correct answer is really a list of (potentially long) strings.  As a result, the correct answer is displayed as a long string that spills into the next column or off of the page.  Is there a good way to typeset the correct answer?
19:08 mgage to answer the last question -- no one has worked on making the correct (or student) answers display nicely in the tex format.  The lines often spill over. I'm pretty sure that you can find behavior like that in many other problems.  It would be a nice thing to fix since it would make most hardcopy printouts more readable.
19:09 Paul_Pearson Is \verb what is currently used?
19:09 Paul_Pearson If \verb is used, what special character is used to begin and end the verbatim text?
19:09 mgage For the student answer I'm not sure -- I'd have to polk around for  a while.  Does the student answer show up when viewing hardcopy for other problems?  This might also be a generic bug.
19:10 Paul_Pearson Let me check on your question.
19:10 mgage I believe \verb is used.  and most likely | for a character, but I'd have to check that also
19:11 Paul_Pearson Hold on, there's no submit answers button, so I probably forgot to set the due dates correctly.  Blerg.
19:12 mgage the separator might be my $c = chr(128); ## something that won't be typed 19:13 mgage that is what it is set to for preview_latex_string in PGstringevaluators.pm line 602 approximately 19:14 Paul_Pearson OK. I was thinking of a hack: 19:14 Paul_Pearson we know it is \verb$c some text $c 19:15 Paul_Pearson So why not hack it so that it becomes 19:15 Paul_Pearson \verb$c$c some text$c$c 19:15 Paul_Pearson that way "some text" will be outside of \verb 19:15 Paul_Pearson the hack would be only for draggableProof.pl 19:16 Paul_Pearson BTW, I am getting student answers, but they're things like P1-2,P1-0. 19:17 mgage you can experiment some with this, but I'd check with Davide also. He probably has a better idea. You should experiment first however and see if the spot in PGstringevaluators.pl is causing the troubles. 19:18 mgage that's probably because those are the keys to the text -- which are the things submitted with the answers. 19:18 Paul_Pearson I am guessing that P1-2 is some way of encoding the statements. I should be able to puzzle that out. 19:18 mgage I suggest that you experiment with this a little in PGlabs where you can get the complete ans_hash output. 19:19 mgage you can probably add one of the "withMessage" macros (the name escapes me at the moment) to doctor the latex_preview_entry 19:19 Paul_Pearson Is latex_preview_entry in HTML mode? 19:20 Paul_Pearson I am only concerned with TeX mode right now. 19:20 mgage if this is the right spot the preview entries and what is printed for correct answers should be the same -- it's just that TeX is less forgiving about line breaks. 19:20 mgage yes 19:20 Paul_Pearson I think HTML mode is working just fine in draggableProof.pl 19:21 mgage than this might not be the trouble spot -- this is code in one of the answer evaluators -- and that is probably where hardcopy obtains its data 19:21 mgage see if the messages are the same. 19:22 mgage the preview (dvipng or mathjax?) might handle \verb differently 19:26 Paul_Pearson Thanks for letting me know about PGlabs. I did not know it could do that (I had not used it before). 19:27 mgage PGlabs is great. Davide uses it all the time to debug stuff. 19:27 Paul_Pearson JT and Davide wrote draggableProof.pl and got it working for HTML mode. 19:27 mgage right -- I was there :-) 19:27 Paul_Pearson I noticed that it was not working for TeX mode, so I decided to try working on it a bit today. 19:28 mgage kk -- that's going to be helpful. 19:29 mgage I've made more progress on the geogebraweb applet. I've got a version that uses the standard API -- it works kind of but doesn't save state properly yet. Still a few more wires to connect properly. 19:29 Paul_Pearson Do you think we should try to make global changes to how student answers and correct answers are displayed and typeset in pdf hardcopy output? 19:29 Paul_Pearson I figured that you would be both faster and better at GeoGebraWeb than I would be... 19:30 mgage Probably not -- at least not in a hurry. That needs to be done cautiously. Hacking the current draggable proof problem just by changing macros -- or the problem itself -- is just fine and probably a good idea. That way we'll have some data for making a more global change. 19:32 mgage I want you to help review the work in the applet API. I've been almost the only one using it except for Filipe. In order to clarify it needs to be worked on by more than one person -- even I was having trouble remembering how/why things worked since I' haven't looked at it for at least a couple of years. 19:34 mgage check the actual raw TeX output for your draggable proof pdf. If it has \verb in the student answers than it is almost certainly coming from the string evaluator. That is the only place I could find \verb in the code base. 19:35 Paul_Pearson I would be happy to help review the API. I remember it being good (although the documentation and working examples could be improved to be more accessible to people with less experience). 19:35 Paul_Pearson Ah, of course! The TeX file. 19:36 mgage look at contextAbitraryString.pl as well. 19:36 Paul_Pearson In a pg problem file (not in PGlabs), how can I view the answer hash? 19:36 Paul_Pearson Say$a = Compute("2x+1");
19:37 Paul_Pearson The checkAnswer command of PGlabs does this:
19:37 Paul_Pearson TEXT($a->cmp->evaluate("3")->pretty_print); 19:37 Paul_Pearson to print the answer hash, correct? 19:37 Paul_Pearson Also, how can I get one value from the answer hash? 19:38 mgage Under the hood the checkAnswer() macro expands to 19:38 mgage TEXT($a->cmp->evaluate("3")->pretty_print);
19:38 Paul_Pearson For example, suppose I want to get the value of the key 'correct_ans_latex_string' in the answer hash.
19:39 mgage you can check in PGlabs :-)  probably TEXT(\$a->cmp->evaluate("3")->{correct_ans_latex_string}
19:40 Paul_Pearson Yup, that works (with a closing ); appended to the end).
19:41 mgage also look at the description of custom answer checkers -- and there is a method for adding a comment to an answer
19:41 mgage those routines are passed the ans_hash
19:41 mgage time to eat.  I'll be back in a while.
19:42 Paul_Pearson is new to me :)
19:42 Paul_Pearson enjoy!
19:43 mgage answerHints is what I think I was thinking of
19:44 mgage also withPostFilter in http://webwork.maa.org/wiki/ErrorMessageCustomization
20:02 hij joined #webwork
20:03 hij Hello, I am trying to add some routines for making graphs, histograms and boxplots.
20:04 hij I would like to make some test scripts to generate plots using a script from the  command line.
20:04 hij I cannot seem to be able to require PG.pl and some others without having a full environment.
20:04 hij Is there a way to make a script that I can run outside of the http server for the initial testing and development?
20:08 Paul_Pearson hij Why are you trying to generate plots from the command line?
20:08 Paul_Pearson You should use PGgraphmacros.pl for graphs.
20:09 Paul_Pearson There are many graphing examples at
20:09 Paul_Pearson http://webwork.maa.org/wiki/SubjectAreaTemplates#Graphing
20:10 Paul_Pearson We do not currently have a macro for generating histograms, but it should be possible to use the code here
20:10 Paul_Pearson http://webwork.maa.org/wiki/RiemannSums1
20:10 Paul_Pearson to start that process.
20:11 Paul_Pearson Also, we do not currently have box plots, but it should be possible to take ideas from the Riemann sums example together with some basing graphing capabilities
20:11 Paul_Pearson http://webwork.maa.org/wiki/DynamicImages
20:12 Paul_Pearson http://webwork.maa.org/wiki/DynamicImages2
20:12 Paul_Pearson basing ---> basic
20:12 hij I am not trying to generate graphs from the command line.
20:13 Paul_Pearson I am relieved to hear you say that.
20:13 hij I am trying to write a subroutine that will generate a graph in webwork.
20:13 hij I want to test it using a perl script that I can run from the command line.
20:13 hij Also, thank you for the links! I will take a look at those.
20:14 Paul_Pearson Most people use webwork interactively through their web browser.  What would the advantage be for using a perl script?
20:14 hij I want to add a subroutine in the PG macros that will allow me to just make a call with the data.
20:16 Paul_Pearson The webwork developers would prefer not to modify existing PG macros, but rather to add another new macro file.
20:16 * hij nods
20:17 hij I can do that. I was assuming a new statistics macro file.
20:17 Paul_Pearson In the past, I have created some things like what you propose.  The 2D vector fields macro comes to mind as a good example.
20:17 * hij nods
20:17 Paul_Pearson A new statistics macro would be awesome :)
20:17 hij Did you have to make changes, restart the http server, and then test when you did that?
20:17 Paul_Pearson https://github.com/openwebwork/webwork-open-problem-library/blob/master/OpenProblemLibrary/macros/FortLewis/LiveGraphicsVectorField2D.pl
20:18 hij Thank you! I will take a look.
20:18 Paul_Pearson No, I did not need to restart the http server.
20:19 hij So when a problem uses the loadmacros command it loads the current one on disk?
20:19 Paul_Pearson If you write a .pm file, then you need to restart the http server.  However, my macro (and yours, too) only need to be .pl files, which do not require a restart of the http server.
20:19 Paul_Pearson Do you have a working webwork installation?
20:19 Paul_Pearson I can walk you through this.
20:19 hij Yes.
20:20 hij At the moment I am using the current production version of the PG distribution.
20:20 Paul_Pearson Log in to a course as a professor and click on File Manager (near the bottom left).
20:21 hij I need to play a little bit with our set up. My plan was to move that directory and move the development distribution into it is place. Then switch it back out when not working on it.
20:22 Paul_Pearson You will be able to develop this macro locally within one course to start, so no global changes will be needed.  I do not think you will need to play around with the setup to do this.
20:22 Paul_Pearson After you have the macro working locally, all you need to do to make it work globally is to move it to a different location on your server.  Very easy :)
20:23 hij Well, I made some changes to the statistics module (.pm) that will need to be added. It is used to calc. the five point summary that will be used by the macro.
20:24 Paul_Pearson I have been assuming that you want to make a macro that will do the following:
20:24 Paul_Pearson take data as input
20:24 Paul_Pearson produce various graphs as output
20:24 Paul_Pearson and that the output is intended for the students.
20:25 Paul_Pearson Is this correct?
20:25 hij Yes.
20:25 hij I can move the five point summary calculation to the macro. that is not a big deal.
20:25 hij It seemed like it was more consistent with the way thigns are working to keep that in a module.
20:25 Paul_Pearson What file have you been editing in the past?
20:25 Paul_Pearson Was it
20:25 Paul_Pearson lib/WeBWorK/ContentGenerator/Instructor/Stats.pm
20:26 Paul_Pearson ?
20:26 hij one second...
20:26 Paul_Pearson there may be something before the lib/
20:26 Paul_Pearson I can't remember what it is off the top of my head.
20:26 hij I take it back.... I have that in the PGstatisticsmacros.pl.
20:27 Paul_Pearson OK.  Good :)
20:27 hij I made a couple changes to Distributions.pm, though.
20:27 hij We wanted to add a couple more distributions that were not in there.
20:27 Paul_Pearson That's probably OK, too.
20:27 hij the statistics graphics we assumed would be a whole new .pl file.
20:28 Paul_Pearson Right.
20:28 hij The PGgraphmacros seem somewhat focused on a limited number of functions.
20:29 Paul_Pearson Yes, but they have basic graphing tools that you can use to build your own, more intricate macro.
20:30 Paul_Pearson OK.  Log in to a course as a professor and click on file manager.
20:30 hij I am not quite ready to do it now.
20:31 hij I need to poke around a little bit and then coordinate with some other folks to make sure it is okay.
20:31 hij If we get something that we think might be useful to others. What is the best way to offer to share it?
20:31 Paul_Pearson OK.  The process I am asking you to do is localized only to one course and only to pg homework questions that actually load the new macro you're about to create.
20:32 Paul_Pearson So, it's not going to mess up anybody else's stuff.
20:32 hij okay. Do the macros have to be in the standard pg library location?
20:32 Paul_Pearson Here's an overview:
20:32 * hij nods
20:32 Paul_Pearson you create a local copy of the macro and get it working well.
20:33 hij Will it be local to a specific course?
20:33 Paul_Pearson then, you move it to a new location on your server so that it becomes globally accessible to all the courses on your server.
20:33 * hij nods
20:34 Paul_Pearson then, I hope you would be willing to contribute it back to the webwork community.  This step involves github, but other than that it's not hard.
20:34 hij Okay, should we submit an issue or just make a pull request?
20:34 Paul_Pearson yes, local to a specific course. (sorry for not answering that question sooner)
20:34 hij :-)
20:35 Paul_Pearson goehle around?
20:35 hij Is this done through the file manager?
20:35 Paul_Pearson goehle should a new macro file be contributed by submitting an issue or a pull request?
20:35 Paul_Pearson (I am not a github guru)
20:36 Paul_Pearson OK.  After opening the file manager, find the directory called "macros" and double click on it to open that directory.
20:36 hij Got it
20:36 Paul_Pearson In the macros directory, create a new file, e.g., PGstatisticsgraphs.pl
20:37 hij Then copy paste it in?
20:37 Paul_Pearson Yes, copy and paste existing stuff in.
20:37 Paul_Pearson You may also want to use
20:37 Paul_Pearson https://github.com/openwebwork/webwork-open-problem-library/blob/master/OpenProblemLibrary/macros/FortLewis/VectorField2D.pl
20:37 Paul_Pearson as a template for such a file.
20:37 * hij nods
20:38 Paul_Pearson Of course, you can program it however you see fit (I am not advocating my style as a good example of programming).
20:38 Paul_Pearson But the general setup with things like
20:38 Paul_Pearson sub _VectorField2D_init {}; # don't reload this file
20:38 Paul_Pearson sub VectorField2D {
20:38 Paul_Pearson }
20:38 Paul_Pearson 1;
20:39 hij it looks consistent with the webworks styles.....
20:39 Paul_Pearson is a good idea.
20:39 hij gah.... too many tabs open. Got it.
20:39 Paul_Pearson For the version made publicly available, we also like POD documentation to be made part of the macro.
20:40 * hij nods
20:40 Paul_Pearson A good example with POD documentation is
20:40 Paul_Pearson https://github.com/openwebwork/pg/blob/master/macros/problemRandomize.pl
20:40 hij I was going to just copy that from PGgraphmacros.pl and use that as a template.
20:40 Paul_Pearson :)
20:41 Paul_Pearson I have written several macros like the one you're trying to write, so let me know if you have questions about how to do things (e.g., how to fill rectangles with color, etc.).
20:41 hij So can I just add this file to the list in the loadMacros() command in the problem statement? Is that part of the search path?
20:42 * hij nods
20:42 Paul_Pearson Yes, the local macros directory is part of the search path.  Also, the local macros override existing global macros.
20:43 * hij nods
20:43 Paul_Pearson e.g., if you copy PGgraphmacros.pl into the course's local macros directory and edit it, then your local copy will be the one that is run.
20:43 hij So I can just keep the file manager in one tab, the problem in another and just go back and forth saving, testing?
20:43 Paul_Pearson But only within that course.
20:43 * hij nods
20:43 Paul_Pearson That's exactly how it's usually done :)
20:43 hij Excellent.
20:44 hij Thank you!
20:44 Paul_Pearson You're welcome.  In general, we are hoping to have more good stats questions, so your macro would be a valuable addition!
20:44 hij I need to head out shortly. I am going to keep this open to save the links so I can record them first thing in the morning.
20:45 Paul_Pearson These chats are logged
20:45 Paul_Pearson http://goo.gl/jELTn
20:45 hij nice. Got it. Yet another tab to keep open. :-)
20:45 Paul_Pearson Or bookmark :)
20:46 hij yes. That will be tomorrow's activities. Right now I need to get something else finished before heading home.
20:46 hij Thank you again, this has been very helpful!
20:46 hij Is it evening or morning where you are?
20:47 Paul_Pearson late afternoon.
20:47 hij Then have a great afternoon.
20:47 Paul_Pearson I don't want to post my email address here.
20:47 Paul_Pearson It's easy to find: google Paul Pearson and Hope College.
20:47 Paul_Pearson send me an email any time.
20:48 hij Okay, I am Kelly Black at Clarkson.
21:19 goehle hey Paul_Pearson
21:19 Paul_Pearson No.
21:19 Paul_Pearson What do you recommend?
21:19 goehle this is a new pg macro?
21:20 Paul_Pearson It's in the works, yes.
21:20 goehle when its done you should push it to your local pg fork on github
21:21 goehle and then submit a pull request to the develop branch of pg on openwebwork
21:21 Paul_Pearson Thanks!
21:21 goehle no problem
21:21 goehle issues are more like bugs/feature requests
21:22 goehle you can start an issue without having any code
21:22 goehle pull requests are for when you have all of the code ready to go
21:22 Paul_Pearson That's what I thought, but I was not confident in my answer (nor would my answer have been as succinct or precise).
21:23 goehle you going to be at vancouver
21:23 goehle ?
21:23 Paul_Pearson No.  Are you?
21:24 goehle nope
21:24 Paul_Pearson I'm working on pdf hardcopy output for the draggableProofs.pl macros.
21:24 Paul_Pearson BTW, I demonstrated your essay questions for the PREP Problem Authoring people.  They liked it (of course)!
21:25 Paul_Pearson I also added some documentation:
21:25 goehle great
21:25 goehle its a bit lacking in that :P
21:25 goehle if an instructor visits the homework set page
21:25 Paul_Pearson The essay answer works with the average problem grader and the standard problem grader, but not any other weighted problem graders.
21:25 goehle ah
21:26 goehle yeah
21:26 goehle you have it there
21:26 Paul_Pearson I noticed that the problems are gradable from the homework set page.  I need to document that, too.
21:26 goehle what do you mean works with?
21:26 Paul_Pearson In the example at
21:26 goehle does it not save answers appropriately with the other problem graders?
21:27 Paul_Pearson there are two answers: one for a popup and one for the essay.
21:27 goehle sure
21:27 Paul_Pearson Using the average problem grader, if the popup is correct the student gets 50% credit.
21:28 goehle thats if you dont do anything with the grader?
21:28 goehle just the default behavior?
21:28 Paul_Pearson Using the standard problem grader, if the popup is correct the student gets 0% (because this grader withholds credit until all answers are correct).  It's the all-or-nothing problem grader.
21:29 goehle ah sure
21:29 goehle yeah
21:29 goehle although when you go to grade the problem manually
21:29 Paul_Pearson If a custom weighted grader is used to set, say, the popup to be worth 10%, then things go a little haywire.
21:29 goehle it should still show correct and gradeable problems in green
21:29 goehle and incorrect ones in red
21:29 goehle hows that?
21:29 Paul_Pearson I don't remember exactly what happens, but this sort of issue has nothing to do with code that you wrote.
21:30 Paul_Pearson It's part of the limitations of webwork problem grading as implemented when webwork was still an infant.
21:30 goehle Is it just because it expects everything to be either right or wrong?
21:31 Paul_Pearson I think it's got something do do with the scores that ANS( ) records in the gradebook and how the results of ->cmp are handled by ANS( ).
21:31 Paul_Pearson I never looked into the details of this, though.  Mike would be the one to ask.
21:32 Paul_Pearson I could be totally wrong...
21:32 goehle pg is one of the things that I haven't looked at really closely
21:32 Paul_Pearson about the ANS() and ->cmp stuff.
21:33 goehle I'll put it on the list of things to think about.  It seems reasonable that someone would want to specify in the problem what the essay portion is worth
21:34 goehle anyway, I've got to head out
21:35 goehle cheers
21:35 goehle left #webwork
22:34 mgage joined #webwork
22:50 Paul_Pearson mgage I had an interesting discussion with Kelly Black at Clarkson about developing new macros for statistics graphing (box plots, histograms, etc.).
22:50 Paul_Pearson (The discussion was on IRC)
22:51 Paul_Pearson Also, I sent you, Davide, and JT an email about draggableProof.pl
22:52 Paul_Pearson I was able to hack the \begin{verbatim} Correct answer \end{verbatim} by using \begin{verbatim}\end{verbatim} Correct answer \begin{verbatim}\end{verbatim} so that the correct answer was not formatted by the verbatim environment.
23:02 mgage on the other hand if you use this in any situation where the student has free form input you will have trouble if the student enters something like _  or = or anything that TeX doesn't like in its current mode.  That's why the \verb was there in the first place.
23:02 mgage I think it's worth coming up with a long term solution for line breaks.
23:02 mgage in answers in tex
23:04 mgage Another thought that occurred to me is that we really should develop some alternate tex "fillers" for the headings of tex and between problems and all that kind of thing.  It might actually be better for student's studying if we used single columns, perhaps with some space.
23:04 mgage It would be nice to be able to choose a variety of download formats, along with themes, language and so forth.