Developing a question theme - Issues with saving and rendering

Mehr
1 Monat 2 Wochen her #194537 von Mindflow
Hi there,

I am currently implementing a question theme that should extend the multiple choice question such that the user checks the answers by clicking on elements in an SVG drawing. A JS-callback for the onclick-event in the SVG will check the hidden answers.

So far, I can select the question theme and the additional attribute (A URL to the SVG File) is correctly shown in the advanced settings. However, I encountered some problems:

- While the custom attribute is correctly saved to the database, it is not retrieved while loading the settings, leaving the field blank

- The answer.twig file of my theme is not used to while rendering the question, instead, LS uses the original multiplechoice template. I tried emptying the cache without luck.


- I cannot uninstall a User Theme (the console says TypeError: settings is undefined).



I'm running LS Version 4.1.7+200224
The source code of the question theme is available at github.com/florianheller/LimeSurvey_SVG_Selection


If somebody could give me some advice on how to trace down the error, help is highly appreciated.

Kind regards,

Florian
Folgende Benutzer bedankten sich: DenisChenu

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

LimeSurvey Partners
Mehr
1 Monat 1 Woche her #194574 von tpartner
I don't see anything wrong.

In version 4.1.7, I was able to import the question theme downloaded from your GitHub repository via the theme management interface. I extracted the svgselection folder from the GitHub download, zipped it and then imported the resulting .zip folder.

I do see the file path in the question editor after saving the question (first screenshot below) and I see both of your twig files being used (2nd and 3rd screenshots).







I don't have a suitable .svg file to test fully but one suggestion I would make is to give the svg object a question-specific ID so you could place several of these questions on the same page.


Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com
Anhänge:

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
1 Monat 1 Woche her #194581 von Mindflow
Hi Tony,
thanks for your reply and check. I just re-installed LS 4.17 from scratch, but no luck, same problem as before (Both Firefox and Chrome). I will try a different environment as soon as possible and post the results here.

Good pointer with the ID, I'll work on that and the documentation as soon as I get my LS installation to accept my theme :)

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
1 Monat 1 Woche her #194590 von jelo

Mindflow schrieb: but no luck, same problem as before (Both Firefox and Chrome).

Are you logged in as a superadmin? I don't understand the issue, but if the SVG file is important, it might be the XSS protection (blocks SVG cause Javascript can be embedded).
I can be totally wrong, but when I read SVG it's like a trigger.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
1 Monat 1 Woche her #194596 von Mindflow
Hi,
yes, I'm logged in as a super-admin. Yes, indeed, SVG can trigger XSS protection, but I'm struggeling with a problem before even getting to embed an SVG. Apparently, the theme works well on Tony's LS installation, but not on mine (LS 4.1.7+200224). The additional attribute is shown in the advanced settings, and when I hit save, the data is correctly stored to the DB, but when the question editor reloads, the field is set back to the placeholder value. On the view side, my theme's twig isn't used (again, on Tony's installation this seems to work).

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
1 Monat 1 Woche her #194610 von DenisChenu
No,

Link to a svg are not checked by LimeSurvey, only upload of SVG currently.

But saving Question Attribute value have some error and fix.
Maybe try to reset assets ? Can you de-activate debug mode ?

Personaly : i check on last version : seems not saved too ... debug mode at 2.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
An error happen ? Before make a new topic : remind the Debug mode .

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
1 Monat 1 Woche her #194627 von Mindflow
Hi,
I just ran a test on a different fresh installation in a virtual machine (LS 4.1.7+200224) and ran into the same problem. Turning debug mode on/off did not help (checked with the frontend/backend settings + the one in config.php). Both installations were running a recent LAMP stack.

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
1 Monat 1 Woche her #194630 von tpartner
That's the weirdest thing - see screen-cast here - screencast-o-matic.com/watch/cYntI7wPcM

Debug mode makes no difference.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
1 Monat 1 Woche her #194644 von DenisChenu
One dev working , 2 other didn't working :).

But if i remind : no real difference between our server @tparner :)

My opinion : need to be reported.

Another thing : in my opinion : it's best to have QuetsionTheme directly in their won directory :
See github.com/tpartner/LimeSurvey-Adjustabl...c-Differential-Array
or gitlab.com/SondagesPro/QuestionTheme/really_hidden_equation

Then : we can just do

cd upload/theme/question
git clone repourl NameOfDirectory

Here : need to rename the directory :)

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
An error happen ? Before make a new topic : remind the Debug mode .

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
1 Monat 1 Woche her - 1 Monat 1 Woche her #194645 von DenisChenu
Screencast
Dateianhang:

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
An error happen ? Before make a new topic : remind the Debug mode .
Letzte Änderung: 1 Monat 1 Woche her von DenisChenu.

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
1 Monat 1 Woche her #194647 von tpartner

But if i remind : no real difference between our server @tparner

I am testing on XAMPP:

- Database: mysqlnd 5.0.12
- Server OS: Windows 10
- Webserver: Apache/2.4.39 (Win64)
- PHP Version: 7.3.7

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
1 Monat 1 Woche her - 1 Monat 1 Woche her #194659 von jelo
Too many people running 5.0.12 ;-)

tpartner schrieb: - Database: mysqlnd 5.0.12


That is the connector version, not the MySQL version used.
The systeminfo via the LimeSurvey version number is lacking that info too.
Only the connector is reported.

That is a common issue in a lot of bugtickets too.
We're lucky that MySQL is seldom the root cause of issues.


www.php.net/manual/en/mysqli.get-server-info.php
 
<?php
$link = mysqli_connect("localhost", "my_user", "my_password");
 
/* check connection */
if (mysqli_connect_errno()) {
    printf("Connect failed: %s\n", mysqli_connect_error());
    exit();
}
 
/* print server version */
printf("Server version: %s\n", mysqli_get_server_info($link));
 
/* close connection */
mysqli_close($link);
?>
 

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Letzte Änderung: 1 Monat 1 Woche her von jelo.

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
1 Monat 1 Woche her #194662 von tpartner
Sorry for trying to help.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
1 Monat 1 Woche her #194663 von jelo

tpartner schrieb: Sorry for trying to help.

I'm not in the mood to demotivating you or anybody else in this thread.
I just pointed out that the real MySQL database version is often not stated.
Nothing more, nothing less.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
1 Monat 1 Woche her #194666 von DenisChenu

tpartner schrieb: Sorry for trying to help.

Sorry @tpartner , i didn't want to be offensive.

Just we have different behaviour.

I already think that all of this new question editor are really hard to fix ... and debug.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
An error happen ? Before make a new topic : remind the Debug mode .

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Jetzt loslegen!

Melden Sie sich jetzt an, und erstellen Sie in wenigen Minuten Ihre erste Umfrage.

Account einrichten

Abonnieren Sie unseren Newsletter

Abonnieren Sie unseren Newsletter für alle Neuigkeiten rund um LimeSurvey
captcha