Realization of online answer game in chat Room with ASP (cont.)

Source: Internet
Author: User
Chat Room | The online answer processing section is placed in the process of sending a conversation message. Here is the code part of the answer process:

If mid (fstr,i,1) = "#" Then ' Fstr is a string variable that holds the dialog information
Tfstr=mid (fstr,i+1,1)
If CInt (DateDiff ("N", Application ("Questiontime"), Now ()) <=1 Then ' judgment time is valid within 1 minutes
If LCase (TFSTR) =lcase (Application ("Answertrue")) Then ' Determine if the answer is correct
If InStr ("Answername"), Session ("User_username") >0 then ' to determine if the user has already answered the question
Tfstr=session ("User_username") & "has already answered the question!!! "
Else
Tfstr=session ("User_username") & "correct answer!" "
Session ("User_exp") =session ("User_exp") +application ("questioncent") ' Add points to the user of the correct question
Application ("Answername") =application ("Answername") &session ("User_username") & "" ' Save the name of the user who answered the question correctly
End If
Else
If InStr ("Tanswername"), Session ("User_username") >0 then "" to determine whether the user has answered the question

Tfstr=session ("User_username") & "has already answered the question!!! "
Else
Application ("Tanswername") =application ("Tanswername") &session ("User_username") & "" ' Save the name of the user who answered the wrong question
End If
End If
End If



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.