Browse Source

Merge branch 'develop-rc' into xw/develop-220506

XW 3 years ago
parent
commit
71bb1ba512

+ 7 - 3
TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContentTypeTemplate/LessonTestReportCharts/QuCount.vue

@@ -2,9 +2,13 @@
     <div>
         <div class="qu-score-count" id="class-score-count"></div>
         <p class="legend-info">
-            <span>{{ $t('studentWeb.exam.chart.legendSimple.legend1') }}</span>
-            <span>{{ $t('studentWeb.exam.chart.legendSimple.legend2') }}√</span>
-            <span>{{ $t('studentWeb.exam.chart.legendSimple.legend3') }}×</span>
+            <!-- <span>{{ $t('studentWeb.exam.chart.legendSimple.legend1') }}</span> -->
+            <span>{{ $t('studentWeb.exam.chart.legendSimple.legend2') }}
+                <span style="color: #00AD6C;">√</span>
+            </span>
+            <span>{{ $t('studentWeb.exam.chart.legendSimple.legend3') }}
+                <span style="color: #FF5508;">×</span>
+            </span>
         </p>
     </div>
 </template>

+ 2 - 1
TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContentTypeTemplate/PaperView.vue

@@ -132,7 +132,8 @@
                         id: paper.id,
                         studentId: this.userInfo.sub,
                         code: codes,
-                        scode: paper.scode
+                        scode: paper.scode,
+                        cIds: paper.classIds
                     }
                     this.paperCtn = paper.scope
                     let isTest = 0

+ 7 - 0
TEAMModelOS/ClientApp/src/view/teachermgmt/components/mgt/TeacherMgt.less

@@ -307,4 +307,11 @@
     border-radius: 3px;
     padding: 1px 5px;
     color: white;
+}
+.unauth-tag{
+    color: white;
+    background: #ff9900;
+    padding: 1px 8px 1px 6px;
+    margin-left: 5px;
+    border-radius: 4px;
 }

+ 12 - 2
TEAMModelOS/ClientApp/src/view/teachermgmt/components/mgt/TeacherMgt.vue

@@ -135,11 +135,16 @@
             <div class="auth-list-box">
                 <vuescroll>
                     <div class="category-item" v-for="(category) in authListFormat" :key="category.category">
-                        <div class="auth-category">{{ $t('teachermgmt.authority.' + category.category) }}</div>
+                        <div class="auth-category">
+                            {{ $t('teachermgmt.authority.' + category.category) }}
+                            <span class="unauth-tag" v-if="category.category == 'analysis' && hasAnalysisAuth">
+                                {{$t('learnActivity.createEv.noAuth')}}
+                            </span>
+                        </div>
                         <div class="auth-item" v-for="auth in category.auth" :key="auth.rowKey">
                             <span class="auth-desc">{{ $t('teachermgmt.authority.' + auth.rowKey) }}</span>
                             <span class="autn-cont">
-                                <i-switch v-model="authStatus[auth.rowKey]" @on-change="handlerRelativeAuth($event,auth)" true-color="#1cc0f2" false-color="#a9a9a9" />
+                                <i-switch :disabled="auth.category == 'analysis' && hasAnalysisAuth" v-model="authStatus[auth.rowKey]" @on-change="handlerRelativeAuth($event,auth)" true-color="#1cc0f2" false-color="#a9a9a9" />
                             </span>
                         </div>
                     </div>
@@ -351,6 +356,11 @@ export default {
             teacherImport: 'user/getTeacherImport',
             isKeyInSpace: 'spaceAuth/getIsKeyInSpace'
         }),
+        hasAnalysisAuth() {
+            const proInfo = this.$store.state.user?.schoolProfile?.svcStatus || null
+            console.log(proInfo)
+            return proInfo && proInfo.YMPCVCIM
+        },
         subjectData() {
             let nodes = []
             let schoolBase = this.$store.state.user.schoolProfile.school_base

+ 7 - 6
TEAMModelOS/Controllers/Common/ExamController.cs

@@ -1500,7 +1500,7 @@ namespace TEAMModelOS.Controllers
             //ResponseBuilder builder = ResponseBuilder.custom();
             //var (id, school) = HttpContext.GetAuthTokenInfo();
             if (!requert.TryGetProperty("id", out JsonElement id)) return BadRequest();
-            //if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
+            if (!requert.TryGetProperty("cIds", out JsonElement cIds)) return BadRequest();
             if (!requert.TryGetProperty("studentId", out JsonElement studentId)) return BadRequest();
             if (!requert.TryGetProperty("code", out JsonElement school)) return BadRequest();
             if (!requert.TryGetProperty("scode", out JsonElement scode)) return BadRequest();
@@ -1513,7 +1513,7 @@ namespace TEAMModelOS.Controllers
                 List<string> classIds = new List<string>();
                 //List<string> stus = new List<string>();
                 //存放当前学生所在班级ID或者名单ID
-                HashSet<string> resultIds = new();
+                /*HashSet<string> resultIds = new();
                 //List<string> ids = new List<string>();
                 //处理班级人数(公共部分的校本名单)
                 //List<Student> students = new List<Student>();
@@ -1575,8 +1575,8 @@ namespace TEAMModelOS.Controllers
                     {
                         infoIds.Add(ids);
                     }
-                }
-
+                }*/
+                List<string> infoIds = cIds.ToObject<List<string>>();
                 await foreach (var item in client.GetContainer(Constant.TEAMModelOS, "Common").GetItemQueryIterator<PaperSimple>(queryText: query, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"{scode}") }))
                 {
                     papers.Add(item);
@@ -1659,7 +1659,7 @@ namespace TEAMModelOS.Controllers
                     int index = subId.IndexOf(exam.subjectId);
                     //根据索引找到试卷分数
                     List<double> points = papers[index].point;
-                    List<double> wn = await getWrongNum(exam, points);
+                    List<double> wn = await getWrongNum(exam, points,infoIds);
                     wno.Add(wn);
                 }
                 if (papers.IsNotEmpty())
@@ -3498,7 +3498,7 @@ namespace TEAMModelOS.Controllers
             return (ansBlob, scores);
         }
 
-        private Task<List<double>> getWrongNum(ExamResult result, List<double> points)
+        private Task<List<double>> getWrongNum(ExamResult result, List<double> points,List<string> infoIds)
         {
             int num = 0;
             List<double> wn = new List<double>();
@@ -3508,6 +3508,7 @@ namespace TEAMModelOS.Controllers
                 double p = point * 0.8;
                 foreach (ClassRange range in result.classes)
                 {
+                    if (!infoIds.Contains(range.id)) continue;
                     for (int i = range.range[0]; i <= range.range[1]; i++)
                     {
                         //判断推送的数据中,学生正常得分数据

+ 113 - 0
TEAMModelOS/Properties/ServiceDependencies/teammodelos-yx - Web Deploy/profile.arm.json

@@ -0,0 +1,113 @@
+{
+  "$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#",
+  "contentVersion": "1.0.0.0",
+  "metadata": {
+    "_dependencyType": "compute.appService.windows"
+  },
+  "parameters": {
+    "resourceGroupName": {
+      "type": "string",
+      "defaultValue": "TEAMModelChengdu",
+      "metadata": {
+        "description": "Name of the resource group for the resource. It is recommended to put resources under same resource group for better tracking."
+      }
+    },
+    "resourceGroupLocation": {
+      "type": "string",
+      "defaultValue": "",
+      "metadata": {
+        "description": "Location of the resource group. Resource groups could have different location than resources, however by default we use API versions from latest hybrid profile which support all locations for resource types we support."
+      }
+    },
+    "resourceName": {
+      "type": "string",
+      "defaultValue": "yx",
+      "metadata": {
+        "description": "Name of the main resource to be created by this template."
+      }
+    },
+    "resourceLocation": {
+      "type": "string",
+      "defaultValue": "[parameters('resourceGroupLocation')]",
+      "metadata": {
+        "description": "Location of the resource. By default use resource group's location, unless the resource provider is not supported there."
+      }
+    }
+  },
+  "variables": {
+    "appServicePlan_name": "[concat('Plan', uniqueString(concat(parameters('resourceName'), subscription().subscriptionId)))]",
+    "appServicePlan_ResourceId": "[concat('/subscriptions/', subscription().subscriptionId, '/resourceGroups/', parameters('resourceGroupName'), '/providers/Microsoft.Web/serverFarms/', variables('appServicePlan_name'))]"
+  },
+  "resources": [
+    {
+      "type": "Microsoft.Resources/resourceGroups",
+      "name": "[parameters('resourceGroupName')]",
+      "location": "[parameters('resourceGroupLocation')]",
+      "apiVersion": "2019-10-01"
+    },
+    {
+      "type": "Microsoft.Resources/deployments",
+      "name": "[concat(parameters('resourceGroupName'), 'Deployment', uniqueString(concat(parameters('resourceName'), subscription().subscriptionId)))]",
+      "resourceGroup": "[parameters('resourceGroupName')]",
+      "apiVersion": "2019-10-01",
+      "dependsOn": [
+        "[parameters('resourceGroupName')]"
+      ],
+      "properties": {
+        "mode": "Incremental",
+        "template": {
+          "$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
+          "contentVersion": "1.0.0.0",
+          "resources": [
+            {
+              "location": "[parameters('resourceLocation')]",
+              "name": "[parameters('resourceName')]",
+              "type": "Microsoft.Web/sites",
+              "apiVersion": "2015-08-01",
+              "tags": {
+                "[concat('hidden-related:', variables('appServicePlan_ResourceId'))]": "empty"
+              },
+              "dependsOn": [
+                "[variables('appServicePlan_ResourceId')]"
+              ],
+              "kind": "app",
+              "properties": {
+                "name": "[parameters('resourceName')]",
+                "kind": "app",
+                "httpsOnly": true,
+                "reserved": false,
+                "serverFarmId": "[variables('appServicePlan_ResourceId')]",
+                "siteConfig": {
+                  "metadata": [
+                    {
+                      "name": "CURRENT_STACK",
+                      "value": "dotnetcore"
+                    }
+                  ]
+                }
+              },
+              "identity": {
+                "type": "SystemAssigned"
+              }
+            },
+            {
+              "location": "[parameters('resourceLocation')]",
+              "name": "[variables('appServicePlan_name')]",
+              "type": "Microsoft.Web/serverFarms",
+              "apiVersion": "2015-08-01",
+              "sku": {
+                "name": "S1",
+                "tier": "Standard",
+                "family": "S",
+                "size": "S1"
+              },
+              "properties": {
+                "name": "[variables('appServicePlan_name')]"
+              }
+            }
+          ]
+        }
+      }
+    }
+  ]
+}