Format code, remove unused calls

remotes/angel/1.11.x
Julio 9 years ago
parent e0d5796483
commit 9db0b97215
  1. 4
      main/auth/openid/login.php
  2. 9
      main/exercice/exercise_history.php
  3. 28
      main/exercice/fill_blanks.class.php
  4. 14
      main/tracking/userLog.php

@ -10,10 +10,6 @@
* good way of avoiding password theft)
* @package chamilo.auth.openid
*/
/**
* Initialisation
*/
require_once api_get_path(CONFIGURATION_PATH) . 'auth.conf.php';
require_once 'openid.lib.php';
require_once 'xrds.lib.php';

@ -1,5 +1,6 @@
<?php
/* For licensing terms, see /license.txt */
/**
* Exercise list: This script shows the list of exercises for administrators and students.
* @package chamilo.exercise
@ -7,15 +8,13 @@
* @author Denes Nagy, HotPotatoes integration
* @author Wolfgang Schneider, code/html cleanup
*/
/**
* Code
*/
require_once '../inc/global.inc.php';
$this_section=SECTION_COURSES;
api_protect_course_script(true);
// moved down to fix bug: http://www.dokeos.com/forum/viewtopic.php?p=18609#18609
$show = (isset($_GET['show']) && $_GET['show'] == 'result') ? 'result' : 'test';
$show = (isset($_GET['show']) && $_GET['show'] == 'result') ? 'result' : 'test';
/* Constants and variables */
$is_allowedToEdit = api_is_allowed_to_edit(null,true);
@ -65,7 +64,7 @@ $sql = "SELECT *, quiz_question.question, firstname, lastname FROM $TBL_TRACK_AT
$query = Database::query($sql);
while($row = Database::fetch_array($query)){
echo '<tr';
if ($i%2==0) {
if ($i % 2 == 0) {
echo 'class="row_odd"';
} else {
echo 'class="row_even"';

@ -148,7 +148,6 @@ class FillBlanks extends Question
';
if (isset($listAnswersInfo) && count($listAnswersInfo["tabweighting"]) > 0) {
foreach ($listAnswersInfo["tabweighting"] as $i => $weighting) {
echo 'document.getElementById("weighting['.$i.']").value = "'.$weighting.'";';
}
@ -309,7 +308,6 @@ class FillBlanks extends Question
$answer = api_preg_replace("/\xc2\xa0/", " ", $answer);
// start and end separator
$blankStartSeparator = self::getStartSeparator($form->getSubmitValue('select_separator'));
$blankEndSeparator = self::getEndSeparator($form->getSubmitValue('select_separator'));
$blankStartSeparatorRegexp = self::escapeForRegexp($blankStartSeparator);
@ -456,9 +454,9 @@ class FillBlanks extends Question
$inTeacherSolution = $inTabTeacherSolution[$inBlankNumber];
switch (self::getFillTheBlankAnswerType($inTeacherSolution)) {
case self::FILL_THE_BLANK_MENU:
$selected = "";
$selected = '';
// the blank menu
$optionMenu = "";
$optionMenu = '';
// display a menu from answer separated with |
// if display for student, shuffle the correct answer menu
$listMenu = self::getFillTheBlankMenuAnswers($inTeacherSolution, $displayForStudent);
@ -751,13 +749,18 @@ class FillBlanks extends Question
* )
* )
*/
public static function getFillTheBlankTabResult($testId, $questionId, $studentsIdList, $startDate, $endDate, $useLastAnswerredAttempt = true) {
public static function getFillTheBlankTabResult(
$testId,
$questionId,
$studentsIdList,
$startDate,
$endDate,
$useLastAnswerredAttempt = true
) {
$tblTrackEAttempt = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ATTEMPT);
$tblTrackEExercise = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
$courseId = api_get_course_int_id();
require_once api_get_path(SYS_PATH).'main/exercice/fill_blanks.class.php';
// request to have all the answers of student for this question
// student may have doing it several time
@ -766,7 +769,6 @@ class FillBlanks extends Question
// we got the less recent attempt first
$sql = '
SELECT * FROM '.$tblTrackEAttempt.' tea
LEFT JOIN '.$tblTrackEExercise.' tee
ON tee.exe_id = tea.exe_id
AND tea.c_id = '.$courseId.'
@ -797,7 +799,10 @@ class FillBlanks extends Question
// get the indice of the choosen answer in the menu
// we know that the right answer is the first entry of the menu, ie 0
// (remember, menu entries are shuffled when taking the test)
$tabUserResult[$data['user_id']][$bracketNumber] = FillBlanks::getFillTheBlankMenuAnswerNum($tabAnswer['tabwords'][$bracketNumber], $tabAnswer['studentanswer'][$bracketNumber]);
$tabUserResult[$data['user_id']][$bracketNumber] = FillBlanks::getFillTheBlankMenuAnswerNum(
$tabAnswer['tabwords'][$bracketNumber],
$tabAnswer['studentanswer'][$bracketNumber]
);
break;
default :
if (FillBlanks::isGoodStudentAnswer($tabAnswer['studentanswer'][$bracketNumber], $tabAnswer['tabwords'][$bracketNumber])) {
@ -819,14 +824,11 @@ class FillBlanks extends Question
}
}
}
}
return $tabUserResult;
}
/**
* Return the number of student that give at leat an answer in the fill the blank test
* @param $resultList

@ -28,15 +28,11 @@ $is_allowed = true;
require_once api_get_path(SYS_CODE_PATH).'resourcelinker/resourcelinker.inc.php';
require_once api_get_path(SYS_CODE_PATH).'exercice/hotpotatoes.lib.php';
/* Header */
/*
$interbreadcrumb[]= array ("url"=>"../group/group.php", "name"=> get_lang('BredCrumpGroups'));
$interbreadcrumb[]= array ("url"=>"../group/group_space.php?gidReq=$_gid", "name"=> get_lang('BredCrumpGroupSpace'));
*/
if(isset($uInfo)) {
$interbreadcrumb[]= array ('url'=>'../user/userInfo.php?uInfo='.Security::remove_XSS($uInfo), "name"=> api_ucfirst(get_lang('Users')));
if (isset($uInfo)) {
$interbreadcrumb[]= array(
'url'=>'../user/userInfo.php?uInfo='.Security::remove_XSS($uInfo),
"name"=> api_ucfirst(get_lang('Users'))
);
}
$nameTools = get_lang('ToolName');

Loading…
Cancel
Save