Removing var_dumps

skala
Julio Montoya 13 years ago
parent a7b84c53dc
commit cb3020e45a
  1. 1
      main/admin/settings.php
  2. 2
      main/admin/skills_profile.php
  3. 1
      main/admin/user_list.php
  4. 8
      main/auth/cas/lib/CAS/PGTStorage/pgt-db.php
  5. 5
      main/calendar/agenda.inc.php
  6. 9
      main/calendar/allagendas.php
  7. 2
      main/course_description/add.php
  8. 3
      main/document/document_lite.php
  9. 2
      main/document/download_scorm.php
  10. 4
      main/exercice/addlimits.php
  11. 7
      main/exercice/exercise.class.php
  12. 5
      main/exercice/exercise.lib.php
  13. 2
      main/exercice/exercise_reminder.php
  14. 4
      main/exercice/exercise_submit.php
  15. 2
      main/exercice/exercise_submit_modal.php
  16. 439
      main/exercice/global_multiple_answer.class.php
  17. 7
      main/gradebook/lib/be/category.class.php
  18. 1
      main/gradebook/lib/fe/linkaddeditform.class.php
  19. 2
      main/gradebook/lib/flatview_data_generator.class.php
  20. 2
      main/gradebook/lib/gradebook_functions.inc.php
  21. 3
      main/inc/ajax/model.ajax.php
  22. 1
      main/inc/ajax/user_manager.ajax.php
  23. 2
      main/inc/global.inc.php
  24. 8
      main/inc/lib/chat.lib.php
  25. 1
      main/inc/lib/database.lib.php
  26. 11
      main/inc/lib/document.lib.php
  27. 1
      main/inc/lib/extra_field.lib.php
  28. 1
      main/inc/lib/main_api.lib.php
  29. 1
      main/inc/lib/nanogong.lib.php
  30. 7
      main/inc/lib/online.inc.php
  31. 4
      main/inc/lib/sessionmanager.lib.php
  32. 6
      main/inc/lib/skill.lib.php
  33. 3
      main/inc/lib/thematic.lib.php
  34. 3
      main/inc/lib/tracking.lib.php
  35. 12
      main/newscorm/lp_impress.php
  36. 2
      main/newscorm/lp_view.php
  37. 1
      main/tracking/course_session_report.php
  38. 24
      main/tracking/exams.php
  39. 23
      main/tracking/question_course_report.php
  40. 1
      main/work/work.php
  41. 1
      plugin/bbb/lib/bbb.lib.php

@ -233,7 +233,6 @@ if (!empty($_GET['category']) && !in_array($_GET['category'], array('Plugins', '
//$r = api_set_settings_category($my_category, 'false', $_configuration['access_url'], array('checkbox', 'radio'));
//This is a more accurate way of updating to false the checkboxes and radios the settings
//var_dump($settings);exit;
/*
foreach ($values as $key => $value) {

@ -150,8 +150,6 @@ $tpl->assign('search_skill_list', $skills);
$form_to_html = $form->return_form();
//var_dump($total_skills_to_search);
$tpl->assign('form', $form_to_html);
$tpl->assign('url', $url);

@ -763,7 +763,6 @@ $form->addElement('html', '</td><td>');
/*
* @todo fix this code
$extra_data = UserManager::get_extra_fields( 0,10,5, 'ASC', true, 1);
var_dump($extra_data);
$extra_options = array();
if (!empty($extra_data)) {
$extra_options[0] = get_lang('All');

@ -206,13 +206,9 @@ class PGTStorageDB extends PGTStorage
// try to connect to the database
$this->_link = DB::connect($this->getURL());
if ( DB::isError($this->_link) ) {
phpCAS::error('could not connect to database ('.DB::errorMessage($this->_link).')');
phpCAS::error('could not connect to database ('.DB::errorMessage($this->_link).')');
}
var_dump($this->_link);
phpCAS::traceBEnd();
}
/** @} */
}
?>

@ -3672,7 +3672,7 @@ function get_week_agendaitems($courses_dbs, $month, $year, $week = '')
// $sqlquery = "SELECT * FROM $agendadb WHERE (DAYOFMONTH(day)>='$start_day' AND DAYOFMONTH(day)<='$end_day')
// AND (MONTH(day)>='$start_month' AND MONTH(day)<='$end_month')
// AND (YEAR(day)>='$start_year' AND YEAR(day)<='$end_year')";
//var_dump($sqlquery);
$result = Database::query($sqlquery);
while ($item = Database::fetch_array($result)) {
$agendaday_string = api_convert_and_format_date($item['start_date'], "%d", date_default_timezone_get());
@ -5030,7 +5030,7 @@ function agenda_import_ical($course_info, $file)
$attendee = $ve->getProperty('attendee');
$course_name = $ve->getProperty('location');
//insert the event in our database
//var_dump($title,$desc,$start_date,$end_date);
$id = agenda_add_item($course_info,$title,$desc,$start_date_string,$end_date_string,$_POST['selectedform']);
@ -5139,7 +5139,6 @@ function agenda_import_ical($course_info, $file)
$all_day = 'true';
}
//var_dump($start_date_string, $end_date_string, $all_day);
$id = $agenda_obj->add_event(
$start_date_string,
$end_date_string,

@ -158,16 +158,15 @@ function get_agenda_items_by_course_list($course_list, $month, $year, $session_i
ORDER BY start_date ";
$result = Database::query($sqlquery);
while ($item = Database::fetch_array($result,'ASSOC')) {
//var_dump($item);
//taking the day
$agendaday = date("j",strtotime($item['start_date']));
if(!isset($items[$agendaday])){$items[$agendaday]=array();}
//taking the time
$time = date("H:i",strtotime($item['start_date']));
//var_dump($time );
$end_time= date("H:i",strtotime($item['end_date']));
$URL = api_get_path(WEB_PATH)."main/calendar/allagendas.php?cidReq=".urlencode($code)."&amp;sort=asc&amp;view=list&amp;day=$agendaday&amp;month=$month&amp;year=$year#$agendaday"; // RH //Patrick Cool: to highlight the relevant agenda item
//var_dump($URL);
if ($setting_agenda_link == 'coursecode') {
//$title=$array_course_info['title'];
@ -260,14 +259,10 @@ if(!empty($my_session_id)) {
$_SESSION['my_course_list'] = array();
$my_course_list = array();
} else {
//echo 'here';
$my_course_list = $_SESSION['my_course_list'];
//var_dump($_SESSION['my_course_list'], $my_course_list);
$my_course_list_keys = array_keys($my_course_list);
//var_dump($my_course_list, $my_course_list_keys);
if (!in_array($my_course_id, $my_course_list_keys)) {
$course_info = api_get_course_info_by_id($my_course_id);
$_SESSION['my_course_list'][$my_course_id] = $course_info;

@ -10,8 +10,6 @@
// protect a course script
api_protect_course_script(true);
//var_dump($_SESSION['studentview']);
// display categories
$categories = array ();
foreach ($default_description_titles as $id => $title) {

@ -1126,6 +1126,3 @@ if (!is_null($docs_and_folders)) {
$content .= Display::div($link, array('class' => 'right'));
$controller->tpl->assign('content', $content);
$controller->tpl->display($tpl);
//var_dump($sortable_data);

@ -48,8 +48,6 @@ if (strpos($doc_url,'../') OR strpos($doc_url,'/..')) {
$sys_course_path = api_get_path(SYS_COURSE_PATH).$_course['path'].'/scorm';
//var_dump($sys_course_path);
if (is_dir($sys_course_path.$doc_url)) {
api_not_allowed();
}

@ -17,7 +17,6 @@ require_once '../inc/global.inc.php';
require_once 'exercise.class.php';
require_once 'question.class.php';
require_once 'answer.class.php';
require_once api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php';
// name of the language file that needs to be included
$language_file='exercice';
@ -29,8 +28,7 @@ api_protect_course_script();
$dsp_percent = false;
$debug=0;
if($debug>0)
{
if($debug>0) {
echo str_repeat('&nbsp;',0).'Entered exercise_result.php'."<br />\n";exervar_dump($_POST);
}
// general parameters passed via POST/GET

@ -3647,9 +3647,9 @@ class Exercise
//Fixes multiple answer question in order to be exact
if ($answerType == MULTIPLE_ANSWER || $answerType == GLOBAL_MULTIPLE_ANSWER) {
//var_dump($answer_correct_array, $real_answers);
$diff = @array_diff($answer_correct_array, $real_answers);
//var_dump($diff);
/*
* All good answers or nothing works like exact
$counter = 1;
@ -4481,10 +4481,9 @@ class Exercise
}
$questions_in_category = $one_question_per_category;
}
//var_dump($questions_in_category);
while (list($category_id, $question_id) = each($questions_in_category)) {
$elements = Testcategory::getNElementsFromArray($question_id, $number_of_random_question);
//var_dump($elements);
$temp_question_list = array_merge($temp_question_list, $elements);
}

@ -1700,7 +1700,7 @@ 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);
if ($return_string) {
if (!empty($position) && !empty($my_ranking)) {
return $position.'/'.count($my_ranking);
@ -1793,7 +1793,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;
}
}
@ -1801,7 +1800,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;
}
@ -1997,7 +1995,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) {

@ -168,7 +168,7 @@ foreach ($attempt_list as $question_id => $options) {
$item['answer'] = $objExercise->fill_in_blank_answer_to_string($item['answer']);
break;
case HOT_SPOT:
//var_dump($item['answer']);
break;
}

@ -536,7 +536,6 @@ if ($objExercise->selectAttempts() > 0) {
if ($debug) { error_log("4. Setting the exe_id: $exe_id");} ;
//5. Getting user exercise info (if the user took the exam before) - generating exe_id
//var_dump($learnpath_id.' - '.$learnpath_item_id.' - '.$learnpath_item_view_id);
$exercise_stat_info = $objExercise->get_stat_track_exercise_info($learnpath_id, $learnpath_item_id, $learnpath_item_view_id);
@ -1041,7 +1040,6 @@ if ($reminder == 2) {
exit;
}
}
//var_dump($remind_question_id, $my_remind_list, $data_tracking, $current_question);
}
if ($objExercise->review_answers) {
@ -1330,7 +1328,7 @@ function render_question_list($objExercise, $questionList, $current_question, $e
echo $objQuestionTmp->show_media_content();
$count_of_questions_inside_media = count($media_question_list);
//var_dump($media_question_list);
//Show questions that belongs to a media
if (!empty($media_question_list)) {
foreach ($media_question_list as $my_question_id) {

@ -436,8 +436,8 @@ if (!empty($choice_value)) {
<td><div style="color:'.$missing_color.'">'.(($final_missing < 0)?0:intval($final_missing)).'</div></td>
</tr>
</table>';
//var_dump($final_overlap, $threadhold1 , $final_missing, $threadhold2 , $final_excess, $threadhold3);
}
$_SESSION['newquestionList'] = $newquestionList;
$links='';

@ -1,255 +1,252 @@
<?php
/* For licensing terms, see /license.txt */
if (!class_exists('GlobalMultipleAnswer')):
class GlobalMultipleAnswer extends Question {
class GlobalMultipleAnswer extends Question {
static $typePicture = 'mcmagl.gif';
static $explanationLangVar = 'GlobalMultipleAnswer';
static $typePicture = 'mcmagl.gif';
static $explanationLangVar = 'GlobalMultipleAnswer';
/* Constructor */
/* Constructor */
function GlobalMultipleAnswer() {
parent::question();
$this->type = GLOBAL_MULTIPLE_ANSWER;
$this->isContent = $this->getIsContent();
function GlobalMultipleAnswer() {
parent::question();
$this->type = GLOBAL_MULTIPLE_ANSWER;
$this->isContent = $this->getIsContent();
}
/**
* function which redifines Question::createAnswersForm
* @param the formvalidator instance
* @param the answers number to display
*/
function createAnswersForm($form) {
$nb_answers = isset($_POST['nb_answers']) ? $_POST['nb_answers'] : 4;
$nb_answers += (isset($_POST['lessAnswers']) ? -1 : (isset($_POST['moreAnswers']) ? 1 : 0));
$obj_ex = $_SESSION['objExercise'];
/* Mise en variable de Affichage "Reponses" et son icone, "N<EFBFBD>", "Vrai", "Reponse" */
$html = '<table class="data_table">
<tr>
<th width="10px">
' . get_lang('Number') . '
</th>
<th width="10px">
' . get_lang('True') . '
</th>
<th width="50%">
' . get_lang('Answer') . '
</th>';
// Espace entre l'entete et les r<EFBFBD>ponses
if ($obj_ex->selectFeedbackType() != EXERCISE_FEEDBACK_TYPE_EXAM) {
$html .='<th>' . get_lang('Comment') . '</th>';
}
$html .='</tr>';
/**
* function which redifines Question::createAnswersForm
* @param the formvalidator instance
* @param the answers number to display
*/
function createAnswersForm($form) {
$nb_answers = isset($_POST['nb_answers']) ? $_POST['nb_answers'] : 4;
$nb_answers += (isset($_POST['lessAnswers']) ? -1 : (isset($_POST['moreAnswers']) ? 1 : 0));
$obj_ex = $_SESSION['objExercise'];
/* Mise en variable de Affichage "Reponses" et son icone, "N<EFBFBD>", "Vrai", "Reponse" */
$html = '<table class="data_table">
<tr>
<th width="10px">
' . get_lang('Number') . '
</th>
<th width="10px">
' . get_lang('True') . '
</th>
<th width="50%">
' . get_lang('Answer') . '
</th>';
// Espace entre l'entete et les r<EFBFBD>ponses
if ($obj_ex->selectFeedbackType() != EXERCISE_FEEDBACK_TYPE_EXAM) {
$html .='<th>' . get_lang('Comment') . '</th>';
$form->addElement('label', get_lang('Answers') . '<br /> <img src="../img/fill_field.png">', $html);
/* Initialiation variable */
$defaults = array();
$correct = 0;
/* Mise en variable du nombre de reponse */
if (!empty($this->id)) {
$answer = new Answer($this->id);
$answer->read();
if (count($answer->nbrAnswers) > 0 && !$form->isSubmitted()) {
$nb_answers = $answer->nbrAnswers;
}
$html .='</tr>';
}
#le nombre de r<EFBFBD>ponses est bien enregistr<EFBFBD> sous la forme int(nb)
/* Ajout mise en forme nb reponse */
$form->addElement('hidden', 'nb_answers');
$boxes_names = array();
/* V<EFBFBD>rification : Cr<EFBFBD>action d'au moins une r<EFBFBD>ponse */
if ($nb_answers < 1) {
$nb_answers = 1;
Display::display_normal_message(get_lang('YouHaveToCreateAtLeastOneAnswer'));
}
$form->addElement('label', get_lang('Answers') . '<br /> <img src="../img/fill_field.png">', $html);
//D<EFBFBD>but affichage score global dans la modification d'une question
$scoreA = "0"; //par reponse
$scoreG = "0"; //Global
/* Initialiation variable */
$defaults = array();
$correct = 0;
/* boucle pour sauvegarder les donn<EFBFBD>es dans le tableau defaults */
for ($i = 1; $i <= $nb_answers; ++$i) {
/* si la reponse est de type objet */
if (is_object($answer)) {
$defaults['answer[' . $i . ']'] = $answer->answer[$i];
$defaults['comment[' . $i . ']'] = $answer->comment[$i];
$defaults['correct[' . $i . ']'] = $answer->correct[$i];
/* Mise en variable du nombre de reponse */
if (!empty($this->id)) {
$answer = new Answer($this->id);
$answer->read();
if (count($answer->nbrAnswers) > 0 && !$form->isSubmitted()) {
$nb_answers = $answer->nbrAnswers;
}
//------------- D<EFBFBD>but
$scoreA = $answer->weighting[$i];
}
if ($scoreA > 0) {
$scoreG = $scoreG + $scoreA;
}
//------------- Fin
//------------- Debut si un des scores par reponse est egal <EFBFBD> 0 : la coche vaut 1 (coch<EFBFBD>)
if ($scoreA == 0)
$defaults['pts'] = 1;
else
$defaults['pts'] = 0;
#le nombre de r<EFBFBD>ponses est bien enregistr<EFBFBD> sous la forme int(nb)
$renderer = & $form->defaultRenderer();
/* Ajout mise en forme nb reponse */
$form->addElement('hidden', 'nb_answers');
$boxes_names = array();
$renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'correct['.$i.']');
$renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'counter['.$i.']');
$renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'answer['.$i.']');
$renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'comment['.$i.']');
//$renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'weighting['.$i.']');
/* V<EFBFBD>rification : Cr<EFBFBD>action d'au moins une r<EFBFBD>ponse */
if ($nb_answers < 1) {
$nb_answers = 1;
Display::display_normal_message(get_lang('YouHaveToCreateAtLeastOneAnswer'));
}
$answer_number = $form->addElement('text', 'counter[' . $i . ']', null, 'value="' . $i . '"');
$answer_number->freeze();
//D<EFBFBD>but affichage score global dans la modification d'une question
$scoreA = "0"; //par reponse
$scoreG = "0"; //Global
/* boucle pour sauvegarder les donn<EFBFBD>es dans le tableau defaults */
for ($i = 1; $i <= $nb_answers; ++$i) {
/* si la reponse est de type objet */
if (is_object($answer)) {
$defaults['answer[' . $i . ']'] = $answer->answer[$i];
$defaults['comment[' . $i . ']'] = $answer->comment[$i];
$defaults['correct[' . $i . ']'] = $answer->correct[$i];
//------------- D<EFBFBD>but
$scoreA = $answer->weighting[$i];
}
if ($scoreA > 0) {
$scoreG = $scoreG + $scoreA;
}
//------------- Fin
//------------- Debut si un des scores par reponse est egal <EFBFBD> 0 : la coche vaut 1 (coch<EFBFBD>)
if ($scoreA == 0)
$defaults['pts'] = 1;
else
$defaults['pts'] = 0;
$renderer = & $form->defaultRenderer();
$renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'correct['.$i.']');
$renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'counter['.$i.']');
$renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'answer['.$i.']');
$renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'comment['.$i.']');
//$renderer->setElementTemplate('<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>', 'weighting['.$i.']');
$answer_number = $form->addElement('text', 'counter[' . $i . ']', null, 'value="' . $i . '"');
$answer_number->freeze();
$form->addElement('checkbox', 'correct[' . $i . ']', null, null, 'class="checkbox"');
$boxes_names[] = 'correct[' . $i . ']';
$form->addElement('html_editor', 'answer[' . $i . ']', null, 'style="vertical-align:middle"', array('ToolbarSet' => 'TestProposedAnswer', 'Width' => '100%', 'Height' => '100'));
$form->addRule('answer[' . $i . ']', get_lang('ThisFieldIsRequired'), 'required');
// show comment when feedback is enable
if ($obj_ex->selectFeedbackType() != EXERCISE_FEEDBACK_TYPE_EXAM) {
$form->addElement('html_editor', 'comment[' . $i . ']', null, 'style="vertical-align:middle"', array('ToolbarSet' => 'TestProposedAnswer', 'Width' => '100%', 'Height' => '100'));
}
$form->addElement('html', '</tr>');
}
//--------- Mise en variable du score global lors d'une modification de la question/r<EFBFBD>ponse
$defaults['weighting[1]'] = (round($scoreG));
$form->addElement('html', '</div></div></table>');
//$form -> addElement ('html', '<br />');
$form->add_multiple_required_rule($boxes_names, get_lang('ChooseAtLeastOneCheckbox'), 'multiple_required');
//only 1 answer the all deal ...
$form->addElement('text', 'weighting[1]', get_lang('Score'));
global $pts;
//--------- Creation coche pour ne pas prendre en compte les n<EFBFBD>gatifs
$form->addElement('checkbox', 'pts', '', get_lang('NoNegativeScore'));
$form->addElement('html', '<br />');
// Affiche un message si le score n'est pas renseign<EFBFBD>
$form->addRule('weighting[1]', get_lang('ThisFieldIsRequired'), 'required');
$navigator_info = api_get_navigator();
global $text, $class;
//ie6 fix
if ($obj_ex->edit_exercise_in_lp == true) {
if ($navigator_info['name'] == 'Internet Explorer' && $navigator_info['version'] == '6') {
$form->addElement('submit', 'lessAnswers', get_lang('LessAnswer'), 'class="minus"');
$form->addElement('submit', 'moreAnswers', get_lang('PlusAnswer'), 'class="plus"');
$form->addElement('submit', 'submitQuestion', $text, 'class="' . $class . '"');
} else {
$form->addElement('style_submit_button', 'lessAnswers', get_lang('LessAnswer'), 'class="minus"');
$form->addElement('style_submit_button', 'moreAnswers', get_lang('PlusAnswer'), 'class="plus"');
$form->addElement('style_submit_button', 'submitQuestion', $text, 'class="' . $class . '"');
// setting the save button here and not in the question class.php
}
$form->addElement('checkbox', 'correct[' . $i . ']', null, null, 'class="checkbox"');
$boxes_names[] = 'correct[' . $i . ']';
$form->addElement('html_editor', 'answer[' . $i . ']', null, 'style="vertical-align:middle"', array('ToolbarSet' => 'TestProposedAnswer', 'Width' => '100%', 'Height' => '100'));
$form->addRule('answer[' . $i . ']', get_lang('ThisFieldIsRequired'), 'required');
// show comment when feedback is enable
if ($obj_ex->selectFeedbackType() != EXERCISE_FEEDBACK_TYPE_EXAM) {
$form->addElement('html_editor', 'comment[' . $i . ']', null, 'style="vertical-align:middle"', array('ToolbarSet' => 'TestProposedAnswer', 'Width' => '100%', 'Height' => '100'));
}
$renderer->setElementTemplate('{element}&nbsp;', 'lessAnswers');
$renderer->setElementTemplate('{element}&nbsp;', 'submitQuestion');
$renderer->setElementTemplate('{element}', 'moreAnswers');
$form->addElement('html', '</div></div>');
$form->addElement('html', '</tr>');
}
//--------- Mise en variable du score global lors d'une modification de la question/r<EFBFBD>ponse
$defaults['weighting[1]'] = (round($scoreG));
$defaults['correct'] = $correct;
$form->addElement('html', '</div></div></table>');
if (!empty($this->id)) {
$form->setDefaults($defaults);
//$form -> addElement ('html', '<br />');
$form->add_multiple_required_rule($boxes_names, get_lang('ChooseAtLeastOneCheckbox'), 'multiple_required');
//only 1 answer the all deal ...
$form->addElement('text', 'weighting[1]', get_lang('Score'));
global $pts;
//--------- Creation coche pour ne pas prendre en compte les n<EFBFBD>gatifs
$form->addElement('checkbox', 'pts', '', get_lang('NoNegativeScore'));
$form->addElement('html', '<br />');
// Affiche un message si le score n'est pas renseign<EFBFBD>
$form->addRule('weighting[1]', get_lang('ThisFieldIsRequired'), 'required');
$navigator_info = api_get_navigator();
global $text, $class;
//ie6 fix
if ($obj_ex->edit_exercise_in_lp == true) {
if ($navigator_info['name'] == 'Internet Explorer' && $navigator_info['version'] == '6') {
$form->addElement('submit', 'lessAnswers', get_lang('LessAnswer'), 'class="minus"');
$form->addElement('submit', 'moreAnswers', get_lang('PlusAnswer'), 'class="plus"');
$form->addElement('submit', 'submitQuestion', $text, 'class="' . $class . '"');
} else {
if ($this->isContent == 1) {
$form->setDefaults($defaults);
}
$form->addElement('style_submit_button', 'lessAnswers', get_lang('LessAnswer'), 'class="minus"');
$form->addElement('style_submit_button', 'moreAnswers', get_lang('PlusAnswer'), 'class="plus"');
$form->addElement('style_submit_button', 'submitQuestion', $text, 'class="' . $class . '"');
// setting the save button here and not in the question class.php
}
$form->setConstants(array('nb_answers' => $nb_answers));
}
$renderer->setElementTemplate('{element}&nbsp;', 'lessAnswers');
$renderer->setElementTemplate('{element}&nbsp;', 'submitQuestion');
$renderer->setElementTemplate('{element}', 'moreAnswers');
/**
* abstract function which creates the form to create / edit the answers of the question
* @param the formvalidator instance
* @param the answers number to display
*/
function processAnswersCreation($form) {
$questionWeighting = $nbrGoodAnswers = 0;
$objAnswer = new Answer($this->id);
$nb_answers = $form->getSubmitValue('nb_answers');
// Score total
$answer_score = trim($form->getSubmitValue('weighting[1]'));
// Reponses correctes
$nbr_corrects = 0;
for ($i = 1; $i <= $nb_answers; $i++) {
$goodAnswer = trim($form->getSubmitValue('correct[' . $i . ']'));
if ($goodAnswer) {
$nbr_corrects++;
}
}
// Set question weighting (score total)
$questionWeighting = $answer_score;
// Set score per answer
$nbr_corrects = $nbr_corrects == 0 ? 1 : $nbr_corrects;
$answer_score = $nbr_corrects == 0 ? 0 : $answer_score;
//echo('affiche1');var_dump($answer_score);echo('<br>');
$answer_score = ($answer_score / $nbr_corrects);
//echo('affiche2');var_dump($answer_score);echo('<br>');
//$answer_score <EFBFBD>quivaut <EFBFBD> la valeur d'une bonne r<EFBFBD>ponse
// cr<EFBFBD>ation variable pour r<EFBFBD>cuperer la valeur de la coche pour la prise en compte des n<EFBFBD>gatifs
$test = "";
$test = $form->getSubmitValue('pts');
for ($i = 1; $i <= $nb_answers; $i++) {
$answer = trim($form->getSubmitValue('answer[' . $i . ']'));
$comment = trim($form->getSubmitValue('comment[' . $i . ']'));
$goodAnswer = trim($form->getSubmitValue('correct[' . $i . ']'));
if ($goodAnswer) {
$weighting = abs($answer_score);
} else {
if ($test == 1) {
$weighting = 0;
}else
$weighting = -abs($answer_score);
}
$objAnswer->createAnswer($answer, $goodAnswer, $comment, $weighting, $i);
$form->addElement('html', '</div></div>');
$defaults['correct'] = $correct;
if (!empty($this->id)) {
$form->setDefaults($defaults);
} else {
if ($this->isContent == 1) {
$form->setDefaults($defaults);
}
// saves the answers into the data base
$objAnswer->save();
}
$form->setConstants(array('nb_answers' => $nb_answers));
}
// sets the total weighting of the question --> sert <EFBFBD> donner le score total pendant l'examen
$this->updateWeighting($questionWeighting);
$this->save();
/**
* abstract function which creates the form to create / edit the answers of the question
* @param the formvalidator instance
* @param the answers number to display
*/
function processAnswersCreation($form) {
$questionWeighting = $nbrGoodAnswers = 0;
$objAnswer = new Answer($this->id);
$nb_answers = $form->getSubmitValue('nb_answers');
// Score total
$answer_score = trim($form->getSubmitValue('weighting[1]'));
// Reponses correctes
$nbr_corrects = 0;
for ($i = 1; $i <= $nb_answers; $i++) {
$goodAnswer = trim($form->getSubmitValue('correct[' . $i . ']'));
if ($goodAnswer) {
$nbr_corrects++;
}
}
// Set question weighting (score total)
$questionWeighting = $answer_score;
function return_header($feedback_type = null, $counter = null, $score = null, $show_media = false) {
$header = parent::return_header($feedback_type, $counter, $score, $show_media);
$header .= '<table class="'.$this->question_table_class .'">
<tr>
<th>' . get_lang("Choice") . '</th>
<th>' . get_lang("ExpectedChoice") . '</th>
<th>' . get_lang("Answer") . '</th>';
if ($feedback_type != EXERCISE_FEEDBACK_TYPE_EXAM) {
$header .= '<th>' . get_lang("Comment") . '</th>';
// Set score per answer
$nbr_corrects = $nbr_corrects == 0 ? 1 : $nbr_corrects;
$answer_score = $nbr_corrects == 0 ? 0 : $answer_score;
$answer_score = ($answer_score / $nbr_corrects);
//$answer_score <EFBFBD>quivaut <EFBFBD> la valeur d'une bonne r<EFBFBD>ponse
// cr<EFBFBD>ation variable pour r<EFBFBD>cuperer la valeur de la coche pour la prise en compte des n<EFBFBD>gatifs
$test = "";
$test = $form->getSubmitValue('pts');
for ($i = 1; $i <= $nb_answers; $i++) {
$answer = trim($form->getSubmitValue('answer[' . $i . ']'));
$comment = trim($form->getSubmitValue('comment[' . $i . ']'));
$goodAnswer = trim($form->getSubmitValue('correct[' . $i . ']'));
if ($goodAnswer) {
$weighting = abs($answer_score);
} else {
$header .= '<th>&nbsp;</th>';
if ($test == 1) {
$weighting = 0;
}else
$weighting = -abs($answer_score);
}
$header .= '</tr>';
return $header;
$objAnswer->createAnswer($answer, $goodAnswer, $comment, $weighting, $i);
}
// saves the answers into the data base
$objAnswer->save();
// sets the total weighting of the question --> sert <EFBFBD> donner le score total pendant l'examen
$this->updateWeighting($questionWeighting);
$this->save();
}
function return_header($feedback_type = null, $counter = null, $score = null, $show_media = false) {
$header = parent::return_header($feedback_type, $counter, $score, $show_media);
$header .= '<table class="'.$this->question_table_class .'">
<tr>
<th>' . get_lang("Choice") . '</th>
<th>' . get_lang("ExpectedChoice") . '</th>
<th>' . get_lang("Answer") . '</th>';
if ($feedback_type != EXERCISE_FEEDBACK_TYPE_EXAM) {
$header .= '<th>' . get_lang("Comment") . '</th>';
} else {
$header .= '<th>&nbsp;</th>';
}
$header .= '</tr>';
return $header;
}
endif;
}

@ -653,12 +653,6 @@ class Category implements GradebookItem
$rescount = 0;
$ressum = 0;
$weightsum = 0;
/*$debug = false;
if ($stud_id == 11) {
$debug = true;
}
if ($debug) var_dump($links);*/
if (!empty($cats)) {
foreach ($cats as $cat) {
@ -691,7 +685,6 @@ class Category implements GradebookItem
if (!empty($links)) {
foreach ($links as $link) {
$linkres = $link->calc_score($stud_id);
//if ($debug) var_dump($linkres);
if (isset($linkres) && $link->get_weight() != 0) {
$linkweight = $link->get_weight();

@ -120,7 +120,6 @@ class LinkAddEditForm extends FormValidator
$cat = Category :: load($parent_cat[0]->get_parent_id());
//$global_weight = $cat[0]->get_weight();
//$values['weight'] = $link->get_weight()/$parent_cat[0]->get_weight()*$global_weight;
//var_dump($global_weight, $link->get_weight(), $parent_cat[0]->get_weight());
//$weight = $parent_cat[0]->get_weight()* $link->get_weight() / $global_weight;
//$values['weight'] = $weight;
$values['weight'] = $link->get_weight() ;

@ -421,7 +421,7 @@ class FlatViewDataGenerator
}
}
unset($score);
//var_dump($row);exit;
$data[] = $row;
}
return $data;

@ -764,7 +764,6 @@ function export_pdf_flatview($cat, $users, $alleval, $alllinks, $params = array(
if ($has_data) {
$counter = 1;
//var_dump($printable_data);exit;
foreach ($printable_data[1] as &$printable_data_row) {
$column = 0;
$table->setCellContents($row, $column, $counter);
@ -783,7 +782,6 @@ function export_pdf_flatview($cat, $users, $alleval, $alllinks, $params = array(
if ($key === 'total') {
$attributes['style'] = 'font-weight:bold';
}
//var_dump($key, $printable_data_cell, $attributes);
$table->setCellContents($row, $column, $printable_data_cell);
$table->updateCellAttributes($row, $column, $attributes);
$column++;

@ -93,7 +93,6 @@ if ($_REQUEST['_search'] == 'true') {
$where_condition .= ' AND '.$where_condition_in_form;
}
$filters = isset($_REQUEST['filters']) ? json_decode($_REQUEST['filters']) : false;
//var_dump($filters);
//for now
$extra_field = new ExtraField('session');
@ -132,7 +131,6 @@ if ($_REQUEST['_search'] == 'true') {
if (isset($double_select[$rule->field])) {
$data = explode('#', $rule->data);
//var_dump($data);
$rule->data = $data[1].'::'.$double_select[$rule->field];
} else {
// only was sent 1 select
@ -160,7 +158,6 @@ if ($_REQUEST['_search'] == 'true') {
if (!empty($condition_array)) {
$where_condition .= ' AND ( ';
//var_dump($condition_array);
$where_condition .= implode($filters->groupOp, $condition_array);
$where_condition .= ' ) ';

@ -10,7 +10,6 @@ $action = $_GET['a'];
switch ($action) {
case 'get_user_popup':
$user_info = api_get_user_info($_REQUEST['user_id']);
//var_dump($user_info);
echo '<div class="well">';
echo '<div class="row">';
echo '<div class="span2">';

@ -255,7 +255,6 @@ $app['translator'] = $app->share($app->extend('translator', function($translator
foreach ($filter as $entry) {
//$domain = $entry->getBasename('.inc.po');
$locale = api_get_language_isocode($language); //'es_ES';
//var_dump($locale);exit;
//$translator->addResource('pofile', $entry->getPathname(), $locale, $domain);
$translator->addResource('pofile', $entry->getPathname(), $locale, 'messages');
}
@ -857,7 +856,6 @@ $app->before(
$app->abort(500, "archive folder must be writeable");
}
//var_dump($_setting);
//$app['request']->getSession()->start();
}
);

@ -136,14 +136,6 @@ class Chat extends Model
}
//print_r($_SESSION['chatHistory']);
/*
var_dump($_SESSION['openChatBoxes']);
var_dump($_SESSION['tsChatBoxes']);
var_dump($_SESSION['chatHistory']);
var_dump($items);
*/
//print_r($_SESSION['chatHistory']);
$sql = "UPDATE ".$this->table." SET recd = 1 WHERE to_user = '".$to_user_id."' AND recd = 0";
Database::query($sql);

@ -167,7 +167,6 @@ class Database
{
//forces fatal errors so we can debug more easily
if (!empty($extra)) {
var_dump($extra);
//@todo remove this
echo "<h3>Dev Message: get_course_table() doesn't have a 2nd parameter</h3>";
//exit;

@ -1389,7 +1389,6 @@ class DocumentManager
}
if (isset($item_info_in_session['visibility'])) {
//if ($doc_id == 85) { var_dump($item_info_in_session);}
if ($item_info_in_session['visibility'] == 1) {
return true;
}
@ -2364,19 +2363,12 @@ class DocumentManager
$content_html = file_get_contents($destiny_path.'/'.$file_name);
$destination_file = $destiny_path.'/'.$file_name;
$pre_original = strstr($original_path, 'document');
$pre_destin = strstr($destiny_path, 'document');
//var_dump ("pre_original $pre_original");
//var_dump ("pre_destin $pre_destin");
$pre_original = substr($pre_original, 8, strlen($pre_original));
$pre_destin = substr($pre_destin, 8, strlen($pre_destin));
//var_dump ("pre_original $pre_original");
//var_dump ("pre_destin $pre_destin");
$levels = count(explode('/', $pre_destin)) - 1;
$link_to_add = '';
for ($i = 1; $i <= $levels; $i++) {
@ -2399,10 +2391,7 @@ class DocumentManager
$pre_destin = '..'.$pre_destin.'/';
}
//var_dump($pre_original);
$levels = explode('/', $pre_original);
//var_dump($levels);
$count_pre_destination_levels = 0;
foreach ($levels as $item) {

@ -238,7 +238,6 @@ class ExtraField extends Model {
*/
static function extra_field_double_select_convert_array_to_string($options) {
$string = null;
//var_dump($options);
$options_parsed = self::extra_field_double_select_convert_array_to_ordered_array($options);
if (!empty($options_parsed)) {

@ -1471,7 +1471,6 @@ function api_get_course_info_by_id($id = null, $add_extra_values = false) {
$_course = array();
if (Database::num_rows($result) > 0) {
$course_data = Database::fetch_array($result);
var_dump($course_data);
if ($add_extra_values) {
$extra_field_values = new ExtraField('course');
$course_data['extra_fields'] = $extra_field_values->get_handler_extra_data($course_data['code']);

@ -209,7 +209,6 @@ class Nanogong
$items[5] = $exe_id;
$filename = $filename = implode('-', $items);
$new_name = $this->store_path.$filename.'.'.$extension;
//var_dump($old_name, $new_name);
rename($old_name, $new_name);
break;
}

@ -248,12 +248,7 @@ class Online {
$valid_date_time->sub(new DateInterval($diff));*/
$users_online = array();
while(list($login_user_id, $login_date) = Database::fetch_row($result)) {
$users_online[] = $login_user_id;
/*$user_login_date = new DateTime($login_date);
var_dump($user_login_date->format('Y-m-d H:i:s'), $valid_date_time->format('Y-m-d H:i:s'));
if ($user_login_date->format('Y-m-d H:i:s') > $valid_date_time->format('Y-m-d H:i:s')) {
}*/
$users_online[] = $login_user_id;
}
return $users_online;
} else {

@ -364,7 +364,7 @@ class SessionManager {
}
//Cleaning double selects
//var_dump($session);
foreach ($session as $key => &$value) {
if (isset($options_by_double[$key]) || isset($options_by_double[$key.'_second'])) {
$options = explode('::', $value);
@ -520,7 +520,6 @@ class SessionManager {
$options_by_double['extra_'.$double['field_variable']] = $my_options;
}
//var_dump($options_by_double);
//sc.name as category_name,
$select = "
SELECT * FROM (
@ -627,7 +626,6 @@ class SessionManager {
}
//Cleaning double selects
//var_dump($session);
foreach ($session as $key => &$value) {
if (isset($options_by_double[$key]) || isset($options_by_double[$key.'_second'])) {
$options = explode('::', $value);

@ -213,7 +213,7 @@ class SkillRelGradebook extends Model {
$gradebooks_to_add[] = $gradebook_id;
}
}
//var_dump($gradebooks_to_add, $gradebooks_to_remove);
if (!empty($gradebooks_to_remove)) {
foreach($gradebooks_to_remove as $id) {
$this->delete($id);
@ -607,8 +607,6 @@ class Skill extends Model {
$original_skill = $skills;
//var_dump($skills);
//Show 1 item
if (!empty($skill_id)) {
if ($add_root) {
@ -677,8 +675,6 @@ class Skill extends Model {
$refs[$skill['id']] = &$skill;
$flat_array[$skill['id']] = &$skill;
}
//var_dump($skills);
//var_dump($refs);
//Checking family value

@ -559,9 +559,6 @@ class Thematic
$session_star = '';
$return = '<div id="thematic_plan_'.$thematic_id.'">';
//var_dump($thematic_simple_list);
//var_dump($new_thematic_plan_data);
if (!empty($thematic_plan_data)) {
foreach ($thematic_plan_data as $plan_data) {

@ -983,8 +983,7 @@ class Tracking
}
$lp_with_quiz = 0;
if ($debug)
var_dump($lp_list);
foreach ($lp_list as $lp_id) {
//Check if LP have a score we asume that all SCO have an score
$sql = "SELECT count(id) as count FROM $lp_item_table

@ -63,7 +63,7 @@ if ($is_allowed_to_edit) {
$interbreadcrumb[] = array('url' => 'lp_controller.php?action=list&isStudentView=false', 'name' => get_lang('LearningPaths'));
$interbreadcrumb[] = array('url' => api_get_self()."?action=add_item&type=step&lp_id=".$_SESSION['oLP']->lp_id."&isStudentView=false", 'name' => $_SESSION['oLP']->get_name());
$interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Preview'));
echo return_breadcrumb($interbreadcrumb, null, null);
echo $app['template']->returnBreadcrumb($interbreadcrumb, null, null);
echo '</div>';
}
$html = '';
@ -83,8 +83,8 @@ foreach ($list as $toc) {
}
//Setting the template
$tpl = new Template($tool_name, false, false, true);
$tpl->assign('html', $html);
$content = $tpl->fetch('default/learnpath/impress.tpl');
$tpl->assign('content', $content);
$tpl->display_one_col_template();
//$tpl = new Template($tool_name, false, false, true);
$app['template']->assign('html', $html);
$content = $app['template']->fetch('default/learnpath/impress.tpl');
$app['template']->assign('content', $content);
$app['template']->display_one_col_template();

@ -353,7 +353,7 @@ if ($is_allowed_to_edit) {
$interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Preview'));
//$interbreadcrumb[] = array('type' => 'right', 'url' => api_get_self()."?action=add_item&type=step&lp_id=".$_SESSION['oLP']->lp_id."&isStudentView=false", 'name' => get_lang('Edit'), 'class' => 'btn btn-mini btn-warning');
echo $app['template']->return_breadcrumb($interbreadcrumb, null, null);
echo $app['template']->returnBreadcrumb($interbreadcrumb, null, null);
echo '</div>';
}
echo '<div id="learning_path_left_zone" style="'.$display_none.'"> ';

@ -148,7 +148,6 @@ foreach ($course_list as $current_course ) {
$main_result[$current_course['code']] = $attempt_result;
}
//var_dump($main_result);
$total_average_score = 0;
$total_average_score_count = 0;
if (!empty($users) && is_array($users)) {

@ -248,34 +248,10 @@ if(!empty($course_list) && is_array($course_list)) {
}
$i++;
/*echo " <td align='right'>
";
echo $current_student_id.' ';
echo " </td>";
*/
//var_dump($pourcentageScore);
/* echo " <td align='right'>
";
echo $pourcentageScore.' %';
echo " </td>";
echo "<td align='right'>
";
/*
echo $a_essais['essais'];
echo " </td>
<td align='center'>
";*/
if ($a_essais['essais'] > 0 ) {
$taken++;
}
/*if ($pourcentageScore >= $parameter_porcentage) {
$total_with_parameter_porcentage++;
}*/
if ($pourcentageScore >= $filter_score) {
$total_with_parameter_score++;
}

@ -86,7 +86,7 @@ if (empty($course_code)) {
$form->setDefaults(array('course_code'=>(string)$course_code));
$course_info = api_get_course_info($course_code);
//var_dump($session_id);
if (!empty($course_info)) {
$list = new learnpathList('', $course_code);
$lp_list = $list->get_flat_list();
@ -94,39 +94,31 @@ if (!empty($course_info)) {
$main_question_list = array();
foreach ($lp_list as $lp_id =>$lp) {
$exercise_list = get_all_exercises_from_lp($lp_id, $course_info['real_id']);
//var_dump($exercise_list);
foreach ($exercise_list as $exercise) {
$my_exercise = new Exercise();
//$my_exercise->read($exercise['ref']);
$my_exercise->read($exercise['path']);
$question_list = $my_exercise->selectQuestionList();
$exercise_stats = get_all_exercise_event_from_lp($exercise['path'],$course_info['id'], $session_id);
//echo '<pre>'; print_r($exercise_stats);
foreach($question_list as $question_id) {
foreach ($question_list as $question_id) {
$question_data = Question::read($question_id);
///var_dump($question_data);
$main_question_list[$question_id] = $question_data;
$quantity_exercises = 0;
$question_result = 0;
//echo '<pre>';
//print_r($exercise_stats);
foreach($exercise_stats as $stats) {
if (!empty($stats['question_list'])) {
foreach($stats['question_list'] as $my_question_stat) {
// var_dump($my_question_stat);
if ($question_id == $my_question_stat['question_id']) {
//var_dump($my_question_stat);
$question_result = $question_result + $my_question_stat['marks'];
// var_dump($my_question_stat['marks']);
$quantity_exercises++;
}
}
}
}
//echo $question_id;
//var_dump($question_result.' - '.$quantity_exercises.$main_question_list[$question_id]->weighting);
if(!empty($quantity_exercises)) {
$main_question_list[$question_id]->results =(($question_result / ($quantity_exercises)) ) ; // Score % average
} else {
@ -139,11 +131,6 @@ if (!empty($course_info)) {
}
}
//var_dump($main_question_list);
//var_dump($main_question_list);
//$course_list = SessionManager::get_course_list_by_session_id($session_id);
if (!$export_to_xls) {
Display :: display_header(get_lang("MySpace"));

@ -654,7 +654,6 @@ switch ($action) {
parent_id = '".$work_id."' ,
session_id = '".intval($id_session)."' ,
user_id = '".$user_id."'";
//var_dump($sql_add_publication);exit;
Database::query($sql_add_publication);
$id = Database::insert_id();
}

@ -307,7 +307,6 @@ class bbb {
}
}
}
//var_dump($record_array);
$item['show_links'] = implode('<br />', $record_array);
}

Loading…
Cancel
Save