removed comments
This commit is contained in:
Родитель
081180046d
Коммит
f2200cc79c
|
@ -178,14 +178,12 @@ namespace Assessment.App.Functions.Student
|
|||
{
|
||||
if (requestData.Responses.TryGetValue(questionId, out var responseInfo))
|
||||
{
|
||||
questionItems[questionId].Answer.ForEach(Console.WriteLine);
|
||||
var questionType = questionItems[questionId].QuestionType;
|
||||
var studentAns = responseInfo.ChosenOption;
|
||||
studentAns = studentAns.Select(s => s.ToLowerInvariant()).ToArray();
|
||||
var correctAns = questionItems[questionId].Answer;
|
||||
correctAns = correctAns.ConvertAll(d => d.ToLower());
|
||||
var res = getResult(studentAns, correctAns.ToArray(), questionType);
|
||||
Console.WriteLine(res.ToString());
|
||||
correctAnswers = correctAnswers + res;
|
||||
}
|
||||
}
|
||||
|
@ -234,13 +232,8 @@ namespace Assessment.App.Functions.Student
|
|||
|
||||
private static int getResult(string[] studentResponse, string[] correctAns, string questionType){
|
||||
if (questionType == "MCQ" || questionType == "TF"){
|
||||
Console.WriteLine("Yep this is either TF or MCQ");
|
||||
Array.Sort(studentResponse);
|
||||
Console.WriteLine("This is student response after sorting");
|
||||
Console.WriteLine(String.Join("\n", studentResponse));
|
||||
Array.Sort(correctAns);
|
||||
Console.WriteLine("This is OG response after sorting");
|
||||
Console.WriteLine(String.Join("\n", correctAns));
|
||||
if (studentResponse.SequenceEqual(correctAns)){
|
||||
return 1;
|
||||
}
|
||||
|
@ -251,7 +244,6 @@ namespace Assessment.App.Functions.Student
|
|||
if (questionType == "QA"){
|
||||
foreach(string answer in studentResponse ){
|
||||
if (correctAns.Contains(answer)){
|
||||
// currently case insensitive
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче