OPL Maintenance

How to contribute a library

How to contribute a library

by Mike O'Sullivan -
Number of replies: 7
I've a library of problems and I want to 
1) See how the problems are rendered by WebWork, using my iMac.
2) Submit the library to the OPL.

I followed the instructions at 
http://webwork.maa.org/wiki/Installing_from_WW2.7_Ubuntu12.04_Vanilla_Virtual_Machine_Image#.U6209cZRI-Y
to install virtual box and the WebWork virtual machine.
I also changed passwords like a good boy.

I also followed the instructions at 
http://webwork.maa.org/wiki/Submitting_problems_to_the_OPL#.U621zcZRI-Y
to install Github, create an Github account, create a  Webwork fork for myself and clone the library.

Questions:  
1) Where should I clone the library? In my home account on my iMac?
Or within the virtual machine?  And, if the latter, where.
2)  When I use Firefox within the virtual machine to access webwork, I'm not sure which copy of the OPL I am looking at (by the way it is call National
Public Library not OPL in the Library Browser).  When I use the library Browser and search Local Problems, the only thing I see is "achievements".

3) My goal is to have my Library in my Github clone /Contrib directory.
I would like to be able to edit those files and quickly see how they render in Webwork.  I'd like to do this in the most vanilla fashion possible.

Thanks
Mike



In reply to Mike O'Sullivan

Re: How to contribute a library

by John Jones -
Hi,

I haven't used virtual machines with webwork myself.  Some of your questions seem to related to the disk seen by the virtual machine.  In short, the OPL should be cloned on that disk.  Assuming your virtual machine already has /opt/webwork/webwork2 and /opt/webwork/pg, you can put it in /opt/webwork/libraries/OPL.  There is a configuration line which needs to point to .../webwork-open-problem-library/OpenProblemLibrary.

Setting up a link to Contrib is, I am afraid, another bit of setup, and is essentially undocumented.  Inside the templates directory of a course, make a symbolic link to Contrib with something like

  ln -s /opt/webwork/libraries/webwork-open-problem-library/Contrib Contrib

You can add one more directory level after Contrib if you only want to see a particular subdirectory of Contrib.  You should then be able to browse inside Contrib.

A little nicer is if you also find $courseFiles{problibs} in webwork/webwork2/config/localOverrides.conf and add a line saying

Contrib => "Contrib",

to the list.  Then you should get a button in the library browser labelled Contrib which sets you to browsing just the contents of Contrib.

Of course, post again if you have questions or problems.

John

In reply to John Jones

Re: How to contribute a library

by Louise Wilson -
I have made some Geometry problems, and I've touted WebworK enough that some other high schools want my Geometry problems.
So I am trying and failing to add problems using this github system
I created a fork at https://github.com/jlouisewilson/webwork-open-problem-library. Made a clone onto my own machine. I put a folder in to "contrib" on my own machine. I added in my files ( which I have changed to make sure they point to things already in your list, so middle school and geometry_figures)
Now here's where it breaks down. I can do sync. i can do push. I have no idea what these mean, I think it is supposed to make the remote fork be the same as my local repository. But instead it created another repository called "louise" I have no idea how to get the folder and files into where they are supposed to be under "contrib", nor how to make them wave their hands to say "hey guys, please check out these files and put them in the library." I spent 10 hours on this yesterday, I have emailed to the Github people. Nobody seems to understand my question or my problem.
Please, I beg you, can anyone explain to me in simple words ( because I am a bear of very little brain) how to do this? I attach the .doc with my screenshots, in case that helps. well, if it's small enough I do.
I am really sorry for thrashing around like a wild beast on the gitplace, I have no idea what I have done.
In reply to Louise Wilson

Re: How to contribute a library

by John Jones -
Hi,

I am not a github expert, but from the screenshots it looks like what happened was
  1. you created a fork of the opl (which is what you wanted)
  2. in that, you made a branch called louise (not necessary, and part of what is going to confuse matters)
  3. when you pushed, you ended up creating a new github repository called louise
The last is definitely not what you wanted.  Here is what I would do if I were you.  Commands are approximately right -- they depend on actual paths.

  1. Go to a new directory on your server (say "mkdir /opt/opl/fixup", change permissions first if need be or use a different path).
  2. cd /opt/opl/fixup
  3. git clone git@github.com:jlouisewilson/webwork-open-problem-library.git
  4. cd webwork-open-problem-library/Contrib
  5. if needed, mkdir louise (or better, use your institution as the name of the directory such as mkdir GRPS)
  6. cp -R /path/to/old/directory/* GRPS
  7. ls GRPS (to check that things ended up they way you want them, adjust if needed)
  8. git add GRPS (it should add the current directory and everything in subdirectories)
  9. git commit (you need to write a commit message)
  10. git push
If something goes wrong, post here.  If all is well, then go to your fork on github and look to the upper right of the directory listing of your fork.  There is an icon next to "Pull Request" (or search the page for that phrase).  Click to make a pull request, confirm, and wait.

John

In reply to John Jones

Re: How to contribute a library

by Louise Wilson -
Okay, I am just a person at home. So I presumed this meant add a new folder. I made one called ~/opt/opl/fixup
I used the gitbash window to git clone http://github.com/jlouisewilson/webwork-open-problem-library.git
I did cd webwork-open-problem-library/Contrib
I did mkdir GRPS
I could not do cp-R because it did not like the ~ or the /to lead the path, and I did not know what protocol to start with. I copied the files into the folder using the windows file thing ( I'm sure it ahs a name) copy and paste.
Is GRPS did nothing for me. I went to github and saw that the files were there.
I did git add GRPS I don't know what that did
I did commit using github. I don't know what that did.
I did push using github.
That gave me error: failed to push some references
Updates were rejected because he remote contains work that you do not have locally. This is usually cause by another repository pushing to the same ref. You may want to first integrate the remote changes ( e.g. git pull...) before pushing again.

I did try making another directory yesterday, and ended up in this same place (now I have 3 copies of the library on my hard drive, I am hoping to dispense with 2 of them...)
So I am stuck, because I don't know how to get the work to push up to the remote site...
But am so grateful that you sent me something!!
In reply to Louise Wilson

Re: How to contribute a library

by Louise Wilson -
Oh my god, suddenly I have GRPS loaded onto the repository. I did get rid of all the branches you said were a problem, then just kept trying commit and push.
Anyway i hope I have quick generated a pull request before everything disappears (oh, magic).
I have to have a rest before I try and put up the rest of the problems.
15 hours. I am waaay too old for this.
Thank you.
In reply to John Jones

Re: How to contribute a library

by Leah Bridgers -

Hi,

I think this thread is the closest to the problem I am having that I can find. I am also trying to add a library of problems that a colleague and I have created and have been using locally by just copying them from one course to another. It is time to officially upload them and try to create a Contrib folder, and eventually submit some of them for inclusion in the OPL.

I am trying to following the instructions here: https://webwork.maa.org/wiki/Submitting_problems_to_the_OPL

I have forked the OPL, but I get stuck at the very next step. I am trying to use Gitbash to clone the copy on my desktop computer. However, after running the commands listed, I check the directory that has been created and it is empty (other than some hidden files that do not include a Contrib folder). This means I have no way to do the next step in the process to add and edit my problems in the Contrib subdirectory. 

I did manage to clone a copy onto my desktop using Github desktop, but then I could not figure out how to go any further because the rest of the instructions use command line instructions. When I tried to continue with the next step (git push) using the copy cloned using github desktop, Gitbash told me that the process failed.

I should mention that I do not fully understand what any of these things is trying to do. This is my first time using github, and I am not really sure what is going wrong here or why. Any assistance would be greatly appreciated.

In reply to Leah Bridgers

Re: How to contribute a library

by Leah Bridgers -
I am replying to myself to say that I think I have fixed my issue. Apparently asking on this forum for help was what it took to get the idea of something to try that actually worked