Browse Source

[svn r16123] Minor - get_comment function typo

Julio Montoya 16 years ago
parent
commit
1d9aafd7d5
1 changed files with 6 additions and 5 deletions
  1. 6 5
      main/exercice/exercise_show.php

+ 6 - 5
main/exercice/exercise_show.php

@@ -185,16 +185,17 @@ function getFCK(vals,marksid){
 <?php
 
 /**
- * Enter description here...
+ * This function gets the comments of an exercise
  *
- * @param unknown_type $id
- * @param unknown_type $question_id
- * @return unknown
+ * @param int $id
+ * @param int $question_id
+ * @return str the comment
  */
 function get_comments($id,$question_id)
 	{
 	global $TBL_TRACK_ATTEMPT;
-	$sql = "select teacher_comment from ".$TBL_TRACK_ATTEMPT." where exe_id='".Database::escape_string($id and question_id)."' = '".Database::escape_string($question_id)."' order by question_id";
+	//$sql = "select teacher_comment from ".$TBL_TRACK_ATTEMPT." where exe_id='".Database::escape_string($id and question_id)."' = '".Database::escape_string($question_id)."' order by question_id";
+	$sql = "select teacher_comment from ".$TBL_TRACK_ATTEMPT." where exe_id='".Database::escape_string($id)."' and question_id = '".Database::escape_string($question_id)."' order by question_id";
 	$sqlres = api_sql_query($sql, __FILE__, __LINE__);
 	$comm = mysql_result($sqlres,0,"teacher_comment");
 	return $comm;