|
@@ -390,87 +390,94 @@ namespace TEAMModelOS.Controllers
|
|
|
if (rule > 0)
|
|
|
{
|
|
|
int falseCount = 0;
|
|
|
- foreach (string obj in ans[i])
|
|
|
+ if (ans[i].Count > 0)
|
|
|
{
|
|
|
- if (!standard[i].Contains(obj))
|
|
|
+ foreach (string obj in ans[i])
|
|
|
{
|
|
|
- falseCount++;
|
|
|
- }
|
|
|
- }
|
|
|
- switch (rule)
|
|
|
- {
|
|
|
- case 1:
|
|
|
- if (ans[i].Count == standard[i].Count)
|
|
|
+ if (!standard[i].Contains(obj))
|
|
|
{
|
|
|
- if (falseCount == 0)
|
|
|
+ falseCount++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ switch (rule)
|
|
|
+ {
|
|
|
+ case 1:
|
|
|
+ if (ans[i].Count == standard[i].Count)
|
|
|
{
|
|
|
- result.studentScores[newIndex][i] = points[i];
|
|
|
+ if (falseCount == 0)
|
|
|
+ {
|
|
|
+ result.studentScores[newIndex][i] = points[i];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ result.studentScores[newIndex][i] = 0;
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
result.studentScores[newIndex][i] = 0;
|
|
|
}
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- result.studentScores[newIndex][i] = 0;
|
|
|
- }
|
|
|
- break;
|
|
|
- case 2:
|
|
|
- if (falseCount > 0)
|
|
|
- {
|
|
|
- result.studentScores[newIndex][i] = 0;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- if (ans[i].Count == standard[i].Count)
|
|
|
+ break;
|
|
|
+ case 2:
|
|
|
+ if (falseCount > 0)
|
|
|
{
|
|
|
- result.studentScores[newIndex][i] = points[i];
|
|
|
+ result.studentScores[newIndex][i] = 0;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- result.studentScores[newIndex][i] = points[i] / 2;
|
|
|
- }
|
|
|
+ if (ans[i].Count == standard[i].Count)
|
|
|
+ {
|
|
|
+ result.studentScores[newIndex][i] = points[i];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ result.studentScores[newIndex][i] = points[i] / 2;
|
|
|
+ }
|
|
|
|
|
|
- }
|
|
|
- break;
|
|
|
- case 3:
|
|
|
- if (falseCount > 0)
|
|
|
- {
|
|
|
- result.studentScores[newIndex][i] = 0;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- if (ans[i].Count == standard[i].Count)
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 3:
|
|
|
+ if (falseCount > 0)
|
|
|
{
|
|
|
- result.studentScores[newIndex][i] = points[i];
|
|
|
+ result.studentScores[newIndex][i] = 0;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- result.studentScores[newIndex][i] = System.Math.Round((double)ans[i].Count / standard[i].Count * points[i], 1);
|
|
|
- }
|
|
|
+ if (ans[i].Count == standard[i].Count)
|
|
|
+ {
|
|
|
+ result.studentScores[newIndex][i] = points[i];
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ result.studentScores[newIndex][i] = System.Math.Round((double)ans[i].Count / standard[i].Count * points[i], 1);
|
|
|
+ }
|
|
|
|
|
|
- }
|
|
|
- break;
|
|
|
- case 4:
|
|
|
- if (ans[i].Count == standard[i].Count)
|
|
|
- {
|
|
|
- result.studentScores[newIndex][i] = points[i];
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- double persent = (double)(standard[i].Count - 2 * falseCount) / standard[i].Count;
|
|
|
- if (persent <= 0)
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 4:
|
|
|
+ if (ans[i].Count == standard[i].Count)
|
|
|
{
|
|
|
- result.studentScores[newIndex][i] = 0;
|
|
|
+ result.studentScores[newIndex][i] = points[i];
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- result.studentScores[newIndex][i] = System.Math.Round(persent * points[i], 1);
|
|
|
+ double persent = (double)(standard[i].Count - 2 * falseCount) / standard[i].Count;
|
|
|
+ if (persent <= 0)
|
|
|
+ {
|
|
|
+ result.studentScores[newIndex][i] = 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ result.studentScores[newIndex][i] = System.Math.Round(persent * points[i], 1);
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
- break;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ result.studentScores[newIndex][i] = 0;
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
}
|