eraser 4 tahun lalu
induk
melakukan
ff38b496f0

TEMPAT SAMPAH
assets/home/homeBG.png


TEMPAT SAMPAH
assets/startLearning/learningAndExperiment/TopImage.png


+ 2 - 2
components/startLearning/learningAndExperiment/ksxx_xxysy_sjkc/ksxx_xxysy_sjkc.vue

@@ -326,7 +326,7 @@
 				for (let i = 0; i < this.allWrongTest.length; i++) {
 					//把用户选择的答案放进去
 					let curCheckedLetter = '我的答案:【';
-					for (let j = 0; j < this.allCheckedAnswer[i].length; j++) {
+					for (let j = 0; j < this.allCheckedAnswer[this.allWrongTest[i]].length; j++) {
 						if (this.allCheckedAnswer[i][j] == 1) {
 							curCheckedLetter += this.test_answer_pre[j];
 							curCheckedLetter += ','
@@ -360,7 +360,7 @@
 				// console.log("正确答案", this.allWrong_right_letter);
 			},
 			onClick_test_exit() {
-				this.checkedIndex1 = 1;
+				this.checkedIndex1 = 0;
 				this.testIndex = 0;
 				this.resetTest();
 			},

+ 1 - 1
components/startLearning/learningAndExperiment/ksxx_xxysy_ylrz/ksxx_xxysy_ylrz.vue

@@ -331,7 +331,7 @@
 				for (let i = 0; i < this.allWrongTest.length; i++) {
 					//把用户选择的答案放进去
 					let curCheckedLetter = '我的答案:【';
-					for (let j = 0; j < this.allCheckedAnswer[i].length; j++) {
+					for (let j = 0; j < this.allCheckedAnswer[this.allWrongTest[i]].length; j++) {
 						if (this.allCheckedAnswer[i][j] == 1) {
 							curCheckedLetter += this.test_answer_pre[j];
 							curCheckedLetter += ','

+ 1 - 1
components/user/personalLearning.vue

@@ -219,7 +219,7 @@
 				let totalScore = 0;
 				for (let i = 2; i < 16; i++) {
 					if (data[i].Score != -1) {
-						totalScore++;
+						totalScore+=data[i].Score;
 					}
 				}
 			

+ 109 - 38
components/user/stuTestDetails.vue

@@ -95,51 +95,62 @@
 									<th>分值</th>
 								</tr>
 							</thead>
-							<tbody>
+							<tbody v-if="isShow_jspf">
 								<tr>
 									<th>原理认知</th>
 									<th>{{model.Score_ylrz>0?'是':'否'}}</th>
 									<th>{{model.Score_ylrz>=10?'是':'否'}}</th>
-									<th>{{model.Score_ylrz>0?model.Score_ylrz:'0'}}</th>
+									<th>{{model.Score_ylrz}}</th>		
 								</tr>
 								<tr>
 									<th>实景勘察</th>
 									<th>{{model.Score_sjkc>0?'是':'否'}}</th>
 									<th>{{model.Score_sjkc>=10?'是':'否'}}</th>
-									<th>{{model.Score_sjkc>0?model.Score_sjkc:'0'}}</th>
+									<th>{{model.Score_sjkc}}</th>	
 								</tr>
 								<tr>
 									<th>虚拟技术搭建</th>
 									<th>{{model.Score_xnjsdj>0?'是':'否'}}</th>
 									<th>{{model.Score_xnjsdj>=10?'是':'否'}}</th>
-									<th>{{model.Score_xnjsdj>0?model.Score_xnjsdj:'0'}}</th>
+									<th>{{model.Score_xnjsdj}}</th>
 								</tr>
 								<tr>
 									<th>虚拟艺术创作</th>
 									<th>{{model.Score_xnyscz>0?'是':'否'}}</th>
 									<th>{{model.Score_xnyscz>=10?'是':'否'}}</th>
-									<th>{{model.Score_xnyscz>0?model.Score_xnyscz:'0'}}</th>
+									<th>{{model.Score_xnyscz}}</th>
 								</tr>
 								<tr>
 									<!-- <th>教师评分</th> -->
 									<th>总成绩</th>
 									<th></th>
 									<th></th>
-									<!-- <th v-show="isShow_jspf">{{model.Score_jspf>0?model.Score_jspf:'0'}}</th> -->
+									<th>{{totalScore}}</th>
+								</tr>
+							</tbody>
+							<tbody v-if="!isShow_jspf">
+								<tr v-for="(item,index) in scores" :key="index">
+									<th>{{item.Title}}</th>
+									<th>{{item.Score>0?'是':'否'}}</th>
+									<th></th>
 									<th class=" df aic jcc">
-										<view>
-											<view v-show="isShow_jspf" class=" input-jspf">{{model.Score_jspf>0?model.Score_jspf:'0'}}</view>
-											<input v-show="!isShow_jspf" class=" input-jspf" v-model="model.Score_jspf" placeholder="请输入分数" />
-										</view>
+										<input class="input-jspf" v-model="item.Score" placeholder="请输入分数" />
 									</th>
 								</tr>
+								<tr>
+									<!-- <th>教师评分</th> -->
+									<th>总成绩</th>
+									<th></th>
+									<th></th>
+									<th>{{totalScore}}</th>
+								</tr>
 							</tbody>
 						</table>
 					</view>
 				</view>
 				<view class="btn-box df fdr aic jcc">
-					<view class="btn-submit df aic jcc" @click="onClick_jspf(0)" v-show="isShow_jspf">成绩添加与修改</view>
-					<view class="btn-submit df aic jcc" @click="onClick_jspf(1)" v-show="!isShow_jspf">确定</view>
+					<view class="btn-submit df aic jcc" @click="onClick_jspf(0)" v-show="isShow_jspf">修改成绩</view>
+					<view class="btn-submit df aic jcc" @click="onClick_jspf(1)" v-show="!isShow_jspf">保存</view>
 				</view>
 			</view>
 		</view>
@@ -169,7 +180,9 @@
 				SJKC_P: 0,
 				XNSY_P: 0,
 				isShow_jspf: true,
-
+				
+				scores:[],
+				totalScore:0,
 				model: {
 					"Name": "", //姓名
 					"Class": "", //班级
@@ -219,42 +232,48 @@
 				this.mzIndex = e.target.value
 			},
 			updateInfo(data) {
-				// console.log('学生管理data=',data)
+				console.log('学生管理data=',data)
 				this.model.Name = data.Name;
 				this.model.Class = data.Class;
 				this.model.StudentID = data.StudentID;
+				this.model.Id = data.Id;
 				
-				// console.log('data.UserScore',data.UserScore)
-				// console.log('typeof(data.UserScore)=',typeof(data.UserScore))
 				if(typeof(data.UserScore) == 'string')
 				{
-					data.UserScore = JSON.parse(data.UserScore);
+					this.scores = JSON.parse(data.UserScore);
 				}
-				userController.data_scores = data.UserScore;
+				// console.log('this.scores=',this.scores);
+				
+				userController.data_scores = this.scores;
 				this.model.Score_ylrz = userController.getScore_ylrz();
 				this.model.Score_sjkc = userController.getScore_sjck();
 				this.model.Score_xnjsdj = userController.getScore_xnjsdj();
 				this.model.Score_xnyscz = userController.getScore_xnyscz();
 				this.model.Score_jspf = userController.getScore_jspf();
+				
+				this.totalScore = this.model.Score_ylrz+this.model.Score_sjkc+this.model.Score_xnjsdj+this.model.Score_xnyscz;
 			},
 			updateLearnProgress(data) {
-
+				
+				// 进度表
+				// 原理认知
 				if (data[0].Score != -1) {
 					this.YLRZ_P = parseInt(data[0].Score / 10 * 100);
 				}
+				//实景勘察
 				if (data[1].Score != -1) {
 					this.SJKC_P = parseInt(data[1].Score / 5 * 100);
 				}
-
-				let totalScore = 0;
+				// 虚拟实验
+				let aTotalScore = 0;
 				for (let i = 2; i < 16; i++) {
 					if (data[i].Score != -1) {
-						totalScore++;
+						aTotalScore+=data[i].Score;
 					}
 				}
-
-				this.XNSY_P = parseInt(totalScore / 14 * 100);
-
+			
+				this.XNSY_P = parseInt(aTotalScore / 14 * 100);
+				
 				//五维图
 				let aData = [];
 				let miniPoint = 0;
@@ -271,6 +290,7 @@
 				} else {
 					aData.push(parseInt(data[1].Score));
 				}
+				
 				//虚拟技术搭建
 				let XNJSDJ_score = 0;
 				for (let i = 2; i < 5; i++) {
@@ -308,7 +328,7 @@
 				// let data = {"categories":["维度1","维度2","维度3"],"series":[{"name":"成交量1","data":[90,110,165,195,187,172]}]}
 				
 				for(let i=0;i<aData.length;i++){
-					aData[i]=aData[i]*20;
+					aData[i]=aData[i]*10;
 				}
 				let data = {
 					"categories": ["原理认知", "实景考察", "虚拟技术搭建", "虚拟艺术创作", "教师评分(加分项目)"],
@@ -355,13 +375,53 @@
 					this.isShow_jspf = false;
 				}
 				//点击"确定"
-				else {
+				else 
+				{
 					this.isShow_jspf = true;
-					userController.setupScore_jspf(this.model.Score_jspf,function(res){
-						// console.log("请求分数成功",res);
-						alert("修改成功");
-					},function(res){
-						// console.log("请求分数失败",res);
+					
+					for(let i=0;i<this.scores.length;i++)
+					{
+						this.scores[i].Score=Number(this.scores[i].Score);
+					}
+					
+					let data = {
+						"UserID": this.model.Id,
+						"Scores": this.scores
+					};
+					// console.log('data=',data)
+					// console.log('url=',mydata_api + '/score/setupscore')
+					uni.request({
+						header: {
+							'Content-Type': 'application/json;charset=UTF-8'
+						},
+						url: mydata_api + '/score/setupscore',
+						method: 'POST',
+						data: data,
+						dataType: 'json',
+						success: (res) => {
+							//100成功
+							if (res.data.Code == 100) {
+								// console.log('suc100', res);
+								userController.data_scores = _self.scores;
+								_self.model.Score_ylrz = userController.getScore_ylrz();
+								_self.model.Score_sjkc = userController.getScore_sjck();
+								_self.model.Score_xnjsdj = userController.getScore_xnjsdj();
+								_self.model.Score_xnyscz = userController.getScore_xnyscz();
+								_self.model.Score_jspf = userController.getScore_jspf();
+								
+								_self.totalScore = _self.model.Score_ylrz+_self.model.Score_sjkc+_self.model.Score_xnjsdj+_self.model.Score_xnyscz;
+								
+								_self.updateLearnProgress(_self.scores) 
+								console.log("请求分数成功",res);
+							}
+							//200失败
+							else {
+								console.log('请求分数失败200', res);
+							}
+						},
+						fail: (res) => {
+							console.log('请求分数失败', res);
+						}
 					});
 				}
 			}
@@ -577,11 +637,11 @@
 		line-height: 140rpx;
 	}
 
-	tbody tr:hover {
-		// color: #fff;
-		background: #FDEBEC;
-		// opacity: 0.08;
-	}
+	// tbody tr:hover {
+	// 	// color: #fff;
+	// 	background: #FDEBEC;
+	// 	// opacity: 0.08;
+	// }
 
 	.m-table-hander {
 		background-color: #FFF8F7;
@@ -668,7 +728,18 @@
 		margin-left: px2vw(40);
 	}
 
-	.input-jspf {
+	.score-jspf{
 		width: px2vw(110);
 	}
+
+	.input-jspf {
+		width: px2vw(110);
+		border: 1px solid #DDDDDD;
+		
+		// display: flex;
+		// justify-content: center;
+		// // justify-content: space-around;
+		// align-items:center;
+		// flex-direction:row;
+	}	
 </style>

+ 1 - 1
components/user/user.vue

@@ -149,7 +149,7 @@
 					this.checkedIndex_leftMenu = index;
 					this.showIndex = index + 1;
 					// console.log('checkedIndex_leftMenu=',index)
-					console.log('showIndex=',index+1)
+					// console.log('showIndex=',index+1)
 				}
 				
 				if (this.userInfo.role == '老师') 

+ 16 - 9
components/user/userController.js

@@ -27,18 +27,20 @@ userController = {
 	//原理认知0
 	getScore_ylrz: function() {
 		// console.log("//////",userController, userController.data_scores);
-		return userController.data_scores[0].Score;
+		return userController.data_scores[0].Score==-1?0:userController.data_scores[0].Score;
 	},
 	//实景勘察1
 	getScore_sjck: function() {
-		return userController.data_scores[1].Score;
+		return userController.data_scores[1].Score==-1?0:userController.data_scores[1].Score;
 	},
 	//虚拟技术搭建2-4
 	getScore_xnjsdj: function() {
-		let score = -1;
+		// let score = -1;
+		let score = 0;
 		for (let i = 2; i <= 4; i++) {
-			if (userController.data_scores[i].Score > 0) {
-				score += userController.data_scores[i].Score;
+			let aScore = (userController.data_scores[i].Score==-1?0:userController.data_scores[i].Score);
+			if (aScore > 0) {
+				score += aScore;
 			}
 		}
 		return score;
@@ -47,19 +49,24 @@ userController = {
 	getScore_xnyscz: function() {
 		// console.log('艺术创作=',userController.data_scores)
 		// console.log('艺术创作类型=', typeof(userController.data_scores))
-		let score = -1;
+		// let score = -1;
+		let score = 0;
 		for (let i = 5; i <= 14; i++) {
 			// console.log('艺术创作'+i+'=',userController.data_scores[i])
 			// console.log('艺术创作222'+i+'=',userController.data_scores[i].Score)
-			if (userController.data_scores[i].Score > 0) {
-				score += userController.data_scores[i].Score;
+			let aScore = (userController.data_scores[i].Score==-1?0:userController.data_scores[i].Score);
+			if (aScore > 0) {
+				score += aScore;
 			}
+			// if (userController.data_scores[i].Score > 0) {
+			// 	score += userController.data_scores[i].Score;
+			// }
 		}
 		return score;
 	},
 	//教师评分15
 	getScore_jspf: function() {
-		return userController.data_scores[15].Score;
+		return userController.data_scores[15].Score==-1?0:userController.data_scores[15].Score;
 	},
 	userInfo: null,
 	updateUserInfo:function(){

+ 1 - 1
myData/myData_XXYSY.js

@@ -81,7 +81,7 @@ myData_XXYSY_SJKC = {
 			],
 			[
 				{
-					"text": '该部分共10分,设有5道选择题,每道题2分。完成该部分测试后可在“测试与结果”中查看成绩,完成测试后可进入下一模块实验学习。',
+					"text": '该部分共5分,设有5道选择题,每道题1分。完成该部分测试后可在“测试与结果”中查看成绩,完成测试后可进入下一模块实验学习。',
 					"color": '#020202',
 					"fontWeight":'normal'
 				}