Recovered most of the completion display code
This commit is contained in:
		
							parent
							
								
									27cb13fbfc
								
							
						
					
					
						commit
						050362905d
					
				
					 1 changed files with 39 additions and 26 deletions
				
			
		|  | @ -584,10 +584,10 @@ export default { | |||
|                         </div> | ||||
|                     </template> | ||||
|                     <r-item-studentgrades  | ||||
|                         v-if='!!value.course.grades && value.course.grades.length >0'  | ||||
|                         v-if='!!value.course.grades && value.course.grades.length > 0'  | ||||
|                         v-model='value' | ||||
|                         :guestmode='guestmode'></r-item-studentgrades> | ||||
|                     <-item-studentcompletion | ||||
|                     <r-item-studentcompletion | ||||
|                         v-if='!!value.course.completion'  | ||||
|                         v-model='value.course.completion' | ||||
|                         :course='value.course' | ||||
|  | @ -709,8 +709,37 @@ export default { | |||
|             }, | ||||
|             data() { | ||||
|                 return { | ||||
|                     text: { | ||||
|                         completion_incomplete: "completion_incomplete", | ||||
|                         completion_failed: "completion_failed", | ||||
|                         completion_pending: "completion_pending", | ||||
|                         completion_progress: "completion_progress", | ||||
|                         completion_completed: "completion_completed", | ||||
|                         completion_good: "completion_good", | ||||
|                         completion_excellent: "completion_excellent", | ||||
|                         view_feedback: "view_feedback", | ||||
|                         coursetiming_past: "coursetiming_past", | ||||
|                         coursetiming_present: "coursetiming_present", | ||||
|                         coursetiming_future: "coursetiming_future", | ||||
|                         required_goal: "required_goal", | ||||
|                     }, | ||||
|                 }; | ||||
|             }, | ||||
|             created(){ | ||||
|                 const self = this; | ||||
|                 // Get text strings for condition settings
 | ||||
|                 let stringkeys = []; | ||||
|                 for(const key in  this.text){ | ||||
|                     stringkeys.push({ key: key, component: 'local_treestudyplan'}); | ||||
|                 } | ||||
|                 get_strings(stringkeys).then(function(strings){ | ||||
|                     let i = 0; | ||||
|                     for(const key in  self.text){ | ||||
|                         self.text[key] = strings[i]; | ||||
|                         i++; | ||||
|                     } | ||||
|                 }); | ||||
|             }, | ||||
|             computed: { | ||||
|             }, | ||||
|             methods: { | ||||
|  | @ -739,7 +768,7 @@ export default { | |||
|             }, | ||||
|             template: ` | ||||
|             <table class="r-item-course-grade-details"> | ||||
|                 <template v-for='cgroup in value.conditions> | ||||
|                 <template v-for='cgroup in value.conditions'> | ||||
|                     <tr> | ||||
|                         <th colspan='2'>{{cgroup.title}}</th> | ||||
|                         <th><i :class="'fa fa-'+completion_icon(completion_tag(cgroup))+' r-completion-'+completion_tag(cgroup)" | ||||
|  | @ -747,23 +776,23 @@ export default { | |||
|                     </tr> | ||||
|                     <tr v-for='ci in cgroup.items'> | ||||
|                         <td><span v-if='guestmode'>{{ci.title}}</span> | ||||
|                             <span v-else>{{ci.details.criteria}}</span> | ||||
|                             <span v-else v-html='ci.details.criteria'></span> | ||||
|                             <abbr v-if="ci.details.requirement" :title="ci.details.requirement" | ||||
|                                 :class="'s-required ' + ci.status" | ||||
|                                 ><i class='fa fa-questionmark' ></i | ||||
|                             ></abbr> | ||||
|                         <td><span :class="' r-completion-'+ci.status">{{g.grade}}</span></td> | ||||
|                         <td><span :class="' r-completion-'+ci.status">{{ci.grade}}</span></td> | ||||
|                         <td><i :class="'fa fa-'+completion_icon(ci.status)+' r-completion-'+ci.status" | ||||
|                             :title="text['completion_'+ci.status"></i> | ||||
|                             :title="text['completion_'+ci.status]"></i> | ||||
|                             <i v-if='ci.pending' :title="text['completion_pending']"  | ||||
|                                 class="r-pendingsubmission fa fa-clock-o"></i> | ||||
|                         </td> | ||||
|                         <td v-if="ci.feedback"> | ||||
|                             <a  v-b-modal="'r-grade-feedback-'+g.id"  | ||||
|                             <a  v-b-modal="'r-grade-feedback-'+ci.id"  | ||||
|                                 href="#"  | ||||
|                             >{{ text["view_feedback"]}}</a> | ||||
|                             <b-modal | ||||
|                                 :id="'r-grade-feedback-'+g.id"  | ||||
|                                 :id="'r-grade-feedback-'+ci.id"  | ||||
|                                 size="sm" | ||||
|                                 ok-only | ||||
|                                 centered | ||||
|  | @ -771,29 +800,13 @@ export default { | |||
|                             > | ||||
|                                 <template #modal-header> | ||||
|                                     <h2><i class="fa fa-graduation-cap"></i>{{ course.fullname }}</h2><br> | ||||
|                                     <span class="r-activity-icon" :title="g.typename" v-html="g.icon"></span>{{g.name}} | ||||
|                                     <span class="r-activity-icon" :title="ci.typename" v-html="ci.icon"></span>{{ci.name}} | ||||
|                                 </template> | ||||
|                                 <span v-html="g.feedback"></span> | ||||
|                                 <span v-html="ci.feedback"></span> | ||||
|                             </b-modal> | ||||
|                         </td> | ||||
|                     </tr> | ||||
|                 </template> | ||||
|                 <tr v-for="g in value.course.grades"> | ||||
|                     <td><span class="r-activity-icon" :title="g.typename" v-html="g.icon"></span | ||||
|                         ><a | ||||
|                         :href="(!guestmode)?(g.link):undefined" target="_blank" :title="g.name">{{g.name}}</a> | ||||
|                         <abbr v-if="useRequiredGrades && g.required" :title="text.required_goal" | ||||
|                             :class="'s-required ' + g.completion" | ||||
|                             ><i class='fa fa-asterisk' ></i | ||||
|                         ></abbr> | ||||
|                     </td> | ||||
|                     <td><span :class="' r-completion-'+g.completion">{{g.grade}}</span></td> | ||||
|                     <td><i :class="'fa fa-'+completion_icon(g.completion)+' r-completion-'+g.completion" | ||||
|                         :title="text['completion_'+g.completion]"></i> | ||||
|                         <i v-if='g.pendingsubmission' :title="text['completion_pending']"  | ||||
|                             class="r-pendingsubmission fa fa-clock-o"></i></td> | ||||
|                      | ||||
|                 </tr> | ||||
|             </table> | ||||
|             `,
 | ||||
|         }); | ||||
|  |  | |||
		Reference in a new issue
	
	 PMKuipers
						PMKuipers