From 13d82faca1f40a2df42e8503ed9f82c18d6441d8 Mon Sep 17 00:00:00 2001
From: wangxiner55 <1468441589@qq.com>
Date: Sat, 14 Sep 2024 16:18:12 +0800
Subject: [PATCH] Init default Material
---
StudentManager/App.xaml | 8 ++-
StudentManager/Common/HomeWorkSet.cs | 53 +++++++++-------
StudentManager/Editor/CheckView.xaml | 65 ++++++++++++--------
StudentManager/Editor/DetailCheckView.xaml | 71 ++++++++++++++++------
StudentManager/Editor/DetailView.xaml | 3 +-
StudentManager/Editor/MainEditor.xaml | 6 +-
StudentManager/Editor/QuestionsView.xaml | 40 ++++++++++--
StudentManager/Editor/StudentsView.xaml | 35 ++++++-----
StudentManager/Model/Students.cs | 11 ++++
StudentManager/StudentManager.csproj | 1 +
10 files changed, 203 insertions(+), 90 deletions(-)
diff --git a/StudentManager/App.xaml b/StudentManager/App.xaml
index 2a75079..c302656 100644
--- a/StudentManager/App.xaml
+++ b/StudentManager/App.xaml
@@ -2,8 +2,14 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:StudentManager"
+ xmlns:md="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:prism="http://prismlibrary.com/">
-
+
+
+
+
+
+
diff --git a/StudentManager/Common/HomeWorkSet.cs b/StudentManager/Common/HomeWorkSet.cs
index f6de5c9..0827111 100644
--- a/StudentManager/Common/HomeWorkSet.cs
+++ b/StudentManager/Common/HomeWorkSet.cs
@@ -19,14 +19,17 @@ namespace StudentManager.Common
public class DetailHomeWorkInfo
{
- public DetailQuestionBase QuestionData { get; set; } = new DetailQuestionBase();
- public DateTime DateTime { get; set; } = DateTime.Now;
- public int Lesson { get; set; } = 0;
+ //public DetailQuestionBase QuestionData { get; set; } = new DetailQuestionBase();
+ public QuestionData QuestionData { get; set; } = new QuestionData();
+ //public DateTime DateTime { get; set; } = DateTime.Now;
+ //public int Lesson { get; set; } = 0;
public bool Status { get; set; } = false;
- public int TotalCount { get; set; } = 0;
- public int ErrorCount { get; set; } = 0;
- public int CorrectCount { get; set; } = 0;
+ //public int TotalCount { get; set; } = 0;
+ //public int ErrorCount { get; set; } = 0;
+ //public int CorrectCount { get; set; } = 0;
+
+ public int PID { get; set; } = 0;
}
public class HomeWork
@@ -48,15 +51,17 @@ namespace StudentManager.Common
{
list.Add(new DetailHomeWorkInfo
{
- QuestionData = {
- QuestionData = QuestionLib.Get(item.ID),
- Status = item.Status },
+ //QuestionData = {
+ // QuestionData = QuestionLib.Get(item.ID),
+ // Status = item.Status },
+ QuestionData = QuestionLib.Get(item.ID),
Status = Status,
- Lesson = Lesson,
- DateTime = DateTime,
- TotalCount = TotalCount,
- ErrorCount = ErrorCount,
- CorrectCount = CorrectCount
+ //Lesson = Lesson,
+ //DateTime = DateTime,
+ //TotalCount = TotalCount,
+ //ErrorCount = ErrorCount,
+ //CorrectCount = CorrectCount,
+ PID = item.ID
});
}
@@ -140,15 +145,17 @@ namespace StudentManager.Common
{
list.Add(new DetailHomeWorkInfo
{
- QuestionData = {
- QuestionData = QuestionLib.Get(item.ID),
- Status = item.Status },
- Status = HomeWorks[lesson].Status,
- Lesson = HomeWorks[lesson].Lesson,
- DateTime = HomeWorks[lesson].DateTime,
- TotalCount = HomeWorks[lesson].TotalCount,
- ErrorCount = HomeWorks[lesson].ErrorCount,
- CorrectCount = HomeWorks[lesson].CorrectCount
+ //QuestionData = {
+ // QuestionData = QuestionLib.Get(item.ID),
+ // Status = item.Status },
+ QuestionData = QuestionLib.Get(item.ID),
+ Status = item.Status,
+ //Lesson = HomeWorks[lesson].Lesson,
+ //DateTime = HomeWorks[lesson].DateTime,
+ //TotalCount = HomeWorks[lesson].TotalCount,
+ //ErrorCount = HomeWorks[lesson].ErrorCount,
+ //CorrectCount = HomeWorks[lesson].CorrectCount,
+ PID = item.ID
});
}
diff --git a/StudentManager/Editor/CheckView.xaml b/StudentManager/Editor/CheckView.xaml
index dee11da..7298a01 100644
--- a/StudentManager/Editor/CheckView.xaml
+++ b/StudentManager/Editor/CheckView.xaml
@@ -7,17 +7,23 @@
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
+
+
+
-
@@ -29,31 +35,42 @@
-
-
-
-
-
-
-
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/StudentManager/Editor/DetailCheckView.xaml b/StudentManager/Editor/DetailCheckView.xaml
index 5ff9513..5ca98db 100644
--- a/StudentManager/Editor/DetailCheckView.xaml
+++ b/StudentManager/Editor/DetailCheckView.xaml
@@ -7,15 +7,21 @@
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
+
+
+
+
-
-
-
+
+
+ CommandParameter="{Binding SelectedItem, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListBox}}"
+ Command="{Binding DataContext.HomeWorkSetSelectedCommand ,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ItemsControl}}"/>
@@ -24,21 +30,48 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/StudentManager/Editor/DetailView.xaml b/StudentManager/Editor/DetailView.xaml
index e5b23ba..ecd8c20 100644
--- a/StudentManager/Editor/DetailView.xaml
+++ b/StudentManager/Editor/DetailView.xaml
@@ -12,6 +12,7 @@
@@ -22,7 +23,7 @@
-
diff --git a/StudentManager/Editor/MainEditor.xaml b/StudentManager/Editor/MainEditor.xaml
index 107ab10..868d856 100644
--- a/StudentManager/Editor/MainEditor.xaml
+++ b/StudentManager/Editor/MainEditor.xaml
@@ -7,6 +7,7 @@
xmlns:prism="http://prismlibrary.com/"
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
xmlns:extent="clr-namespace:StudentManager.Extensions"
+ Background="#FF333333"
mc:Ignorable="d"
Title="MainEditor" Height="450" Width="800">
@@ -15,13 +16,14 @@
-
+
+
+ CommandParameter="{Binding NameSpace}" Margin="5.0"/>
diff --git a/StudentManager/Editor/QuestionsView.xaml b/StudentManager/Editor/QuestionsView.xaml
index cf7974b..a863351 100644
--- a/StudentManager/Editor/QuestionsView.xaml
+++ b/StudentManager/Editor/QuestionsView.xaml
@@ -12,12 +12,12 @@
-
-
+ -->
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/StudentManager/Editor/StudentsView.xaml b/StudentManager/Editor/StudentsView.xaml
index e1d9d96..32446e9 100644
--- a/StudentManager/Editor/StudentsView.xaml
+++ b/StudentManager/Editor/StudentsView.xaml
@@ -8,15 +8,15 @@
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
-
-
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
diff --git a/StudentManager/Model/Students.cs b/StudentManager/Model/Students.cs
index 7687e3d..7a05740 100644
--- a/StudentManager/Model/Students.cs
+++ b/StudentManager/Model/Students.cs
@@ -127,6 +127,7 @@ namespace StudentManager.Model
public DelegateCommand HomeWorkSelectedCommand { get; set; }
public DelegateCommand HomeWorkSetSelectedCommand { get; set; }
public DelegateCommand RegionToDetailCommand { get; set; }
+ public DelegateCommand SubmitHomeWorkCommand { get; set; }
Students(IRegionManager regionManager)
{
@@ -145,6 +146,8 @@ namespace StudentManager.Model
RegionToStudents();
});
+ SubmitHomeWorkCommand = new DelegateCommand(() => SubmitHomeWork());
+
SelectedCommand = new DelegateCommand((x) =>
{
if (x == null) return;
@@ -184,6 +187,14 @@ namespace StudentManager.Model
SaveAll();
}
+ private void SubmitHomeWork()
+ {
+ SelectedStudent.HomeWorkSet.Get(SelectedHomeWorkSet.Lesson).Questions.ForEach(x =>
+ {
+ x.Status = HomeWork.FirstOrDefault(hw => hw.PID == x.ID).Status;
+ });
+ }
+
private void RegionToDetailView()
{
if(selectedStudent == null) return;
diff --git a/StudentManager/StudentManager.csproj b/StudentManager/StudentManager.csproj
index 7158781..a204739 100644
--- a/StudentManager/StudentManager.csproj
+++ b/StudentManager/StudentManager.csproj
@@ -9,6 +9,7 @@
+