[Ref: your sample-quiz doesn’t work in Opera & IE]
I’ve the “sample-graded” on my PC, and in FFox works fine. This is the good news, the bad one follows:
Then I used Opera my default browser (faster) , and it fails. It seems Opera is unable to load .json data + home.html. Can you please clarify? IE (which I swear I never use) is also NOT able to load the quiz -> ERR: This page cannot be loaded.
Please have the errors in Opera: (I didn’t expect such problems for this simple script)
libs.min.js:92 Failed to load file:///O:/Projects/OPI/%23Code/Quiz/sample-graded/data/config.json: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.
(anonymous) @ libs.min.js:92
libs.min.js:92 Failed to load file:///O:/Projects/OPI/%23Code/Quiz/sample-graded/data/questions.json: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.
(anonymous) @ libs.min.js:92
libs.min.js:92 Failed to load file:///O:/Projects/OPI/%23Code/Quiz/sample-graded/templates/home.html: Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.
(anonymous) @ libs.min.js:92
libs.min.js:107 Error: [$compile:tpload] http://errors.angularjs.org/1.4.0/$compile/tpload?p0=templates%2Fhome.html&p1=0&p2=
at m.$eval (libs.min.js:134)
at m.$digest (libs.min.js:131)
at m.$apply (libs.min.js:134)
at Object.e [as invoke] (libs.min.js:38)
at d (libs.min.js:19)
at zc (libs.min.js:20)
Also, pls note that I had to reset my password logging here because my credentials were not recognized. (2nd time)
Hi Alex. I’ve just tested again my quiz examples on the web with opera, and it works fine. But you need to open it in a server, not in your local machine. You can use any basic server to test it. Could that be the problem?
Hi, thanks for your feedback. Yes indeed the problem is that FFox render file:///O:/... differently from other browsers. I fixed the issue by uploading on the server. Thanks.
I’m trying to integrate your quiz in my CMS, but it doesn’t show up.
Usually I’ve no problems integrating external files (HTML , CSS, JS).
For your quiz I’ve linked all external resources (JS,CSS) and added the few HTML lines as is. I’ve also added a simple
Am I missing anything? Could you please share your comments.
Sorry, I can’t help you with integrating an AngularJS app with a CMS. The AngularJS app is a single page app, working with routes, a very different concept than a classic CMS. So the integration can be a little tricky. I know there are people that do it with success, but I don’t know how to do it. My app was only intended for a basic HTML / JS page.
Hi , Thanks for your feedback. I found a brilliant way to do it.
I’ve changed one AsideImage in questions.json, but my browser insist to show the old image, even when I force page reload.
The old image is still shown if I rename the Image-folder altogether.
Is there a way to disable the cache in your quiz?
The cache problem concerns to your browser or your server rather than the quiz. Maybe you can add a pseudo-random parameter to the URL: http://spacebug.com/solving_browser_caching_problem_of_ajax-html/
Got it, Thanks
I need to save quiz results to a .txt file.
I know you’ve added MySQL option in Builder, but I can’t use it because DB access outside my CMS Framework is not allowed (nor safe).
Can you please suggest a way to get the results in a text file or JSON instead? (I can use AJAX to save on server)
I don’t know how to do it. You can search in the quickquiz.js the section /* SEND TO A DATABASE */ I send to the database an object (data: this.sendObj) that maybe you can use for your text file.
OK, I’ll try that, thanks.
I’m looking into data.js and it looks like config + questions (json).
If I run a new quiz, is’t ok if I change only questions.json ? (using the same config.json)
Yes, of course, you can use the same config and change the questions.json. The data.js is just for use the quiz without a web server, but I recommend using instead config.json and questions.json. It’s easier to manipulate.
Apologies for troubling you with multiple requests.
I wanted to save scorePercentageRounded to score.html template.
I’ve added a simple DIV at line 18 to process it with AJAX, but I’m not getting it on the page-source, do you know why?
I tried to print some:
Thanks for your help..
It’s a cache problem. I’ve tried it right now and it works fine. When I changed the server (first with mamp, after with fenix web server), I could see the changes.
(Sorry for the delay in the answer but it was first weekend and then new year. Happy new year!)
OK, if data: this.sendObj works, I’ll use that instead. Thank you, and Happy new Year.
I’m working with score.html, in the area where you added the comment
”<!- Write here your custom HTML score description ->”
I’ve imported jquery as usual from google , then I added inside a <script> tag, a simple alert(‘hello’); but it doesn’t fire.
The page looks pretty clean, and I get the Summary Result at the end of the quiz, but it seems nothing is executed inside the <script> tags, and I cannot run any JS code (which is bad).
Do you have a any clue please?
Hi again. You can include a script tag in the index.html, outside the quickquiz app (outside the quickquiz div). You can also include basic html inside any angular template, but you can’t include script tag inside an angular template (like the score.html). Searching on google I found this (you can try it):
I have been digging and found that Angular uses JQlite that doesn’t permit script tags inside templates. However you can include JQuery just before you load Angular on your main page, Angular will then use JQuery instead of JQlite and you will be able to run your custom <script> tags that are inside each one of your templates.
Thanks for your feedback.
I’m trying to figure out how to resolve this. I know AJAX with JQuery, but unfortunately I don’t know Angular.
Is there a way to do an AJAX call from score.html? You save data to the DOM as I do …data-quizresult() but I’m unable to store this data somewhere else so that I can use it, nor to make an AJAX call. Can I use AJAX with JQlite instead?
I run your quiz from an iFrame (doesn’t work otherwise in my CMS), and score.html is loaded dynamically so I can’t use AJAX from the starting page (because it will change).
Pretty simple but apparently not too easy to fix
Please share some clue.
Many thanks !
It has been a long journey (and a pain..), but finally , I got my data in parent.document , available in the iFrame.
JQuery was working , but only in the iFrame.
I read many posts last night. Nothing worked since JQuery “parent.document” is disabled in Angular. (only works in the same scope).
window.opener.angular.element.. // didn’t work
window.parent.document.getElementById .. // didn’t work
In case you’re interested to know how I fixed, please deposit $10k in Bitcoin
I’m joking!! Here is the solution that worked for me: HTML 5 -> sessionStorage
Save your data in the parent.document, and then retrieve it in the iFrame.
Why iFrames? Because Angular templates doesn’t work when integrated in my CMS. (based on its own framework)
Have a nice day
p.s. Bitcoin is on the edge again, which is good !
Glad you’ve found a solution. Thanks for sharing your fix, my application was not designed to work inside a CMS.
turkish character language problem?
There should be no problem with the Turkish characters. If there is a problem with the characters in the builder, you can try to manually modify the characters in the generated json files.
How to change button color if click wrong answer.. wrong answer click color red fight answer green..
This option is not supported. Nevertheless, maybe the feedback option can be useful for you. You can choose to show directly a feedback text when the user answer (under the choices). Select feedback type: right/wrong and feedback class: show the feedback text directly
Hola ILM, estoy necesitando hacer un test estilo personalidad, con 3 preguntas con 3 checkboxes como opciones de respuesta, pero necesito que esas 3 opciones sean mostradas de forma aleatoria de un conjunto de 9 opciones para cada pregunta. No veo que esa opción esté incluída. Estarías disponible para presupuestarme esa customización? Desde ya muchas gracias!
Hola! Desde hace un tiempo no hago customizaciones de esta aplicación porque estoy trabajando a tiempo completo en otros proyectos. Saludos.
Use, by you or one client, in a single end product which end users are not charged for. The total price includes the item price and a buyer fee.
Use, by you or one client, in a single end product which end users can be charged for. The total price includes the item price and a buyer fee.
View license details
Get it now and save up to $9
Deliver better projects faster. Photos, templates & courses
Unlimited downloads. Only $29/month
Learn almost anything with
Envato Tuts+ for free
25,000+ tutorials and 1,000+ courses
Designers matched perfectly to
you on Envato Studio
2000 artists ready to undertake your work