|
|
|
@ -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 |
|
|
|
|