Minor - format code + removing var_dumps.

1.9.x
Julio Montoya 11 years ago
parent eee2cee5d9
commit 0c2c0ac34c
  1. 18
      main/exercice/exercise.lib.php
  2. 18
      main/newscorm/lp_list_search.php
  3. 4
      main/newscorm/lp_stats.php

@ -1386,7 +1386,6 @@ function get_exam_results_data(
if ($hp_title == '') {
$hp_title = basename($hpresults[$i][3]);
}
//var_dump($hpresults[$i]);
$hp_date = api_get_local_time($hpresults[$i][6], null, date_default_timezone_get());
$hp_result = round(($hpresults[$i][4] / ($hpresults[$i][5] != 0 ? $hpresults[$i][5] : 1)) * 100, 2).'% ('.$hpresults[$i][4].' / '.$hpresults[$i][5].')';
@ -1726,8 +1725,11 @@ function get_exercise_result_ranking($my_score, $my_exe_id, $exercise_id, $cours
}
}
//}
$return_value = array('position'=>$position, 'count'=>count($my_ranking));
//var_dump($my_score, $my_ranking);
$return_value = array(
'position' => $position,
'count' => count($my_ranking)
);
if ($return_string) {
if (!empty($position) && !empty($my_ranking)) {
$return_value = $position.'/'.count($my_ranking);
@ -1786,8 +1788,11 @@ function get_exercise_result_ranking_by_attempt($my_score, $my_exe_id, $exercise
}
}
}
$return_value = array('position'=>$position, 'count'=>count($my_ranking));
//var_dump($my_score, $my_ranking);
$return_value = array(
'position' => $position,
'count' => count($my_ranking)
);
if ($return_string) {
if (!empty($position) && !empty($my_ranking)) {
return $position.'/'.count($my_ranking);
@ -1881,7 +1886,6 @@ function get_average_score_by_course($course_code, $session_id) {
foreach($user_results as $result) {
if (!empty($result['exe_weighting']) && intval($result['exe_weighting']) != 0) {
$score = $result['exe_result']/$result['exe_weighting'];
//var_dump($score);
$avg_score +=$score;
}
}
@ -1889,7 +1893,6 @@ function get_average_score_by_course($course_code, $session_id) {
//$avg_score = show_score( $avg_score / count($user_results) , $result['exe_weighting']);
$avg_score = ($avg_score / count($user_results));
}
//var_dump($avg_score);
return $avg_score;
}
@ -2081,7 +2084,6 @@ function get_number_students_answer_count($answer_id, $question_id, $exercise_id
cu.status = ".STUDENT." AND
relation_type <> 2 AND
e.status = ''";
//var_dump($sql);
$result = Database::query($sql);
$return = 0;
if ($result) {

@ -7,10 +7,10 @@
* @author Diego Escalante Urrelo <diegoe@gmail.com>
* @author Marco Antonio Villegas Vega <marvil07@gmail.com>
* @author Julio Montoya <gugli100@gmail.com> Lots of bug fixing
*
*
*/
/**
* Code
* Code
*/
require api_get_path(LIBRARY_PATH).'search/search_widget.php';
require api_get_path(LIBRARY_PATH).'search/ChamiloQuery.php';
@ -79,7 +79,7 @@ foreach ($specific_fields as $specific_field) {
}
}
} else {
$sf_terms_for_code = xapian_get_all_terms(1000, $specific_field['code']);
$sf_terms_for_code = xapian_get_all_terms(1000, $specific_field['code']);
foreach ($sf_terms_for_code as $term) {
if (!empty($term)) {
$term_array[] = chamilo_get_boolean_query($term['name']); // Here name includes prefix.
@ -91,25 +91,23 @@ foreach ($specific_fields as $specific_field) {
// Get right group of terms to show on multiple select.
$fixed_queries = array();
$course_filter = NULL;
if ( ($cid=api_get_course_id()) != -1 ) {
if ( ($cid=api_get_course_id()) != -1 ) {
// Results only from actual course.
$course_filter = chamilo_get_boolean_query(XAPIAN_PREFIX_COURSEID . $cid);
}
if (count($term_array)) {
if (count($term_array)) {
$fixed_queries = chamilo_join_queries($term_array, null, $op);
if ($course_filter != NULL) {
$fixed_queries = chamilo_join_queries($fixed_queries, $course_filter, 'and');
}
} else {
if (!empty($query)) {
if (!empty($query)) {
$fixed_queries = array($course_filter);
}
}
//var_dump($fixed_queries);
list($count, $results) = chamilo_query_query(api_convert_encoding($query, 'UTF-8', $charset), 0, 1000, $fixed_queries);
// Prepare blocks to show.
@ -166,7 +164,7 @@ if (count($blocks) > 0) {
}
}
$additional_parameters['operator'] = $op;
$s->additional_parameters = $additional_parameters;
if ($mode == 'default') {

@ -556,7 +556,6 @@ if (is_array($list) && count($list) > 0) {
}
}
//var_dump($row['path'] .' '.$score);
if ($score == 0) {
$maxscore = $row['mymaxscore'];
} else {
@ -728,7 +727,6 @@ if (is_array($list) && count($list) > 0) {
}
$counter++;
//var_dump($extend_this_attempt, $extend_all);
if ($extend_this_attempt OR $extend_all) {
$list1 = learnpath :: get_iv_interactions_array($row['iv_id']);
@ -872,7 +870,6 @@ if (!empty($a_my_id)) {
$my_studen_id = intval(api_get_user_id());
$my_course_id = Database::escape_string(api_get_course_id());
}
//var_dump($my_studen_id, $my_course_id,$a_my_id);
if (isset($_GET['extend_attempt'])) {
//"Right green cross" extended
$total_score = Tracking::get_avg_student_score($my_studen_id, $my_course_id, $a_my_id, $session_id, false, false);
@ -884,7 +881,6 @@ if (!empty($a_my_id)) {
// Extend all "left green cross"
if ($origin == 'tracking') {
$my_course_id = Database::escape_string($_GET['course']);
// var_dump($student_id, $my_course_id );
if (!empty($student_id) && !empty($my_course_id)) {
$total_score = Tracking::get_avg_student_score($student_id, $my_course_id, array(intval($_GET['lp_id'])), $session_id, false, false);
} else {

Loading…
Cancel
Save