January 29, 2016 at 3:06 pm #304591
For some testing that I’m implementing, one requirement is that if the student fails the test, he/she can not see the correct answers. (These are regulatory tests, so it is possible to memorize the questions and answers to pass.) On the other hand, if someone does pass, they must be shown the correct answers to any questions they did miss.
This is difficult but possible using the Custom Results, because I can add an action to that page to close itself if the student has a failing score. However, the Test Results page is absurdly buggy and routinely either fails to close for several minutes (!) or freezes the entire course forever on loading.
I could get away with the uncustomized results window (though it is not ideal and is very ugly) but I can’t show it to those who fail, and since it is dynamically generated I can’t add an Action to it.
I did try the code
<pre style=”padding-left: 30px;”>var w = window.open(“”, “OQ Test”);
However, this did not work, and the alert dialog just reads “The page at https://cloud.scorm.com says: [object Window].
CarlJanuary 29, 2016 at 3:23 pm #304592
Gah. Now the non-custom results window is displaying with no OK or Print button, rendering it useless. Why?
EDIT: actually, I mean the custom results window when re-enabled it. The text is absurdly huge and the bottom of the page, including the answer to the last question, is cut off.
February 1, 2016 at 8:44 am #304626
- This reply was modified 3 years, 2 months ago by CarlFink .
This is a really long thread of just me, isn’t it? But for the sake of anyone coming along later: Trivantis support tells me that the custom results problem is a known bug in version 16. My contact hopes it will be fixed in Service Pack 1 … eventually.February 1, 2016 at 11:07 am #304642
I actually do have it review the test questions page by page. It took awhile to set up the first one I guess, but for new titles I just copy my test and change the questions. Basically I create an action group on each page with the actions to go to a question only if that question was answered incorrectly. Then the next button runs this action group only if the user is reviewing the test. I guess it’s complicated to explain and you might want to do it your own way. But as long as you make one that works for you, you can use it as template and not have to reenter all these actions on each title. Although if you want to change the question type, you may have to redo some of the actions. One simple advice if creating such a template is to always select multiple choice as the question type for true/false questions so that you don’t have to create a new question if you want to change it to a regular multiple choice question.
February 1, 2016 at 12:57 pm #304653
- This reply was modified 3 years, 2 months ago by rwalters .
This is excellent advice … if I were just starting the project, and if I could design my own tests. Neither is true. I already have dozens of tests with many hundreds of questions. Hand-retooling them all is exactly what I’m trying to avoid.
Similarly, I don’t get to pick my own questions (and thus, my own question types). They’re supplied by a demi-governmental regulator. I just implement them.
So you are absolutely right, and I would really, really rather not do it that way.February 2, 2016 at 2:33 pm #304681
You can try closing a non-custom test results window with following action
executing that action while a non custom results window is up will close the window and move you to the next appropriate page whether you have passed or failed.all you have to do is put the appropriate condition to execute the action. for instance, put that action as the second action of the Done button for the test and put a condition on it that checks whether the test is passed or failed.
hope that helps, i did very minimal testing with it so it may have some holes.This post has received 1 vote up.
February 2, 2016 at 5:23 pm #304699
- This reply was modified 3 years, 2 months ago by Felipe Prieto.
That sounds like exactly what I needed.
However, when I put that script anywhere on the last page of a test–whether it is triggered by a mouse click or an OnShow action–the page won’t display correctly. All inherited controls (like progress indicators and navigation buttons) as well as all added elements like buttons and images are not shown, except the text blocks, which are the only things that do show, but in in small, unformatted text. I even deleted and recreated the page, and this happens reliably and repeatably. I’ve confirmed this in both AICC and SCORM publishing.
If I change the code to a Hello, World snippet (window.alert(“<i>Yes!</i>”);) the page displays normally. This is really odd.
Hmm … can a syntax error in JS cause Lectora to fail to display a page? Is there one there? As I said, I don’t really know much JS.February 2, 2016 at 5:48 pm #304700
Uncaught SyntaxError: Unexpected token if
a001_oq_test_end_of_test.html:724 Uncaught ReferenceError: findWH is not defined(anonymous function) @ a001_oq_test_end_of_test.html:724
a001_oq_test_end_of_test.html:734 Uncaught ReferenceError: button9422 is not defined(anonymous function) @ a001_oq_test_end_of_test.html:734
a001_oq_test_end_of_test.html:760 Uncaught ReferenceError: image2853 is not defined(anonymous function) @ a001_oq_test_end_of_test.html:760
a001_oq_test_end_of_test.html:779 Uncaught ReferenceError: image28298 is not defined(anonymous function) @ a001_oq_test_end_of_test.html:779
a001_oq_test_end_of_test.html:787 Uncaught TypeError: text28301.addHeading is not a function
So it would appear that there’s some sort of problem with this JS, and it’s interfering with the JS already on that page. I wonder if I can make this a function for the entire course and then call it from the page?February 2, 2016 at 6:08 pm #304702
so the code does the following:
setInterval( “<<some code>>”, 100 ); //this executes the code thats in quotes every 100 milliseconds. this is done to resolve timing issues because it takes a bit of time to open the results page.
the code thats in the quotes is:
if( resWind && resWind.finishTestResults ) resWind.finishTestResults()
this basically says if there is a resWind variable AND there is a resWind.FinishTestResults function, call the function. the calling the function bit is accomplished by resWind.finishTestResults()
technically you can just call resWind.finishTestResults() directly, but you would need to put a delay of a half second or more on the action so you give the browser enough time to load the results page. you can try that to see if it works.
which version of lectora are you working with?This post has received 1 vote up.February 2, 2016 at 6:14 pm #304703
Sr. Prieto, you have saved my sanity and possibly this project. Thank you!
I had figured out the quotes were not meant to be there by checking the syntax of the command at W3Schools, but as it turns out putting that code in a script even without the quotation marks made the page refuse to display. As you suggest, I cut out just the actual command to close the results window, and used conditional Actions to repeat it at 0.1, 0.5, and 1 second after the user clicks Submit–that means that even if it opens quite slowly, it will still be closed almost immediately.
There wouldn’t happen to be a similar command to close the custom results window, by any chance? That would come in very handy.
Again, thank you. If we’re ever in the same place, let me buy you a drink.February 3, 2016 at 9:48 am #304711
I’m glad that worked for you!
Those functions were never intended for direct usage, so they can’t be found in any documentation. In fact those functions could change at any point in time with new releases of Lectora. So technically its not a best practice to do what we just did. But odds are it won’t change at all. if it does break in a future release, we find a new way to do it!
Well, again, thanks. You have been a huge help.February 3, 2016 at 3:33 pm #304730
Hmm … the custom results page opens in the main window (the way I have it set up), so I’d need JS to trigger the “process test/survey” action based on variable values. Unfortunately I doubt (haven’t tested) that resWind.finishTestResults() will work with the non-custom results window not displayed. I think I’ll test that.
You must be logged in to reply to this topic.