Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only static text as caption? #56

Open
raba34 opened this issue May 23, 2022 · 21 comments
Open

Only static text as caption? #56

raba34 opened this issue May 23, 2022 · 21 comments

Comments

@raba34
Copy link

raba34 commented May 23, 2022

Hello,

it looks like you can only enter static text as caption.

"Use text as caption" has no effect.

Also the placeholder %c has no effect. I had written the boolean variables in a table column and right next to it in the next column the text. Unfortunately also no effect. It simply appears "%c" in the field of the variables.

Ralph

@PhMemmel
Copy link
Member

Hi @raba34,

could you please provide a sample GGB file and some screenshots to exactly describe what you are trying to achieve? Thanks in advance!

@raba34
Copy link
Author

raba34 commented May 24, 2022

Hello,

I have attached four screenshots.

The first two images show the normal error-free behavior. Images 3 and 4 show what happens when you use a separate text for the label.

In image 1 you can see how a static text is created as a label for the boolean variable.

This is image 1
geo1

In image2 you can see that the label is displayed correctly in the GeoGebra task in Moodle.

Thist is image 2
geo2

In image 3, the label is first created as a separate text.

Thist is image 3
geo3

In image 4 you can see that the label is not displayed.

This is image 4
geo4

The GGB file (Punkte2.ggb) for image 3 can be found at

https://oszlisemeitner-my.sharepoint.com/:u:/g/personal/ba_osz-lise-meitner_eu/EfNts-cRHKhHn_yo9F5L8rMBAQmE22D1UAFfRQfSKKUxDQ?e=aDbrdb

@murkle
Copy link
Contributor

murkle commented May 24, 2022

Your .ggb file is using "text as caption" on
beside=abs(A - B) < 1
which is not a drawable object so has no label.

Please provide a .ggb file showing the problem you originally describe with %c

https://wiki.geogebra.org/en/Labels_and_Captions

@raba34
Copy link
Author

raba34 commented May 24, 2022

Could it be that there is a misunderstanding here?

With the "moodle-qtype_geogebra" it is necessary to label the boolean variables. This label is used for the feedback as text. This is how this task type is constructed.

As you can see in image 1 and in image 2 it works for static text too.

Before I document the more complicated case "%c", let's first discuss the simpler case I have shown in Image 3 and 4.

@murkle
Copy link
Contributor

murkle commented May 24, 2022

Please send the .ggb file for %c

@raba34
Copy link
Author

raba34 commented May 24, 2022 via email

@murkle
Copy link
Contributor

murkle commented May 24, 2022

Sorry, I don't see the .ggb file

@raba34
Copy link
Author

raba34 commented May 24, 2022 via email

@murkle
Copy link
Contributor

murkle commented May 24, 2022

Thanks, I've had a look and the API call ggbApplet.getCaption() returns just the "raw" caption ie what the user has typed in the Caption textfield

so ggbApplet.getCaption("A1") returns "%c" and the "Use text as caption" doesn't affect what ggbApplet.getCaption() returns (as you've noticed) so you won't be able to use those features

@raba34
Copy link
Author

raba34 commented May 24, 2022

So my guess is correct: only the exact text that is entered directly at the label is output. So neither the replacements like %c nor the possibility to specify the value of a text variable works.

If this is true, then the only feedback is: "The result is correct." if the variable is true, and no feedback if the variable is false.

But this is very inflexible. Aren't there other ways to make the feedback more flexible?

@PhMemmel
Copy link
Member

PhMemmel commented May 24, 2022

OK, as far as I can tell: the getCaption function does seem to support placeholders (%c etc.):

grafik

The issue here is probably that qtype_geogebra does not use this function, but extracts the caption directly from XML using a XML parser. As far as I can see this could be reworked to use the getCaption function of the GeoGebra API.

I think we can adress this while doing the rework.

@murkle Can you confirm I got this right?

@murkle
Copy link
Contributor

murkle commented May 24, 2022

Ah, good spot! Yes, using getCaption() should fix the %c issue at least 😄

What else is being extracted directly from XML?

@PhMemmel
Copy link
Member

Not 100% sure if there are other places where XML is being read. Having a first look it does not seem to be used in other places, at least not in the JS code. I'm not sure, why the feedback is being extracted with a XML parser (which didn't even work in all cases, see the fix #54 which has recently been merged). Maybe the getCaption function has not been there at the point this has been implemented.

In general: If there is an API function IMHO we should use it, the target is to remove XML as a data structure completely anyway for this plugin and just rely on base64, see #55 .

@raba34
Copy link
Author

raba34 commented May 25, 2022

Since I don't understand the programming details, I wanted to ask if this activity here indicates that the fixes are being addressed and a result can be expected soon.

@PhMemmel
Copy link
Member

PhMemmel commented May 25, 2022

The issue concerning the placeholders can and will be adressed most likely. If it will be possible to also deal with the associated text labels as caption instead of the description itself, I can't tell right now.

However, the way we extract these information will have to be completely rewritten to make this work. We plan to rework a lot of the code in this plugin anyway. While doing so we will try to adress these issues as well. So the answer would be "Yes, we will adress this", but this will take some time until it will make it into a production ready version of this plugin, sorry.

@raba34
Copy link
Author

raba34 commented May 25, 2022

I find it very pleasing that finally someone cares more intensively about this plugin. Many thanks for that!

But if I understand correctly, it's only about replacing %c, %v and %n. %x, %y and %z don't make sense here, do they?

@PhMemmel
Copy link
Member

I can only assume right now, but the idea is to use the GeoGebra internal function to retrieve the caption which should ideally deal with all the possible placeholders in GeoGebra. If this is working out the way I imagine we should be able to support the captions like GeoGebra does, because we basically use the exact same function.

@raba34
Copy link
Author

raba34 commented Oct 11, 2022 via email

@PhMemmel
Copy link
Member

Could you please also add the pictures you are referring to? Github probably does not add mail attachments when replying via mail. You probably need to use the github issue tracker via browser directly.

@raba34
Copy link
Author

raba34 commented Oct 12, 2022

Hi @PhMemmel ,

it is a pleasant surprise to receive feedback after almost five months. Since I delete very little in the "Download" directory, the four files mentioned are actually still there. I attach them to this message.

Best Regards,
Ralph

================== geo1.jpg =========================================================

geo1

================== geo2.jpg =========================================================

geo2

================== geo3.jpg =========================================================

geo3

================== geo4.jpg =========================================================

geo4

==================================================================================

@PhMemmel
Copy link
Member

Thank you for the screenshots. The issue is quite clear now. Unfortunately, there are a lot of things with higher priority on our list and we will only be able to tackle this issue while going for a bigger rework which will take some time, sorry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants