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 6961873
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:35:14+00:00 2026-05-27T15:35:14+00:00

I am trying to develop a structure in the following manner… I am representing

  • 0

I am trying to develop a structure in the following manner…

  • I am representing Courses which are taught by Teachers.
  • For each of those Courses there are any number of Exams (because the Exam is randomly generated, each generation counts as a different exam), and I have to track that in the database.
  • An Exam can be taken by 0 or more Students. (And, conversely, a Student can have taken one or more Exams.)
  • Once the Student takes the exam (which is done via a web interface that I have already developed), that Student receives a score for the Exam and an ExamStatus (Passed, Failed, Retake, TestOut, etc.)
  • There are some other “stuff” in there that I didn’t address such as Exams are made up of Questions (which are created by the Teacher), etc, but I have a good understanding of that.

I have almost finished my structure, but I am struggling with how to represent the relationship of Students to Exams and also working the ExamStatus. Here is my thought so far. (It is late, so my apologies for stupid errors.)

public class Student
{
    public string StudentID { get; set; }
    public string FirstName { get; set; }
    public string LastName { get; set; }

    // Should this even be part of the Student POCO?
    public virtual ICollection<Exam> ExamsTaken { get; set; }
}

// I know this is right - putting it here to provide all the classes in question.
public class ExamStatus
{
    public int ExamStatusID { get; set; }
    public string Name { get; set; }
    public string Description { get; set; }
}

// This is the POCO that really hangs me up.
public class Exam
{
    public int ExamID { get; set; }
    public int CourseID { get; set; }
    public string ExamTitle { get; set; }

    // Not sure if this should be part of Exam, or part of a different
    // object?
    public decimal? Score { get; set; }
    public int? ExamStatusID { get; set; }

    public virtual ICollection<Question> Questions { get; set; }
    public virtual Course Course { get; set; }
    public virtual ExamStatus ExamStatus { get; set; }
}

I would appreciate any help with this many-to-many relationship (Students <-> Exams). I think I’ve thought about it too much and have thoroughly confused myself on something that is probably fairly straightforward.

  • 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-05-27T15:35:14+00:00Added an answer on May 27, 2026 at 3:35 pm

    This is what I would change. I don’t THINK its exactly what Adam said. If it is let me know and i’ll remove the post

    public class Student
    {
        public string StudentID { get; set; }
        public string FirstName { get; set; }
        public string LastName { get; set; }
    
        // changed this to results of the exams taken
        // you can still get exam via ExamResult -> Exam
        public virtual ICollection<ExamResult> ExamsTaken { get; set; }
    }
    
    public class Exam
    {
        public int ExamID { get; set; }
        public int CourseID { get; set; }
        public string ExamTitle { get; set; }
    
        public virtual ICollection<Question> Questions { get; set; }
        public virtual Course Course { get; set; }
        // used to be ICollection of exam statuses, but that got moved to the
        // ExamResult class
        public virtual ICollection<ExamResults> Results { get; set; }
    }
    
    public class ExamResult
    {
        public int ExamID { get; set; }
        public int StudentID { get; set; }
    
        public decimal? Score { get; set; }
        // all your results should have a status right? im assuming
        // unfinished or not started exams have statuses
        // so this shouldn't be nullable
        public int ExamStatusID { get; set; }
    
        public virtual Student Student { get; set; }
        public virtual Exam Exam { get; set; }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is the code I'm trying to develop: Public Structure Statistic(Of t) Dim maxStat
I'm trying to develop an alarm history structure to be stored in non-volatile flash
I am trying to develop programs which will work for nokia mobile phones. I
Am trying to develop a windows service which listens to a rabbitMQ listener and
I'm trying to develop a responsive navigation menu which dynamically creates a More.. menu
I am trying to develop a simple map application, which will display a map
I am trying to develop a concept for a simple algorithm which will turn
I'm currently trying to develop a program which stores lots of data, similar to
I'm trying develop a reddit style site which allows users to vote on links.
I am trying develop a basic referrer system to my Django website, system will

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.