marcusgreen / moodle-qtype_wordselect

langHighlight words by clicking e.g. select all nouns in this sentence
2 stars 10 forks source link

Wordselect doesn´t show images #47

Open juanpablopradootero opened 2 years ago

juanpablopradootero commented 2 years ago

I have a question using images but when I upload them into moodle the images are broken. here the screeenshots and the code. Thanjs BEFORE PREVIEW imagen1 IN PREVIEW AND TEST MODE imagen2

CODE OF QUESTION:


1. 1
A.
[B.]
C.
in a shop
in a library
in a hotel

2. 2
A.
B.
[C.]
in a museum
in a hotel
at a market
3. 3
[A.]
B.
C.
in a classroom
in a museum
in an office
4. 4
A.
B.
[C.]
in a school
in a hospital
in a department store
5. 5
A.
B.
[C.]
in a theater
in an airport
in a station



marcusgreen commented 2 years ago

I would require a dump of the question in xml format to investigate further. Here is an example of the question type using and image.

image
juanpablopradootero commented 2 years ago

Thank you, Here I attach the file, I have tried with Mozilla, and Google Chrome, and I get the same, I mean it is not showing the images. Thanks a lot for any support

juanpablopradootero commented 2 years ago

Sorry Here, I attach the file thanks [questio with word select.zip](https://github.com/marcusgreen/moodle-qtype_wordselect/files/8952768/questio.with.word.select.zip)

marcusgreen commented 2 years ago

I can reproduce what you are seeing and I don't know why it is happening.

juanpablopradootero commented 2 years ago

Thank you for your response. I attach the video, do you think is it my laptop? I will try with a different one. Thanks

On Tue, Jun 21, 2022 at 4:17 PM Marcus Green @.***> wrote:

I can reproduce what you are seeing and I don't know why it is happening.

— Reply to this email directly, view it on GitHub https://github.com/marcusgreen/moodle-qtype_wordselect/issues/47#issuecomment-1162376963, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJN4N4DL5SOVO4EUJGCRT6TVQIWPXANCNFSM5ZNHH7YA . You are receiving this because you authored the thread.Message ID: @.***>

--

Declinación de Responsabilidades: Los servicios de MISENA son soportados tecnológicamente por © Google y ofrecidos por el Servicio Nacional de Aprendizaje – SENA de manera gratuita a los aprendices e instructores de programas de formación titulada, las opiniones que contenga este mensaje son exclusivas de su autor y no representan la opinión del Servicio Nacional de Aprendizaje o de sus autoridades. El receptor deberá verificar posibles virus informáticos que tenga el correo o cualquier anexo, razón por la cual el SENA no es responsable de los daños causados por cualquier virus transmitido en este correo electrónico.

Los contenidos, textos, imágenes, archivos enviados en este mensaje son responsabilidad exclusiva del remitente y no reflejan ni comprometen de ninguna manera a la institución. No se autoriza el uso de esta herramienta para el intercambio de correos masivos, cadenas o spam, ni de mensajes ofensivos, de carácter político, sexual o religioso, con fines de lucro, con propósitos delictivos o cualquier otro mensaje que se considere indebido o que vaya en contra de la Ley.

juanpablopradootero commented 2 years ago

https://user-images.githubusercontent.com/39569136/174900827-9378e47e-1ed8-4705-abba-406b06a45d49.mp4 Here the video Thank you, what do you suggest to me? Thanks

juanpablopradootero commented 2 years ago

May I get the code of the question you sent me with the cat's image? I would like to see what is the difference in checking my questions Regards

marcusgreen commented 2 years ago

It is probably a bug. You can get the example questions from here.

https://github.com/marcusgreen/moodle-qtype_wordselect/blob/master/examples/en/wordselect_examples.xml

I think the difference is that I have copy/pasted the images into the questions and you have added them via the editor button. That should work but it seems it does not, my apologies.

juanpablopradootero commented 2 years ago

It is okay, Thank you so much Regards

On Tue, Jun 21, 2022 at 5:14 PM Marcus Green @.***> wrote:

It is probably a bug. You can get the example questions from here.

https://github.com/marcusgreen/moodle-qtype_wordselect/blob/master/examples/en/wordselect_examples.xml

I think the difference is that I have copy/pasted the images into the questions and you have added them via the editor button. That should work but it seems it does not, my apologies.

— Reply to this email directly, view it on GitHub https://github.com/marcusgreen/moodle-qtype_wordselect/issues/47#issuecomment-1162417710, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJN4N4BS6ZASIQUUYMSSBX3VQI5ENANCNFSM5ZNHH7YA . You are receiving this because you authored the thread.Message ID: @.***>

--

Declinación de Responsabilidades: Los servicios de MISENA son soportados tecnológicamente por © Google y ofrecidos por el Servicio Nacional de Aprendizaje – SENA de manera gratuita a los aprendices e instructores de programas de formación titulada, las opiniones que contenga este mensaje son exclusivas de su autor y no representan la opinión del Servicio Nacional de Aprendizaje o de sus autoridades. El receptor deberá verificar posibles virus informáticos que tenga el correo o cualquier anexo, razón por la cual el SENA no es responsable de los daños causados por cualquier virus transmitido en este correo electrónico.

Los contenidos, textos, imágenes, archivos enviados en este mensaje son responsabilidad exclusiva del remitente y no reflejan ni comprometen de ninguna manera a la institución. No se autoriza el uso de esta herramienta para el intercambio de correos masivos, cadenas o spam, ni de mensajes ofensivos, de carácter político, sexual o religioso, con fines de lucro, con propósitos delictivos o cualquier otro mensaje que se considere indebido o que vaya en contra de la Ley.

marcusgreen commented 2 years ago

This has also been reported on the Moodle.org forums here

https://moodle.org/mod/forum/discuss.php?d=435813#p1753923

There is an indication of the source of the problem when debug is set to developer with this error message

Before calling format_text(), the content must be processed with file_rewrite_pluginfile_urls()
line 1347 of /lib/weblib.php: call to debugging()
line 448 of /question/type/wordselect/question.php: call to format_text()
line 109 of /question/behaviour/deferredfeedback/behaviour.php: call to qtype_wordselect_question->grade_response()
line 57 of /question/behaviour/deferredfeedback/behaviour.php: call to qbehaviour_deferredfeedback->process_finish()
line 1356 of /question/engine/questionattempt.php: call to qbehaviour_deferredfeedback->process_action()
line 1396 of /question/engine/questionattempt.php: call to question_attempt->process_action()
line 859 of /question/engine/questionusage.php: call to question_attempt->finish()
line 167 of /question/preview.php: call to question_usage_by_activity->finish_all_questions()

I am tagging @timhunt as he will want to know this issue exists

juanpablopradootero commented 2 years ago

Thank you Marcus, I still have the same issue, I am going to use Cloze questions as the solution for inserting images. Regards

On Mon, Jun 27, 2022 at 3:36 AM Marcus Green @.***> wrote:

This has also been reported on the Moodle.org forums here

https://moodle.org/mod/forum/discuss.php?d=435813#p1753923

There is an indication of the source of the problem when debug is set to developer with this error message

Before calling format_text(), the content must be processed with file_rewrite_pluginfile_urls() line 1347 of /lib/weblib.php: call to debugging() line 448 of /question/type/wordselect/question.php: call to format_text() line 109 of /question/behaviour/deferredfeedback/behaviour.php: call to qtype_wordselect_question->grade_response() line 57 of /question/behaviour/deferredfeedback/behaviour.php: call to qbehaviour_deferredfeedback->process_finish() line 1356 of /question/engine/questionattempt.php: call to qbehaviour_deferredfeedback->process_action() line 1396 of /question/engine/questionattempt.php: call to question_attempt->process_action() line 859 of /question/engine/questionusage.php: call to question_attempt->finish() line 167 of /question/preview.php: call to question_usage_by_activity->finish_all_questions()

— Reply to this email directly, view it on GitHub https://github.com/marcusgreen/moodle-qtype_wordselect/issues/47#issuecomment-1167052988, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJN4N4BJ7OFNHL5GXEYQCR3VRFRX5ANCNFSM5ZNHH7YA . You are receiving this because you authored the thread.Message ID: @.***>

--

Declinación de Responsabilidades: Los servicios de MISENA son soportados tecnológicamente por © Google y ofrecidos por el Servicio Nacional de Aprendizaje – SENA de manera gratuita a los aprendices e instructores de programas de formación titulada, las opiniones que contenga este mensaje son exclusivas de su autor y no representan la opinión del Servicio Nacional de Aprendizaje o de sus autoridades. El receptor deberá verificar posibles virus informáticos que tenga el correo o cualquier anexo, razón por la cual el SENA no es responsable de los daños causados por cualquier virus transmitido en este correo electrónico.

Los contenidos, textos, imágenes, archivos enviados en este mensaje son responsabilidad exclusiva del remitente y no reflejan ni comprometen de ninguna manera a la institución. No se autoriza el uso de esta herramienta para el intercambio de correos masivos, cadenas o spam, ni de mensajes ofensivos, de carácter político, sexual o religioso, con fines de lucro, con propósitos delictivos o cualquier otro mensaje que se considere indebido o que vaya en contra de la Ley.

marcusgreen commented 2 years ago

If you are going to use Cloze, then you may find this plugin helpful https://moodle.org/plugins/atto_cloze

timhunt commented 2 years ago

Is there are reason you are calling format_text yourself, rather than calling $this->format_questiontext, which will do the right thing.

More to the point, it seems incredibly dangerous to do

$this->questiontext = format_text($this->questiontext, ...);

since other code (e.g. rendering) might later want to display stuff, and itself do format_text($this->questiontext, ...) again. format_text cannot be called repeatedly on the same content - at least not if you want a sensible result.

If you need to ready-to-output HTML in the grading code, then just do

$formattedquestiontext = format_text($this->questiontext, ...); // Or rather $this->format_questiontext();

there.

I hope this helps.

marcusgreen commented 2 years ago

"I hope this helps." I suspect it will :) The order of the 'words' that are rendered is used to determined which responses are correct and processing by filters can change that order. So it can work without any filter processing but mlang or embedded media will change it so I am not sure what would be a good solution.

juanpablopradootero commented 2 years ago

Hi Marcus, The only way of visualizing the images was to convert them to Base64. I used this website to do it. https://www.base64-image.de/ I saw the code of the cat image and it is base 64. Thank you so much

On Tue, Jun 21, 2022 at 2:39 PM Marcus Green @.***> wrote:

I would require a dump of the question in xml format to investigate further. Here is an example of the question type using and image. [image: image] https://github.com/assets/732202/0aa9a247-c546-4703-a589-13d3ecc2a066

— Reply to this email directly, view it on GitHub https://github.com/marcusgreen/moodle-qtype_wordselect/issues/47#issuecomment-1162249430, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJN4N4GM5M2VB6ZWLC3XEBLVQIK57ANCNFSM5ZNHH7YA . You are receiving this because you authored the thread.Message ID: @.***>

--

Declinación de Responsabilidades: Los servicios de MISENA son soportados tecnológicamente por © Google y ofrecidos por el Servicio Nacional de Aprendizaje – SENA de manera gratuita a los aprendices e instructores de programas de formación titulada, las opiniones que contenga este mensaje son exclusivas de su autor y no representan la opinión del Servicio Nacional de Aprendizaje o de sus autoridades. El receptor deberá verificar posibles virus informáticos que tenga el correo o cualquier anexo, razón por la cual el SENA no es responsable de los daños causados por cualquier virus transmitido en este correo electrónico.

Los contenidos, textos, imágenes, archivos enviados en este mensaje son responsabilidad exclusiva del remitente y no reflejan ni comprometen de ninguna manera a la institución. No se autoriza el uso de esta herramienta para el intercambio de correos masivos, cadenas o spam, ni de mensajes ofensivos, de carácter político, sexual o religioso, con fines de lucro, con propósitos delictivos o cualquier otro mensaje que se considere indebido o que vaya en contra de la Ley.

marcusgreen commented 2 years ago

Hi Juan, yes that would work, The examples I gave were pasted in from the Atto editor, which might be easier than using a 3rd party site for base64. I have been working hard on getting it to work without needing to do things like that and have created some new test questions that include the use of various filters including core multi language, mlang2 and audio file (that is clickable and plays) and also images.

I have a version that appears to work as expected but it needs some more testing. At the moment it works when I test it by hand and it passes the automated tests. However questions can be used in many different ways (E.G through the quesitons filter) and I need to check other things like backup and restore.

ukampanart commented 2 years ago

Here is the POST (info) https://moodle.org/mod/forum/discuss.php?d=435813#p1753894

There are only 2 choices to be chosen for the full 2 marks. But never CORRECT! Please help!

Word Select: 2.48 2022020500

Moodle 3.8.1 (Build: 20200113)

=====

It's a beautiful [picture].

She has a [pretty] face.

=====

2022-06-25_14-24-04

Here are the exported files. Thank you.

XML Exported files.zip

marcusgreen commented 2 years ago

Thank you for the link. I have been working on this. It seems there was a general issue with filters and images. I should have a branch and a test site available soon.