Skip to content

Commit ad032e3

Browse files
committed
Merge remote-tracking branch 'origin/1.11.x' into 1.11.x
2 parents 9171070 + 23ac2b2 commit ad032e3

File tree

3 files changed

+82
-56
lines changed

3 files changed

+82
-56
lines changed

app/Resources/public/css/base.css

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2419,14 +2419,6 @@ div.admin_section h4 {
24192419
background: #FAFAFA;
24202420
}
24212421

2422-
.question-result .page-header {
2423-
margin-top: 20px;
2424-
}
2425-
2426-
.question-result h2.page-header {
2427-
font-size: 25px;
2428-
}
2429-
24302422
.question_row_score .title-score .total h3 {
24312423
margin: 0;
24322424
font-size: 22px;
@@ -8650,14 +8642,6 @@ main[dir="rtl"] .radio-inline input[type=radio]{
86508642
margin: 0;
86518643
}
86528644

8653-
.question-result .page-header {
8654-
margin-top: 20px;
8655-
}
8656-
8657-
.question-result h2.page-header {
8658-
font-size: 20px;
8659-
}
8660-
86618645
.dl-horizontal dt {
86628646
float: left;
86638647
width: 120px;
@@ -8720,14 +8704,6 @@ main[dir="rtl"] .radio-inline input[type=radio]{
87208704
margin: 0;
87218705
}
87228706

8723-
.question-result .page-header {
8724-
margin-top: 20px;
8725-
}
8726-
8727-
.question-result h2.page-header {
8728-
font-size: 20px;
8729-
}
8730-
87318707
.navbar-nav .open .dropdown-menu .user-header {
87328708
width: 100%;
87338709
}
@@ -10148,7 +10124,28 @@ ul.dropdown-menu.inner > li > a {
1014810124
.summary-course .list-info .text-color{
1014910125
color: #0A649F;
1015010126
}
10127+
<<<<<<< HEAD
10128+
.question-result h3{
10129+
margin-top: 0;
10130+
margin-bottom: 10px;
10131+
font-size: 20px;
10132+
font-weight: bold;
10133+
}
10134+
.question-result .user-avatar,
10135+
.question-result .user-info{
10136+
text-align: center;
10137+
}
10138+
.question-result .user-avatar img{
10139+
border-radius: 10px;
10140+
}
10141+
.group-data .list-data .item{
10142+
width: 150px;
10143+
display: inline-block;
10144+
font-weight: bold;
10145+
}
10146+
=======
1015110147

10148+
>>>>>>> 23bad83a744482179b36bc14365ed0c1bef45a2c
1015210149
@media (min-width: 768px) {
1015310150
.clear-rows-6-4-3 .col-sm-6:nth-child(2n+1) {
1015410151
clear: left;

main/exercise/exercise.class.php

Lines changed: 21 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -5966,6 +5966,8 @@ public function showExerciseResultHeader(
59665966
$trackExerciseInfo
59675967
) {
59685968
$start_date = null;
5969+
$tpl = new Template(null, false, false, false, false, false, false);
5970+
59695971
if (isset($trackExerciseInfo['start_date'])) {
59705972
$start_date = api_convert_and_format_date($trackExerciseInfo['start_date']);
59715973
}
@@ -5978,19 +5980,17 @@ public function showExerciseResultHeader(
59785980
if (api_is_teacher() || api_is_platform_admin(true, true)) {
59795981
$userFullName = '<a href="'.$user_data['profile_url'].'" title="'.get_lang('GoToStudentDetails').'">'.$user_data['complete_name'].'</a>';
59805982
}
5981-
$array[] = [
5982-
'title' => get_lang('Name'),
5983-
'content' => $userFullName,
5984-
];
5985-
$array[] = [
5986-
'title' => get_lang('Username'),
5987-
'content' => $user_data['username'],
5983+
5984+
$data = [
5985+
'name_url' => $userFullName,
5986+
'complete_name' => $user_data['complete_name'],
5987+
'username' => $user_data['username'],
5988+
'avatar' => $user_data['avatar_medium'],
5989+
'url' => $user_data['profile_url']
59885990
];
5991+
59895992
if (!empty($user_data['official_code'])) {
5990-
$array[] = [
5991-
'title' => get_lang('OfficialCode'),
5992-
'content' => $user_data['official_code'],
5993-
];
5993+
$data['code'] = $user_data['official_code'];
59945994
}
59955995
}
59965996
// Description can be very long and is generally meant to explain
@@ -6002,43 +6002,32 @@ public function showExerciseResultHeader(
60026002
}
60036003
*/
60046004
if (!empty($start_date)) {
6005-
$array[] = ['title' => get_lang('StartDate'), 'content' => $start_date];
6005+
$data['start_date'] = $start_date;
60066006
}
60076007

60086008
if (!empty($duration)) {
6009-
$array[] = ['title' => get_lang('Duration'), 'content' => $duration];
6009+
$data['duration'] = $duration;
60106010
}
60116011

60126012
if (!empty($ip)) {
6013-
$array[] = ['title' => get_lang('IP'), 'content' => $ip];
6013+
$data['ip'] = $ip;
60146014
}
60156015

6016-
$icon = Display::return_icon(
6017-
'test-quiz.png',
6018-
get_lang('Result'),
6019-
null,
6020-
ICON_SIZE_MEDIUM
6021-
);
60226016

6023-
$html = '<div class="question-result">';
60246017
if (api_get_configuration_value('save_titles_as_html')) {
6025-
$html .= $this->get_formated_title();
6026-
$html .= Display::page_header(get_lang('Result'));
6018+
$data['title'] = $this->get_formated_title().get_lang('Result');
60276019
} else {
6028-
$html .= Display::page_header(
6029-
$icon.PHP_EOL.$this->exercise.' : '.get_lang('Result')
6030-
);
6020+
$data['title'] = PHP_EOL.$this->exercise.' : '.get_lang('Result');
60316021
}
60326022

60336023
$hide = api_get_configuration_value('hide_user_info_in_quiz_result');
60346024

6035-
if ($hide === false) {
6036-
$html .= Display::description($array);
6037-
}
6025+
$tpl->assign('hide', $hide);
6026+
$tpl->assign('data', $data);
6027+
$layoutTemplate = $tpl->get_template('exercise/partials/result_exercise.tpl');
6028+
$content = $tpl->fetch($layoutTemplate);
60386029

6039-
$html .= "</div>";
6040-
6041-
return $html;
6030+
return $content;
60426031
}
60436032

60446033
/**
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
2+
{% if hide != true %}
3+
<div class="question-result">
4+
<div class="panel panel-default">
5+
<div class="panel-body">
6+
<h3>{{ data.title }}</h3>
7+
<div class="row">
8+
<div class="col-md-3">
9+
<div class="user-avatar">
10+
<img src="{{ data.avatar }}">
11+
</div>
12+
<div class="user-info">
13+
<strong>{{ data.name_url }}</strong><br>
14+
</div>
15+
</div>
16+
<div class="col-md-9">
17+
<div class="group-data">
18+
<div class="list-data username">
19+
<span class="item">{{ 'Username'|get_lang }}</span>
20+
<i class="fa fa-user" aria-hidden="true"></i> {{ data.username }}
21+
</div>
22+
<div class="list-data start-date">
23+
<span class="item">{{ 'StartDate'|get_lang }}</span>
24+
<i class="fa fa-calendar" aria-hidden="true"></i> {{ data.start_date }}
25+
</div>
26+
<div class="list-data duration">
27+
<span class="item">{{ 'Duration'|get_lang }}</span>
28+
<i class="fa fa-clock-o" aria-hidden="true"></i> {{ data.duration }}
29+
</div>
30+
<div class="list-data ip">
31+
<span class="item">{{ 'IP'|get_lang }}</span>
32+
<i class="fa fa-laptop" aria-hidden="true"></i> {{ data.ip }}
33+
</div>
34+
</div>
35+
</div>
36+
</div>
37+
</div>
38+
</div>
39+
</div>
40+
{% endif %}

0 commit comments

Comments
 (0)