Minor - format code

pull/2487/head
jmontoyaa 9 years ago
parent 32110808f9
commit 516c5ec619
  1. 2
      main/exercise/TestCategory.php
  2. 2
      main/exercise/answer.class.php
  3. 4
      main/exercise/fill_blanks.class.php
  4. 4
      main/exercise/multiple_answer.class.php
  5. 7
      main/exercise/question_admin.inc.php
  6. 3
      main/exercise/unique_answer.class.php
  7. 3
      main/inc/ajax/exercise.ajax.php
  8. 6
      main/inc/lib/exercise.lib.php

@ -667,7 +667,7 @@ class TestCategory
*/
public static function getCatScoreForExeidForUserid($in_cat_id, $in_exe_id, $in_user_id)
{
$tbl_track_attempt = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_ATTEMPT);
$tbl_track_attempt = Database::get_statistic_table(TABLE_STATISTIC_TRACK_E_ATTEMPT);
$tbl_question_rel_category = Database::get_course_table(TABLE_QUIZ_QUESTION_REL_CATEGORY);
$in_cat_id = intval($in_cat_id);
$in_exe_id = intval($in_exe_id);

@ -662,7 +662,6 @@ class Answer
)) {
$answer = new Answer($this->questionId);
$answer->read();
$correctAnswerId = $answer->selectAnswerIdByPosition($correct);
// Continue to avoid matching question bug if $correctAnswerId returns false
@ -672,7 +671,6 @@ class Answer
}
$correctAnswerAutoId = $answer->selectAutoId($correct);
$quizAnswer->setCorrect($correctAnswerAutoId ? $correctAnswerAutoId : 0);
$em->merge($quizAnswer);

@ -762,9 +762,7 @@ class FillBlanks extends Question
$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();
// request to have all the answers of student for this question
// request to have all the answers of student for this question
// student may have doing it several time
// student may have not answered the bracket id, in this case, is result of the answer is empty

@ -23,8 +23,8 @@ class MultipleAnswer extends Question
public function __construct()
{
parent::__construct();
$this -> type = MULTIPLE_ANSWER;
$this -> isContent = $this-> getIsContent();
$this->type = MULTIPLE_ANSWER;
$this->isContent = $this->getIsContent();
}
/**

@ -20,7 +20,7 @@ if (isset($_GET['editQuestion'])) {
if (is_object($objQuestion)) {
// FORM CREATION
$form = new FormValidator('question_admin_form','post', $action);
$form = new FormValidator('question_admin_form', 'post', $action);
if (isset($_GET['editQuestion'])) {
$class = "btn btn-default";
$text = get_lang('ModifyQuestion');
@ -50,7 +50,6 @@ if (is_object($objQuestion)) {
// FORM VALIDATION
if (isset($_POST['submitQuestion']) && $form->validate()) {
// question
$objQuestion->processCreation($form, $objExercise);
@ -62,10 +61,10 @@ if (is_object($objQuestion)) {
// redirect
if ($objQuestion->type != HOT_SPOT && $objQuestion->type != HOT_SPOT_DELINEATION) {
if(isset($_GET['editQuestion'])) {
if (isset($_GET['editQuestion'])) {
echo '<script type="text/javascript">window.location.href="admin.php?exerciseId='.$exerciseId.'&'.api_get_cidreq().'&message=ItemUpdated"</script>';
} else {
//New question
// New question
echo '<script type="text/javascript">window.location.href="admin.php?exerciseId='.$exerciseId.'&'.api_get_cidreq().'&message=ItemAdded"</script>';
}
} else {

@ -310,7 +310,6 @@ class UniqueAnswer extends Question
$answer = trim($form->getSubmitValue('answer[' . $i . ']'));
$comment = trim($form->getSubmitValue('comment[' . $i . ']'));
$weighting = trim($form->getSubmitValue('weighting[' . $i . ']'));
$scenario = $form->getSubmitValue('scenario');
//$list_destination = $form -> getSubmitValue('destination'.$i);
@ -340,7 +339,7 @@ class UniqueAnswer extends Question
$destination_str.=$destination_id.';';
}*/
$goodAnswer = ($correct == $i) ? true : false;
$goodAnswer = $correct == $i ? true : false;
if ($goodAnswer) {
$nbrGoodAnswers++;

@ -229,7 +229,6 @@ switch ($action) {
// Use have permissions?
if (api_is_allowed_to_session_edit()) {
// "all" or "simple" strings means that there's one or all questions exercise type
$type = isset($_REQUEST['type']) ? $_REQUEST['type'] : null;
@ -407,7 +406,7 @@ switch ($action) {
$session_id,
$my_question_id
);
if ($objQuestionTmp->type == HOT_SPOT) {
if ($objQuestionTmp->type == HOT_SPOT) {
Event::delete_attempt_hotspot(
$exe_id,
api_get_user_id(),

@ -633,11 +633,9 @@ class ExerciseLib
*/
if ($origin !== null) {
global $exe_id;
$trackAttempts = Database::get_main_table(
TABLE_STATISTIC_TRACK_E_ATTEMPT
);
$trackAttempts = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ATTEMPT);
$sql = 'SELECT answer FROM ' . $trackAttempts . '
WHERE exe_id=' . $exe_id . ' AND question_id=' . $questionId;
WHERE exe_id=' . $exe_id . ' AND question_id=' . $questionId;
$rsLastAttempt = Database::query($sql);
$rowLastAttempt = Database::fetch_array($rsLastAttempt);
$answer = $rowLastAttempt['answer'];

Loading…
Cancel
Save