Closed gabindu closed 3 years ago
EDIT: I didn't read to the end of your issue the first time. OOPS.
You have to put the js
subdirectory in the already existing course html directory. From your templates (File Manager) directory, press the up arrow. This is your course directory. Double click the html
directory that is already there and this is where you need to create the js
subdirectory.
Also the macros
subdirectory is an already existing subdirectory of your templates directory, but I think that you will not need to add draggableProof.pl
there, the version we have on the server is up-to-date.
Original (too hasty) reply):
To make that particular problem work in your course seems straight-forward. My experimentation shows that what is needed is:
Create a js
subdirectory in the course html directory
place a copy of jquery.nestable.js
in that js
subdirectory
jquery.nestable.js
could come from the original source https://github.com/RamonSmit/Nestable2, but I think it would be better to use the version used by Peter Selinger when he was revising draggableProof.pl
. That version is available from https://www.mathstat.dal.ca/~selinger/downloads/draggable/I have tested and this is working on our server with the addition of the jquery.nestable.js
in my sandbox course.
You can add it to your course, or I can add it to your course if you like, let me know.
We can't add jquery.nestable.js
to a global server location as draggableProof.pl
specifically references the $courseHtmlUrl
location. (This is a To do: in draggableProof.pl
, but when that will get addressed I have no idea).
I don't know the maintenance status of draggable proof type problems in the OPL. There seems to be only sporadic activity.
Hm, I've done exactly that, but it doesn't seem to work for me. Where exactly is the course html directory? I've tried putting js
directly in the main directory of my course, and also creating a subdirectory html
(which didn't exist) and putting js
(and jquery.nestable.js
in there), but neither works.
ah, never mind, I just realized that I was always looking in the default, template
folder for my course and never went a level up. Working now, thanks.
As for the future (when I forget in about 5 minutes time what I had to do - ahem), I understand that there's no nicer solution and it depends on an upstream fix, but couldn't we simply prophylactically create that js
subdirectory with that file for all newly created courses? (Are there any custom scripts which can automatically be run when a course is created, so this could be done automatically maybe?)
Yes, I was thinking about this some. There is no easy way that I know of to pre-populate an html/js
, but I will poke around a bit and see what I can find out. When we create a course, the templates
directory from the model course gets copied across, but I don't think anything 'higher up' gets copied over. I'll try to dig up where those other directories (html, logs, scoring, ...) are determined.
I was wrong, we can do it. Adding a js subdirectory to the html directory in every model course and uploading a copy of jquery.nestable.js
there will resolve the issue for every course created going forward (provided it is created based on one of our standard model courses).
html/js/jquery.nestable.js
to every model course.for dest in model*/html; do sudo -u www-data -g wwdata mkdir -p "$dest"/js; sudo -u www-data -g wwdata cp jquery.nestable.js "$dest"/js; done
did the trick
Stretch:
Everything in /templates/
and everything in /html/
is copied from the model course to the newly created course. Nothing else is.
Although some of the wiki documentation indicates that only the templates
directory of the model course is used to pre-seed the new course, the code in WeBWorK::Utils::CourseManagement addCourse copies across the full contents of the templates
directory and the html
directory.
I tried to use one of the "draggable" problems from the OPL - and the dragging simply doesn't work.
Example: https://webwork.champlainww.ca/webwork2/201-203-INDURSKIS/FinalExam-Review/5/
I actually remember having run into that problem in the past, and it seems to be a generic problem. Any chance of looking into this, so using
draggableProof.pl
runs out of the box on our server?Here are some relevant links on the topic I've found:
https://github.com/openwebwork/webwork-open-problem-library/issues/622
https://webwork.maa.org/moodle/mod/forum/discuss.php?d=4335
https://www.mathstat.dal.ca/~selinger/downloads/draggable/
(I've tried following the instructions mentioned there, creating a
html/js/
andtemplates/macros/
folder in my course directory, putting injquery.nestable.js
anddraggableProof.pl
, respectively - to no avail.)