As a rails/web newbie... I''m working on an "exam" application using rails... for administering tests/quizzes/exams. Is there a way in rails to start a timer when the user begins a test, and then automatically end the test when the timer elapses? Any thoughts/suggestions would be much appreciated.
Joe, First thought: Sounds like an interesting project. As a high school teacher, I''ve been thinking about writing some education-centric rails apps On your question: Assuming that you want the user to be "cut off" when the time expires, your functionality is going to have to come from javascript. Rails can only handle operations in the request/response cycle. I am picturing your workflow going something like: - User logs in - User opens test page, clock starts - User finishes test (submits) || Time expires - Answers are submitted I think your whole timing function would be embedded using JS in the test page itself. Something that starts a countdown when the page is loaded and automatically sends the form(s) when the time expires. Sorry that I don''t know enough (any?) JavaScript to point you in the right direction there, but at least know that looking to rails to handle it is barking up the wrong tree. -Jeff Joe Lester wrote:> As a rails/web newbie... I''m working on an "exam" application using > rails... for administering tests/quizzes/exams. Is there a way in > rails to start a timer when the user begins a test, and then > automatically end the test when the timer elapses? Any > thoughts/suggestions would be much appreciated. > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails
Keep in mind that you''ll need to set the timer on the server as well to cut off the folks who are clever enough to simply disable JS. On Aug 4, 2005, at 4:12 PM, Jeff Casimir wrote:> Joe, > > First thought: Sounds like an interesting project. As a high > school teacher, I''ve been thinking about writing some education- > centric rails apps > > On your question: > Assuming that you want the user to be "cut off" when the time > expires, your functionality is going to have to come from > javascript. Rails can only handle operations in the request/ > response cycle. I am picturing your workflow going something like: > - User logs in > - User opens test page, clock starts > - User finishes test (submits) || Time expires > - Answers are submitted > > I think your whole timing function would be embedded using JS in > the test page itself. Something that starts a countdown when the > page is loaded and automatically sends the form(s) when the time > expires. Sorry that I don''t know enough (any?) JavaScript to point > you in the right direction there, but at least know that looking to > rails to handle it is barking up the wrong tree. > > -Jeff > > Joe Lester wrote: > > >> As a rails/web newbie... I''m working on an "exam" application >> using rails... for administering tests/quizzes/exams. Is there a >> way in rails to start a timer when the user begins a test, and >> then automatically end the test when the timer elapses? Any >> thoughts/suggestions would be much appreciated. >> >> >> _______________________________________________ >> Rails mailing list >> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
You could use ajax periodic updates to continually save a students progress, and spit back at the right time a page updating js. this would prevent any client-side trickery, and the JS would be kept to a minimum. Also rails would handle all of your validations and stuff right there in the test. Just make sure that you always have the updaters running on all pages. Joshua On 8/4/05, Jeff Casimir <jeff-+RlNNtFrnNmT15sufhRIGw@public.gmane.org> wrote:> > Joe, > > First thought: Sounds like an interesting project. As a high school > teacher, I''ve been thinking about writing some education-centric rails > apps > > On your question: > Assuming that you want the user to be "cut off" when the time expires, > your functionality is going to have to come from javascript. Rails can > only handle operations in the request/response cycle. I am picturing > your workflow going something like: > - User logs in > - User opens test page, clock starts > - User finishes test (submits) || Time expires > - Answers are submitted > > I think your whole timing function would be embedded using JS in the > test page itself. Something that starts a countdown when the page is > loaded and automatically sends the form(s) when the time expires. Sorry > that I don''t know enough (any?) JavaScript to point you in the right > direction there, but at least know that looking to rails to handle it is > barking up the wrong tree. > > -Jeff > > Joe Lester wrote: > > > As a rails/web newbie... I''m working on an "exam" application using > > rails... for administering tests/quizzes/exams. Is there a way in > > rails to start a timer when the user begins a test, and then > > automatically end the test when the timer elapses? Any > > thoughts/suggestions would be much appreciated. > > > > > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
The problem with using JS is that it can be disabled, so it''s not really a good way of enforcing time constraints. All the timed tests that I remember taking online would only have one question per page. This allows you to check if the time has expired before moving on to each question. It protects the proctor by ensuring that no questions get answered after the scheduled time has elapsed, but more importantly protects test-takers from answering 30 questions and submitting them moments after time expires, thus invalidating all the questions they had answered. I think a good approach is to save the start time as a session variable, and load up each question on individual pages. When the user submits the answer, you can check to see if the time has expired - just check to see if Time.now >= @session[:start_time] + a certain amount. Use javascript in the pages to let the user see how much time he has left; a simple countdown timer will do fine. Just don''t use it to enforce the time constraints. Pat On 8/4/05, Jeff Casimir <jeff-+RlNNtFrnNmT15sufhRIGw@public.gmane.org> wrote:> Joe, > > First thought: Sounds like an interesting project. As a high school > teacher, I''ve been thinking about writing some education-centric rails apps > > On your question: > Assuming that you want the user to be "cut off" when the time expires, > your functionality is going to have to come from javascript. Rails can > only handle operations in the request/response cycle. I am picturing > your workflow going something like: > - User logs in > - User opens test page, clock starts > - User finishes test (submits) || Time expires > - Answers are submitted > > I think your whole timing function would be embedded using JS in the > test page itself. Something that starts a countdown when the page is > loaded and automatically sends the form(s) when the time expires. Sorry > that I don''t know enough (any?) JavaScript to point you in the right > direction there, but at least know that looking to rails to handle it is > barking up the wrong tree. > > -Jeff > > Joe Lester wrote: > > > As a rails/web newbie... I''m working on an "exam" application using > > rails... for administering tests/quizzes/exams. Is there a way in > > rails to start a timer when the user begins a test, and then > > automatically end the test when the timer elapses? Any > > thoughts/suggestions would be much appreciated. > > > > > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
On Thursday 04 August 2005 21:25, Joe Lester wrote:> As a rails/web newbie... I''m working on an "exam" application using > rails... for administering tests/quizzes/exams. Is there a way in > rails to start a timer when the user begins a test, and then > automatically end the test when the timer elapses? Any > thoughts/suggestions would be much appreciated.You don''t really need a timer for that. On the server, record the time when the first question was sent to the user. Then when the answers trickle in, check if they''re within the allowed range. Optionally, you can give the user current feedback in the browser with the help of some JavaScript code. Michael -- Michael Schuerig The Fifth Rider of the Apocalypse mailto:michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org is a programmer. http://www.schuerig.de/michael/
While I would agree that a javascript-only approach has problems, it is a significant pedagogical difference to give a complete test (all on one page, online or on paper) versus single question-by-question. Going one by one, in my estimate, would not improve the performance of any student and would degrade the performance of some. To me, it is not an acceptable methodology. -Jeff Pat Maddox wrote:>The problem with using JS is that it can be disabled, so it''s not >really a good way of enforcing time constraints. > >All the timed tests that I remember taking online would only have one >question per page. This allows you to check if the time has expired >before moving on to each question. It protects the proctor by >ensuring that no questions get answered after the scheduled time has >elapsed, but more importantly protects test-takers from answering 30 >questions and submitting them moments after time expires, thus >invalidating all the questions they had answered. > >I think a good approach is to save the start time as a session >variable, and load up each question on individual pages. When the >user submits the answer, you can check to see if the time has expired >- just check to see if Time.now >= @session[:start_time] + a certain >amount. Use javascript in the pages to let the user see how much time >he has left; a simple countdown timer will do fine. Just don''t use it >to enforce the time constraints. > >Pat > >
I dont see a problem with relying somewhat on JS. If a student turns it off, he gains nothing. If you periodically update the test status, you will know who is messing around, and could probably gather other useful data. Spread the whole thing across some screens, and leave a small window at the end. On 8/5/05, Jeff Casimir <jeff-+RlNNtFrnNmT15sufhRIGw@public.gmane.org> wrote:> > While I would agree that a javascript-only approach has problems, it is > a significant pedagogical difference to give a complete test (all on one > page, online or on paper) versus single question-by-question. Going one > by one, in my estimate, would not improve the performance of any student > and would degrade the performance of some. To me, it is not an > acceptable methodology. > > -Jeff > > Pat Maddox wrote: > > >The problem with using JS is that it can be disabled, so it''s not > >really a good way of enforcing time constraints. > > > >All the timed tests that I remember taking online would only have one > >question per page. This allows you to check if the time has expired > >before moving on to each question. It protects the proctor by > >ensuring that no questions get answered after the scheduled time has > >elapsed, but more importantly protects test-takers from answering 30 > >questions and submitting them moments after time expires, thus > >invalidating all the questions they had answered. > > > >I think a good approach is to save the start time as a session > >variable, and load up each question on individual pages. When the > >user submits the answer, you can check to see if the time has expired > >- just check to see if Time.now >= @session[:start_time] + a certain > >amount. Use javascript in the pages to let the user see how much time > >he has left; a simple countdown timer will do fine. Just don''t use it > >to enforce the time constraints. > > > >Pat > > > > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Relying on JS is dangerous if these students are even mildly savvy. It''s trivial to craft requests from the client as a sole trusted source of info -- which is exactly what''s being proposed. Trusting client applications of any type without fidelity and integrity checks on the server is always going to lead to hacks and cheats. Trusting something as simple to subvert as JS is 10x as risky. Also, you are always going to have to take into account network latency/hiccups and subjective usability disparities when giving a test this way. It is a tough situation, certainly. Perhaps you might send messages with each answer as questions are answered, but ALSO submit the entire quiz at the end. This way, you can at least know which questions were answered within a given time frame to help prevent unnecessary disqualification of timely answers. Just don''t trust timing info to come from JS or you''re pulling the wool over your own eyes and duct taping it in place ;) On Aug 4, 2005, at 6:45 PM, Joshua Sierles wrote:> I dont see a problem with relying somewhat on JS. If a student > turns it off, he gains nothing. If you periodically update the test > status, you will know who is messing around, and could probably > gather other useful data. Spread the whole thing across some > screens, and leave a small window at the end. > > > > On 8/5/05, Jeff Casimir <jeff-+RlNNtFrnNmT15sufhRIGw@public.gmane.org> wrote: > While I would agree that a javascript-only approach has problems, > it is > a significant pedagogical difference to give a complete test (all > on one > page, online or on paper) versus single question-by-question. > Going one > by one, in my estimate, would not improve the performance of any > student > and would degrade the performance of some. To me, it is not an > acceptable methodology. > > -Jeff > > Pat Maddox wrote: > > >The problem with using JS is that it can be disabled, so it''s not > >really a good way of enforcing time constraints. > > > >All the timed tests that I remember taking online would only have one > >question per page. This allows you to check if the time has expired > >before moving on to each question. It protects the proctor by > >ensuring that no questions get answered after the scheduled time has > >elapsed, but more importantly protects test-takers from answering 30 > >questions and submitting them moments after time expires, thus > >invalidating all the questions they had answered. > > > >I think a good approach is to save the start time as a session > >variable, and load up each question on individual pages. When the > >user submits the answer, you can check to see if the time has expired > >- just check to see if Time.now >= @session[:start_time] + a certain > >amount. Use javascript in the pages to let the user see how much > time > >he has left; a simple countdown timer will do fine. Just don''t > use it > >to enforce the time constraints. > > > >Pat > > > > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Seems like there''s a best of both worlds here. Why not use ajax to retrieve test questions? That way the student must have Javascript enabled in order to even get the test. As the test commences, insert a row in a "running_tests" table which records the start time of the particular test instance. Have each test instance generate a new private key and record that, too. With each test response, encrypt the result with the test''s public key and then the test can decrypt it, verify it''s a valid response from the correct test instance on the client, and record the answer. As each question is answered, simply do another ajax call and compare the current time on the server with the recorded time. You don''t even need a timer running, per se, although you could have one on the client to keep the student informed. If the student wants to fool around with the Javascript, well, the server is tracking the time, so once the time is up, that''s that. The client Javascript can simply end the test for the student when the countdown is done. If the student tries to mess with it, it wouldn''t make any difference, any displayed timer is just a courtesy. Regardless of what time is shown on the client timer, the server has recorded the start time, so late submissions can be dq''d. This way a student can have all the questions available to him/her, or as many as the test designer believes is appropriate in order to present the proper questions at the proper time and also to give the student an opportunity to form any test-taking strategy which involves a comparison of test questions or whatever. The test has a unique identifier and the student''s answers are encrypted. I dunno. Just typing out loud. There are still ways to cheat, but you could probably put a stopper on most with some careful thought. Although, since the test is Web-based, it would really only be effective to test for things like demonstrable knowledge. What I mean is, you wouldn''t want to give away any kind of license or anything with this kind of test, since, obviously, it''s hard to beat the cheat where someone who knows the answers is standing behind the person taking the test. That said, the question of doing this with http is interesting. Is the whole point to create an http exercise? It might be fun to create some kind of markup language like the one used by mod_survey (http://gathering.itm.mh.se/modsurvey/). A test-oriented markup could generate some nice CSS-friendly xhtml that would lend itself well to customization while providing the advantage of quickly prototyping an exam. Just my .02. Peace, Greg
What about some kind of JS that makes sure (for a given value of sure) that you have js turned on to use it. For example, a bit of javascript that adds the submit button and a hidden field with some kind of encrypted code that can be matched against a database. Maybe the server could be producing new codes every few minutes that the client has to ask for a new one and send back the old one. To some extent it depends on the environment the people will be taking the test and how long they''ll have / inclined they''d be to circumvent it. Just an idea, Ben On 8/5/05, Toby Boudreaux <rails-lb8SQxIZKShBDgjK7y7TUQ@public.gmane.org> wrote:> Relying on JS is dangerous if these students are even mildly savvy. > It''s trivial to craft requests from the client as a sole trusted source of > info -- which is exactly what''s being proposed. > > Trusting client applications of any type without fidelity and integrity > checks on the server is always going to lead to hacks and cheats. Trusting > something as simple to subvert as JS is 10x as risky. > > Also, you are always going to have to take into account network > latency/hiccups and subjective usability disparities when giving a test this > way. > > It is a tough situation, certainly. > > Perhaps you might send messages with each answer as questions are answered, > but ALSO submit the entire quiz at the end. This way, you can at least know > which questions were answered within a given time frame to help prevent > unnecessary disqualification of timely answers. Just don''t trust timing info > to come from JS or you''re pulling the wool over your own eyes and duct > taping it in place ;) > > > > > On Aug 4, 2005, at 6:45 PM, Joshua Sierles wrote: > I dont see a problem with relying somewhat on JS. If a student turns it off, > he gains nothing. If you periodically update the test status, you will know > who is messing around, and could probably gather other useful data. Spread > the whole thing across some screens, and leave a small window at the end. > > > > On 8/5/05, Jeff Casimir <jeff-+RlNNtFrnNmT15sufhRIGw@public.gmane.org> wrote: > > While I would agree that a javascript-only approach has problems, it is > > a significant pedagogical difference to give a complete test (all on one > > page, online or on paper) versus single question-by-question. Going one > > by one, in my estimate, would not improve the performance of any student > > and would degrade the performance of some. To me, it is not an > > acceptable methodology. > > > > -Jeff > > > > Pat Maddox wrote: > > > > >The problem with using JS is that it can be disabled, so it''s not > > >really a good way of enforcing time constraints. > > > > > >All the timed tests that I remember taking online would only have one > > >question per page. This allows you to check if the time has expired > > >before moving on to each question. It protects the proctor by > > >ensuring that no questions get answered after the scheduled time has > > >elapsed, but more importantly protects test-takers from answering 30 > > >questions and submitting them moments after time expires, thus > > >invalidating all the questions they had answered. > > > > > >I think a good approach is to save the start time as a session > > >variable, and load up each question on individual pages. When the > > >user submits the answer, you can check to see if the time has expired > > >- just check to see if Time.now >= @session[:start_time] + a certain > > >amount. Use javascript in the pages to let the user see how much time > > >he has left; a simple countdown timer will do fine. Just don''t use it > > >to enforce the time constraints. > > > > > >Pat > > > > > > > > > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > > >
I took an online class from a local college a while ago, and the system they had for tests seemed to work pretty well. It displayed all the questions at once on one scrolling page, with the ability to save each answer to the server as you go along. A separate frame on the right showed the status of each of the questions (Not Answered, Not Saved Yet, and Saved). If you entered an answer, but hadn''t saved it, you could see easily from the status icons. There was a javascript timer that counted down your time left, but of course the REAL check for the time was stored on the server (just store the time the test was first displayed, and then disallow any new answers from being saved after X minutes). The javascript timeout would tell you "time to submit the test!", and no more answers would be allowed to be saved after the time limit (this is controlled by server, so no way to fake it). You could change answers any time before the time limit (just re-save them). - Isaac On 8/4/05, Joe Lester <joe_lester-AmHgdjvPR7O+XT7JhA+gdA@public.gmane.org> wrote:> As a rails/web newbie... I''m working on an "exam" application using > rails... for administering tests/quizzes/exams. Is there a way in rails > to start a timer when the user begins a test, and then automatically > end the test when the timer elapses? Any thoughts/suggestions would be > much appreciated.
After I finish my current project and get the school year rolling I would like to start work on some rails-based "courseware". If other people would be interested in collaborating I would love to hear it. Let me know off list. -Jeff>That said, the question of doing this with http is interesting. Is the >whole point to create an http exercise? It might be fun to create some >kind of markup language like the one used by mod_survey >(http://gathering.itm.mh.se/modsurvey/). A test-oriented markup could >generate some nice CSS-friendly xhtml that would lend itself well to >customization while providing the advantage of quickly prototyping an >exam. > >Just my .02. > >Peace, >Greg >_______________________________________________ >Rails mailing list >Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >http://lists.rubyonrails.org/mailman/listinfo/rails > >
On Aug 4, 2005, at 12:25 PM, Joe Lester wrote:> As a rails/web newbie... I''m working on an "exam" application using > rails... for administering tests/quizzes/exams. Is there a way in > rails to start a timer when the user begins a test, and then > automatically end the test when the timer elapses? Any thoughts/ > suggestions would be much appreciated.I think the method you want is the Ajax helper "periodically_call_remote" - docs are available here: http:// rails.rubyonrails.com/classes/ActionView/Helpers/ JavaScriptHelper.html#M000396 Then you would have a <div> that would call a controller method to enforce the time limit, save progress, and so on. If the user disables JavaScript, just have the save method check the timeout based on their session (and require cookies - that seems reasonable for a courseware app). b. _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Thanks to all who responded. I really appreciate it. Joe On Aug 4, 2005, at 2:25 PM, Joe Lester wrote:> As a rails/web newbie... I''m working on an "exam" application using > rails... for administering tests/quizzes/exams. Is there a way in > rails to start a timer when the user begins a test, and then > automatically end the test when the timer elapses? Any > thoughts/suggestions would be much appreciated.