From 984e741b974bed214586ff0f91750fb0f6da9406 Mon Sep 17 00:00:00 2001 From: Alex Aragon Date: Mon, 10 Apr 2017 11:26:57 -0500 Subject: [PATCH 1/2] remove degrade from exercise results --- app/Resources/public/css/base.css | 49 +++++++------------------------ 1 file changed, 10 insertions(+), 39 deletions(-) diff --git a/app/Resources/public/css/base.css b/app/Resources/public/css/base.css index f88a71bf17..bef6b0c705 100644 --- a/app/Resources/public/css/base.css +++ b/app/Resources/public/css/base.css @@ -1884,20 +1884,11 @@ div.admin_section h4 { } .question_row_score .title-score .total{ border: 1px solid #ddd; - border-radius: 4px; - -moz-border-radius: 4px; - -webkit-border-radius: 4px; + border-radius: 5px; padding: 10px; text-align: center; color: #666; - background: #ffffff; /* Old browsers */ - background: -moz-linear-gradient(top, #ffffff 0%, #f6f6f6 47%, #ededed 100%); /* FF3.6+ */ - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(47%,#f6f6f6), color-stop(100%,#ededed)); /* Chrome,Safari4+ */ - background: -webkit-linear-gradient(top, #ffffff 0%,#f6f6f6 47%,#ededed 100%); /* Chrome10+,Safari5.1+ */ - background: -o-linear-gradient(top, #ffffff 0%,#f6f6f6 47%,#ededed 100%); /* Opera 11.10+ */ - background: -ms-linear-gradient(top, #ffffff 0%,#f6f6f6 47%,#ededed 100%); /* IE10+ */ - background: linear-gradient(to bottom, #ffffff 0%,#f6f6f6 47%,#ededed 100%); /* W3C */ - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#ededed',GradientType=0 ); /* IE6-9 */ + background: #FAFAFA; } .question-result .page-header{ margin-top: 20px; @@ -1937,14 +1928,7 @@ div.admin_section h4 { border-radius: 3px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); position: relative; - background: #ffffff; /* Old browsers */ - background: -moz-linear-gradient(top, #ffffff 0%, #f6f6f6 47%, #ededed 100%); /* FF3.6+ */ - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ffffff), color-stop(47%,#f6f6f6), color-stop(100%,#ededed)); /* Chrome,Safari4+ */ - background: -webkit-linear-gradient(top, #ffffff 0%,#f6f6f6 47%,#ededed 100%); /* Chrome10+,Safari5.1+ */ - background: -o-linear-gradient(top, #ffffff 0%,#f6f6f6 47%,#ededed 100%); /* Opera 11.10+ */ - background: -ms-linear-gradient(top, #ffffff 0%,#f6f6f6 47%,#ededed 100%); /* IE10+ */ - background: linear-gradient(to bottom, #ffffff 0%,#f6f6f6 47%,#ededed 100%); /* W3C */ - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#ededed',GradientType=0 ); /* IE6-9 */ + background: #FAFAFA; } .ribbon .rib { @@ -1989,16 +1973,9 @@ div.admin_section h4 { } .ribbon .rib-error, .ribbon .ribbon-total-error { - background: #ff3019; /* Old browsers */ - background: -moz-linear-gradient(top, #ff3019 0%, #cf0404 100%); /* FF3.6+ */ - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ff3019), color-stop(100%,#cf0404)); /* Chrome,Safari4+ */ - background: -webkit-linear-gradient(top, #ff3019 0%,#cf0404 100%); /* Chrome10+,Safari5.1+ */ - background: -o-linear-gradient(top, #ff3019 0%,#cf0404 100%); /* Opera 11.10+ */ - background: -ms-linear-gradient(top, #ff3019 0%,#cf0404 100%); /* IE10+ */ - background: linear-gradient(to bottom, #ff3019 0%,#cf0404 100%); /* W3C */ - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ff3019', endColorstr='#cf0404',GradientType=0 ); /* IE6-9 */ - border-top: 1px solid #ff3019; - border-bottom: 1px solid #cf0404; + background: #ff3019; + border-top: none; + border-bottom: none; float: left; } @@ -2016,15 +1993,9 @@ div.admin_section h4 { } .ribbon .rib-success, .ribbon .ribbon-total-success{ - background-color: #768E00; - background-image: -ms-linear-gradient(top, #9CB80A, #768E00); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#9CB80A), to(#768E00)); - background-image: -webkit-linear-gradient(top, #9CB80A, #768E00); - background-image: -o-linear-gradient(top, #9CB80A, #768E00); - background-image: -moz-linear-gradient(top, #9CB80A, #768E00); - background-image: linear-gradient(top, #9CB80A, #768E00); - border-top: 1px solid #A8C31B; - border-bottom: 1px solid #617700; + background: #86B404; + border-top: none; + border-bottom: none; float: left; } @@ -2067,7 +2038,7 @@ div.admin_section h4 { } .ribbon .rib-success::before { - border-color: #66751B transparent transparent transparent; + border-color: #4B610B transparent transparent transparent; } .ribbon .rib-gray::before { From c04497467375dca9fcb0c8b974386e5f67dfa003 Mon Sep 17 00:00:00 2001 From: Alex Aragon Date: Mon, 10 Apr 2017 13:25:47 -0500 Subject: [PATCH 2/2] style css for show student progress in My courses --- app/Resources/public/css/base.css | 6 ++++ main/inc/lib/userportal.lib.php | 12 ++++---- .../classic_courses_with_category.tpl | 30 +++++++++---------- .../classic_courses_without_category.tpl | 28 +++++++++-------- .../default/user_portal/classic_session.tpl | 29 +++++++++--------- .../grid_courses_with_category.tpl | 28 +++++++++-------- .../grid_courses_without_category.tpl | 28 +++++++++-------- .../default/user_portal/grid_session.tpl | 28 +++++++++-------- 8 files changed, 103 insertions(+), 86 deletions(-) diff --git a/app/Resources/public/css/base.css b/app/Resources/public/css/base.css index bef6b0c705..a8393c3320 100644 --- a/app/Resources/public/css/base.css +++ b/app/Resources/public/css/base.css @@ -4755,6 +4755,12 @@ div#chat-remote-video video { padding-top: 10px; border-bottom: 1px solid #ECF0F1; } +.course-student-info{ + background-color: #d9edf7; + border: 1px solid #bce8f1; + padding: 5px; + border-radius: 5px; +} .grid-courses .items{ /* position: relative; */ vertical-align: top; diff --git a/main/inc/lib/userportal.lib.php b/main/inc/lib/userportal.lib.php index 4a09414a6e..7697589e98 100755 --- a/main/inc/lib/userportal.lib.php +++ b/main/inc/lib/userportal.lib.php @@ -1171,10 +1171,11 @@ class IndexManager $this->load_directories_preview ); - //Course option (show student progress) //This code will add new variables (Progress, Score, Certificate) + if ($studentInfoProgress || $studentInfoScore || $studentInfoCertificate) { + if(!empty($specialCourses)){ foreach ($specialCourses as $key => $specialCourseInfo) { if ($studentInfoProgress) { $progress = Tracking::get_avg_student_progress( @@ -1207,12 +1208,13 @@ class IndexManager if ($category[0]->is_certificate_available($user_id)) { $specialCourses[$key]['student_info']['certificate'] = Display::label(get_lang('Yes'), 'success'); } else { - $specialCourses[$key]['student_info']['certificate'] = Display::label(get_lang('No')); + $specialCourses[$key]['student_info']['certificate'] = Display::label(get_lang('No'), 'danger'); } } } } + } if (isset($courses['in_category']) && isset($courses['not_category'])) { foreach ($courses['in_category'] as $key1 => $value) { @@ -1249,7 +1251,7 @@ class IndexManager if ($category[0]->is_certificate_available($user_id)) { $courses['in_category'][$key1]['student_info']['certificate'] = Display::label(get_lang('Yes'), 'success'); } else { - $courses['in_category'][$key1]['student_info']['certificate'] = Display::label(get_lang('No')); + $courses['in_category'][$key1]['student_info']['certificate'] = Display::label(get_lang('No'), 'danger'); } } } @@ -1289,7 +1291,7 @@ class IndexManager if ($category[0]->is_certificate_available($user_id)) { $courses['not_category'][$key]['student_info']['certificate'] = Display::label(get_lang('Yes'), 'success'); } else { - $courses['not_category'][$key]['student_info']['certificate'] = Display::label(get_lang('No')); + $courses['not_category'][$key]['student_info']['certificate'] = Display::label(get_lang('No'), 'danger'); } } } @@ -1298,7 +1300,7 @@ class IndexManager } } - + if ($viewGridCourses) { $coursesWithoutCategoryTemplate = '/user_portal/grid_courses_without_category.tpl'; $coursesWithCategoryTemplate = '/user_portal/grid_courses_with_category.tpl'; diff --git a/main/template/default/user_portal/classic_courses_with_category.tpl b/main/template/default/user_portal/classic_courses_with_category.tpl index 3fc8a7f85f..325c6d69ba 100644 --- a/main/template/default/user_portal/classic_courses_with_category.tpl +++ b/main/template/default/user_portal/classic_courses_with_category.tpl @@ -70,25 +70,25 @@ {% endfor %} {% endif %} - + {% if item.student_info %} -
-
- - {% if (item.student_info.progress is not null) %} - {{ "StudentCourseProgressX" | get_lang | format(item.student_info.progress) }} - {% endif %} - - {% if (item.student_info.score is not null) %} - {{ "StudentCourseScoreX" | get_lang | format(item.student_info.score) }} - {% endif %} + {% if (item.student_info.progress is not null) and (item.student_info.score is not null) %} +
+
+ {% if (item.student_info.progress is not null) %} + {{ "StudentCourseProgressX" | get_lang | format(item.student_info.progress) }} + {% endif %} - {% if (item.student_info.certificate is not null) %} - {{ "StudentCourseCertificateX" | get_lang | format(item.student_info.certificate) }} - {% endif %} + {% if (item.student_info.score is not null) %} + {{ "StudentCourseScoreX" | get_lang | format(item.student_info.score) }} + {% endif %} + {% if (item.student_info.certificate is not null) %} + {{ "StudentCourseCertificateX" | get_lang | format(item.student_info.certificate) }} + {% endif %} +
-
+ {% endif %} {% endif %}
diff --git a/main/template/default/user_portal/classic_courses_without_category.tpl b/main/template/default/user_portal/classic_courses_without_category.tpl index 3bf4381e72..49044c4ba0 100644 --- a/main/template/default/user_portal/classic_courses_without_category.tpl +++ b/main/template/default/user_portal/classic_courses_without_category.tpl @@ -69,23 +69,25 @@ {% if item.student_info %} -
-
+ {% if (item.student_info.progress is not null) and (item.student_info.score is not null) %} +
+
- {% if (item.student_info.progress is not null) %} - {{ "StudentCourseProgressX" | get_lang | format(item.student_info.progress) }} - {% endif %} + {% if (item.student_info.progress is not null) %} + {{ "StudentCourseProgressX" | get_lang | format(item.student_info.progress) }} + {% endif %} - {% if (item.student_info.score is not null) %} - {{ "StudentCourseScoreX" | get_lang | format(item.student_info.score) }} - {% endif %} + {% if (item.student_info.score is not null) %} + {{ "StudentCourseScoreX" | get_lang | format(item.student_info.score) }} + {% endif %} - {% if (item.student_info.certificate is not null) %} - {{ "StudentCourseCertificateX" | get_lang | format(item.student_info.certificate) }} - {% endif %} + {% if (item.student_info.certificate is not null) %} + {{ "StudentCourseCertificateX" | get_lang | format(item.student_info.certificate) }} + {% endif %} -
-
+
+
+ {% endif %} {% endif %} diff --git a/main/template/default/user_portal/classic_session.tpl b/main/template/default/user_portal/classic_session.tpl index fbe08319ba..878f3e2bb0 100644 --- a/main/template/default/user_portal/classic_session.tpl +++ b/main/template/default/user_portal/classic_session.tpl @@ -80,25 +80,26 @@ {% if item.student_info %} -
-
+ {% if (item.student_info.progress is not null) and (item.student_info.score is not null) %} +
+
- {% if (item.student_info.progress is not null) %} - {{ "StudentCourseProgressX" | get_lang | format(item.student_info.progress) }} - {% endif %} + {% if (item.student_info.progress is not null) %} + {{ "StudentCourseProgressX" | get_lang | format(item.student_info.progress) }} + {% endif %} - {% if (item.student_info.score is not null) %} - {{ "StudentCourseScoreX" | get_lang | format(item.student_info.score) }} - {% endif %} + {% if (item.student_info.score is not null) %} + {{ "StudentCourseScoreX" | get_lang | format(item.student_info.score) }} + {% endif %} - {% if (item.student_info.certificate is not null) %} - {{ "StudentCourseCertificateX" | get_lang | format(item.student_info.certificate) }} - {% endif %} + {% if (item.student_info.certificate is not null) %} + {{ "StudentCourseCertificateX" | get_lang | format(item.student_info.certificate) }} + {% endif %} -
-
+
+
+ {% endif %} {% endif %} - {% endfor %} diff --git a/main/template/default/user_portal/grid_courses_with_category.tpl b/main/template/default/user_portal/grid_courses_with_category.tpl index 4ad3e2a93b..f26e04a627 100644 --- a/main/template/default/user_portal/grid_courses_with_category.tpl +++ b/main/template/default/user_portal/grid_courses_with_category.tpl @@ -66,23 +66,25 @@
{{ item.notifications }}
{% if item.student_info %} -
-
+ {% if (item.student_info.progress is not null) and (item.student_info.score is not null) %} +
+
- {% if (item.student_info.progress is not null) %} - {{ "StudentCourseProgressX" | get_lang | format(item.student_info.progress) }} - {% endif %} + {% if (item.student_info.progress is not null) %} + {{ "StudentCourseProgressX" | get_lang | format(item.student_info.progress) }} + {% endif %} - {% if (item.student_info.score is not null) %} - {{ "StudentCourseScoreX" | get_lang | format(item.student_info.score) }} - {% endif %} + {% if (item.student_info.score is not null) %} + {{ "StudentCourseScoreX" | get_lang | format(item.student_info.score) }} + {% endif %} - {% if (item.student_info.certificate is not null) %} - {{ "StudentCourseCertificateX" | get_lang | format(item.student_info.certificate) }} - {% endif %} + {% if (item.student_info.certificate is not null) %} + {{ "StudentCourseCertificateX" | get_lang | format(item.student_info.certificate) }} + {% endif %} -
-
+
+
+ {% endif %} {% endif %} diff --git a/main/template/default/user_portal/grid_courses_without_category.tpl b/main/template/default/user_portal/grid_courses_without_category.tpl index 4278655010..80ec4ef204 100644 --- a/main/template/default/user_portal/grid_courses_without_category.tpl +++ b/main/template/default/user_portal/grid_courses_without_category.tpl @@ -63,23 +63,25 @@
{{ item.notifications }}
{% if item.student_info %} -
-
+ {% if (item.student_info.progress is not null) and (item.student_info.score is not null) %} +
+
- {% if (item.student_info.progress is not null) %} - {{ "StudentCourseProgressX" | get_lang | format(item.student_info.progress) }} - {% endif %} + {% if (item.student_info.progress is not null) %} + {{ "StudentCourseProgressX" | get_lang | format(item.student_info.progress) }} + {% endif %} - {% if (item.student_info.score is not null) %} - {{ "StudentCourseScoreX" | get_lang | format(item.student_info.score) }} - {% endif %} + {% if (item.student_info.score is not null) %} + {{ "StudentCourseScoreX" | get_lang | format(item.student_info.score) }} + {% endif %} - {% if (item.student_info.certificate is not null) %} - {{ "StudentCourseCertificateX" | get_lang | format(item.student_info.certificate) }} - {% endif %} + {% if (item.student_info.certificate is not null) %} + {{ "StudentCourseCertificateX" | get_lang | format(item.student_info.certificate) }} + {% endif %} -
-
+
+
+ {% endif %} {% endif %} diff --git a/main/template/default/user_portal/grid_session.tpl b/main/template/default/user_portal/grid_session.tpl index 7ec12cc0ee..9ce36f1b00 100644 --- a/main/template/default/user_portal/grid_session.tpl +++ b/main/template/default/user_portal/grid_session.tpl @@ -30,23 +30,25 @@ {% endfor %} {% if item.student_info %} -
-
+ {% if (item.student_info.progress is not null) and (item.student_info.score is not null) %} +
+
- {% if (item.student_info.progress is not null) %} - {{ "StudentCourseProgressX" | get_lang | format(item.student_info.progress) }} - {% endif %} + {% if (item.student_info.progress is not null) %} + {{ "StudentCourseProgressX" | get_lang | format(item.student_info.progress) }} + {% endif %} - {% if (item.student_info.score is not null) %} - {{ "StudentCourseScoreX" | get_lang | format(item.student_info.score) }} - {% endif %} + {% if (item.student_info.score is not null) %} + {{ "StudentCourseScoreX" | get_lang | format(item.student_info.score) }} + {% endif %} - {% if (item.student_info.certificate is not null) %} - {{ "StudentCourseCertificateX" | get_lang | format(item.student_info.certificate) }} - {% endif %} + {% if (item.student_info.certificate is not null) %} + {{ "StudentCourseCertificateX" | get_lang | format(item.student_info.certificate) }} + {% endif %} -
-
+
+
+ {% endif %} {% endif %}