Home/ASP.NET Forums/Advanced ASP.NET/Architecture/Online quiz application integrated in bigger web application

Online quiz application integrated in bigger web applicationRSS

20 replies

Last post Jan 28, 2011 11:27 AM by boredbysomanyregistrationsteps

  • BoredBySoManyRegistrationSteps BoredBySoMan...

    None

    0 Points

    13 Posts

    Re: Online quiz application integrated in bigger web application

    Jan 26, 2011 06:14 AM|BoredBySoManyRegistrationSteps|LINK

    theway23

    For comet .. idont know too much about it... but you can use this helpful post : http://forums.asp.net/p/1073944/1573265.aspx
    in that post you will find this codeproject comet example : http://www.codeproject.com/KB/custom-controls/CometMultiClient.aspx

    Thank your, I've beed googling and binging around this problem and find some articles, this one will be helpfull too.

    atconway

    boredbysomanyregistrationsteps

    You sound pretty sure about this. Really. You mean traditional web, or web in general?

    Yes I am sure about this - in general the web environment or HTTP protocol is stateless...
    Traditional web is stateless and what you're beed citing later on in your previous post is true. There are techniques, that mimics this and make it look as there is a state, so you can make you code at server so as there is a/look like state. And in your previous post you didn't say HTTP protocol, you say WEB. Web is not only HTTP protocol, there is a FTP, TCP/IP (IP stands for internet protocol), SMTP, POP, IMAP...

    atconway

    boredbysomanyregistrationsteps

    As I say in my first post, one possible way is via some sort of constantly repeating client request to server - every 5 sec client call async the server: hello server, do you have something new for me? yes/no etc. This solution is encumberent hovewer.
    Agree 100% this is a bad idea just like I said in my last post. How annoying it would be to have page interruptions every few seconds to check a value on the server.
    Yes, it will be anoying to have page interruptions every few seconds. But maybe there is a workaround and there is a technique, which will do this without user notify it, so can you help me with good pull technology, which I can use in order to emulate this "server push"? I don't have anything in mind to use client scripting, as long as time is measured on server and quiz logic is preserved on server.

    atconway

    Once again you are going to be looking at client side technologies like jQuery, AJAX, etc which are both just JavaScript which you state you do not want to use, so I don't know why you mention using an async callback.
    Once again, I am telling you that I want quiz logic to be on server and time to be measured on server. Which does not mean that I do not want to use jQuery or other javascript tech. If you can help me with some good pull technique to emulate this "server-push" it will be helpfull for me. And since in this case we can use js, we can use asycn request too.

    atconway

    Yes I have, but I am wondering how much you have read on it.
    Well, to be honest, I dind't read much about. If I have beed read, I would be developing my application instead of asking more info in this forum.

    atconway

    J-A-V-A-S-C-R-I-P-T  So no JS, no COMET.
    I have check a litte bit and I found this: XMPP over BOSH http://xmpp.org/extensions/xep-0206.html So here there is Comet technology, but I guess that there is no javascript. So there is COMET, there is http, but there isn't javascript. SO yes Comet, no JS. Maybe I am missing something?

    atconway

    boredbysomanyregistrationsteps

    If exists other solution for my needs, I will be happy to hear it and know more about it.
    If you would like to break out of traditional web development you could consider using Silverlight. You could create a polling duplex WCF service that will do exactly what you want by subscribing to the server and having data pushed to the client via a binding like netTCPBinding. You could read the following if you are interested:

    Building and Accessing Duplex Services: http://msdn.microsoft.com/en-us/library/cc645026(v=VS.95).aspx
    I hope this information is helping you make a decision on how to design your online quiz!

    Yes, silverlight is an alternative. It's not so widely used as Flash, but this can change in future. It loads slower comparing to pure html or html+script, but UI is great, almost as on desktop application. There is duplex communication with Silverligh over port 80, which is quite good.

    I have some questions in order to clarify some things:
    Which way do you advise me to use: over Http or over TCP. You stated up above netTCPBinding, so i guess tcp. I guess this will require opening a tcp connection to my server, so what will happen with many users connect? Is it better to use duplex over Http?
    In order to use Duplex with Silverligh, I would need to create WCF service on my server. Is it possible to achieve duplex using asmx service instead of WCF? Pros / Cons?
    In article that you're pointing out, in a comment below, one guy is pointing out a "End-of-life", end of service case. How is this handled? What code should i make in order to hanlde this.
    In my application I am using ASP.NET membership for authorization and user access to specific resources. How is used with Silverlight? I will place Silverlight application in a page with restricted access, so membership will allow only user with autorization to access it. Is there other ways? Better ways?

  • bmhc bmhc

    Member

    63 Points

    60 Posts

    Re: Online quiz application integrated in bigger web application

    Jan 26, 2011 08:32 AM|bmhc|LINK

    My little 2 cents:

    -For each question(or per form) you save the amount of time(timestamp or such) the user has to answer. (DB field)

    -Show a bundle of questions per page/step and calculate the amount of time for that bundle.

    -Add the calculated time with the current time so you know the endtime and save it in the session.

    -Start a timer on the page(JS) so the user can see how much time he has, but its just for him, you wont be using this timer.

    -When the user submits his answers you get the end time from the session and check it.

    Haven't read all the post, just the beginning so if this is a but to simple dont hit me :O this is how I would do it I gues.

    -Bryan

    "Program your own life." -Someone
  • BoredBySoManyRegistrationSteps BoredBySoMan...

    None

    0 Points

    13 Posts

    Re: Online quiz application integrated in bigger web application

    Jan 26, 2011 09:08 AM|BoredBySoManyRegistrationSteps|LINK

    bmhc

    My little 2 cents:
    -For each question(or per form) you save the amount of time(timestamp or such) the user has to answer. (DB field)
    Yes, why not.

    bmhc

    -Show a bundle of questions per page/step and calculate the amount of time for that bundle.
    Yes, it's possible.

    bmhc

    -Add the calculated time with the current time so you know the endtime and save it in the session.
    Yes, can be done.

    bmhc

    -Start a timer on the page(JS) so the user can see how much time he has, but its just for him, you wont be using this timer.
    Aham, it's ok. Wait, why should i bother with JS and timer in this case? I can just put a label and wrote on it: Look, user, buddy - you have 5 min and 38 sec to solve the quiz or you will BE HIT HARD BY SOME UNKNOWN FORCE!

    bmhc

    -When the user submits his answers you get the end time from the session and check it.
    Yes, it will be great.

    bmhc

    Haven't read all the post, just the beginning so if this is a but to simple dont hit me :O this is how I would do it I gues.
    Don't worry, in our days everybody is writting, nobody is reading :)

    Now, to be serours: Look Bryan, the workaround that you have suggest is good and can be done. I am looking however for a way to have some interactivity between client and server. Let's say for example that I've desing the quiz as you suggest. It is working, but people don't like it. And I decide to put some tricks - for example, if you answer 2 questions too fast, you get some additional bonus. Or if you are  stuggling with one question, you are getting hint from the server. Or if it takes some time to process the  quiz and user is waiting, it will be nice to have him informed what is going out. For example - loading questions... Calculating question weight score...Processing other stuffs... So I will need to search for every feature new workaround, which will cost me additional time and efforts. So it is way better to have an idea for all possible solutions and to implement client-server communication in two ways. This will allow me to enhance my quiz, to use this approach in other applications etc.

  • bmhc bmhc

    Member

    63 Points

    60 Posts

    Re: Online quiz application integrated in bigger web application

    Jan 26, 2011 03:32 PM|bmhc|LINK

    The thing is, a webserver only works on request, so for you example "bonus if you answer 2 questions": then you'll need to give a postback each time a question is answered because you'll need the time it got answered, calculate it and add the bonus in a list if it matches the conditions.

    "Aham, it's ok. Wait, why should i bother with JS and timer in this case? I can just put a label and wrote on it: Look, user, buddy - you have 5 min and 38 sec to solve the quiz or you will BE HIT HARD BY SOME UNKNOWN FORCE!"
    Haha, you could idd just tell him the total time, but its a nicer feature to just show him a countdown(in JS, its easy anyway). Bit more userfriendly and great to tell clients as feature.

    The hint part will be a bit more tricky because you'll need a request for the hint. And this all fits well in my model. What I said was just the basic, for all the features you'll just have to build in it.

    "For example - loading questions... Calculating question weight score...Processing other stuffs..."
    Loading questions: UpdatePanel > UpdateProgress, feedback to the user
    Calculating question weight score: The Question will have a property ScoreWeight and to calculate it you can make a Util. QuizUtil maybe?

    You want to make a very extendible quiz app so you can make alot of plugin(features) right? What I gave was a bit the workflow how to make it without details(abstract). How detailed you want to make it depends on you, what you want to be able to do with it. If you can list the features you want in it, you'll know what objects you'll need. You need a Functional Design. To my experience: A project without a Functional Design will be hell! because you dont know what it needs to be able to do.

    Im already thinking objects: Quiz, QuizUtil, Question, Answer, QuestionCollection. And depending on the features you'll be adding properties(and maybe even classes). For example, you mentioned a weight score calculation on questions.. so.. your Question object will need the ScoreWeight property or something similar.

    Tip: Check out the Wizard control, I would use the Wizard control to make a quiz in combination with a updatepanel. I just made a Webshop for my work with the Wizard control(with feedback to the user) and a webshop is basically also just forms. Each step shows a QuestionCollection :)

    Wow.. thats alot of typing I did :| hope you'll find something useful in it ;)

    Bryan.

    "Program your own life." -Someone
  • atconway atconway

    Star

    12060 Points

    2740 Posts

    Re: Online quiz application integrated in bigger web application

    Jan 26, 2011 03:41 PM|atconway|LINK

    If the premise exists that JS is not totally out of the question for use, then you might also want to look into Reactive Extensions for .NET which is new in .NET Framework 4.0. Specifically the Reactive Extensions for JavaScript.

    Reactive Extensions for .NET: 

    http://msdn.microsoft.com/en-us/data/gg577609

    Introducing RxJS - Reactive Extensions for JavaScript:

    http://codebetter.com/matthewpodwysocki/2010/02/16/introduction-to-the-reactive-extensions-to-javascript/

     

  • bmhc bmhc

    Member

    63 Points

    60 Posts

    Re: Online quiz application integrated in bigger web application

    Jan 26, 2011 04:31 PM|bmhc|LINK

    atconway

    If the premise exists that JS is not totally out of the question for use, then you might also want to look into Reactive Extensions for .NET which is new in .NET Framework 4.0. Specifically the Reactive Extensions for JavaScript.

    Reactive Extensions for .NET: 

    http://msdn.microsoft.com/en-us/data/gg577609

    Introducing RxJS - Reactive Extensions for JavaScript:

    http://codebetter.com/matthewpodwysocki/2010/02/16/introduction-to-the-reactive-extensions-to-javascript/


    This looks great, I see the great possibility's!


    "Program your own life." -Someone
  • BoredBySoManyRegistrationSteps BoredBySoMan...

    None

    0 Points

    13 Posts

    Re: Online quiz application integrated in bigger web application

    Jan 26, 2011 06:28 PM|BoredBySoManyRegistrationSteps|LINK

    bmhc

    The thing is, a webserver only works on request, so for you example "bonus if you answer 2 questions": then you'll need to give a postback each time a question is answered because you'll need the time it got answered, calculate it and add the bonus in a list if it matches the conditions.
    The thing is that you didn't get my joke and this conversation in going in wrong direction. I understand that you only writting but yor're not reading, but in this case you should read some of the posts. In this case look what I am saying about COMET in post No 10 in  this discussion and later in post No 13 about emulation of server push.

    bmhc

    The hint part will be a bit more tricky because you'll need a request for the hint.
    Look again about two way communication and emulation of it.

    bmhc

    Loading questions: UpdatePanel > UpdateProgress, feedback to the user
    Look again about two way communication and emulation of it and look at post No 3 about why I don't want to use AJAX Control toolkit, to which Update panel belongs. If i go to JS, i'll use jQuery or simular library, not slow and hardly extendible controls.

    bmhc

    Calculating question weight score: The Question will have a property ScoreWeight and to calculate it you can make a Util. QuizUtil maybe?
    Not a close. BL and DAL and all stuff about logic and database are not a point of discussion here. Usage of utils neither. Usage of utils is good when it concern some typical activity, here this is not the case. For example, I am using FCEditor for .NET for most of user entries, which is ready software. For things that are more customized, I make the code and all other stuffs myself.

    bmhc

    ...Im already thinking objects: Quiz, QuizUtil, Question, Answer, QuestionCollection. And depending on the features you'll be adding properties(and maybe even classes). For example, you mentioned a weight score calculation on questions.. so.. your Question object will need the ScoreWeight property or something similar.
    It is good to think about classes and properties, but this is not an issue here. How and why I am designing BL is not a topic here.

    bmhc

    Tip: Check out the Wizard control, I would use the Wizard control to make a quiz in combination with a updatepanel. I just made a Webshop for my work with the Wizard control(with feedback to the user) and a webshop is basically also just forms. Each step shows a QuestionCollection :)
    Tip: Check in Post 3 about AJAX controls (update panel) and what I am thinking about them. I can program myself wizard if i want, here such control is not needed.
    And it is good that you have made a webshop for your work with wizard control, but this is not what I am looking in this post. Anyway, does the colleagues like it?

    bmhc

    Wow.. thats alot of typing I did :| hope you'll find something useful in it ;)
    Yes, lot of typing. Now if you follow my advices about reading some of posts in this discutiion, you should do some reading :)

    atconway

    If the premise exists that JS is not totally out of the question for use, then you might also want to look into Reactive Extensions for .NET which is new in .NET Framework 4.0. Specifically the Reactive Extensions for JavaScript.

    Reactive Extensions for .NET: http://msdn.microsoft.com/en-us/data/gg577609

    Introducing RxJS - Reactive Extensions for JavaScript:
    http://codebetter.com/matthewpodwysocki/2010/02/16/introduction-to-the-reactive-extensions-to-javascript/

    Reactive Extensions looks interesting, I will need some time to check it more closely.

    Can you give try to answer my questions about the Silverlight apporach? I place them in one of my previous post, it is post No 13, lower part of the post.

     

  • atconway atconway

    Star

    12060 Points

    2740 Posts

    Re: Online quiz application integrated in bigger web application

    Jan 27, 2011 02:02 PM|atconway|LINK

    boredbysomanyregistrationsteps

    Can you give try to answer my questions about the Silverlight apporach?
     

    I would reccomend the Silverlight forums if you would like to go down that path:

    http://forums.silverlight.net/

  • BoredBySoManyRegistrationSteps BoredBySoMan...

    None

    0 Points

    13 Posts

    Re: Online quiz application integrated in bigger web application

    Jan 28, 2011 11:27 AM|BoredBySoManyRegistrationSteps|LINK

    This post is simply to sumarize and update the info that we have gathered so far. When I find out a satisfying solution, I'll describe it here to complete the thread.

    Comet for ASP.NET has turn out to be not so easy task to engineer. There are some "ready-to-use" solutions, which are paid, and most of them are non-open-code, so I won't use any ot them. In those solutions comet is implemented via separate web server, which can be integrated with IIS or Apache or used as a main web server. To name a few solutions, there are APE - Ajax Push Engine (designed mainly for Apache, but supports IIS i guess), WebSync (designed for .NET, paid), StreamHub (paid), PokeIn (paid), nmosafi aspcomet solution (it is open - source, but lack good documentation and examples).

    The task for two-way interactive online quiz can be done using Silverlight, I am checking also this approach.

    Atconway, I guess that Reactive extensions are good and may prove useful, but at the moment I can not use them. To me they look as LINQ on steroids. But anyway, good work on Rx team, I guess that they did a pretty good job.

     

  • ‹ Previous Thread|Next Thread ›