WeBWorK Problems

modifying existing problems

modifying existing problems

by Arnold Pizer -
Number of replies: 2
Hi folks,

A new course, rollins-mat140, was created for me yesterday (thank you, Rajiv) on the Rochester server.  I used the Library browser to find some discrete math problems, and I created a new problem set called MAT140ProbSet1-Logic and imported about 14 problems that I found.  There are several more I intend to import, but I want to first experiment with these in order to become familiar with the system.  In particular, my plan was to import various problems, use some as is, but modify others.  For instance, one of the problem files I imported was Library/ASU-topics/setDiscrete/katie5.pg, which was a truth table problem.  What I’m hoping to do is create a bunch of truth table problems using that particular one as a template.  Because I know nothing about the PG language and I only have a few weeks before my class begins, being able to modify problems that other folks have created is critical to my initial experimentation with Webwork.

 

I’m hoping you can help resolve the following difficulty I’ve encountered.

 

The full pathname of the original .pg file for the first problem I imported was Library/Rochester/setDiscrete1Logic/ur_dis_1_1.pg.

 

I modified parts of the problem and I selected Save as a renamed the path name, local/Library/Rochester/mat140jy/jy1.pg.  Notice that I chose to change the subfolder name “setDiscrete1Logic” to “mat140jy” to help me identify this new set of problems I was creating for my course.  I hope that was okay to do.

 

I modified the .pg file once again, but when I tried to save it to the same jy1.pg file, the following message appeared:

File '[TMPL]/local/Library/Rochester/mat140jy/jy1.pg' exists. File not saved. No changes have been made. You can change the file path for this problem manually from the 'Hmwk Sets Editor' page

 

So from the Hmwk Sets Editor I selected Save As local/Library/Rochester/mat140jy/jy2.pg, and the modified problem appears as I want it. Does this mean that the jy1.pg file is essentially a dead file, or is there some way I can delete it or overwrite it?

 

In summary, when I create a pathname starting with “local/”, is there a way that I can reuse that particular filename for subsequent modifications?

Thanks in advance,

--Jay
In reply to Arnold Pizer

Re: modifying existing problems

by Arnold Pizer -
Hi Jay

What I’m hoping to do is create a bunch of truth table problems using that particular one as a template.  Because I know nothing about the PG language and I only have a few weeks before my class begins, being able to modify problems that other folks have created is critical to my initial experimentation with Webwork.


This is exactly the right way to start, and you'll progress quickly in understanding how things work.  If you haven't already found it, there is a lot of authoring documentation on the wiki when you're ready for it:

http://webwork.maa.org/wiki/Category:Authors

After you get the basics down, this section is very helpful:  http://webwork.maa.org/wiki/Category:Problem_Techniques
 

I modified parts of the problem and I selected Save as a renamed the path name, local/Library/Rochester/mat140jy/jy1.pg.  Notice that I chose to change the subfolder name “setDiscrete1Logic” to “mat140jy” to help me identify this new set of problems I was creating for my course.  I hope that was okay to do.


Yes, it's your course and you are free to organize the files you put in there in whatever way you find most helpful.

 

I modified the .pg file once again, but when I tried to save it to the same jy1.pg file, the following message appeared:

File '[TMPL]/local/Library/Rochester/mat140jy/jy1.pg' exists. File not saved. No changes have been made. You can change the file path for this problem manually from the 'Hmwk Sets Editor' page

 

So from the Hmwk Sets Editor I selected Save As local/Library/Rochester/mat140jy/jy2.pg, and the modified problem appears as I want it. Does this mean that the jy1.pg file is essentially a dead file, or is there some way I can delete it or overwrite it?

 

In summary, when I create a pathname starting with “local/”, is there a way that I can reuse that particular filename for subsequent modifications?

Yes - the saving options at the bottom of the homework sets editor can be confusing at first.  "Save as:" should be used whenever you want to save a problem under a new name as you did with jy1.pg.  The other option is "Save to:" this is used to save modifications to a problem under its existing file name.  

The error message you got is from leaving "Save as:" selected.  When you have that selected, webwork assumes you want to save it under a new name, so it objects if the name is the same as the name of an existing problem file.  This screenshot will show you what I mean:

http://screencast.com/t/rdrrxeuO

 Hope this helps,
Jason
In reply to Arnold Pizer

Re: modifying existing problems

by Arnold Pizer -
Hi Jay,

Jason beat me to answering your question.  As he said, you did the correct thing using Save As at first (since you do not have permission to modify problems in the NPL), but once you own a problem you can edit it and Save the new version or Save As under a new file name. But if you try to Save As to an existing file, you get the error you saw.

I have moved your email and Jason's reply to the forum (http://webwork.maa.org/moodle/mod/forum/view.php?id=4) so this information is available to other people. The forum is a good place to post such questions.

Arnie