If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Building a test - Basic C#

I could do this on my own, but I thought I'd throw this to you guys to help out. I'm trying to do this fast (next 24-48 hours) as I want to test a new content type we are launching here on CodeGuru. What I need is a test. This first test is to test a person's knowledge on C#.

Let's keep this to BASIC knowledge, so a very intro level quiz as a start. I'd like to come up with about 10 questions that have multiple choice answers.

If you want to suggest a question, post it to this thread along with possible answers. The next post will be an example from me to get things rolling.

Again -- This is a BEGINNING / BASIC test. We can follow this with tests on specific topic areas as well as more advanced tests. If someone scores perfect on this test, we can say they know what C# is....

Re: Building a test - Basic C#

Is this an ad hoc set of questions for evaluating the new functionality, or is this going to be actual content?
IMO, you should ditch the first question, as it's not all that important on a basic level.
These are some topics or ability tests that the question should cover: what is the target environment, the ability to recognize a C# program, the knowledge that it's a managed language, that there's a difference between value types and reference types (maybe not so basic, but certainly fundamental), the basics of classes - that it defines a type, that it can have members, like fields, properties and methods, and the difference between a class and an instance, and maybe some other questions, depending on what knowledge its supposed to test for.

How many questions do you need? Are all of them to be in the same format? And could you more precisely specify how basic is "BASIC"? That is, what is the knowledge being tested? Basic info and the simple ability to recognize C# code? The ability to write a simple C# program. The basic ability to use some elements of the .NET library? What?

Re: Building a test - Basic C#

To answer your questions:

This sample test is to test the new functionality, but it will also go live on the site, so it will be real content.

The 'basic' was just to do something fun and relatively easy. I can do a set of questions on any topic. While each post could have an unlimited number of questions with an unlimited number of answers, I'd prefer to create something that is between 5 and 10 questions long with 10 seeming to be a good target.

The format of the questions/answer is multiple choice. I can work any HTML markup into the question and the answers, so that gives a little flexibility. There is no free form coding or anything like that in this first example. Questions can have an unlimited number of answers, as I indicated, but I suggest keeping it between two and five.

In addition to the questions and answers, I also have the ability to display a response if the person answers the question wrong. As such, this gives us a chance to indicate which answer was correct and why the others might have been wrong. It also let's us do things such as point (link) to the FAQs that have been created on the forum for more information.

This isn't a revolutionary feature, but it should be interesting. In addition to this basic quiz for C#, I can do quizzes on any programming topic. I'll create a word doc template that can be used to set up a new "Tech IQ" test in case someone wants to build a couple for the site.

I'd be curious to see someone write 10 questions that are super hard-core C# (or VB or C++) as a test under a title such as "Are you a hardcore C# developer?" (or VB or C++). Those are a bit more difficult though, so I thought I'd try to start with 10 simple, basic questions on C# to get a sample build and launched.

Re: Building a test - Basic C#

Here are some suggestions. You'll notice that most of them ask very basic questions about classes, that is, they are about a fundamental OO concept, rather than things like functions, variables, conditionals, control flow statements, etc. This is inevitable since in C# you can't make anything that's not a part of a class. Sure, one could still circumvent this to some extent, but IMO, it's a wrong way to introduce the language to a beginner. Thus, all of these questions are rather general in nature, and ask about the basics of the C# language, without going to much into the details of the actual code. I understand that beginners might not be able to answer some of the questions, but, hey, it's a great opportunity for them to learn something important.

The format I used here, for the sake of clarity is:Question?

Correct answer

-

A list of wrong answers.

The answers offered should be shuffled, of course. Please correct any grammar mistakes you spot.

Which of the following is a valid "Hello world" program in C#?

use your example

Which one of these represents a standard entry point to a desktop program?
// Note: had to specify "desktop", since now this is different for Win Store Apps (unless I'm mistaken)

public static void Main()

-

public static class Program

public void Main()

Console.WriteLine();

Application.Run(new Form1());

namespace MyApplication

using System.Windows.Forms;

public static void Run()

What are the names of the most commonly used fundamental types supported by the language?

int, float, double, bool, string

-

do, for, while, break, as, continue

void, out, switch, if, goto, using

Console.WriteLine(), Console.ReadLine(), Application.Run()

What is a class?

A user-defined type, which represents some concept by describing it in terms of state and associated behaviors.

-

A user-defined function, which can be used from other parts of the program.

A predefined body of code which is generated by an IDE when a new C# project is started.

Another name for a C# file.

Which of these denote basic kinds of class members?

Fields, properties and methods.

-

Console.WriteLine(), Console.ReadLine(), return

Input parameters, output parameters, and a return type.

A backing field, a get block, and a set block.

Namespaces, modules and assemblies.

How classes represent state (data) and behavior?

Class fields and properties are used to represent state, while methods implement behaviors.

Re: Building a test - Basic C#

As a note - this is the first Tech IQ to get posted. There are some bugs we are still working to fix. For example, the text has been initial cap'd. It shouldn't be. That is being fixed. If you see any other issues with the functionality of this, feel free to chime in.

If you want to create a new Tech IQ, I've created a guideline document that is also rough, but I'll go ahead and attach it.

Re: Building a test - Basic C#

I had a few strange things happen. On one of the missed answers the correct answer didn't show up like on others. At some points during the quiz, I was not able to select an answer and have to refresh the screen to be able to continue. I am using Chrome as the browser.

Re: Building a test - Basic C#

There's an error on the first question - the correct answer is 3 (the one with the static Main()). When an option different than 1 is chosen, the error/info message (wrongly) says that the right answer is 1, but correctly displays the code from the answer 3.

BTW: you can re-do the test by deleting codeguru.com cookies (specifically, the one with the name "b2b_techIQ_CSharpBeginning").