openlab-at-city-tech / webworkqa

WeBWorK integration for WordPress and BuddyPress
GNU General Public License v2.0
4 stars 2 forks source link

Find a way to handle GeoGebra question #92

Closed moui72 closed 7 years ago

moui72 commented 7 years ago

GeoGebra is different Math open source application, draws mathematical figures, lets you click and drag things. It's a standalone application, can take something that you've made in GeoGebra and turn it into an applet. New WW feature allows you to integrate a GeoGebra applet into a WW problem - integrated kludgily, copy and past Java applet code into WW problem. Just experimenting with it - only being used by techie people right now. But has attracted interest because it looks cool and has a lot of potential.

What does that do to us? How do we handle a problem tha that has this in it? Do we want to enable any functionality around thsis stuff?

FOR NOW: Implement a method to handle (but not necessarily display) these problems, maybe with a backlink, so that they don't break WW-OL if asked about.

boonebgorges commented 7 years ago

@moui72 (or @drdrew42) - can you please provide me with a link to an accessible WW problem that contains one of these questions? I'll need to see what it looks like in order to detect it on the WP end.

moui72 commented 7 years ago

I think this is up to @drdrew42 as I have no idea where to find one

On Tue, May 30, 2017 at 3:38 PM Boone Gorges notifications@github.com wrote:

@moui72 https://github.com/moui72 (or @drdrew42 https://github.com/drdrew42) - can you please provide me with a link to an accessible WW problem that contains one of these questions? I'll need to see what it looks like in order to detect it on the WP end.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/livinglab/webwork-for-wordpress/issues/92#issuecomment-304985512, or mute the thread https://github.com/notifications/unsubscribe-auth/ADtKPONvNN3wKBOY3cVtcr7t3eeinH9wks5r_HBQgaJpZM4NYPWI .

drdrew42 commented 7 years ago

I have not coded any problems that use the GeoGebra applets yet. I put a sample problem that uses GeoGebra in Tyler's test course.

moui72 commented 7 years ago

@drdrew42 sorry, what's the login info for that course? My usual didn't work.

@boonebgorges are you waiting on me to post this problem to webwork-playground?

drdrew42 commented 7 years ago

I've put one of the new GeoGebra problems in the WW-Dev course, that way it can easily be tested on OL-playground

boonebgorges commented 7 years ago

@moui72 I haven't gotten to this issue yet as it seemed from conversations that it was more speculative than anything else. If you're able to test and identify existing issues, it would help me, but otherwise I will slate some time in the next two days to look at it myself.

drdrew42 commented 7 years ago

I attempted to post a question on the GeoGebra WW problem, and the result was that only the text was posted to the OL. I'm sure that we don't actually want to embed the applet, however there is an associated static image that is provided on the WW side (so that PDFs can be generated). I don't know if it's possible to retrieve these image files when posting to OL... or if it's even necessary?

boonebgorges commented 7 years ago

@drdrew42 Could you please post a sample question to WWDev, where I'll have access and can test? The static image seems like it'd be fine, but I'm unsure whether WW sends it over.

drdrew42 commented 7 years ago

It's already there: http://mathww.citytech.cuny.edu/webwork2/WW-Dev/GeoGebra/1 I'm not sure how WW handles the static image, it might only appear when generating the PDF copy of the problem set...

boonebgorges commented 7 years ago

@drdrew42 Thanks. I see it now.

It looks like WeBWorK sends the encoded GeoGebra applet itself as part of the POST payload, but I don't see a reference to a thumbnail image. Can you say more about how PDFs are generated in the WW interface? I can try to poke into the WW codebase to see if there's a reusable tool there.

Barring that, perhaps we could have some sort of placeholder? Maybe text (or an image?) that says "Visit WeBWorK to view this interactive content", which would be a link back to the WW problem?

drdrew42 commented 7 years ago

Eww. That's a nasty chunk of garbage then.

The static images here are a bit different than images in other problems, as they're never intended to be accessed externally. The images live in the same folder as the source code for the problem, rather than in the htdocs subdirectories.

When requesting a PDF copy of a problem set, WeBWorK runs pdflatex behind the scenes and transfers the PDF file to an htdocs subdirectory for hardcopies, where it is available for download. If I'd thought this through more carefully, I'd have realized my own wishful thinking.

I think a placeholder image would be the most straightforward, as the text of these problems should contain all the necessary information in most cases. I'd also imagine that a WW linkback would be difficult, as we cannot assure the viewer that we're sending them back to their proper course... and sending them to the wrong course would be frustrating as even their correct login would not work.

drdrew42 commented 7 years ago

From the source code of the problem: TEXT($PAR, MODES(TeX=>$im, HTML=>$applet->insertAll( debug =>0, reinitialize_button => 1, includeAnswerBox=>1, ))); The problem responds differently if it's being rendered in HTML mode vs TeX mode (for PDFs) The variable $im is simply a reference to the name of the image, along with some options for setting dimensions of the image.

boonebgorges commented 7 years ago

Thanks for doing this research, @drdrew42. If pdflatex is part of the solution, there must be some more magic happening, because the applet is not LaTeX. This confirms my suspicion that doing a similar rendering on the WP side is going to be a large undertaking, definitely not feasible for this term.

You make a good point about the linkback URL. We've got a couple different user types to think about when considering a problem that contains GeoGebra:

  1. Non-logged-in viewers
  2. Viewers who are logged in to the OL but have never posted anything to OL-WW
  3. Viewers who have posted responses, but no questions, to WW
  4. Viewers who have posted questions to WW, but no questions about the specific GeoGebra problem
  5. Viewers who have posted a OL-WW question about the specific GeoGebra problem.

Only in case 5 do we have 100% reliable information about the return URL. In case 4, we can try to make some inferences, but they won't be 100% reliable (Joe posted a question that's linked to section A; therefore Joe is a member of section A; Jane has posted a question on the GeoGebra question linked to section A, and therefore we have Jane's return URL; therefore when Joe views that GeoGebra question, we can assume that Joe can use Jane's return URL). In the other cases, we have really no reliable information at all about what the return URL should be. See #14 for related considerations.

So, a placeholder image (or text) seems like the best. I'd suggest that it contain text along the following lines:

This problem contains interactive elements that cannot be displayed on the OpenLab. Please visit your WeBWorK course to see the full problem content.

If we display it as text rather than an image, we could at least suggest something like: ... See Problem XYZ in your WeBWorK course, where XYZ is the problem ID visible to the user (not 100% reliable across courses, but from my understanding, it's generally consistent).

@drdrew42 Could you weigh in with thoughts about language? Let's do something simple for Fall, and consider what a more robust solution would look like for a future term.

drdrew42 commented 7 years ago

If pdflatex is part of the solution, there must be some more magic happening, because the applet is not LaTeX.

The magic is in the code I pasted - the source code for the problem either inserts the $im code (in TeX/PDF mode) or it inserts the $applet->insertAll (in HTML mode). So the problem itself represents differently based on the context of who's "looking" at it.

I think your suggestion for text replacement is good - Particularly because we know the problem set name and the problem number (at least for any course following the default layout, as you pointed out). I agree that considering a more robust solution for the future is recommended, as a simple fix such as the text replacement will certainly suffice for the fall.

moui72 commented 7 years ago

we need exact wording for the placeholder text from @drdrew42 or @jspevack

drdrew42 commented 7 years ago

I'm okay with Boone's suggested text. Further consideration inclines me against including reference to "Problem XYZ", as it seems more or less unnecessary and could potentially cause confusion for any students who's instructors modified the problem set. They already have access to see which problem set it comes from, by looking to the problem header...

boonebgorges commented 7 years ago

I've got an initial implementation of this working. See http://openlabdev.org/webwork-playground/#:problemId=local/setGeogebra/circle-center-multians-inc/circle-center-multians-inc.pg:questionId=11451 and the screenshot below. Styling is minimal but (I hope) OK for the fall. Ping @jennaspevack in case there's some visual mods she can suggest.

screenshot_2017-08-10_13-25-49

moui72 commented 7 years ago

looks great for individual instances of the problem, but when not logged in, or logged in as a user who doesn't didn't post the question, e.g., tpeckenpaugh the "general" version of the problem does not contain the placeholder text is missing.. not sure if this is as intended, but to me it seems like it would be nice to have it there if it's feasible to do so

geogebra

boonebgorges commented 7 years ago

Be sure you're testing with new content. The replacement only applies to newly-imported stuff, and it sounds like you're seeing the version of the plugin imported before the fix. (You might have to delete existing content on webwork-playground. Are you able to do that?)

moui72 commented 7 years ago

im out of time for today but ill look again tomorrow

moui72 commented 7 years ago

ugh, sorry, ill get to this ASAP

bree-z commented 7 years ago

This looks good to me! At first I saw the same thing as @moui72 but then I deleted all geogebra questions and now this is what I see:

geogebra

moui72 commented 7 years ago

Thanks bree. What about the one at the top not tied to a specific questions?

moui72 commented 7 years ago

I looked and it is good!