Click here to Skip to main content
15,903,741 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have class Answerlist class Questionlist class

Answerlist class inherite from list<answer>
also Questionlist inherite from list<question>

Answerlist for model answers

questionlist for questions

i have attribute
in questionlist class


C#
List<string> ans 
 public List<string> Ans
        {
            get { return ans; }
            set { ans = value; }
        }

that i will store user answer in it

C#
Answerlist al = new Answerlist ();
Questionlist userAnswer = new userAnswer();

now i need to compare 

al[i].Equals(userAnswer.Ans[i])
Posted
Comments
Arjsrya 2-Jan-15 5:16am    
Question is not clear.
King Fisher 2-Jan-15 5:34am    
Not Clear .
[no name] 2-Jan-15 5:37am    
Provide the userAnswer() details.
Neetin_1809 2-Jan-15 5:46am    
Do You Need To Check the Answer is Of Respective Question ??
BillWoodruff 2-Jan-15 11:08am    
For each time the test is run (for each person taking the test ?) is a new list of questions and possible answers, and correct answers, constructed from some master list of questions, possible answers, and correct answers ?

1 solution

C#
CList<answerlist> m_AnswerItems;
CList<questionlist> m_QuestionItems;
POSITION pos = m_m_AnswerItems.GetHeadPosition();
for(int i = 0;i < m_AnswerItems.GetCount();i++)
{
    Answerlist *pItem = m_AnswerItems.GetNext(pos);
    POSITION pos1 = m_QuestionItems.GetHeadPosition();
    for(int j = 0;j < m_QuestionItems.GetCount();j++)
    {
         Questionlist *pItem1 = m_QuestionItems.GetNext(pos);

///    if(pItem1->xxx == pItem->xxx)
 
     }
}</questionlist></answerlist>
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900