pull/3680/head
Yannick Warnier 5 years ago
commit bcdd3688a9
  1. 1
      main/exercise/admin.php
  2. 59
      main/inc/lib/exercise.lib.php
  3. 10
      main/lang/english/trad4all.inc.php

@ -422,6 +422,7 @@ if ($newQuestion || $editQuestion) {
echo '</div>';
} else {
require 'question_admin.inc.php';
ExerciseLib::showExtraInfoWhereQuestionUsed($objQuestion->iid);
}
}
}

@ -1647,6 +1647,65 @@ HOTSPOT;
return $nbrAnswers;
}
public static function showExtraInfoWhereQuestionUsed($exerciseId)
{
$sql = "SELECT q.title quiz_title,
c.title course_title,
s.name session_name,
q.iid as quiz_id,
q.c_id,
q.session_id
FROM c_quiz q,
c_quiz_rel_question qq,
course c,
session s
WHERE q.c_id = c.id AND
(q.session_id = s.id OR q.session_id = 0) AND
qq.exercice_id = q.iid AND
qq.question_id = $exerciseId
GROUP BY qq.iid";
$result = [];
$html = "";
$sqlResult = Database::query($sql);
if (Database::num_rows($sqlResult) >= 2) {
while ($row = Database::fetch_array($sqlResult, 'ASSOC')) {
$tmp = [];
$tmp[0] = $row['course_title'];
$tmp[1] = $row['session_name'];
$tmp[2] = $row['quiz_title'];
$urlToQuiz = api_get_path(WEB_CODE_PATH).'exercise/admin.php?'.api_get_cidreq().'&exerciseId='.$row['quiz_id'];
$tmp[3] = Display::url('Link to the questions list of that test', $urlToQuiz);
if ((int) $row['session_id'] == 0) {
$tmp[1] = '-';
}
$result[] = $tmp;
}
$headers = [
get_lang('Course'),
get_lang('Session'),
get_lang('Quiz'),
get_lang('LinkToTheQuestionListOfThatTest')
];
$title = Display::div(
get_lang('QuestionUsedInTheFollowingTests'),
[
'class' => 'section-title',
'style' => 'margin-top: 25px; border-bottom: none'
]
);
$html = $title . Display::table($headers, $result);
}
echo $html;
}
/**
* @param int $exeId
*

@ -5832,7 +5832,7 @@ $Item = "Item";
$ConfigureDashboardPlugin = "Configure Dashboard Plugin";
$EditBlocks = "Edit blocks";
$Never = "Never";
$YourAccountIsActiveYouCanLoginAndCheckYourCourses = "Dear user,
$YourAccountIsActiveYouCanLoginAndCheckYourCourses = "Dear user,
Your account has now been activated on the platform. Please login and enjoy your courses.";
$SessionFields = "Session fields";
@ -8006,11 +8006,11 @@ $SpecificDate = "Specific dispatch date";
$BaseDate = "Dispatch based on the session's start/end dates";
$AfterOrBefore = "After or before";
$Before = "Before";
$ScheduleAnnouncementDescription = "This form allows scheduling announcements to be sent automatically to the students who are taking a course in a session.
$ScheduleAnnouncementDescription = "This form allows scheduling announcements to be sent automatically to the students who are taking a course in a session.
There are two types of announcements that can be sent:
There are two types of announcements that can be sent:
Specific date: In this case a specific day is selected to make the announcement.
Specific date: In this case a specific day is selected to make the announcement.
Based on the start / end date of the session: in this case the number of days to pass before sending the announcement must be indicated. And those days can be associated to before or after the start / end date. For example: 3 days after the start date.";
$MandatorySurveyNoAnswered = "A mandatory survey is waiting your answer. To enter the course, you must first complete the survey.";
@ -8710,4 +8710,4 @@ $PriceUpdated = "Price updated";
$RemoveSelected = "Remove selected authors";
$DeletedAuthors = "Authors have been removed";
$HideCategoryTable = "Hide category table";
?>
?>

Loading…
Cancel
Save