| 
					
				 | 
			
			
				@@ -18,6 +18,7 @@ require_once(dirname(dirname(dirname(__FILE__))).'/config.php'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 require_once(dirname(__FILE__).'/lib.php'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 require_once($CFG->libdir.'/filelib.php'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 require_once('locallib.php'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+require_once('libs/viewlib.php'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   global $DB; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -125,46 +126,11 @@ if (has_capability('mod/gradeimporter:edit', $context)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     get_teacher_view($cm->id, $gradeimporter->id, $enrolledusers); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    $data = get_comments($cm->id, $id); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    // Loads student view. 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    $table = new html_table(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    $table->attributes['class'] = 'generaltable mod_index'; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    $table->head  = array(get_string('type', 'gradeimporter'), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        get_string('submission', 'gradeimporter'), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        get_string('grade', 'gradeimporter'), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        get_string('comment', 'gradeimporter'), 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        get_string('file', 'gradeimporter')); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    $table->align = array('center', 'center', 'center', 'center', 'center'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    if (count($data)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $current = ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        foreach ($data as $tipo => $cells) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            if ($current != "" && $current != $tipo) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                $row = new html_table_row(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                $cell = new html_table_cell(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                $cell->colspan = 5; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                $row->cells[] = $cell; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                $table->data[] = $row; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            $current = $tipo; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            $row = new html_table_row(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            $cell = new html_table_cell($tipo); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            $cell->rowspan = count($cells) + 1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            $row->cells[] = $cell; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            $table->data[] = $row; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            foreach ($cells as $cell) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                $row = new html_table_row(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                foreach ($cell as $value) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    $cell = new html_table_cell($value); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                    $row->cells[] = $cell; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-                $table->data[] = $row; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    echo html_writer::table($table); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    // Load student view 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    // Query database to find student feedbacks 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    $feedbacks = query_feedbacks($cm->id, $gradeimporter->id); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    make_feedback_table($feedbacks); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 // Finishes the page! 
			 |