Skip to content

Commit 7e921a0

Browse files
committed
Fix SCORM progress visualisation issue with current element marked complete + clean CSS of chamilo style - refs #7190
1 parent 2cbf074 commit 7e921a0

File tree

3 files changed

+64
-144
lines changed

3 files changed

+64
-144
lines changed

main/css/chamilo/scorm.css

Lines changed: 53 additions & 134 deletions
Original file line numberDiff line numberDiff line change
@@ -6,40 +6,33 @@
66
height: 210px;
77
}
88

9-
.inner_lp_toc .scorm_item a {
10-
font-weight: normal;
9+
.inner_lp_toc .scorm_item_1 a,
10+
.inner_lp_toc .scorm_item_2 a {
1111
font-size: 13px;
1212
margin-right: 1px;
1313
padding-bottom: 2px;
1414
text-decoration: none;
1515
color: #2F3E46;
1616
}
1717

18-
.inner_lp_toc .scorm_item a.chapter_module {
18+
.inner_lp_toc .scorm_item_1 a.chapter_module,
19+
.inner_lp_toc .scorm_item_2 a.chapter_module {
1920
font-weight: normal;
2021
margin-right: 10px;
2122
}
2223
.inner_lp_toc .scorm_item_highlight {
23-
border: 1px solid #999;
24-
background:#999;
2524
font-weight:bold;
26-
text-shadow:0 -1px 1px #666;
27-
background-image:-webkit-gradient(linear,left top,left bottom,from(#666),to(#999));
28-
background-image:-webkit-linear-gradient(top,#666,#999);
29-
background-image:-moz-linear-gradient(top,#666,#999);
30-
background-image:-ms-linear-gradient(top,#666,#999);
31-
background-image:-o-linear-gradient(top,#666,#999);
32-
background-image:linear-gradient(top,#666,#999);
25+
border:1px solid #00aad4;
26+
background-color: #00aad4;
27+
background-image:none;
3328
margin-right: 0px;
3429
padding: 10px 0px 10px 0px;
3530
text-decoration: none;
3631
}
37-
3832
.inner_lp_toc .scorm_item_highlight a {
3933
color:#fff;
4034
margin-right: 1px;
4135
text-decoration: none;
42-
font-weight: bold;
4336
}
4437

4538
.inner_lp_toc .scorm_item_section {
@@ -59,50 +52,6 @@
5952
text-decoration: none;
6053
}
6154

62-
.inner_lp_toc .scorm_item {
63-
font-size: 16px;
64-
margin-left: 10px;
65-
margin-right:10px;
66-
text-decoration: none;
67-
border-color: rgba(255, 255, 255, 0.3);
68-
}
69-
70-
.inner_lp_toc .scorm_item_1 {
71-
border-bottom: 1px solid #CCCCCC;
72-
background:#eee;
73-
font-weight:bold;
74-
color:#444;
75-
text-shadow:0 1px 1px #f6f6f6;
76-
background-image:-webkit-gradient(linear,left top,left bottom,from(#fdfdfd),to(#eee));
77-
background-image:-webkit-linear-gradient(top,#fdfdfd,#eee);
78-
background-image:-moz-linear-gradient(top,#fdfdfd,#eee);
79-
background-image:-ms-linear-gradient(top,#fdfdfd,#eee);
80-
background-image:-o-linear-gradient(top,#fdfdfd,#eee);
81-
background-image:linear-gradient(top,#fdfdfd,#eee);
82-
margin-right: 1px;
83-
padding: 10px 0px 10px 0px;
84-
text-decoration: none;
85-
font-weight: normal;
86-
background:#FDFDFD;
87-
}
88-
89-
.inner_lp_toc .scorm_item_2 {
90-
background-image:-webkit-gradient(linear,left top,left bottom,from(#fdfdfd),to(#eee));
91-
background-image:-webkit-linear-gradient(top,#fdfdfd,#eee);
92-
background-image:-moz-linear-gradient(top,#fdfdfd,#eee);
93-
background-image:-ms-linear-gradient(top,#fdfdfd,#eee);
94-
background-image:-o-linear-gradient(top,#fdfdfd,#eee);
95-
background-image:linear-gradient(top,#fdfdfd,#eee);
96-
border-bottom: 1px solid #CCCCCC;
97-
color: #444444;
98-
font-weight: bold;
99-
text-shadow: 0 1px 1px #F6F6F6;
100-
margin-right: 1px;
101-
padding: 10px 0px 10px 0px;
102-
text-decoration: none;
103-
font-weight: normal;
104-
}
105-
10655
.inner_lp_toc .scorm_item_section .scorm_item:before
10756
{
10857
content : url('../lp_section.png'); /* from main/newscorm/lp_controller.php file */
@@ -187,33 +136,6 @@
187136
height: 210px;
188137
/*padding: 10px;*/
189138
}
190-
191-
.inner_lp_toc .scorm_item a {
192-
margin-right: 1px;
193-
padding-bottom: 2px;
194-
text-decoration: none;
195-
color: #2F3E46;
196-
}
197-
198-
.inner_lp_toc .scorm_item a.chapter_module {
199-
font-weight: normal;
200-
margin-right: 10px;
201-
}
202-
.inner_lp_toc .scorm_item_highlight {
203-
border:1px solid #00aad4;
204-
background:#00aad4;
205-
background-image:none;
206-
margin-right: 0px;
207-
padding: 10px 0px 10px 0px;
208-
text-decoration: none;
209-
}
210-
211-
.inner_lp_toc .scorm_item_highlight a {
212-
color:#fff;
213-
margin-right: 1px;
214-
text-decoration: none;
215-
}
216-
217139
.inner_lp_toc .scorm_item_section {
218140
border:none;
219141
background:#333;
@@ -250,31 +172,7 @@
250172
.inner_lp_toc .scorm_item.scorm_item_level_1{
251173
background: url(../img/archive.png) no-repeat;
252174
}
253-
.inner_lp_toc .scorm_item_1 {
254-
border-bottom: 1px solid #CCCCCC;
255-
background:#eee;
256-
font-weight:bold;
257-
color:#444;
258-
text-shadow:0 1px 1px #f6f6f6;
259-
background-image:none;
260-
261-
margin-right: 1px;
262-
padding: 10px 0px 10px 0px;
263-
text-decoration: none;
264-
font-weight: normal;
265-
/* background:#FDFDFD; */
266-
}
267175

268-
.inner_lp_toc .scorm_item_2 {
269-
background-image:none;
270-
border-bottom: 1px solid #CCCCCC;
271-
color: #444444;
272-
font-weight: normal;
273-
margin-right: 1px;
274-
padding: 10px 0px 10px 0px;
275-
text-decoration: none;
276-
font-weight: normal;
277-
}
278176

279177
.inner_lp_toc .scorm_title {
280178
font-weight: bold;
@@ -449,26 +347,54 @@ opacity: 0.7;
449347
}
450348

451349
/*STYLES PROCESS LESSION*/
452-
.inner_lp_toc .scorm_completed {
453-
background-image: url("images/blue_arrow.png") !important;
350+
.inner_lp_toc .scorm_item a {
351+
margin-right: 1px;
352+
padding-bottom: 2px;
353+
text-decoration: none;
354+
color: #2F3E46;
355+
}
356+
357+
.inner_lp_toc .scorm_item a.chapter_module {
358+
font-weight: normal;
359+
margin-right: 10px;
360+
}
361+
362+
.scorm_item_1,
363+
.scorm_item_2 {
364+
font-size: 16px;
365+
margin-left: 10px;
366+
margin-right:10px;
367+
text-decoration: none;
368+
border-color: rgba(255, 255, 255, 0.3);
369+
}
370+
.scorm_item_1 {
371+
border-bottom: 1px solid #CCCCCC;
372+
color:#444;
373+
text-shadow:0 1px 1px #f6f6f6;
374+
background: none;
375+
margin-right: 1px;
376+
padding: 10px 0px 10px 0px;
377+
}
378+
.scorm_item_2 {
379+
border-bottom: 1px solid #CCCCCC;
380+
color: #444444;
381+
text-shadow: 0 1px 1px #F6F6F6;
382+
margin-right: 1px;
383+
padding: 10px 0px 10px 0px;
384+
background-image:none;
385+
}
386+
.scorm_item_1.scorm_item_highlight.scorm_completed,
387+
.scorm_item_2.scorm_item_highlight.scorm_completed {
388+
background-image: url("images/white_arrow.png") !important;
454389
background-position: 270px center !important;
455390
background-repeat: no-repeat;
391+
color: white;
456392
}
457-
458-
.inner_lp_toc .scorm_item_1 {
459-
background:none;
460-
background-repeat: no-repeat;
461-
border-bottom-color: #CCCCCC;
462-
border-bottom-style: solid;
463-
border-bottom-width: 1px;
464-
color: #444444;
465-
font-weight: normal;
466-
margin-right: 1px;
467-
padding-bottom: 10px;
468-
padding-left: 0;
469-
padding-right: 0;
470-
padding-top: 10px;
471-
text-shadow: 0 1px 1px #F6F6F6;
393+
.scorm_item_1.scorm_item_normal.scorm_completed,
394+
.scorm_item_2.scorm_item_normal.scorm_completed {
395+
background-image: url("images/blue_arrow.png") !important;
396+
background-position: 270px center !important;
397+
background-repeat: no-repeat;
472398
}
473399
#learning_path_main #control {
474400
background-image: none;
@@ -488,14 +414,7 @@ opacity: 0.7;
488414
width: 100%;
489415
border-top:1px solid #00AAD4;
490416
}
491-
.inner_lp_toc .scorm_item_highlight {
492-
background-color: #00aad4;
493-
background-image: url("images/white_arrow.png") !important;
494-
background-position: 270px center !important;
495-
background-repeat: no-repeat;
496-
border: 1px solid #00aad4;
497-
text-shadow:none;
498-
}
417+
499418
#author_name {
500419
color: #666666;
501420
float: left;

main/newscorm/learnpath.class.php

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2973,18 +2973,16 @@ public function get_html_toc($toc_list = null)
29732973

29742974
$class_name = array (
29752975
'not attempted' => 'scorm_not_attempted',
2976-
'incomplete' => 'scorm_incomplete',
2977-
'failed' => 'scorm_failed',
2976+
'incomplete' => 'scorm_not_attempted',
2977+
'failed' => 'scorm_not_attempted',
29782978
'completed' => 'scorm_completed',
2979-
'passed' => 'scorm_passed',
2980-
'succeeded' => 'scorm_succeeded',
2979+
'passed' => 'scorm_completed',
2980+
'succeeded' => 'scorm_completed',
29812981
'browsed' => 'scorm_completed',
29822982
);
29832983

2984-
$style = 'scorm_item';
29852984
$scorm_color_background = 'scorm_item_2';
29862985
$style_item = 'scorm_item';
2987-
$current = false;
29882986

29892987
if ($color_counter % 2 == 0) {
29902988
$scorm_color_background = 'scorm_item_1';
@@ -2993,8 +2991,9 @@ public function get_html_toc($toc_list = null)
29932991
$scorm_color_background =' scorm_item_section ';
29942992
}
29952993
if ($item['id'] == $this->current) {
2996-
$style = 'scorm_item_highlight';
29972994
$scorm_color_background .= ' scorm_item_highlight';
2995+
} else {
2996+
$scorm_color_background .= ' scorm_item_normal';
29982997
}
29992998

30002999
$html .= '<div id="toc_' . $item['id'] . '" class="' . $scorm_color_background . ' '.$class_name[$item['status']].' ">';

main/newscorm/scorm_api.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1167,25 +1167,27 @@ function update_toc(update_action, update_id, change_ids) {
11671167
if (update_action == "unhighlight" || update_action == "highlight") {
11681168
if (update_action == "unhighlight") {
11691169
myelem.removeClass('scorm_item_highlight');
1170+
myelem.addClass('scorm_item_normal');
11701171
} else {
11711172
if (change_ids=='yes') {
11721173
olms.lms_next_item = update_id;
11731174
olms.lms_previous_item = update_id;
11741175
}
1176+
myelem.removeClass('scorm_item_normal');
11751177
myelem.addClass('scorm_item_highlight');
11761178
}
11771179
} else {
11781180
myelem.removeClass("scorm_not_attempted scorm_incomplete scorm_completed scorm_failed scorm_passed");
11791181
if (update_action == "not attempted") {
11801182
myelem.addClass('scorm_not_attempted');
11811183
} else if (update_action == "incomplete") {
1182-
myelem.addClass('scorm_incomplete');
1184+
myelem.addClass('scorm_not_attempted');
11831185
} else if (update_action == "completed") {
11841186
myelem.addClass('scorm_completed');
11851187
} else if (update_action == "failed") {
1186-
myelem.addClass('scorm_failed');
1188+
myelem.addClass('scorm_not_attempted');
11871189
} else if (update_action == "passed") {
1188-
myelem.addClass('scorm_passed');
1190+
myelem.addClass('scorm_completed');
11891191
} else if (update_action == "browsed") {
11901192
myelem.addClass('scorm_completed');
11911193
} else {

0 commit comments

Comments
 (0)