Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please put the answer as a file or tell me step by step how it works. Create an

ID: 3665951 • Letter: P

Question

Please put the answer as a file or tell me step by step how it works.

Create an online web form using ASP.NET framework with C# code behind. The web form is for a review test. The user will have to enter their name on top of the test form to be included in the final report. Questions will be listed followed by the answer’s appropriate entry method (server control). Each question will have a checkbox to show a helpful hint. Hints are hidden. They will be visible only if the show hint check box for any question is checked. Questions are in different format such as true and false, multiple choices, select one, etc. Your project must contain the following controls:

1- Label

2- Button

3- TextBox

4- CheckBox

5- RadioButton

6- DropDownList

When the user submits the exam, the user should receive a report that includes:
The test taker’s name on top of the report.

Final score

Total correct answers,

Total wrong answers.

Percent of correct answers.

Percent of incorrect answers

Letter grade on the scale of A, B, C, D, and F based on the correct score percentage. Please note that letter grade of F is for any score below 60 %.

I have included below the test questions and the hints.

Enter Name:   

1. In C#, = and == mean the same thing. Hint: In C# we use assignment and == for equality comparison.   
2. Button, Label, RadioButtons, TextBox, DropDownList, and Checkbox are different kinds of server controls.
3. All following are legal variable names: Player1, Player_2, IF, firstName, Last_name, TAX.
Hint: in C# variable names are made of alphanumeric characters, underscore “_” and “$”. No other special characters are allowed. No use of reserved words.
4. Check the boxes for all correct variable names: Player1, Player 2, First Name, 1Player, if, TAX%, FOR, You&Me.
Hint: in C# variable names are made of alphanumeric characters, underscore “_” and “$”. No other special characters are allowed. No use of reserved words.
5. Instead of using regular HTML tags, we define the TextBox .NET server controls this way: <asp:TextBox ID="Message" runat="server" >
Hint: the format is <asp:TypeOfControl ID="ControlName" runat="server" />
6. Select the date type for the variable balance that will store bank account balance: char, int, double, string
7. We can make any control disappear from the form by sitting the “invisible” attribute’s value to true. (True of False)
Hint: controls have an attribute called visible that can be set to true or false
8. What is the value returned by the following code “The total is: “ + 5 + 4; The total is: + 5 + 4 The total is: 5 + 5 The total is: 9 The total is: 54
Hint: the + sign in numbers means addition operation but with a string means concatenation.   
9. What is the value returned by the following code “The total is: “ + (5 + 4); The total is: (5 + 4) The total is: 5 + 5 The total is: 9 The total is: 54
Hint: the + sign in numbers means addition operation but with a string means concatenation.   
10. C# programming language is a case-sensitive language. So that means variables LastName, lastName, and lastname all means the same thing and contain the same value?
Hint: The answer is in the question. If you are looking at this hint, that means you need to read this question again and read it carefully.

Explanation / Answer

Below is c# code which is entirly dynamic. You can update the questions without static data.

private void Page_Load(object sender, System.EventArgs e)
{
if (!IsPostBack)
{
// This is the Initial Page Load. Draw the Quiz
ReadQuizTitle();
ReadQuestionsIntoTable();
AddSubmitButton();
}
else
{
// The User has pressed the score button, calculate and publish the results
HttpRequest r;
r = this.Request;
bool AreAllAnswered = CalculateScore(r);
HttpResponse rs;
rs = this.Response;
if (AreAllAnswered == false)
{
rs.Write("You missed a few questions. Go back in your browser and answer them<P>");
return;
}
// Write the score
rs.Write("Your score is " + NumberCorrect.ToString() + " out of " + NumberOfQuestions.ToString() +
"<P>");
// Print out the corrected answers
for (int num = 0; num < NumberOfQuestions; num++)
{
if (WrongArray[num].Length > 0)
rs.Write(WrongArray[num]);
}
// Rank the User
rs.Write(GetRanking());
}
}

private void ReadQuestionsIntoTable()
{
// Fill the questions and choices tables in memory
DataSet ds1 = new DataSet("questionsds");
oleDbDataAdapter1.Fill(ds1, "Questions");
oleDbDataAdapter2.Fill(ds1, "Choices");
DataTable QuestionsTable = ds1.Tables["Questions"];
DataTable ChoicesTable = ds1.Tables["Choices"];
// create a data relation between the Questions and Choices Tables
// so we can cycle through the choices for each question
DataRelation QALink = new DataRelation("QuestionLink", QuestionsTable.Columns["QuestionID"],
ChoicesTable.Columns["QuestionID"]);
QuestionsTable.ChildRelations.Add(QALink);
NumberOfQuestions = 0;
// go through every row in the questions table
// and place each question in the Table Web Control
foreach (DataRow dr in QuestionsTable.Rows)
{
// create a row for the question and read it from the database
TableRow tr = new TableRow();
Table1.Rows.Add(tr);
TableCell aCell = new TableCell();
// get the text for the question and stick it in the cell
aCell.Text = dr["QuestionText"].ToString();
tr.Cells.Add(aCell);
AnswerArray[NumberOfQuestions] = dr["Answer"].ToString();
// create a row for the choices and read from the database
int count = 0;
// go through the child rows of the question table
// established by the DataRelation QALink and
// fill the choices for the table
foreach (DataRow choiceRow in dr.GetChildRows(QALink))
{
TableRow tr2 = new TableRow();
Table1.Rows.Add(tr2);
// create a cell for the choice
TableCell aCell3 = new TableCell();
aCell3.Width = 1000;
// align the choices on the left
aCell3.HorizontalAlign = HorizontalAlign.Left;
tr2.Cells.Add(aCell3);

// create a radio button in the cell
RadioButton rb = new RadioButton();
// assign the radio button to Group + QuestionID
rb.GroupName = "Group" + choiceRow["QuestionID"].ToString();

// Assign the choice to the radio button
rb.Text = choiceRow["ChoiceLetter"].ToString() + ". " + choiceRow["ChoiceText"].ToString();
// Assign the radio button id corresponding to the choice and question #
rb.ID = "Radio" + NumberOfQuestions.ToString() + Convert.ToChar(count + 65);
rb.Visible = true;
// add the radio button to the cell
aCell3.Controls.Add(rb);
count++;
}
// add a table row between each question
// as a spacer
TableRow spacer = new TableRow();
spacer.Height = 30;
TableCell spacerCell = new TableCell();
spacerCell.Height = 30;
spacer.Cells.Add(spacerCell);
Table1.Rows.Add(spacer); // add a spacer
// Increment the # of Questions
NumberOfQuestions++;
}
}

private bool CalculateScore(HttpRequest r)
{
// initialize wrong answer array
WrongArray.Initialize();
// Load up statistic table to get Number of Questions
DataSet ds = new DataSet("StatsDS");
oleDbDataAdapter4.MissingSchemaAction = MissingSchemaAction.AddWithKey;
this.oleDbDataAdapter4.Fill(ds, "StatsTable");
DataTable StatsTable = ds.Tables["StatsTable"];
NumberOfQuestions = (int)StatsTable.Rows[0]["NumberOfQuestions"];
// Load up Questions Table to Get Answers to
// compare to testtaker
oleDbDataAdapter1.MissingSchemaAction = MissingSchemaAction.AddWithKey;
DataSet ds1 = new DataSet("questionsds");
oleDbDataAdapter1.Fill(ds1, "Questions");
DataTable QuestionTable = ds1.Tables["Questions"];
// Load up choices table to print out correct choices
DataSet ds2 = new DataSet("choicesDS");
oleDbDataAdapter2.MissingSchemaAction = MissingSchemaAction.AddWithKey;
oleDbDataAdapter2.Fill(ds2, "Choices");
DataTable ChoicesTable = ds2.Tables["Choices"];
// make sure all questions were answered by the tester
int numAnswered = CalcQuestionsAnsweredCount(r);
if (numAnswered != NumberOfQuestions)
{
return false;
}
NumberCorrect = 0;
NumberWrong = 0;
// initialize wrong answer array to empty string
for (int j = 0; j < NumberOfQuestions; j++)
{
WrongArray[j] = "";
}
// cycle through all the keys in the returned Http Request Object
for (int i = 0; i < r.Form.Keys.Count; i++)
{
string nextKey = r.Form.Keys[i];
// see if the key contains a radio button Group
if (nextKey.Substring(0, 5) == "Group")
{
// It contains a radiobutton, get the radiobutton ID from the hashed Value-Pair Collection
string radioAnswer = r.Form.Get(nextKey);
// extract the letter choice of the tester from the button ID
string radioAnswerLetter = radioAnswer[radioAnswer.Length - 1].ToString();
// extract the question number from the radio ID
string radioQuestionNumber = radioAnswer.Substring(5);
radioQuestionNumber = radioQuestionNumber.Substring(0, radioQuestionNumber.Length - 1);
int questionNumber = Convert.ToInt32(radioQuestionNumber, 10) + 1;
// now compare the testers answer to the answer in the database
DataRow dr = QuestionTable.Rows.Find(questionNumber);
if (radioAnswerLetter == dr["Answer"].ToString())
{
// tester got it right, increment the # correct
NumberCorrect++;
CorrectArray[questionNumber - 1] = true;
WrongArray[questionNumber - 1] = "";
}
else
{
// tester got it wrong, increment the # incorrect
CorrectArray[questionNumber - 1] = false;
// look up the correct answer
string correctAnswer = ChoicesTable.Rows.Find(dr["AnswerID"])["ChoiceText"].ToString();
// put the correct answer in the Wrong Answer Array.
WrongArray[questionNumber - 1] = "Question #" + questionNumber + " - <B>" + dr
["Answer"].ToString() + "</B>. " + correctAnswer + "<BR> ";
// increment the # of wrong answers
NumberWrong++;
}
}
}
return true;
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote