我有 3 个列表和课程:
List<student_Answers> student_answer = new List<student_Answers>
{new student_Answers {id = "1", q1 ="*C", q2= "*D", q3 = "*B", q4= "*A" },
new student_Answers {id = "2", q1 ="*D", q2= "*E", q3 = "*B", q4= "*A" }};
List<answer> correct_answer = new List<answer>
{new answer{r1 ="*C", r2= "*D", r3 = "*B", r4= "*C" }};
List<Topic> topic_question = new List<Topic>
{ new Topic{ q1_topic ="Verb to be", q2_topic= "Verb to be", q3_topic = "Listening", q4_topic= "Listening" }};
我试过了:
foreach (var na in student_answer)
{var grade = from n in student_answer where !na.Contains(n) select n;}
它不起作用,我不知道如何将我的问题按主题分组。
预期输出:
失败的问题:
Id= 1 : 失败的问题 = 4 : Topic = "Listening" Id= 2 : 失败的问题 = 1 : Topic = "动词 to be" Id= 2 : 失败的问题 = 4 : Topic = "Listening"
主题百分比:
听力 = 2/4 = 50% 不正确 动词 to be = 1/4 = 25% 不正确