OPL Maintenance

How to contribute a library

How to contribute a library

by Mike O'Sullivan -
Number of replies: 5
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.