瀏覽代碼

题目结构更改

CrazyIter 4 年之前
父節點
當前提交
7a9bc2c1b9

+ 6 - 0
HTEXLib/Models/Attach.cs

@@ -11,5 +11,11 @@ namespace HTEXLib.Models
     {
         public new  string type { get; set; } = "Attach";
         public string url { get; set; }
+        /// <summary>
+        /// 附件名称
+        /// </summary>
+        public string name { get; set; }
+        
+        public HTEXLib.Models.HTEX.ShapeStyle style { get; set; } = new Models.HTEX.ShapeStyle();
     }
 }

+ 17 - 19
HTEXLib/Models/ExamItem.cs

@@ -7,28 +7,23 @@ namespace HTEXLib
 {
     public class ExamItem
     {
-        public Position position { get; set; }
+       // public Position position { get; set; }
 
-        [Required(ErrorMessage = "{0} 必须填写")]
-        public string code { get; set; }
+        //[Required(ErrorMessage = "{0} 必须填写")]
+       // public string code { get; set; }
         //[PartitionKey(name = "ExamItem")]
-        public string pk { get; set; }
-        public int? ttl { get; set; }
+        //public string pk { get; set; }
+       // public int? ttl { get; set; }
         public ExamItem()
         {
-            children = new List<ExamItem>();
-            option = new List<CodeValue>();
+            children = new List<string>();
             answer = new List<string>();
             points = new List<string>();
             gradeIds = new List<string>();
-            repairs = new List<Repair>();
+            repairResource = new List<Repair>();
         }
-        public string shaCode { get; set; }
-        //题干
-        [Required(ErrorMessage = "{0} 必须填写")]
-        public string question { get; set; }
-        // 选项 单选 多选 判断
-        public List<CodeValue> option { get; set; }
+        ///public string shaCode { get; set; }
+       
         public List<string> answer { get; set; }
         //解析
         public string explain { get; set; }
@@ -39,12 +34,12 @@ namespace HTEXLib
         /// <summary>
         /// 上级shaCode
         /// </summary>
-        public string pShaCode { get; set; }
+       // public string pShaCode { get; set; }
         //管理知识点
         public List<string> points { get; set; }
         //认知层次 应用 综合 理解 评鉴 知识
         public int?   field { get; set; }
-        public List<ExamItem> children { get; set; }
+        public List<string> children { get; set; }
         // 配分  
         public double score { get; set; }
         /// <summary>
@@ -57,7 +52,7 @@ namespace HTEXLib
         /// <summary>
         /// 补救资源
         /// </summary>
-        public List<Repair> repairs { get; set; }
+        public List<Repair> repairResource { get; set; }
 
         public string subjectId { get; set; }
         public string periodId { get; set; }
@@ -67,7 +62,7 @@ namespace HTEXLib
         /// 难度
         /// </summary>
         public int level { get; set; }
-        public string id { get; set; }
+       /// public string id { get; set; }
         /// <summary>
         /// 是否综合题的小题
         /// </summary>
@@ -80,7 +75,10 @@ namespace HTEXLib
         //使用次数
         public int usageCount { get; set; }
         public string examCode { get; set; }
-        public string url { get; set; }
+        public string blob { get; set; }
+        /// <summary>
+        /// 校本school还是私有题目private
+        /// </summary>
         public string scope { get; set; }
     }
     public class CodeValue

+ 1 - 1
HTEXLib/Models/HTEX/HtexConnectionShape.cs

@@ -66,7 +66,7 @@ namespace HTEXLib.Models.HTEX
             }
             Svg svg = PPTXSvg.GenShapeSvg(connectionShape.element, index, shapeType, position,   shapeBorder);
             //  position = position ,mediaType = "image",type = type,index = index,animatable = animatable ,invisible = invisible
-            Connector item = new Connector { sid =sid, type =type,cxnType=shapeType, invisible = invisible, animatable = animatable, index = index, id = id, svg = svg };
+            Connector item = new Connector { sid =sid, type =type,cxnType=shapeType/*, invisible = invisible, animatable = animatable*/, index = index, id = id, svg = svg };
             item.style.position = position;
             item.style.border = shapeBorder;
             item.uid = connectionShape.suid;

+ 1 - 1
HTEXLib/Models/HTEX/HtexGroupShape.cs

@@ -31,7 +31,7 @@ namespace HTEXLib.Models.HTEX
         {
             Position position = new Position { cx = width, cy = height, x = left, y = top, rot = rot };
             var ShapeStyle = PPTXHelper.DoShapeProperties(groupShape.element.GroupShapeProperties, slide, type, partForm);
-            Group group = new Group() { sid = sid,id = this.id, type = type, index = index, animatable = animatable, invisible = invisible };
+            Group group = new Group() { sid = sid,id = this.id, type = type, index = index/*, animatable = animatable, invisible = invisible */};
             group.style.border = ShapeStyle.border;
             group.style.fill = ShapeStyle.fill;
             group.style.position = position;

+ 1 - 1
HTEXLib/Models/HTEX/HtexImage.cs

@@ -36,7 +36,7 @@ namespace HTEXLib.Models.HTEX
         { 
             Position position = new Position { cx = width, cy = height, x = left, y = top, rot = rot };
             var ShapeStyle = PPTXHelper.DoShapeProperties(image.element.ShapeProperties, slide,type,partForm);
-            Media media = new Media() { sid = sid, id = this.id, mediaType = "image",type=type,index=index,animatable=animatable ,invisible=invisible};
+            Media media = new Media() { sid = sid, id = this.id, mediaType = "image",type=type,index=index/*,animatable=animatable ,invisible=invisible*/};
             media.style.position = position;
             /*
              *  cNvPicPr (非可视图片绘图属性)	§19.3.1.11

+ 1 - 1
HTEXLib/Models/HTEX/HtexMath.cs

@@ -45,7 +45,7 @@ namespace HTEXLib.Models.HTEX
             Position position = new Position { cx = width, cy = height, x = left, y = top, rot = rot };
             var ShapeStyle = PPTXHelper.DoShapeProperties(pptMath.element.ShapeProperties, slide, type, partForm);
             var shapeTypeNode = pptMath.element.ShapeProperties.GetFirstChild<PresetGeometry>();
-            Math math = new Math { sid = sid, id = this.id, type = type, index = index, animatable = animatable, invisible = invisible };
+            Math math = new Math { sid = sid, id = this.id, type = type, index = index/*, animatable = animatable, invisible = invisible*/ };
             math.style.position = position;
             SlideColor slideColor = PPTXHelper.DoShapeStyle(pptMath.element.ShapeStyle, slide, type);
             //从ShapeProperties 获取 p:spPr

+ 1 - 1
HTEXLib/Models/HTEX/HtexShape.cs

@@ -48,7 +48,7 @@ namespace HTEXLib.Models.HTEX
             Position position = new Position { cx= width, cy= height, x=left,y=top,rot=rot};
             var ShapeStyle =PPTXHelper.DoShapeProperties(Shape.element.ShapeProperties, slide,type,partForm);
             //position = position ,mediaType = "image",type = type,index = index,animatable = animatable ,invisible = invisible
-            Shape shape = new Shape() { sid = sid, id =this.id, paragraph = DrawText() ,type=type,index=index,animatable=animatable,invisible=invisible };
+            Shape shape = new Shape() { sid = sid, id =this.id, paragraph = DrawText() ,type=type,index=index/*,animatable=animatable,invisible=invisible*/ };
             shape.style.position = position;
             var shapeTypeNode = Shape.element.ShapeProperties.GetFirstChild<PresetGeometry>();
             var shapeTypeCustom = Shape.element.ShapeProperties.GetFirstChild<CustomGeometry>();

+ 1 - 1
HTEXLib/Models/HTEX/HtexSlide.cs

@@ -292,7 +292,7 @@ namespace HTEXLib.Models.HTEX
             }
             if (items != null && items.Count > 0) {
                // items[0].animations = simpleAnimations;
-                items[0].animatable = animatable;
+               // items[0].animatable = animatable;
             }
             return items;
         }

+ 1 - 1
HTEXLib/Models/HTEX/HtexTable.cs

@@ -41,7 +41,7 @@ namespace HTEXLib.Models.HTEX
             tbStyle.ColumnWidth = columns.Select(x => x.Width * Globals.px96 * 1.0 / Globals.px914400).ToList();
             List<TableRow> rows = Table.Elements<TableRow>().ToList();
             var trs = DoTableRow(rows, slide, type, partForm);
-            Table table = new Table() { sid = sid,id = this.id, tr = trs, style = tbStyle, type =type, index = index, animatable = animatable, invisible = invisible };
+            Table table = new Table() { sid = sid,id = this.id, tr = trs, style = tbStyle, type =type, index = index, /*animatable = animatable, invisible = invisible */};
             table.style.position = position;
             var elmt = new List<Item>();
             elmt.Add(table);

+ 1 - 0
HTEXLib/Models/HtexGroup.cs

@@ -10,5 +10,6 @@ namespace HTEXLib.Models
     public class HtexGroup:Item
     {
         public new string type { get; set; } = "HtexGroup";
+        public HTEXLib.Models.HTEX.ShapeStyle style { get; set; } = new Models.HTEX.ShapeStyle();
     }
 }

+ 1 - 0
HTEXLib/Models/HtexText.cs

@@ -7,5 +7,6 @@ namespace HTEXLib.Models
  public   class HtexText : Item
     {
         public new string type { get; set; } = "HtexText";
+        public HTEXLib.Models.HTEX.ShapeStyle style { get; set; } = new Models.HTEX.ShapeStyle();
     }
 }

+ 4 - 4
HTEXLib/Models/Item.cs

@@ -13,7 +13,7 @@ namespace HTEXLib
        // public List<IAnimation> animations { get; set; }
         public string id { get; set; }
         /// <summary>
-        /// Sp  CxnSp Media Group  Table Chart Diagram
+        /// Sp  CxnSp Media Group  Table Chart Diagram , Question,HtexGroup,HtexText,Brush,Attach
         /// 元素类型
         /// </summary>
         public string type { get; set; }
@@ -38,15 +38,15 @@ namespace HTEXLib
         /// <summary>
         /// 画笔
         /// </summary>
-      //  public Brush brush { get; set; }
+        //  public Brush brush { get; set; }
         /// <summary>
         /// 是否有动画
         /// </summary>
-        public bool animatable { get; set; }
+        //public bool animatable { get; set; }
         /// <summary>
         /// 进入场景之前是否可见元素
         /// </summary>
-        public bool invisible { get; set; }
+        //public bool invisible { get; set; }
         /// <summary>
         /// : 0 ~ 1 (內定 1)  <--(0:透明, 1:不透明, 物件 之 全體透明度)
         /// </summary>

+ 22 - 0
HTEXLib/Models/Question.cs

@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.Text;
+
+namespace HTEXLib.Models
+{
+    public class Question :Item
+    {
+        public new  string type = "Question";
+        //题干
+        [Required(ErrorMessage = "{0} 必须填写")]
+        public string question { get; set; }
+        // 选项 单选 多选 判断
+        public List<CodeValue> option { get; set; }
+        /// <summary>
+        /// 选项布局   grid 网格布局 或 row 行布局
+        /// </summary>
+        public string layout { get; set; }
+        public HTEXLib.Models.HTEX.ShapeStyle style { get; set; } = new Models.HTEX.ShapeStyle();
+    }
+}

+ 9 - 0
HTEXLib/Models/Slide.cs

@@ -10,6 +10,15 @@ namespace HTEXLib
 {
     public class Slide
     {
+        /// <summary>
+        /// 单页PPTX或者题目的uid
+        /// </summary>
+        public string id { get; set; }
+        /// <summary>
+        /// 题目或者单页pptx的校验码 
+        /// </summary>
+        public string shaCode { get; set; }
+
         public List<Animtime>  animations { get; set; }
         public List<Item> item { get; set; }