This commit is contained in:
wangxiner55 2024-09-24 19:00:10 +08:00
parent da9c3b7041
commit a5d33f9f99
12 changed files with 304 additions and 248 deletions

View File

@ -7,7 +7,7 @@
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<md:BundledTheme BaseTheme="Dark" PrimaryColor="Grey" SecondaryColor="LightBlue" />
<md:BundledTheme BaseTheme="Light" PrimaryColor="Grey" SecondaryColor="Cyan" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesign3.Defaults.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>

View File

@ -352,5 +352,39 @@ namespace StudentManager.Common
}
}
}
internal static void AddHomework(CursonQuestionsData homeWork)
{
using (MySqlConnection connection = new MySqlConnection(config))
{
try
{
connection.Open();
string updateQuery = "insert into curson_questions (user_id, problem_ids, correct_ids, lesson, status, update_time)" +
"values (@user_id, @problem_ids, @correct_ids, @lesson, @status, @update_time)";
using (MySqlCommand updateCmd = new MySqlCommand(updateQuery, connection))
{
updateCmd.Parameters.AddWithValue("@user_id", homeWork.UID);
updateCmd.Parameters.AddWithValue("@problem_ids", JsonConvert.SerializeObject(homeWork.ProblemIDS));
updateCmd.Parameters.AddWithValue("@correct_ids", JsonConvert.SerializeObject(homeWork.CorrectIDS));
updateCmd.Parameters.AddWithValue("@lesson", homeWork.Lesson);
updateCmd.Parameters.AddWithValue("@status", homeWork.Status);
updateCmd.Parameters.AddWithValue("@update_time", homeWork.DateTime);
updateCmd.ExecuteNonQuery();
}
}
catch (Exception ex)
{
}
finally
{
connection.Close();
}
}
}
}
}

View File

@ -8,7 +8,7 @@ namespace StudentManager.Data
{
public class CursonQuestionsData : IDataCommon
{
public int UID { get; set; } = 0;
public long UID { get; set; } = 0;
public int[] ProblemIDS { get; set; } = { };
public int[] CorrectIDS { get; set; } = { };
public DateTime DateTime { get; set; } = DateTime.Now;

View File

@ -147,6 +147,23 @@ namespace StudentManager.Data
HomeWorkSet.AddHomeWork(homeWork);
CursonQuestionsData cqd = new CursonQuestionsData();
cqd.ProblemIDS = new int[homeWork.Questions.Count];
int index = 0;
homeWork.Questions.ForEach(question =>
{
cqd.ProblemIDS[index] = question.ID;
index++;
});
cqd.UID = UID;
cqd.Lesson = homeWork.Lesson;
cqd.DateTime = homeWork.DateTime;
cqd.Status = 0;
SQLHelper.AddHomework(cqd);
}
}
}

View File

@ -20,23 +20,44 @@
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<StackPanel VerticalAlignment="Stretch" >
<CheckBox Margin="5" Content="是否加入公共题库" IsChecked="{Binding IsAddPublicQuestionsLib}"/>
<CheckBox Margin="5" Content="是否需要纠错" IsChecked="{Binding IsNeedErrorset}"/>
<CheckBox Margin="5" Content="是否控制题目数量" IsChecked="{Binding IsControlQuestionNum}"/>
<StackPanel Margin="5" Orientation="Horizontal">
<TextBlock Text=" 课程章节序号 "/>
<TextBox Text="{Binding PublicLesson}" MinWidth="50"/>
<StackPanel VerticalAlignment="Stretch">
<Border Background="#FFFFFF" BorderBrush="Gray" BorderThickness="0" CornerRadius="5" Padding="10" Margin="5" Height="150">
<Border.Effect>
<DropShadowEffect Color="#FFF5F5F5" BlurRadius="10" ShadowDepth="1" Direction="0"/>
</Border.Effect>
<StackPanel>
<CheckBox Margin="2,10" Content="是否加入公共题库" IsChecked="{Binding IsAddPublicQuestionsLib}"/>
<CheckBox Margin="2,10" Content="是否需要纠错" IsChecked="{Binding IsNeedErrorset}"/>
<CheckBox Margin="2,10" Content="是否控制题目数量" IsChecked="{Binding IsControlQuestionNum}"/>
</StackPanel>
</Border>
<Border Background="#FFFFFF" BorderBrush="Gray" BorderThickness="0" CornerRadius="5" Padding="10" Margin="5">
<Border.Effect>
<DropShadowEffect Color="#FFF5F5F5" BlurRadius="10" ShadowDepth="1" Direction="0"/>
</Border.Effect>
<StackPanel Margin="5">
<TextBlock Margin="0,10" Text=" 课程章节序号 "/>
<TextBox Text="{Binding PublicLesson}" MinWidth="50"/>
</StackPanel>
<StackPanel Margin="5" Orientation="Horizontal">
<TextBlock Text=" 问题数量 "/>
<TextBox Text="{Binding QuestionCount}" MinWidth="50"/>
</Border>
<Border Background="#FFFFFF" BorderBrush="Gray" BorderThickness="0" CornerRadius="5" Padding="10" Margin="5">
<Border.Effect>
<DropShadowEffect Color="#FFF5F5F5" BlurRadius="10" ShadowDepth="1" Direction="0"/>
</Border.Effect>
<StackPanel Margin="5">
<TextBlock Margin="0,10" Text=" 问题数量 "/>
<TextBox Text="{Binding QuestionCount}" MinWidth="50"/>
</StackPanel>
</Border>
</StackPanel>
<ScrollViewer Grid.Column="1" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
<ItemsControl Grid.Row="1" ItemsSource="{Binding HomeworkTestData}" HorizontalAlignment="Center">
<Border BorderBrush="#FFE1E1E1" BorderThickness="1,0,0,0" Margin="0,0,0,0" Grid.Column="1"/>
<ScrollViewer Grid.Column="1" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Hidden" Margin="10">
<ItemsControl Grid.Row="1" ItemsSource="{Binding HomeworkTestData}" HorizontalAlignment="Left">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel/>
@ -44,8 +65,35 @@
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Border Background="#55aaaaaa" BorderBrush="Gray" BorderThickness="1" Padding="5" Height="50" Width="100" Margin="5">
<TextBlock Margin="1" TextWrapping="Wrap" FontSize="12" Foreground="White" Text="{Binding Stem}" TextAlignment="Center"/>
<Border Background="#FFFEFEFE" BorderBrush="Gray" BorderThickness="0" CornerRadius="10"
Padding="5" Height="150" Width="120" Margin="5" IsHitTestVisible="True">
<Border.Effect>
<DropShadowEffect Color="#FFF5F5F5" BlurRadius="10" ShadowDepth="1" Direction="0"/>
</Border.Effect>
<Border.Style>
<Style TargetType="Border">
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="Black"/>
<Setter Property="BorderBrush" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</Border.Style>
<StackPanel>
<TextBlock TextWrapping="Wrap" FontSize="12" FontWeight="Bold" Text="{Binding Type}"
VerticalAlignment="Center" HorizontalAlignment="Left" Padding="10,10"/>
<Border BorderBrush="Gray" BorderThickness="0,0.5,0,0" Margin="5,0,60,10"/>
<StackPanel Orientation="Vertical">
<TextBlock TextWrapping="Wrap" FontSize="12" Text="题干" Margin="5" Foreground="Gray"
VerticalAlignment="Center" HorizontalAlignment="Left"/>
<TextBlock TextWrapping="Wrap" FontSize="12" Margin="5"
Text="{Binding Stem}" VerticalAlignment="Center" HorizontalAlignment="Left"/>
</StackPanel>
</StackPanel>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
@ -54,7 +102,7 @@
</Grid>
<Button Grid.Row="1" DockPanel.Dock="Bottom" Content="发布作业"
<Button Grid.Row="1" DockPanel.Dock="Bottom" Content="发布作业" Style="{DynamicResource MaterialDesignFlatDarkButton}"
Command="{Binding PublicHomeWorkCommand}"/>
</Grid>

View File

@ -37,119 +37,6 @@
</UserControl.Resources>
<Grid>
<DockPanel LastChildFill="False">
<StackPanel DockPanel.Dock="Top" Orientation="Horizontal">
<TextBlock Text="Lesson" HorizontalAlignment="Left" VerticalAlignment="Center"/>
<TextBox Text="{Binding Lesson}"/>
</StackPanel>
<!--<ListView DockPanel.Dock="Top"
ItemsSource="{Binding ADDQuestionDatas}" ScrollViewer.HorizontalScrollBarVisibility="Disabled"
ScrollViewer.VerticalScrollBarVisibility="Disabled">
--><!--<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<i:InvokeCommandAction
CommandParameter="{Binding SelectedItem, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListBox}}"
Command="{Binding DataContext.SelectedCommand ,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ItemsControl}}"/>
</i:EventTrigger>
</i:Interaction.Triggers>--><!--
<ListView.View >
<GridView>
<GridViewColumn Header="类型">
<GridViewColumn.CellTemplate>
<DataTemplate>
<ComboBox SelectedItem="{Binding Type, Mode=TwoWay}" ItemsSource="{Binding Source={StaticResource TypeEnumValues}}"/>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn Header="题干">
<GridViewColumn.CellTemplate>
<DataTemplate>
<TextBox Text="{Binding Stem}" TextWrapping="Wrap" AcceptsReturn="True"/>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn Header="答案">
<GridViewColumn.CellTemplate>
<DataTemplate>
<TextBox Text="{Binding Answer}" />
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn Header="难度">
<GridViewColumn.CellTemplate>
<DataTemplate>
<ComboBox SelectedItem="{Binding DifficultyLevel, Mode=TwoWay}" ItemsSource="{Binding Source={StaticResource DifficultyEnumValues}}"/>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn Header="标签">
<GridViewColumn.CellTemplate>
<DataTemplate>
<TextBox Text="{Binding Category}" TextWrapping="Wrap" AcceptsReturn="True"/>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn Header="来源">
<GridViewColumn.CellTemplate>
<DataTemplate>
<TextBox Text="{Binding Source}" TextWrapping="Wrap" AcceptsReturn="True"/>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn Header="状态">
<GridViewColumn.CellTemplate>
<DataTemplate>
<ComboBox SelectedItem="{Binding Status, Mode=TwoWay}" ItemsSource="{Binding Source={StaticResource PublishEnumValues}}"/>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn>
<GridViewColumn.HeaderTemplate>
<DataTemplate>
<StackPanel>
<Button Content="添加" Style="{StaticResource MaterialDesignFlatButton}" Padding="5" Foreground="White"
Command="{Binding DataContext.AddNewColumnCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ItemsControl}}"/>
</StackPanel>
</DataTemplate>
</GridViewColumn.HeaderTemplate>
<GridViewColumn.CellTemplate>
<DataTemplate>
<Button Content="添加" Style="{StaticResource MaterialDesignFlatButton}" Padding="5"
Command="{Binding DataContext.AddNewColumnCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ItemsControl}}"/>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn>
<GridViewColumn.HeaderTemplate>
<DataTemplate>
<StackPanel>
<Button Content="删除" Style="{StaticResource MaterialDesignFlatButton}" Padding="5" Foreground="White"
/>
</StackPanel>
</DataTemplate>
</GridViewColumn.HeaderTemplate>
<GridViewColumn.CellTemplate>
<DataTemplate>
<Button Content="删除" Style="{StaticResource MaterialDesignFlatButton}" Padding="5"
Command="{Binding DataContext.RemoveNewColumnCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ItemsControl}}"
CommandParameter="{Binding}"/>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
</GridView>
</ListView.View>
</ListView>-->
<DataGrid DockPanel.Dock="Top" ItemsSource="{Binding ADDQuestionDatas}" ScrollViewer.HorizontalScrollBarVisibility="Disabled" CanUserDeleteRows="True"
ScrollViewer.VerticalScrollBarVisibility="Disabled"/>
<Grid HorizontalAlignment="Stretch" DockPanel.Dock="Bottom">
@ -159,9 +46,9 @@
</Grid.ColumnDefinitions>
<Button Content="提交" HorizontalContentAlignment="Center" HorizontalAlignment="Stretch" Grid.Column="0"
Command="{Binding SubmitAddQuestionsCommand}"/>
Command="{Binding SubmitAddQuestionsCommand}" Style="{DynamicResource MaterialDesignFlatDarkButton}"/>
<Button Content="清除" HorizontalContentAlignment="Center" HorizontalAlignment="Stretch" Grid.Column="1"
Command="{Binding ClearnAddQuestionsCommand}"/>
Command="{Binding ClearnAddQuestionsCommand}" Style="{DynamicResource MaterialDesignFlatDarkButton}"/>
</Grid>
</DockPanel>
</Grid>

View File

@ -12,14 +12,18 @@
<Setter Property="Width" Value="200"/>
</Style>
</UserControl.Resources>
<Grid>
<Grid Background="Transparent">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border CornerRadius="20"/>
<ListBox ItemsSource="{Binding StudentDatas}" ScrollViewer.VerticalScrollBarVisibility="Disabled"
<ListBox ItemsSource="{Binding StudentDatas}" Margin="10"
ScrollViewer.VerticalScrollBarVisibility="Disabled"
SelectedItem="{Binding SelectedStudent}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<i:InvokeCommandAction
@ -27,16 +31,56 @@
Command="{Binding DataContext.SelectedCommand ,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ItemsControl}}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
<ListBox.Style>
<Style TargetType="ListBox">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBox">
<Border BorderBrush="Transparent" BorderThickness="1" CornerRadius="10" Background="#FFEEEEEE">
<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
<ItemsPresenter/>
</ScrollViewer>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ListBox.Style>
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Name}"/>
<TextBlock Text="{Binding Name}" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="5"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<Grid Grid.Column="1">
<ListView ItemsSource="{Binding HomeWorkSet}">
<ListView ItemsSource="{Binding HomeWorkSet}" Foreground="Black"
Margin="10"
ScrollViewer.VerticalScrollBarVisibility="Disabled"
ScrollViewer.HorizontalScrollBarVisibility="Disabled">
<ListView.Style>
<Style TargetType="ListView">
<Setter Property="Background" Value="LightGray"/>
<Setter Property="BorderBrush" Value="Black"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListView">
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="5">
<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
<ItemsPresenter/>
</ScrollViewer>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ListView.Style>
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseDoubleClick">
<i:InvokeCommandAction
@ -54,7 +98,7 @@
<GridView>
<GridViewColumn
DisplayMemberBinding="{Binding DateTime}"
Header="创建时间" />
Header="创建时间"/>
<GridViewColumn
DisplayMemberBinding="{Binding Lesson}"
Header="第几课" />
@ -67,6 +111,14 @@
<GridViewColumn
DisplayMemberBinding="{Binding CorrectCount}"
Header="总正确题数" />
<GridViewColumn>
<GridViewColumn.CellTemplate>
<DataTemplate>
<Button Content="删除" Command="{Binding DeleteSelectedHomeworkCommand}"
CommandParameter="{Binding}"/>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
</GridView>
</ListView.View>
</ListView>

View File

@ -33,22 +33,6 @@
<DockPanel LastChildFill="False" HorizontalAlignment="Stretch">
<!--<StackPanel dock Orientation="Horizontal">
<TextBlock Text=" 创建时间"/>
<TextBlock Text=" 第几课"/>
<TextBlock Text=" 总题数"/>
<TextBlock Text=" 总错误题数"/>
<TextBlock Text=" 总正确题数"/>
<TextBlock Text=" 错误率"/>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding SelectedHomeWorkSet.DateTime}"/>
<TextBlock Text="{Binding SelectedHomeWorkSet.Lesson}"/>
<TextBlock Text="{Binding SelectedHomeWorkSet.TotalCount}"/>
<TextBlock Text="{Binding SelectedHomeWorkSet.ErrorCount}"/>
<TextBlock Text="{Binding SelectedHomeWorkSet.CorrectCount}"/>
</StackPanel>-->
<ListView DockPanel.Dock="Top" ItemsSource="{Binding HomeWork}">
<ListView.View>
<GridView>

View File

@ -9,34 +9,66 @@
xmlns:extent="clr-namespace:StudentManager.Extensions"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:dt="clr-namespace:StudentManager.Data"
Background="#FF333333"
Background="#00000000" WindowStyle="None"
mc:Ignorable="d"
Title="MainEditor" Height="450" Width="800">
Title="MainEditor" Height="800" Width="1400">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100"/>
<ColumnDefinition Width="150"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Border Background="#FFFAFAFA" Grid.ColumnSpan="2" CornerRadius="20"/>
<DockPanel LastChildFill="False">
<ItemsControl DockPanel.Dock="Top" ItemsSource="{Binding MenuBars}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Button Content="{Binding Title}" Command="{Binding DataContext.RegionTo, RelativeSource={RelativeSource AncestorType=ItemsControl}}"
CommandParameter="{Binding NameSpace}" Margin="5.0"/>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<StackPanel DockPanel.Dock="Top">
<Button Margin="5" HorizontalAlignment="Stretch" DockPanel.Dock="Bottom" Content="保存"
<TextBlock Text="STUDENTMANAGER" VerticalAlignment="Center" HorizontalAlignment="Left"
FontSize="12" FontWeight="Bold"
TextAlignment="Center" Padding="25,10" Height="40"/>
<ItemsControl DockPanel.Dock="Top" ItemsSource="{Binding MenuBars}">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Button Content="{Binding Title}" Command="{Binding DataContext.RegionTo, RelativeSource={RelativeSource AncestorType=ItemsControl}}"
Style="{DynamicResource MaterialDesignFlatDarkButton}" HorizontalAlignment="Stretch" Padding="40,0,0,0" HorizontalContentAlignment="Left"
CommandParameter="{Binding NameSpace}" Margin="5.0"/>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
<Button Margin="5" HorizontalAlignment="Stretch" DockPanel.Dock="Bottom" Content="保存" Style="{DynamicResource MaterialDesignFlatDarkButton}"
Command="{Binding SaveAllCommand}"/>
<Button Margin="5" HorizontalAlignment="Stretch" DockPanel.Dock="Bottom" Content="刷新数据"
<Button Margin="5" HorizontalAlignment="Stretch" DockPanel.Dock="Bottom" Content="刷新数据" Style="{DynamicResource MaterialDesignFlatDarkButton}"
Command="{Binding FreshAllCommand}"/>
</DockPanel>
<ContentControl Grid.Column="1" prism:RegionManager.RegionName="{x:Static extent:PrismManager.MainRegionName}"/>
<Grid Grid.Column="1">
<Grid.RowDefinitions>
<RowDefinition Height="100"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Grid Margin="10">
<Border Background="#FFFFFFFF" CornerRadius="10"/>
<DockPanel VerticalAlignment="Center" LastChildFill="False">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
<Border Margin="50,0" CornerRadius="50" Height="20" Width="20" Background="Gray"/>
<StackPanel VerticalAlignment="Center" Margin="20,0">
<TextBlock DockPanel.Dock="Left" Text="USERNAME" HorizontalAlignment="Left" Margin="2" FontWeight="Bold" VerticalAlignment="Center"/>
<TextBlock DockPanel.Dock="Left" Text="desc" HorizontalAlignment="Left" FontSize="8" Foreground="Gray" Margin="2" VerticalAlignment="Center"/>
</StackPanel>
</StackPanel>
<TextBlock DockPanel.Dock="Right" Text="NAME" HorizontalAlignment="Left" Margin="20" VerticalAlignment="Center"/>
</DockPanel>
</Grid>
<ContentControl Grid.Row="1" Margin="10" prism:RegionManager.RegionName="{x:Static extent:PrismManager.MainRegionName}" BorderBrush="White"/>
</Grid>
</Grid>
</Window>

View File

@ -13,60 +13,36 @@
</Style>
</UserControl.Resources>
<Grid>
<ListView ItemsSource="{Binding QuestionDatas}" ScrollViewer.HorizontalScrollBarVisibility="Disabled"
<Grid.RowDefinitions>
<RowDefinition Height="0.4*"/>
<RowDefinition/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0">
<Border Background="Gray" CornerRadius="10" Margin="10" Height="20" />
<Border Background="Gray" CornerRadius="10" Margin="10"/>
</StackPanel>
<DataGrid ItemsSource="{Binding QuestionDatas}" Background="#22aaaaaa" Grid.Row="1"
ScrollViewer.HorizontalScrollBarVisibility="Disabled" CanUserDeleteRows="False" CanUserAddRows="False"
IsReadOnly="True" Foreground="#FF222222"
ScrollViewer.VerticalScrollBarVisibility="Disabled">
<!--<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<i:InvokeCommandAction
CommandParameter="{Binding SelectedItem, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListBox}}"
Command="{Binding DataContext.SelectedCommand ,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ItemsControl}}"/>
</i:EventTrigger>
</i:Interaction.Triggers>-->
<!--<ListView.View>
<GridView>
<GridViewColumn
DisplayMemberBinding="{Binding Id}"
Header="ID" />
<GridViewColumn
DisplayMemberBinding="{Binding Type}"
Header="类型" />
<GridViewColumn
DisplayMemberBinding="{Binding Stem}"
Header="题干" />
<GridViewColumn
DisplayMemberBinding="{Binding Answer}"
Header="答案" />
<GridViewColumn
DisplayMemberBinding="{Binding DifficultyLevel}"
Header="难度" />
<GridViewColumn
DisplayMemberBinding="{Binding Category}"
Header="标签" />
<GridViewColumn
DisplayMemberBinding="{Binding Source}"
Header="来源" />
<GridViewColumn
DisplayMemberBinding="{Binding Status}"
Header="状态" />
<GridViewColumn>
<GridViewColumn.CellTemplate>
<DataTemplate>
<Button Content="删除" Style="{StaticResource MaterialDesignFlatButton}" Padding="5"
Command="{Binding DataContext.DeleteQuestionCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ItemsControl}}"
CommandParameter="{Binding }"/>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
</GridView>
</ListView.View>-->
</ListView>
<DataGrid ItemsSource="{Binding QuestionDatas}" ScrollViewer.HorizontalScrollBarVisibility="Disabled" CanUserDeleteRows="False" CanUserAddRows="False" IsReadOnly="True"
ScrollViewer.VerticalScrollBarVisibility="Disabled"/>
<DataGrid.RowStyle>
<Style TargetType="DataGridRow">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="DataGridRow">
<Border CornerRadius="10" Margin="5" Background="White">
<DataGridCellsPresenter/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</DataGrid.RowStyle>
</DataGrid>
</Grid>
</UserControl>

View File

@ -13,32 +13,59 @@
<Setter Property="Width" Value="50"/>
</Style>
</UserControl.Resources>
<Grid>
<Grid Background="Transparent">
<Border Background="#FFFAFAFA" CornerRadius="10"/>
<ListView ScrollViewer.VerticalScrollBarVisibility="Disabled"
ItemsSource="{Binding StudentDatas}" SelectedItem="{Binding SelectedStudent}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseDoubleClick">
<i:InvokeCommandAction
CommandParameter="DetailView"
Command="{Binding DataContext.RegionTo ,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ItemsControl}}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
<ListView.View>
<GridView>
<GridViewColumn
DisplayMemberBinding="{Binding Name}"
Header="姓名" />
<GridViewColumn
DisplayMemberBinding="{Binding ErrorSet.TotalCount}"
Header="错误总数" />
<GridViewColumn
DisplayMemberBinding="{Binding ErrorSet.CorrectCount}"
Header="修正数量" />
</GridView>
</ListView.View>
</ListView>
<ScrollViewer Grid.Column="1" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Disabled" Margin="10">
<ItemsControl Grid.Row="1" ItemsSource="{Binding StudentDatas}" HorizontalAlignment="Left">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Border Background="#FFFEFEFE" BorderBrush="Gray" BorderThickness="0" CornerRadius="10"
Padding="5" Height="200" Width="120" Margin="5" IsHitTestVisible="True">
<Border.Effect>
<DropShadowEffect Color="#FFF5F5F5" BlurRadius="10" ShadowDepth="1" Direction="0"/>
</Border.Effect>
<Border.Style>
<Style TargetType="Border">
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="Black"/>
<Setter Property="BorderBrush" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</Border.Style>
<StackPanel>
<TextBlock TextWrapping="Wrap" FontSize="20" FontWeight="Bold" Text="{Binding Name}"
VerticalAlignment="Center" HorizontalAlignment="Left" Padding="10,10"/>
<StackPanel Orientation="Vertical">
<TextBlock TextWrapping="Wrap" FontSize="12" Text="总数" Margin="5" Foreground="Gray"
VerticalAlignment="Center" HorizontalAlignment="Left"/>
<TextBlock TextWrapping="Wrap" FontSize="18" Margin="5"
Text="{Binding ErrorSet.TotalCount}" VerticalAlignment="Center" HorizontalAlignment="Left"/>
</StackPanel>
<Border BorderBrush="Gray" BorderThickness="0,0.5,0,0" Margin="5"/>
<StackPanel Orientation="Vertical">
<TextBlock TextWrapping="Wrap" FontSize="12" Text="正确数" Margin="5" Foreground="Gray"
VerticalAlignment="Center" HorizontalAlignment="Left"/>
<TextBlock TextWrapping="Wrap" FontSize="18" Text="{Binding ErrorSet.CorrectCount}" Margin="5"
VerticalAlignment="Center" HorizontalAlignment="Left"/>
</StackPanel>
</StackPanel>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
</Grid>
</UserControl>

View File

@ -308,7 +308,6 @@ namespace StudentManager.Model
QuestionDatas = new ObservableCollection<QuestionData>(questionDatas);
ErrorSetDatas = new ReadOnlyObservableCollection<DetailErrorInfo>(errorSetDatas);
MenuBars = new ReadOnlyObservableCollection<MenuBar>(menuBars);
//CQDatas = new ReadOnlyObservableCollection<CursonQuestionsData>(cQDatas);
HomeWorkSet = new ObservableCollection<DetailHomeWorkSetInfo>(homeWorkSet);