-
+
{{act.author.real_name}}
@@ -256,6 +256,7 @@
diff --git a/public/assets/wechat/join_classgroup.html b/public/assets/wechat/join_classgroup.html
index 6da2f1503..9a7705252 100644
--- a/public/assets/wechat/join_classgroup.html
+++ b/public/assets/wechat/join_classgroup.html
@@ -3,12 +3,12 @@
欢迎加入班级
{{current_course.name}}
-
选择分班
+
选择分班{{selectid}}
@@ -23,8 +23,8 @@
diff --git a/public/assets/wechat/select_my_coursegroup.html b/public/assets/wechat/select_my_coursegroup.html
new file mode 100644
index 000000000..c16b276e4
--- /dev/null
+++ b/public/assets/wechat/select_my_coursegroup.html
@@ -0,0 +1,25 @@
+
+
+
+
我的信息
+
{{current_edit_member.user.show_name}}
+
角色
+
学生
+
选择分班
+
+
+
+
+
+
{{tip_1}}
+
{{tip_2}}
+
+
+
diff --git a/public/javascripts/wechat/controllers/class.js b/public/javascripts/wechat/controllers/class.js
index ea394a1ff..ca4ad6d76 100644
--- a/public/javascripts/wechat/controllers/class.js
+++ b/public/javascripts/wechat/controllers/class.js
@@ -247,7 +247,6 @@ app.controller('ClassController', ['$scope', 'config','$http', 'auth','$location
resetMenu(vm.course.current_user_is_teacher,vm.currentTab);
}
-
vm.onSetting = function(user){
rms.save('current_edit_member', user);
rms.save("course",vm.course);
@@ -255,6 +254,13 @@ app.controller('ClassController', ['$scope', 'config','$http', 'auth','$location
$location.path("/edit_class_member").search({id: courseid,user_id: user.id});
};
+ vm.onSetting_1 = function(user){
+ rms.save('current_edit_member', user);
+ rms.save("course",vm.course);
+ rms.save("tab_num",vm.currentTab);
+ $location.path("/select_my_coursegroup").search({id: courseid});
+ };
+
vm.review = function(user){
rms.save('current_review_member', user);
rms.save('current_course', vm.course);
diff --git a/public/javascripts/wechat/controllers/join_class.js b/public/javascripts/wechat/controllers/join_class.js
index 8f7647b12..709072562 100644
--- a/public/javascripts/wechat/controllers/join_class.js
+++ b/public/javascripts/wechat/controllers/join_class.js
@@ -67,7 +67,11 @@ app.controller('JoinClassController', ['$scope', '$http', 'auth', 'config', 'ale
}
});
} else {
- vm.alertService.showMessage('提示', response.data.message);
+ vm.alertService.showMessage('提示', response.data.message,function(){
+ if(response.data.go_coursegroup_flag == 1) {
+ $location.path("/join_classgroup").search({id: response.data.course_id});
+ }
+ });
}
});
};
diff --git a/public/javascripts/wechat/controllers/join_classgroup.js b/public/javascripts/wechat/controllers/join_classgroup.js
index 504643817..a661ba6fc 100644
--- a/public/javascripts/wechat/controllers/join_classgroup.js
+++ b/public/javascripts/wechat/controllers/join_classgroup.js
@@ -5,14 +5,28 @@ app.controller('JoinClassGroupController', ['$scope', '$http', 'auth', 'config',
var course_id = $routeParams.id;
vm.alertService = alertService.create();
+ vm.selectid = 0;
$http.get(config.apiUrl+ 'courses/'+course_id+"?token="+auth.token()).then(
function(response) {
console.log(response.data);
if (response.data.status == 0){
vm.current_course = response.data.data;
- console.log("courses");
+ console.log("courses=");
console.log(response.data.data);
+ if(vm.current_course){
+ $http.get(config.apiUrl + 'courses/course_groups/'+course_id+'?token='+auth.token()).then(
+ function(response) {
+ console.log("groups=");
+ console.log(response);
+ if(response.data.status == 0) {
+ vm.groups = response.data.data;
+ }
+ else{
+ vm.groups = [];
+ }
+ });
+ }
}
else{
vm.alertService.showMessage('提示', response.data.message);
@@ -23,17 +37,42 @@ app.controller('JoinClassGroupController', ['$scope', '$http', 'auth', 'config',
}
);
- if(vm.current_course){
- $http.get(config.apiUrl + 'courses/course_groups?token='+auth.token()+'&course_id='+course_id).then(
- function(response) {
- if(response.data.status == 0) {
- vm.groups = response.data.groups;
- }
- else{
- vm.groups = [];
- }
- });
- }
+ vm.selectGroup = function(id){
+ vm.selectid = id;
+ };
+ vm.cancel = function(){
+
+ };
+
+ vm.confirm = function(){
+ if(vm.selectid == 0){
+ rms.save('syllabuses',[]);
+ $location.path("/class_list");
+ return;
+ }
+
+ //加入分班
+ $http.post(config.apiUrl+'courses/join_coursegroup', {
+ token: auth.token(),
+ id: course_id,
+ course_group_id:vm.selectid
+ }).then(function(response){
+ console.log(response);
+ if(response.data.status == 0){
+ vm.alertService.showMessage('提示', "加入分班成功!",function(){
+ rms.save('syllabuses',[]);
+ $location.path("/class_list");
+
+ });
+ } else {
+ vm.alertService.showMessage('提示', response.data.message,function(){
+ rms.save('syllabuses',[]);
+ $location.path("/class_list");
+ });
+ }
+ });
+ };
+
}] );
\ No newline at end of file
diff --git a/public/javascripts/wechat/controllers/select_my_coursegroup.js b/public/javascripts/wechat/controllers/select_my_coursegroup.js
new file mode 100644
index 000000000..2c338d33f
--- /dev/null
+++ b/public/javascripts/wechat/controllers/select_my_coursegroup.js
@@ -0,0 +1,66 @@
+
+
+app.controller('SelectMyCourseGroupController', ['$scope', '$http', 'auth', 'config', 'alertService','$location','$routeParams','rms','common', function($scope, $http, auth, config, alertService, $location,$routeParams, rms,common){
+// common.checkLogin();
+
+ var vm = $scope;
+
+ vm.current_review_member = rms.get('current_review_member');
+
+ vm.alertService = alertService.create();
+
+ vm.tip_1 = "";
+ vm.tip_2 = "";
+
+ var course_id = $routeParams.id;
+ if(!vm.current_course){
+ $http.get(config.apiUrl+ 'courses/'+course_id+"?token="+auth.token()).then(
+ function(response) {
+ console.log(response.data);
+ if (response.data.status == 0){
+ vm.current_course = response.data.data;
+ console.log("courses");
+ console.log(response.data.data);
+ }
+ else{
+ vm.alertService.showMessage('提示', response.data.message);
+ }
+ if(!vm.current_course){
+ vm.tip_1 = "该班级不存在或已被删除";
+ }
+
+ }
+ );
+ }
+
+ if(!vm.current_edit_member){
+ $http.post(config.apiUrl+'courses/get_member_info', {
+ token: auth.token(),
+ id: course_id,
+ user_id:user_id
+ }).then(function(response){
+ if(response.data.status!=0){
+ vm.alertService.showMessage('提示', response.data.message,function(){
+ $location.path("/class").search({id: course_id,tag:1});
+ });
+ } else {
+ console.log(response);
+ course_id = response.data.course_id;
+ vm.current_edit_member = response.data.member_info;
+ vm.current_roles_id = vm.current_edit_member.roles_id;
+
+ for(var i in vm.current_roles_id){
+ if(vm.current_roles_id[i] == 10){
+ vm.student = true;
+ return;
+ }
+ }
+
+ if(!vm.student){
+ vm.tip_2 = "您不是该班级的学生!";
+ }
+ }
+ });
+ }
+
+}] );
\ No newline at end of file
diff --git a/public/javascripts/wechat/others/routes.js b/public/javascripts/wechat/others/routes.js
index 845995ec6..7b5434ddd 100644
--- a/public/javascripts/wechat/others/routes.js
+++ b/public/javascripts/wechat/others/routes.js
@@ -41,6 +41,7 @@ app.config(['$routeProvider',"$httpProvider", "$locationProvider",'config', func
.when('/join_class', makeRoute('join_class.html', 'JoinClassController'))
.when('/join_classgroup', makeRoute('join_classgroup.html', 'JoinClassGroupController'))
.when('/review_class_member', makeRoute('review_class_member.html', 'ReviewClassMemberController'))
+ .when('/select_my_coursegroup', makeRoute('select_my_coursegroup.html', 'SelectMyCourseGroupController'))
.when('/class_publishnotice', makeRoute('class_publishnotice.html', 'ClassPublishNoticeController'))
.when('/class_publishissue', makeRoute('class_publishissue.html', 'ClassPublishIssueController'))
.when('/project_list', makeRoute('project_list.html', 'ProjectListController'))
From 5b613964103a1742137c41221f9d81db41a1011b Mon Sep 17 00:00:00 2001
From: yuanke <249218296@qq.com>
Date: Mon, 19 Sep 2016 13:53:15 +0800
Subject: [PATCH 07/42] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E8=AF=BE=E7=A8=8B?=
=?UTF-8?q?=E5=90=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/api/mobile/entities/attachment.rb | 3 +++
app/api/mobile/entities/course.rb | 3 ---
app/api/mobile/entities/exercise.rb | 3 +++
app/api/mobile/entities/homework.rb | 4 ++++
app/api/mobile/entities/message.rb | 5 +++++
app/api/mobile/entities/news.rb | 6 ++++++
app/api/mobile/entities/whomework.rb | 3 +++
7 files changed, 24 insertions(+), 3 deletions(-)
diff --git a/app/api/mobile/entities/attachment.rb b/app/api/mobile/entities/attachment.rb
index 8200c04b2..0eda2d1c0 100644
--- a/app/api/mobile/entities/attachment.rb
+++ b/app/api/mobile/entities/attachment.rb
@@ -23,6 +23,8 @@ module Mobile
(number_to_human_size(f.filesize)).gsub("ytes", "").to_s
when :coursename
f.course.nil? ? "" : f.course.name
+ when :syllabus_title
+ f.course.nil? ? "" : f.course.syllabus.nil? ? "" : f.course.syllabus.title
when :course_id
f.course.nil? ? 0 : f.course.id
@@ -40,6 +42,7 @@ module Mobile
attachment_expose :file_dir
attachment_expose :attafile_size
attachment_expose :coursename #所属班级名
+ attachment_expose :syllabus_title #所属班级名
attachment_expose :course_id #所属班级名
expose :current_user_is_teacher, if: lambda { |instance, options| options[:user] } do |instance, options|
current_user = options[:user]
diff --git a/app/api/mobile/entities/course.rb b/app/api/mobile/entities/course.rb
index 9bf1cc1f6..30a5a6cc9 100644
--- a/app/api/mobile/entities/course.rb
+++ b/app/api/mobile/entities/course.rb
@@ -19,8 +19,6 @@ module Mobile
(format_time(c[field]) if (c.is_a?(Hash) && c.key?(field))) || (format_time(c.send(field)) if c.respond_to?(field))
elsif field == :member_count
::Course===c ? c.members.count : 0
- elsif field == :syllabus_title
- c.syllabus.nil? ? "":c.syllabus.title
else
(c[field] if (c.is_a?(Hash) && c.key?(field))) || (c.send(field) if c.respond_to?(field))
end
@@ -40,7 +38,6 @@ module Mobile
course_expose :lft
course_expose :location
course_expose :name
- course_expose :syllabus_title
course_expose :open_student
# course_expose :password
course_expose :rgt
diff --git a/app/api/mobile/entities/exercise.rb b/app/api/mobile/entities/exercise.rb
index ce6a2fb39..821380b47 100644
--- a/app/api/mobile/entities/exercise.rb
+++ b/app/api/mobile/entities/exercise.rb
@@ -19,6 +19,8 @@ module Mobile
case field
when :coursename
f.course.nil? ? "" : f.course.name
+ when :syllabus_title
+ f.course.nil? ? "" : f.course.syllabus.nil? ? "" : f.course.syllabus.title
end
end
end
@@ -27,6 +29,7 @@ module Mobile
expose :exercise_name
expose :exercise_description
exercise_expose :coursename #所属班级名
+ exercise_expose :syllabus_title
expose :current_user_is_teacher, if: lambda { |instance, options| options[:user] } do |instance, options|
current_user = options[:user]
diff --git a/app/api/mobile/entities/homework.rb b/app/api/mobile/entities/homework.rb
index a5b981c6d..d149681e4 100644
--- a/app/api/mobile/entities/homework.rb
+++ b/app/api/mobile/entities/homework.rb
@@ -39,6 +39,8 @@ module Mobile
val
when :coursename
f.course.nil? ? "" : f.course.name
+ when :syllabus_title
+ f.course.nil? ? "" : f.course.syllabus.nil? ? "" : f.course.syllabus.title
end
end
end
@@ -49,6 +51,8 @@ module Mobile
#课程名称
homework_expose :course_name
+ homework_expose :syllabus_title
+
homework_expose :course_id
#作业发布者
expose :author,using: Mobile::Entities::User do |f, opt|
diff --git a/app/api/mobile/entities/message.rb b/app/api/mobile/entities/message.rb
index 07c560a1f..189b52851 100644
--- a/app/api/mobile/entities/message.rb
+++ b/app/api/mobile/entities/message.rb
@@ -22,6 +22,10 @@ module Mobile
else
u.project.name
end
+ when :syllabus_title
+ if u.board.project_id == -1
+ u.course.syllabus.nil? ? "" : u.course.syllabus.title
+ end
when :lasted_comment
time_from_now u.created_on
when :praise_count
@@ -50,6 +54,7 @@ module Mobile
message_expose :act_type
message_expose :act_id
message_expose :course_project_name
+ message_expose :syllabus_title
message_expose :board_id
message_expose :subject
message_expose :title
diff --git a/app/api/mobile/entities/news.rb b/app/api/mobile/entities/news.rb
index d8c4dcab3..4515791cd 100644
--- a/app/api/mobile/entities/news.rb
+++ b/app/api/mobile/entities/news.rb
@@ -26,6 +26,11 @@ module Mobile
f.id
when :comment_count
f.comments.count
+ when :syllabus_title
+ unless f.course_id == nil
+ course = get_course(f.course_id)
+ course.syllabus.nil? ? "" : course.syllabus.title
+ end
end
end
elsif f.is_a?(::Comment)
@@ -89,6 +94,7 @@ module Mobile
news_expose :praise_count
#课程名字
news_expose :course_name
+ news_expose :syllabus_title
news_expose :lasted_comment
#评论
diff --git a/app/api/mobile/entities/whomework.rb b/app/api/mobile/entities/whomework.rb
index 9d141552a..b19d34f05 100644
--- a/app/api/mobile/entities/whomework.rb
+++ b/app/api/mobile/entities/whomework.rb
@@ -30,6 +30,8 @@ module Mobile
wh.journals_for_messages.count
when :course_name
wh.course.name
+ when :syllabus_title
+ wh.course.syllabus.nil? ? "" : wh.course.syllabus.title
when :act_type
'HomeworkCommon'
when :act_id
@@ -65,6 +67,7 @@ module Mobile
whomework_expose :act_type
whomework_expose :act_id
whomework_expose :course_name
+ whomework_expose :syllabus_title
whomework_expose :created_at
whomework_expose :absence_penalty
whomework_expose :evaluation_start
From 126c18f8333f4afd3fbb60cd53140f6c24927283 Mon Sep 17 00:00:00 2001
From: Tim
Date: Mon, 19 Sep 2016 14:00:52 +0800
Subject: [PATCH 08/42] =?UTF-8?q?=E6=88=91=E7=9A=84=E8=B5=84=E6=BA=90?=
=?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=9D=A5=E6=BA=90=E5=AE=BD=E5=BA=A6=E8=B0=83?=
=?UTF-8?q?=E6=95=B4=EF=BC=9B=E7=8F=AD=E7=BA=A7=E5=8A=A8=E6=80=81=E8=AF=A6?=
=?UTF-8?q?=E6=83=85=E9=A1=B5=E9=9D=A2=E6=98=BE=E7=A4=BA=E8=AF=BE=E7=A8=8B?=
=?UTF-8?q?=E5=90=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/assets/wechat/course_notice.html | 2 +-
public/assets/wechat/homework_detail.html | 2 +-
public/stylesheets/weui/weixin.css | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/public/assets/wechat/course_notice.html b/public/assets/wechat/course_notice.html
index 3358da343..a0c242d72 100644
--- a/public/assets/wechat/course_notice.html
+++ b/public/assets/wechat/course_notice.html
@@ -23,7 +23,7 @@
{{news.title}}
-
{{discussion.syllabus_title}}·{{news.course_name}} - 课程通知{{news.created_on}}
+
{{news.syllabus_title}}·{{news.course_name}} - 课程通知{{news.created_on}}
diff --git a/public/assets/wechat/homework_detail.html b/public/assets/wechat/homework_detail.html
index 3898bee14..908cff977 100644
--- a/public/assets/wechat/homework_detail.html
+++ b/public/assets/wechat/homework_detail.html
@@ -23,7 +23,7 @@
{{homework.name}}
-
{{discussion.syllabus_title}}·{{homework.course_name}} - 普通作业编程作业分组作业{{homework.publish_time}}
+
{{homework.syllabus_title}}·{{homework.course_name}} - 普通作业编程作业分组作业{{homework.publish_time}}
迟交扣分:{{homework.late_penalty}}分
匿评开启时间:{{homework.evaluation_start}}
diff --git a/public/stylesheets/weui/weixin.css b/public/stylesheets/weui/weixin.css
index 8e0b3933e..d2d92a361 100644
--- a/public/stylesheets/weui/weixin.css
+++ b/public/stylesheets/weui/weixin.css
@@ -203,7 +203,7 @@ a.underline {text-decoration:underline;}
.img-circle {border-radius:50% !important;}
.member-banner {height:24px; line-height:24px; text-align:center; vertical-align:middle; background-color:#dfdfdf;}
.resource-width {width:76%;}
-.courseware-from-width {max-width:57%;}
+.courseware-from-width {max-width:50%;}
.other-from-width {max-width:80%;}
.course-name-width {width:68%;}
From 9c214ef57b9756683a1e2f8f8daec86d5414e669 Mon Sep 17 00:00:00 2001
From: Tim
Date: Mon, 19 Sep 2016 14:07:32 +0800
Subject: [PATCH 09/42] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E8=B5=84=E6=96=99?=
=?UTF-8?q?=E6=96=87=E5=AD=97=E6=8F=90=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/assets/wechat/edit_userinfo.html | 6 +++---
public/stylesheets/weui/weixin.css | 1 +
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/public/assets/wechat/edit_userinfo.html b/public/assets/wechat/edit_userinfo.html
index 3e4bf51f2..b0a00bba2 100644
--- a/public/assets/wechat/edit_userinfo.html
+++ b/public/assets/wechat/edit_userinfo.html
@@ -12,7 +12,7 @@