Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7730119
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T06:08:35+00:00 2026-06-01T06:08:35+00:00

I have a problem with my application. First of all on a previous page

  • 0

I have a problem with my application. First of all on a previous page the teacher types in the number of sessions (exams) he or she wants to create and types in the number of questions they want per session.

Now on the current page, If I have multiple sessions or exams in other words, then lets say I am on the first exam, it will let me add question numbers for the first exam. Now If I submit the form then it will take me to the second session and I have to add new question numbers in from scratch. Now if I try to add a question number a question number, then it does not add a question number into the table.

I have figured out where the problem occurs. The problem occurs in the code below:

if (qnum > <?php echo (int)@$_POST['textQuestion']; ?>) {
    return;
}

What I have stated above is that if the number of questions added, is more than the number of questions stated on the previous page, then do not add question number. So lets say I have 2 sessions and I want only 1 question per session. In the first session it adds question number 1, but when I get to second session, it doesn’t add question number 1 for second session because it thinks it is question number 2, even though it is suppose to be question 1 for second session.

So how do I get it so that if user goes to second session, it knows that the question number starts back at 1?

Below is full code on how question number is added into a table:

  var qnum = 1;
    var count = 1;

    function insertQuestion(form) {   

        if (qnum > <?php echo (int)@$_POST['textQuestion']; ?>) {
        return;
    }


        var $tbody = $('#qandatbl > tbody'); 
        var $tr = $("<tr class='optionAndAnswer' align='center'></tr>");
        var $qid = $("<td class='qid'>" + qnum + "</td>");

        $tr.append($qid);
        $tbody.append($tr); 

        count++;


        $(form).find('.numberOfQuestions').val(qnum);

        ++qnum;
        $("#questionNum").text(qnum);  


}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T06:08:36+00:00Added an answer on June 1, 2026 at 6:08 am

    Try to use $_SESSION instead of $_POST. Anyway, using @ is a bad habit.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing my first web application (still!), and have a problem activating user accounts.
I have a problem with my application (first one) when people downloading it from
I have problem with my application. I have table report, there are 2 column
I have a problem linking an application for an embedded target. I'm developing on
i have a problem to distributing application with 2 project (one project with sub-project
I have a problem with winform application which uses threads to update the UI.
We have problem with our Qt based production server for our business application. When
I have problem with Spork (v 1.0.0rc1) and Devise in my Rails application. I
I have problem concerning python packages and testing. I'm writing an application using wx
I have this problem in my ASP.NET application where I'm seeing some of my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.