[svn r13738] Minor - Code fixes to avoid warnings

skala
Yannick Warnier 17 years ago
parent a23ee23c04
commit f9f432ea68
  1. 8
      main/exercice/exercice.php
  2. 15
      main/exercice/exercise_result.php

@ -638,12 +638,16 @@ if($show == 'test'){
<td align='center'><?php
$eid = $row['id'];
$uid= $_SESSION[_user][user_id];
$uid= api_get_user_id();
$qry = "select * from ".$TBL_TRACK_EXERCICES." where exe_exo_id = $eid and exe_user_id = $uid";
$qryres = api_sql_query($qry);
$num = Database::num_rows($qryres);
$row = Database::fetch_array($qryres);
$percentage = ($row['exe_result']/$row['exe_weighting'])*100;
$percentage = 0;
if($row['exe_weighting'] != 0)
{
$percentage = ($row['exe_result']/$row['exe_weighting'])*100;
}
if ($num>0)
{
echo get_lang('Attempted').' ('.get_lang('Score').':';

@ -25,7 +25,7 @@
* @package dokeos.exercise
* @author Olivier Brouckaert, main author
* @author Roan Embrechts, some refactoring
* @version $Id: exercise_result.php 13730 2007-11-21 15:14:12Z yannoo $
* @version $Id: exercise_result.php 13738 2007-11-21 22:03:02Z yannoo $
*
* @todo split more code up in functions, move functions to library?
*/
@ -650,10 +650,15 @@ $exerciseTitle=api_parse_tex($exerciseTitle);
$coursecode = $_SESSION['_course']['id'];
$query1 = "SELECT user_id from $main_course_user_table where course_code= '$coursecode' and status = '1' LIMIT 0,1";
$result1 = api_sql_query($query1, __FILE__, __LINE__);
$temp = mysql_result($result1,0,"user_id");
$query = "select email from $main_user_table where user_id =".intval($temp) ;
$result = api_sql_query($query, __FILE__, __LINE__);
$to = mysql_result($result,0,"email");
if(Database::num_rows($result1)>0)
{
$temp = mysql_result($result1,0,"user_id");
$query = "select email from $main_user_table where user_id =".intval($temp) ;
$result = api_sql_query($query, __FILE__, __LINE__);
$to = mysql_result($result,0,"email");
}else{
//this is a problem (it means that there is no admin for this course)
}
display_free_answer($choice);
}
elseif($answerType == HOT_SPOT)

Loading…
Cancel
Save