Minor - flint fixes

pull/2926/head
Julio 7 years ago
parent 920ac9d5ef
commit 68e6bf661c
  1. 2
      main/exercise/MatchingDraggable.php
  2. 4
      main/exercise/exercise.class.php
  3. 2
      main/exercise/global_multiple_answer.class.php
  4. 2
      main/exercise/matching.class.php
  5. 2
      main/exercise/multiple_answer.class.php
  6. 2
      main/exercise/multiple_answer_combination.class.php
  7. 2
      main/exercise/multiple_answer_true_false.class.php
  8. 8
      main/exercise/question.class.php
  9. 2
      main/exercise/unique_answer.class.php
  10. 2
      main/exercise/unique_answer_no_option.class.php
  11. 60
      main/gradebook/lib/be/category.class.php
  12. 3
      main/inc/lib/exercise.lib.php
  13. 8
      main/inc/lib/exercise_show_functions.lib.php

@ -267,7 +267,7 @@ class MatchingDraggable extends Question
$header .= '<th>'.get_lang('ElementList').'</th>';
if (!in_array($exercise->results_disabled, [
RESULT_DISABLE_SHOW_ONLY_IN_CORRECT_ANSWER_AND_RANKING,
RESULT_DISABLE_SHOW_ONLY_IN_CORRECT_ANSWER
RESULT_DISABLE_SHOW_ONLY_IN_CORRECT_ANSWER,
])
) {
$header .= '<th>'.get_lang('YourChoice').'</th>';

@ -4324,7 +4324,7 @@ class Exercise
echo '<tr>';
if (!in_array($this->results_disabled, [
RESULT_DISABLE_SHOW_ONLY_IN_CORRECT_ANSWER_AND_RANKING,
RESULT_DISABLE_SHOW_ONLY_IN_CORRECT_ANSWER
RESULT_DISABLE_SHOW_ONLY_IN_CORRECT_ANSWER,
])
) {
echo '<td>'.$s_answer_label.'</td>';
@ -4371,7 +4371,7 @@ class Exercise
if ($this->showExpectedChoice()) {
if (!in_array($this->results_disabled, [
RESULT_DISABLE_SHOW_ONLY_IN_CORRECT_ANSWER_AND_RANKING,
RESULT_DISABLE_SHOW_ONLY_IN_CORRECT_ANSWER
RESULT_DISABLE_SHOW_ONLY_IN_CORRECT_ANSWER,
])
) {
echo '<td>'.$user_answer.'</td>';

@ -271,7 +271,7 @@ class GlobalMultipleAnswer extends Question
if (!in_array($exercise->results_disabled, [
RESULT_DISABLE_SHOW_ONLY_IN_CORRECT_ANSWER_AND_RANKING,
RESULT_DISABLE_SHOW_ONLY_IN_CORRECT_ANSWER
RESULT_DISABLE_SHOW_ONLY_IN_CORRECT_ANSWER,
])
) {
$header .= '<th>'.get_lang('Choice').'</th>';

@ -289,7 +289,7 @@ class Matching extends Question
$header .= '<th>'.get_lang('ElementList').'</th>';
if (!in_array($exercise->results_disabled, [
RESULT_DISABLE_SHOW_ONLY_IN_CORRECT_ANSWER_AND_RANKING,
RESULT_DISABLE_SHOW_ONLY_IN_CORRECT_ANSWER
RESULT_DISABLE_SHOW_ONLY_IN_CORRECT_ANSWER,
])
) {
$header .= '<th>'.get_lang('Choice').'</th>';

@ -237,7 +237,7 @@ class MultipleAnswer extends Question
$header .= '<th>'.get_lang('Choice').'</th>';
if (!in_array($exercise->results_disabled, [
RESULT_DISABLE_SHOW_ONLY_IN_CORRECT_ANSWER_AND_RANKING,
RESULT_DISABLE_SHOW_ONLY_IN_CORRECT_ANSWER
RESULT_DISABLE_SHOW_ONLY_IN_CORRECT_ANSWER,
])
) {
$header .= '<th>'.get_lang('ExpectedChoice').'</th>';

@ -234,7 +234,7 @@ class MultipleAnswerCombination extends Question
if (!in_array($exercise->results_disabled, [
RESULT_DISABLE_SHOW_ONLY_IN_CORRECT_ANSWER_AND_RANKING,
RESULT_DISABLE_SHOW_ONLY_IN_CORRECT_ANSWER
RESULT_DISABLE_SHOW_ONLY_IN_CORRECT_ANSWER,
])
) {
$header .= '<th>'.get_lang('Choice').'</th>';

@ -315,7 +315,7 @@ class MultipleAnswerTrueFalse extends Question
if (!in_array($exercise->results_disabled, [
RESULT_DISABLE_SHOW_ONLY_IN_CORRECT_ANSWER_AND_RANKING,
RESULT_DISABLE_SHOW_ONLY_IN_CORRECT_ANSWER
RESULT_DISABLE_SHOW_ONLY_IN_CORRECT_ANSWER,
])
) {
$header .= '<th>'.get_lang('Choice').'</th>';

@ -1996,7 +1996,7 @@ abstract class Question
if (in_array($exercise->results_disabled, [
RESULT_DISABLE_SHOW_ONLY_IN_CORRECT_ANSWER_AND_RANKING,
RESULT_DISABLE_SHOW_ONLY_IN_CORRECT_ANSWER
RESULT_DISABLE_SHOW_ONLY_IN_CORRECT_ANSWER,
])
) {
$scoreLabel = get_lang('QuizWrongAnswerHereIsTheCorrectOne');
@ -2008,7 +2008,7 @@ abstract class Question
if (in_array($exercise->results_disabled, [
RESULT_DISABLE_SHOW_ONLY_IN_CORRECT_ANSWER_AND_RANKING,
RESULT_DISABLE_SHOW_ONLY_IN_CORRECT_ANSWER
RESULT_DISABLE_SHOW_ONLY_IN_CORRECT_ANSWER,
])
) {
$scoreLabel = get_lang('CorrectAnswer');
@ -2046,7 +2046,7 @@ abstract class Question
case UNIQUE_ANSWER:
if (in_array($exercise->results_disabled, [
RESULT_DISABLE_SHOW_ONLY_IN_CORRECT_ANSWER_AND_RANKING,
RESULT_DISABLE_SHOW_ONLY_IN_CORRECT_ANSWER
RESULT_DISABLE_SHOW_ONLY_IN_CORRECT_ANSWER,
])
) {
if (isset($score['user_answered'])) {
@ -2080,7 +2080,7 @@ abstract class Question
if (isset($score['result'])) {
if (in_array($exercise->results_disabled, [
RESULT_DISABLE_SHOW_ONLY_IN_CORRECT_ANSWER_AND_RANKING,
RESULT_DISABLE_SHOW_ONLY_IN_CORRECT_ANSWER
RESULT_DISABLE_SHOW_ONLY_IN_CORRECT_ANSWER,
])
) {
$score['result'] = null;

@ -419,7 +419,7 @@ class UniqueAnswer extends Question
$header .= '<th>'.get_lang('Choice').'</th>';
if (!in_array($exercise->results_disabled, [
RESULT_DISABLE_SHOW_ONLY_IN_CORRECT_ANSWER_AND_RANKING,
RESULT_DISABLE_SHOW_ONLY_IN_CORRECT_ANSWER
RESULT_DISABLE_SHOW_ONLY_IN_CORRECT_ANSWER,
])
) {
$header .= '<th>'.get_lang('ExpectedChoice').'</th>';

@ -406,7 +406,7 @@ class UniqueAnswerNoOption extends Question
if (!in_array($exercise->results_disabled, [
RESULT_DISABLE_SHOW_ONLY_IN_CORRECT_ANSWER_AND_RANKING,
RESULT_DISABLE_SHOW_ONLY_IN_CORRECT_ANSWER
RESULT_DISABLE_SHOW_ONLY_IN_CORRECT_ANSWER,
])
) {
$header .= '<th>'.get_lang('Choice').'</th>';

@ -2539,6 +2539,36 @@ class Category implements GradebookItem
return $this;
}
/**
* Return HTML code with links to download and view certificate.
*
* @param array $certificate
*
* @return string
*/
public static function getDownloadCertificateBlock(array $certificate)
{
if (!isset($certificate['pdf_url'])) {
return '';
}
$downloadLink = Display::toolbarButton(
get_lang('DownloadCertificatePdf'),
$certificate['pdf_url'],
'file-pdf-o'
);
$viewLink = $certificate['certificate_link'];
return "
<div class='panel panel-default'>
<div class='panel-body'>
<h3 class='text-center'>".get_lang('NowDownloadYourCertificateClickHere')."</h3>
<div class='text-center'>$downloadLink $viewLink</div>
</div>
</div>
";
}
/**
* @return Category
*/
@ -2744,34 +2774,4 @@ class Category implements GradebookItem
return api_float_val($categoryScore);
}
/**
* Return HTML code with links to download and view certificate.
*
* @param array $certificate
*
* @return string
*/
public static function getDownloadCertificateBlock(array $certificate)
{
if (!isset($certificate['pdf_url'])) {
return '';
}
$downloadLink = Display::toolbarButton(
get_lang('DownloadCertificatePdf'),
$certificate['pdf_url'],
'file-pdf-o'
);
$viewLink = $certificate['certificate_link'];
return "
<div class='panel panel-default'>
<div class='panel-body'>
<h3 class='text-center'>".get_lang('NowDownloadYourCertificateClickHere')."</h3>
<div class='text-center'>$downloadLink $viewLink</div>
</div>
</div>
";
}
}

@ -5429,8 +5429,7 @@ EOT;
$studentId,
$courseCode,
$sessionId = 0
)
{
) {
if (!api_get_configuration_value('quiz_generate_certificate_ending') ||
!self::isSuccessExerciseResult($totalScore, $totalWeight, $objExercise->selectPassPercentage())
) {

@ -262,7 +262,7 @@ class ExerciseShowFunctions
} else {
if (in_array($resultsDisabled, [
RESULT_DISABLE_SHOW_ONLY_IN_CORRECT_ANSWER_AND_RANKING,
RESULT_DISABLE_SHOW_ONLY_IN_CORRECT_ANSWER
RESULT_DISABLE_SHOW_ONLY_IN_CORRECT_ANSWER,
])
) {
return '';
@ -378,7 +378,7 @@ class ExerciseShowFunctions
$studentChoiceClass = '';
if (in_array($resultsDisabled, [
RESULT_DISABLE_SHOW_ONLY_IN_CORRECT_ANSWER_AND_RANKING,
RESULT_DISABLE_SHOW_ONLY_IN_CORRECT_ANSWER
RESULT_DISABLE_SHOW_ONLY_IN_CORRECT_ANSWER,
])
) {
if ($answerCorrect) {
@ -529,7 +529,7 @@ class ExerciseShowFunctions
$color = 'black';
if (isset($new_options[$studentChoice]) || in_array($exercise->results_disabled, [
RESULT_DISABLE_SHOW_ONLY_IN_CORRECT_ANSWER_AND_RANKING,
RESULT_DISABLE_SHOW_ONLY_IN_CORRECT_ANSWER
RESULT_DISABLE_SHOW_ONLY_IN_CORRECT_ANSWER,
])
) {
if ($studentChoice == $answerCorrect) {
@ -731,7 +731,7 @@ class ExerciseShowFunctions
//@todo replace this harcoded value
if ($studentChoice || in_array($resultsDisabled, [
RESULT_DISABLE_SHOW_ONLY_IN_CORRECT_ANSWER_AND_RANKING,
RESULT_DISABLE_SHOW_ONLY_IN_CORRECT_ANSWER
RESULT_DISABLE_SHOW_ONLY_IN_CORRECT_ANSWER,
])
) {
$color = 'black';

Loading…
Cancel
Save