1. 1 # student_views.py
  2. 2 # ————————60PerfectCRM实现CRM学生上课记录————————
  3. 3 from django.shortcuts import render #页面返回
  4. 4 from crm import models #数据库
  5. 5 from django.contrib.auth.decorators import login_required # 登陆后页面才能访问
  6. 6
  7. 7 # ————————69PerfectCRM实现CRM业务流程(bpm)学生讲师分页————————
  8. 8 from bpm.bpm_auxiliary.pagination import Page #分页
  9. 9 # ————————69PerfectCRM实现CRM业务流程(bpm)学生讲师分页————————
  10. 10
  11. 11 #学生报名的课程
  12. 12 @login_required # 登陆后页面才能访问
  13. 13 def student_course(request):
  14. 14 if request.user.stu_account:
  15. 15 enrollmentlist=request.user.stu_account.enrollment_set.all()#根据账号表关联的ID获取06学员报名信息表
  16. 16
  17. 17 # ————————69PerfectCRM实现CRM业务流程(bpm)学生讲师分页————————
  18. 18 page = Page(request.GET.get(\'p\', 1), len(enrollmentlist)) #当前页数 默认为1 #总数量
  19. 19 enrollmentlist = enrollmentlist[page.start:page.end] # 切片取当前页的数据
  20. 20 page_str = page.page_str(\'/bpm/student_course/\') #总页数 传入url
  21. 21 # ————————69PerfectCRM实现CRM业务流程(bpm)学生讲师分页————————
  22. 22
  23. 23 return render(request, \'bpm_student/student_course.html\', locals())
  24. 24
  25. 25 #学生上课记录列表
  26. 26 @login_required # 登陆后页面才能访问
  27. 27 def studyrecords(request,enroll_obj_id):
  28. 28 enroll_obj=models.Enrollment.objects.get(id=enroll_obj_id)#根据ID获取06学员报名信息表
  29. 29 studyrecordlist=enroll_obj.studyrecord_set.all()#根据06学员报名信息表的ID获取09学习纪录
  30. 30
  31. 31 # ————————69PerfectCRM实现CRM业务流程(bpm)学生讲师分页————————
  32. 32 page = Page(request.GET.get(\'p\', 1), len(studyrecordlist)) #当前页数 默认为1 #总数量
  33. 33 studyrecordlist = studyrecordlist[page.start:page.end] # 切片取当前页的数据
  34. 34 page_str = page.page_str(\'/bpm/studyrecords/%s/\'%enroll_obj_id) #总页数 传入url
  35. 35 # ————————69PerfectCRM实现CRM业务流程(bpm)学生讲师分页————————
  36. 36
  37. 37 return render(request,\'bpm_student/studyrecords.html\',locals())
  38. 38
  39. 39 # ————————60PerfectCRM实现CRM学生上课记录————————
  40. 40
  41. 41 # ————————61PerfectCRM实现CRM学生上传作业————————
  42. 42 from django.contrib.auth.decorators import login_required #登陆才能访问
  43. 43 from PerfectCRM import settings #静态配置文件 #作业上传 # 上传路径
  44. 44 import os,json,time #系统操作
  45. 45 from django.shortcuts import HttpResponse #页面返回
  46. 46 from django.shortcuts import redirect #页面返回
  47. 47 #作业详情
  48. 48 @login_required#登陆才能访问
  49. 49 def homework_detail(request,enroll_obj_id,studyrecord_id):
  50. 50 studyrecord_obj=models.StudyRecord.objects.get(id=studyrecord_id)#取学习记录 对象
  51. 51 enroll_obj=models.Enrollment.objects.get(id=enroll_obj_id)#取班级对象
  52. 52
  53. 53 # 作业根目录 班级ID 上课记录ID 学习记录ID
  54. 54 homework_path="{base_dir}/{class_id}/{course_record_id}/{studyercord_id}/".format(
  55. 55 base_dir=settings.HOMEWORK_DATA, #静态配置文件
  56. 56 class_id=studyrecord_obj.student.enrolled_class_id,#09学习纪录#学生名字#所报班级ID
  57. 57 course_record_id=studyrecord_obj.course_record_id,#09学习纪录#每节课上课纪录表
  58. 58 studyercord_id=studyrecord_obj.id##09学习纪录
  59. 59 )
  60. 60 print(\'homework_path路径:\',studyrecord_obj.student.enrolled_class_id,studyrecord_obj.course_record_id,studyrecord_obj.id)
  61. 61
  62. 62 if os.path.exists(homework_path):#判断目录是否存在
  63. 63 file_lists = [] # 已经上传的文件列表
  64. 64 for file_name in os.listdir( homework_path ):
  65. 65 f_path = \'%s/%s\' % (homework_path, file_name) # 文件名字
  66. 66 modify_time = time.strftime( "%Y-%m-%d %H:%M:%S", time.gmtime( os.stat( f_path ).st_mtime ) ) # 文件上传时间
  67. 67 file_lists.append( [file_name, os.stat( f_path ).st_size, modify_time] ) # 添加到文件列表#文件名字#文件大小文件上传时间
  68. 68
  69. 69
  70. 70 if request.method=="POST":#上传
  71. 71 ret=False
  72. 72 data=request.POST.get(\'data\') #ajax
  73. 73 if data:#如果有删除动作
  74. 74 del_f_path="%s/%s"%(homework_path,data)#文件路径
  75. 75 print(\'删除文件,路径:\',del_f_path)
  76. 76 os.remove(del_f_path) #删除
  77. 77 ret=True
  78. 78 return HttpResponse(json.dumps(ret))#ret=False
  79. 79 if request.is_ajax(): # ajax上传图片 #异步提交
  80. 80 print("POST",request.POST)
  81. 81 if not os.path.isdir( homework_path ): # 没有目录 #isdir返回true,如果路径名是指现有的目录。
  82. 82 os.makedirs( homework_path, exist_ok=True ) # 创建目录  
  83. 83 for k,v in request.FILES.items():#上传的文件
  84. 84 with open(\'%s/%s\'%(homework_path,v.name),\'wb\') as f:#chunk 写入文件
  85. 85 for chunk in v.chunks(): #循环写文件
  86. 86 f.write(chunk)
  87. 87 return HttpResponse( json.dumps( {"status": 0, \'mag\': "上传完成!", \'file_lists\': file_lists} ) ) # 上传文件返回
  88. 88
  89. 89 if request.method=="POST":#上传
  90. 90 link = request.POST.get( \'link\' ) # 让页面POST提交的值,在页面GET后仍然存在显示
  91. 91 if link:
  92. 92 homework_link=models.StudyRecord.objects.filter( id=studyrecord_id ).update(homework_link=link)
  93. 93 return redirect(\'/bpm/homework_detail/%s/%s/\' %(enroll_obj_id,studyrecord_id) )#跳转到enrollment_rejection
  94. 94 return render(request,\'bpm_student/homework_detail.html\',locals())
  95. 95 # ————————61PerfectCRM实现CRM学生上传作业————————

# student_views.py

 

 

 

 

 

  1. 1 {#student_course.html#}
  2. 2 {## ————————60PerfectCRM实现CRM学生上课记录————————#}
  3. 3 {% extends \'bpm_master/bpm_sample.html\' %}
  4. 4 {% load bpm_tags %}
  5. 5 {% block right-container-content %} {#自定义内容开始 右边页面内容#}
  6. 6 <div class="panel-default">
  7. 7 <div class="panel-body">
  8. 8 <h4>当前用户: {{ request.user }} | 学员名字:{{ request.user.stu_account.name }} |
  9. 9 学员QQ:{{ request.user.stu_account }}</h4>
  10. 10 <ol class="breadcrumb">
  11. 11 <li><a href="/bpm/student_course/">我的课程</a></li>
  12. 12 </ol>
  13. 13 <table class="table table-striped table-responsive">
  14. 14 <thead>
  15. 15 <tr>
  16. 16 <th>校区班级</th>
  17. 17 <th>班级类型</th>
  18. 18 <th>课程进度</th>
  19. 19 <th>课程成绩</th>
  20. 20 <th>开课日期</th>
  21. 21 <th>结业日期</th>
  22. 22 </tr>
  23. 23 </thead>
  24. 24
  25. 25
  26. 26 <tbody>
  27. 27 {% for enroll_obj in enrollmentlist %}
  28. 28 <tr>
  29. 29 <td>{{ enroll_obj.enrolled_class }}</td>
  30. 30 {#校区班级#}
  31. 31 <td>{{ enroll_obj.enrolled_class.get_class_type_display }}</td>
  32. 32 {#班级类型#}
  33. 33 <td>
  34. 34 <a href="{% url \'studyrecords\' enroll_obj.id %}">已上: {{ enroll_obj.enrolled_class.courserecord_set.all.count }}节</a>
  35. 35 </td>
  36. 36 {#课程进度#}
  37. 37 <td>
  38. 38 {% get_score enroll_obj request.user.stu_account as score_data %}{{ score_data.score__sum }}</td>
  39. 39 {#课程成绩#}
  40. 40 <td>{{ enroll_obj.enrolled_class.start_date }}</td>
  41. 41 {#开课日期#}
  42. 42 <td>{{ enroll_obj.enrolled_class.end_date }}</td>
  43. 43 {#结业日期#}
  44. 44 </tr>
  45. 45 {% endfor %}
  46. 46 </tbody>
  47. 47 </table>
  48. 48
  49. 49 {## ————————69PerfectCRM实现CRM业务流程(bpm)学生讲师分页————————#}
  50. 50 {% include \'bpm_components/page_str.html\' %}
  51. 51 {## ————————69PerfectCRM实现CRM业务流程(bpm)学生讲师分页————————#}
  52. 52
  53. 53 </div>
  54. 54 </div>
  55. 55 {% endblock %}
  56. 56 {## ————————60PerfectCRM实现CRM学生上课记录————————#}

{#student_course.html#}

 

 

  1. 1 {#studyrecords.html#}
  2. 2 {## ————————60PerfectCRM实现CRM学生上课记录————————#}
  3. 3 {% extends \'bpm_master/bpm_sample.html\' %}
  4. 4 {% load bpm_tags %}
  5. 5 {% block right-container-content %} {#自定义内容开始 右边页面内容#}
  6. 6 <div class="panel-default">
  7. 7 <div class="panel-body">
  8. 8 <h4>当前用户: {{ request.user }} | 学员名字:{{ request.user.stu_account.name }} |
  9. 9 学员QQ:{{ request.user.stu_account }}</h4>
  10. 10 <ol class="breadcrumb">
  11. 11 <li><a href="/bpm/student_course/">我的课程</a></li>
  12. 12 <li><a href="/bpm/studyrecords/{{ enroll_obj.id }}/">{{ enroll_obj.enrolled_class }}</a></li>
  13. 13 </ol>
  14. 14
  15. 15 <table class="table table-striped table-responsive ">
  16. 16 <thead>
  17. 17 <tr>
  18. 18 <th>课程节次</th>
  19. 19 <th>签到状态</th>
  20. 20 <th>本节作业</th>
  21. 21 <th>本节成绩</th>
  22. 22 <th>本节讲师</th>
  23. 23 <th>上课日期</th>
  24. 24 <th>本节大纲</th>
  25. 25 <th>作业标题</th>
  26. 26 <th>作业要求</th>
  27. 27 </tr>
  28. 28 </thead>
  29. 29
  30. 30
  31. 31 <tbody>
  32. 32 {% for studyrecord in studyrecordlist %}
  33. 33 <tr>
  34. 34 <td>{{ studyrecord.course_record.day_num }}</td>
  35. 35 {#课程节次#}
  36. 36 <td>{{ studyrecord.get_attendance_display }}</td>
  37. 37 {#签到状态#}
  38. 38 <td>
  39. 39 <a href="{% url \'homework_detail\' enroll_obj.id studyrecord.id %}">
  40. 40 {{ studyrecord.course_record.has_homework }}
  41. 41 </a>
  42. 42 </td>
  43. 43 {#本节作业#}
  44. 44 <td>{{ studyrecord.get_score_display }}</td>
  45. 45 {#本节成绩#}
  46. 46 <td>{{ studyrecord.course_record.teacher }}</td>
  47. 47 {#本节讲师#}
  48. 48 <td>{{ studyrecord.course_record.date }}</td>
  49. 49 {#上课日期#}
  50. 50 <td>
  51. 51 <pre style="width: 240px;height: 60px">{{ studyrecord.course_record.outline }}</pre>
  52. 52 {#本节大纲#}
  53. 53 </td>
  54. 54 <td>
  55. 55 <pre style="width: 240px;height: 60px">{{ studyrecord.course_record.homework_title }}</pre>
  56. 56 {#作业标题#}
  57. 57 </td>
  58. 58 <td>
  59. 59 <pre style="width: 240px;height: 60px">{{ studyrecord.course_record.homework_content }}</pre>
  60. 60 {#作业要求#}
  61. 61 </td>
  62. 62 </tr>
  63. 63 {% endfor %}
  64. 64 </tbody>
  65. 65 </table>
  66. 66
  67. 67 {## ————————69PerfectCRM实现CRM业务流程(bpm)学生讲师分页————————#}
  68. 68 {% include \'bpm_components/page_str.html\' %}
  69. 69 {## ————————69PerfectCRM实现CRM业务流程(bpm)学生讲师分页————————#}
  70. 70
  71. 71 </div>
  72. 72 </div>
  73. 73 {% endblock %}
  74. 74 {## ————————60PerfectCRM实现CRM学生上课记录————————#}

{#studyrecords.html#}

 

 

 

 

  1. 1 # teacher_views.py
  2. 2 # ————————62PerfectCRM实现CRM讲师讲课记录————————
  3. 3 from django.contrib.auth.decorators import login_required # 登陆后页面才能访问
  4. 4 from django.shortcuts import render #页面返回
  5. 5
  6. 6 # ————————69PerfectCRM实现CRM业务流程(bpm)学生讲师分页————————
  7. 7 from bpm.bpm_auxiliary.pagination import Page #分页
  8. 8 # ————————69PerfectCRM实现CRM业务流程(bpm)学生讲师分页————————
  9. 9
  10. 10 # 讲师班级
  11. 11 @login_required # 登陆后页面才能访问
  12. 12 def teacher_class(request):
  13. 13 # user_id=request.user.id #当前登陆的ID
  14. 14 # classlist=models.UserProfile.objects.get(id=user_id).classlist_set.all()#讲师所教班级
  15. 15 classes_obj = request.user.classlist_set.all() # 根据 登陆的ID 获取02班级表
  16. 16
  17. 17 # ————————69PerfectCRM实现CRM业务流程(bpm)学生讲师分页————————
  18. 18 page = Page(request.GET.get(\'p\', 1), len(classes_obj)) #当前页数 默认为1 #总数量
  19. 19 classes_obj = classes_obj[page.start:page.end] # 切片取当前页的数据
  20. 20 page_str = page.page_str(\'/bpm/teacher_class/\') #总页数 传入url
  21. 21 # ————————69PerfectCRM实现CRM业务流程(bpm)学生讲师分页————————
  22. 22
  23. 23 return render( request, \'bpm_teacher/teacher_class.html\', locals() )
  24. 24
  25. 25 # 讲师班级课节详情
  26. 26 @login_required # 登陆后页面才能访问
  27. 27 def teacher_class_detail(request, class_id):
  28. 28 # user_id=request.user.id #当前登陆的ID
  29. 29 # classes_obj=models.UserProfile.objects.get(id=user_id).classlist_set.get(id=class_id)#所选的班级
  30. 30 classes_obj = request.user.classlist_set.get( id=class_id ) # 根据 登陆的ID 获取02班级表
  31. 31 courserecordlist = classes_obj.courserecord_set.all() # 根据 02班级表的ID 获取09学习纪录
  32. 32
  33. 33 # ————————69PerfectCRM实现CRM业务流程(bpm)学生讲师分页————————
  34. 34 page = Page( request.GET.get( \'p\', 1 ), len( courserecordlist ) ) # 当前页数 默认为1 #总数量
  35. 35 courserecordlist = courserecordlist[page.start:page.end] # 切片取当前页的数据
  36. 36 page_str = page.page_str(\'/bpm/teacher_class_detail/%s/\'%class_id) #总页数 传入url
  37. 37 # ————————69PerfectCRM实现CRM业务流程(bpm)学生讲师分页————————
  38. 38
  39. 39 return render( request, \'bpm_teacher/teacher_classes_detail.html\', locals() )
  40. 40 # ————————62PerfectCRM实现CRM讲师讲课记录————————
  41. 41
  42. 42 # ————————63PerfectCRM实现CRM讲师下载作业————————
  43. 43 from PerfectCRM import settings # 系统配置
  44. 44 import os # 系统操作
  45. 45 # 本节课的学员
  46. 46 @login_required # 登陆后页面才能访问
  47. 47 def teacher_lesson_detail(request, class_id, courserecord_id):
  48. 48 # classes_obj=models.UserProfile.objects.get(id=request.user.id).classlist_set.get(id=class_id)#所选的班级
  49. 49 classes_obj = request.user.classlist_set.get( id=class_id ) # 根据 登陆的ID 获取02班级表
  50. 50 courserecordlist = classes_obj.courserecord_set.get( id=courserecord_id ) # 根据 前端的ID 获取08每节课上课纪录表
  51. 51
  52. 52 # studyrecord_list=models.CourseRecord.objects.get(id=courserecord_id).studyrecord_set.all()#取本节课所有学员
  53. 53 studyrecord_list = courserecordlist.studyrecord_set.all() # 根据08每节课上课纪录表 #获取09学习纪录 #取本节课所有学员
  54. 54
  55. 55 for i in studyrecord_list: # 循环本节课所有学员 交作业的状态
  56. 56 studyrecord_id = i.id # 获取本节课所有学员的ID
  57. 57 if studyrecord_id: # 有获取到ID
  58. 58 HOMEWORK_path = \'%s/%s/%s/%s/\' % (settings.HOMEWORK_DATA, class_id, courserecord_id, studyrecord_id) # 作业目录
  59. 59 if os.path.exists( HOMEWORK_path ): # 判断目录是否存在
  60. 60 try:#防止后台误删文件
  61. 61 file_list = os.listdir( HOMEWORK_path ) # 取目录 下的文件
  62. 62 isfile = os.path.isfile( \'%s%s\' % (HOMEWORK_path, file_list[0]) ) # 判断是不是文件
  63. 63 studyrecord_list.filter( id=studyrecord_id ).update( delivery=isfile ) # 更新交付作业状态
  64. 64 except:
  65. 65 studyrecord_list.filter( id=studyrecord_id ).update( delivery=False ) # file_list 出错# 更新交付作业状态
  66. 66 else:
  67. 67 studyrecord_list.filter( id=studyrecord_id ).update( delivery=False )# 更新交付作业状态
  68. 68
  69. 69 # ————————69PerfectCRM实现CRM业务流程(bpm)学生讲师分页————————
  70. 70 page = Page( request.GET.get( \'p\', 1 ), len( studyrecord_list ) ) # 当前页数 默认为1 #总数量
  71. 71 studyrecord_list = studyrecord_list[page.start:page.end] # 切片取当前页的数据
  72. 72 page_str = page.page_str(\'/bpm/teacher_lesson_detail/%s/%s/\'%(class_id,courserecord_id)) # 总页数 传入url
  73. 73 # ————————69PerfectCRM实现CRM业务流程(bpm)学生讲师分页————————
  74. 74
  75. 75 return render( request, \'bpm_teacher/teacher_lesson_detail.html\', locals() )
  76. 76
  77. 77 from django.http import StreamingHttpResponse #页面返回
  78. 78 from crm import models #数据库
  79. 79 from django.shortcuts import redirect #页面返回
  80. 80 # 学员作业下载
  81. 81 @login_required # 登陆后页面才能访问
  82. 82 def howk_down(request, class_id, courserecord_id, studyrecord_id):
  83. 83 HOMEWORK_path = \'%s/%s/%s/%s/\' % (settings.HOMEWORK_DATA, class_id, courserecord_id, studyrecord_id) # 作业目录
  84. 84 print( \'下载作业目录:\', HOMEWORK_path )
  85. 85
  86. 86 def file_iterator(file_path, chunk_size=512): # 获取文件 #chunk_size每次读取的大小 #文件迭代器
  87. 87 with open( file_path, \'rb\', ) as f: # 循环打开 文件#以二进制读模式打开
  88. 88 while True: # 如果有文件
  89. 89 byte = f.read( chunk_size ) # read读最多大小字节,作为字节返回。#获取文件大小
  90. 90 if byte:
  91. 91 yield byte # 返回 yield 后的值作为第一次迭代的返回值. 循环下一次,再返回,直到没有可以返回的。
  92. 92 else:
  93. 93 break # 没有字节就中止
  94. 94
  95. 95 if os.path.exists( HOMEWORK_path ): # 判断目录是否存在
  96. 96 try:#防止后台误删文件
  97. 97 file_list = os.listdir( HOMEWORK_path ) # 取目录 下的文件
  98. 98 print( \'文件名:\', file_list, type( file_list ) )
  99. 99 file_path = \'%s%s\' % (HOMEWORK_path, file_list[0]) # 下载文件路径
  100. 100 print( \'下载文件路径:\', file_path )
  101. 101 response = StreamingHttpResponse( file_iterator( file_path ) ) # StreamingHttpResponse是将文件内容进行流式传输
  102. 102 response[\'Content-Type\'] = \'application/octet-stream\' # 文件类型 #应用程序/octet-stream.*( 二进制流,不知道下载文件类型)
  103. 103 file_name = \'attachment;filename=%s\' % file_list[0] # 文件名字# 支持中文
  104. 104 response[\'Content-Disposition\'] = file_name.encode() # 支持中文#编码默认encoding=\'utf-8\'
  105. 105 return response # 返回下载 请求的内容
  106. 106 except:
  107. 107 models.StudyRecord.objects.get( id=studyrecord_id ).update( delivery=False ) # 更新交付作业状态 # file_list 出错
  108. 108 return redirect( \'/bpm/teacher_lesson_detail/%s/%s/\' % (class_id, courserecord_id) ) # 返回##本节课的学员
  109. 109 # ————————63PerfectCRM实现CRM讲师下载作业————————

# teacher_views.py

 

 

 

  1. 1 {#teacher_class.html#}
  2. 2 {## ————————62PerfectCRM实现CRM讲师讲课记录————————#}
  3. 3 {% extends \'bpm_master/bpm_sample.html\' %}
  4. 4 {% block right-container-content %} {#自定义内容开始 右边页面内容#}
  5. 5 <div class="panel-default">
  6. 6 <div class="panel-body">
  7. 7 <h4>当前用户: {{ request.user }} | 讲师名字:{{ request.user.stu_account.name }} |
  8. 8 讲师QQ:{{ request.user.stu_account }}</h4>
  9. 9 <ol class="breadcrumb">
  10. 10 <li><a href="/bpm/teacher_class/">我的班级</a></li>
  11. 11 </ol>
  12. 12 <table class="table table-striped table-responsive">
  13. 13 <thead>
  14. 14 <tr>
  15. 15 <th><a target="_blank" href="/king_admin/crm/classlist/add/">校区班级</a></th>
  16. 16 <th>班级类型</th>
  17. 17 <th><a target="_blank" href="/king_admin/crm/courserecord/add/">课程进度</a></th>
  18. 18 <th><a target="_blank" href="/king_admin/crm/customer/">学员数量</a></th>
  19. 19 <th>开课日期</th>
  20. 20 <th>结业日期</th>
  21. 21 </tr>
  22. 22 </thead>
  23. 23 <tbody>
  24. 24 {% for class in classes_obj %}
  25. 25 <tr>
  26. 26 <td>
  27. 27 {## ————————64PerfectCRM实现CRM课程排名详情————————#}
  28. 28 <a href="{% url \'coursetop_details\' class.id %}">
  29. 29 {## ————————64PerfectCRM实现CRM课程排名详情————————#}
  30. 30 {{ class }}
  31. 31 </a>
  32. 32 </td>
  33. 33 <td>{{ class.get_class_type_display }}</td>
  34. 34 <td>
  35. 35 <a href="{% url \'teacher_class_detail\' class.id %}">
  36. 36 已上: {{ class.courserecord_set.all.count }}节
  37. 37 </a>
  38. 38 </td>
  39. 39 <td>{{ class.enrollment_set.select_related.count }}</td>
  40. 40 <td>{{ class.start_date }}</td>
  41. 41 <td>{{ class.end_date }}</td>
  42. 42 </tr>
  43. 43 {% endfor %}
  44. 44 </tbody>
  45. 45 </table>
  46. 46
  47. 47 {## ————————69PerfectCRM实现CRM业务流程(bpm)学生讲师分页————————#}
  48. 48 {% include \'bpm_components/page_str.html\' %}
  49. 49 {## ————————69PerfectCRM实现CRM业务流程(bpm)学生讲师分页————————#}
  50. 50
  51. 51 </div>
  52. 52 </div>
  53. 53 {% endblock %}
  54. 54 {## ————————62PerfectCRM实现CRM讲师讲课记录————————#}

{#teacher_class.html#}

 

 

 

  1. 1 {#teacher_classes_detail.html#}
  2. 2 {## ————————62PerfectCRM实现CRM讲师讲课记录————————#}
  3. 3 {% extends \'bpm_master/bpm_sample.html\' %}
  4. 4 {% block right-container-content %} {#自定义内容开始 右边页面内容#}
  5. 5 <div class="panel-default">
  6. 6 <div class="panel-default">
  7. 7 <div class="panel-body">
  8. 8 <h4>当前用户: {{ request.user }} | 讲师名字:{{ request.user.stu_account.name }} |
  9. 9 讲师QQ:{{ request.user.stu_account }} </h4>
  10. 10 <ol class="breadcrumb">
  11. 11 <li><a href="/bpm/teacher_class/">我的班级</a></li>
  12. 12 <li><a href="{% url \'teacher_class_detail\' classes_obj.id %}">{{ classes_obj }}</a></li>
  13. 13 </ol>
  14. 14 <table class="table table-striped table-responsive ">
  15. 15 <thead>
  16. 16 <tr>
  17. 17 <th><a target="_blank" href="/king_admin/crm/courserecord/add/">课程节次</a></th>
  18. 18 <th>签到状态</th>
  19. 19 <th>本节作业</th>
  20. 20 <th>上课日期</th>
  21. 21 <th>本节大纲</th>
  22. 22 <th>作业标题</th>
  23. 23 <th>作业要求</th>
  24. 24 </tr>
  25. 25 </thead>
  26. 26
  27. 27
  28. 28 <tbody>
  29. 29 {% for courserecord in courserecordlist %}
  30. 30 <tr>
  31. 31 <td><a target="_blank"
  32. 32 href="/king_admin/crm/courserecord/{{ courserecord.id }}/change/"> {{ courserecord.day_num }}节</a>
  33. 33 </td>
  34. 34 {#课程节次#}
  35. 35 <td>
  36. 36 <a target="_blank"
  37. 37 href="/king_admin/crm/studyrecord/?course_record={{ courserecord.id }} ">点名/成绩</a>
  38. 38 </td>
  39. 39 {#签到状态#}
  40. 40 <td>
  41. 41 {## ————————63PerfectCRM实现CRM讲师下载作业————————#}
  42. 42 <a href="{% url \'teacher_lesson_detail\' class_id courserecord.id %}">
  43. 43 {## ————————63PerfectCRM实现CRM讲师下载作业————————#}
  44. 44 {{ courserecord.has_homework }}
  45. 45 </a>
  46. 46 </td>
  47. 47 {#本节作业#}
  48. 48 <td> {{ courserecord.date }}</td>
  49. 49 {#上课日期#}
  50. 50 <td>
  51. 51 <pre style="width: 240px;height: 60px">{{ courserecord.outline }} </pre>
  52. 52 </td>
  53. 53 {#本节大纲#}
  54. 54 <td>
  55. 55 <pre style="width: 240px;height: 60px">{{ courserecord.homework_title }}</pre>
  56. 56 </td>
  57. 57 {#作业标题#}
  58. 58 <td>
  59. 59 <pre style="width: 240px;height: 60px">{{ courserecord.homework_content }} </pre>
  60. 60 </td>
  61. 61 {#作业要求#}
  62. 62 </tr>
  63. 63 {% endfor %}
  64. 64 </tbody>
  65. 65 </table>
  66. 66
  67. 67 {## ————————69PerfectCRM实现CRM业务流程(bpm)学生讲师分页————————#}
  68. 68 {% include \'bpm_components/page_str.html\' %}
  69. 69 {## ————————69PerfectCRM实现CRM业务流程(bpm)学生讲师分页————————#}
  70. 70
  71. 71 </div>
  72. 72 </div>
  73. 73 </div>
  74. 74 {% endblock %}
  75. 75 {## ————————62PerfectCRM实现CRM讲师讲课记录————————#}

{#teacher_classes_detail.html#}

 

 

 

  1. 1 {#teacher_lesson_detail.html#}
  2. 2 {## ————————63PerfectCRM实现CRM讲师下载作业————————#}
  3. 3 {% extends \'bpm_master/bpm_sample.html\' %}
  4. 4 {% block right-container-content %} {#自定义内容开始 右边页面内容#}
  5. 5 <div class="panel-default">
  6. 6 <div class="panel-default">
  7. 7 <div class="panel-body">
  8. 8 <h4>当前用户: {{ request.user }} | 讲师名字:{{ request.user.stu_account.name }} |
  9. 9 讲师QQ:{{ request.user.stu_account }} </h4>
  10. 10 <ol class="breadcrumb">
  11. 11 <li><a href="/bpm/teacher_class/">我的班级</a></li>
  12. 12 <li><a href="{% url \'teacher_class_detail\' classes_obj.id %}">{{ classes_obj }}</a></li>
  13. 13 <li>
  14. 14 <a href="{% url \'teacher_lesson_detail\' classes_obj.id courserecordlist.id %}">第{{ courserecordlist.day_num }}节</a>
  15. 15 </li>
  16. 16 </ol>
  17. 17 <li>
  18. 18 <a target="_blank"
  19. 19 href="/king_admin/crm/courserecord/{{ courserecordlist.id }}/change/">作业标题:</a>
  20. 20 <pre>{{ courserecordlist.homework_title }}</pre>
  21. 21 </li>
  22. 22 <li>
  23. 23 <a target="_blank"
  24. 24 href="/king_admin/crm/courserecord/{{ courserecordlist.id }}/change/">作业要求:</a>
  25. 25 <pre>{{ courserecordlist.homework_content }}</pre>
  26. 26 </li>
  27. 27
  28. 28
  29. 29 <table class="table table-striped table-responsive">
  30. 30 <thead>
  31. 31 <tr>
  32. 32 <th>学员ID</th>
  33. 33 <th>学员姓名</th>
  34. 34 <th>
  35. 35 <a target="_blank" href="/king_admin/crm/studyrecord/?course_record={{ courserecord_id }} ">签到状态</a>
  36. 36 </th>
  37. 37 <th> 作业链接</th>
  38. 38 <th>
  39. 39 {% if courserecordlist.has_homework %}
  40. 40 <a href="{% url \'teacher_lesson_detail\' classes_obj.id courserecordlist.id %}">学员作业(多刷) </a>
  41. 41 {% else %}
  42. 42 <a style="color: #ff1900" target="_blank"
  43. 43 href="/king_admin/crm/courserecord/{{ courserecordlist.id }}/change/">创建新作业</a>
  44. 44 {% endif %}
  45. 45 </th>
  46. 46 <th>
  47. 47 {% if courserecordlist.has_homework %}
  48. 48 <a href="{% url \'teacher_lesson_detail\' classes_obj.id courserecordlist.id %}">批改作业 </a>
  49. 49 {% else %}
  50. 50 没有作业
  51. 51 {% endif %}
  52. 52 </th>
  53. 53 </tr>
  54. 54 </thead>
  55. 55
  56. 56
  57. 57 <tbody>
  58. 58 {% for studyrecrd in studyrecord_list %}
  59. 59 <tr>
  60. 60 <td>{{ studyrecrd.student.id }}</td>
  61. 61 {#学员ID#}
  62. 62 <td>{{ studyrecrd.student.customer.name }}</td>
  63. 63 {#学员姓名#}
  64. 64 <td>{{ studyrecrd.get_attendance_display }}</td>
  65. 65 {#签到状态#}
  66. 66 <td>
  67. 67 <pre style="width: 240px;height: 60px">{{ studyrecrd.homework_link }}</pre>
  68. 68 </td>
  69. 69 {#作业链接#}
  70. 70 <td>
  71. 71 {% if studyrecrd.delivery %}
  72. 72 <a href="{% url \'howk_down\' classes_obj.id studyrecrd.course_record_id studyrecrd.id %}">下载作业</a>
  73. 73 {% endif %}{#学员作业#}
  74. 74 </td>
  75. 75 <td>
  76. 76 {% if studyrecrd.course_record.has_homework %}
  77. 77 {% if studyrecrd.score == 0 %}
  78. 78 <a target="_blank"
  79. 79 href="/king_admin/crm/studyrecord/{{ studyrecrd.id }}/change/"
  80. 80 style="color: #ff1600">未批改</a>
  81. 81 {% else %}
  82. 82 <a target="_blank"
  83. 83 href="/king_admin/crm/studyrecord/{{ studyrecrd.id }}/change/"
  84. 84 style="color: #0014ff">{{ studyrecrd.get_score_display }}</a>
  85. 85 {% endif %}
  86. 86 {% endif %}{#批改作业#}
  87. 87 </td>
  88. 88 </tr>
  89. 89 {% endfor %}
  90. 90 </tbody>
  91. 91 </table>
  92. 92
  93. 93 {## ————————69PerfectCRM实现CRM业务流程(bpm)学生讲师分页————————#}
  94. 94 {% include \'bpm_components/page_str.html\' %}
  95. 95 {## ————————69PerfectCRM实现CRM业务流程(bpm)学生讲师分页————————#}
  96. 96
  97. 97 </div>
  98. 98 </div>
  99. 99 </div>
  100. 100 {% endblock %}
  101. 101 {## ————————63PerfectCRM实现CRM讲师下载作业————————#}

{#teacher_lesson_detail.html#}

 

 

 

版权声明:本文为ujq3原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/ujq3/p/9036363.html