diff options
author | ankitjavalkar | 2018-10-01 18:41:45 +0530 |
---|---|---|
committer | ankitjavalkar | 2018-10-09 16:46:46 +0530 |
commit | 28edb315ce60a1ad95b7a608301a67ee8ba3e9d6 (patch) | |
tree | 66081612a5d754d8beeb36b6caf857b819adf333 | |
parent | bdd20668da9631396866e8a1942bcb8b2e623396 (diff) | |
download | online_test-28edb315ce60a1ad95b7a608301a67ee8ba3e9d6.tar.gz online_test-28edb315ce60a1ad95b7a608301a67ee8ba3e9d6.tar.bz2 online_test-28edb315ce60a1ad95b7a608301a67ee8ba3e9d6.zip |
Minor UI changes and selenium test fixes
-rw-r--r-- | yaksh/live_server_tests/selenium_test.py | 15 | ||||
-rw-r--r-- | yaksh/static/yaksh/css/yakshcustom.css | 51 | ||||
-rw-r--r-- | yaksh/templates/manage.html | 11 | ||||
-rw-r--r-- | yaksh/templates/user.html | 11 | ||||
-rw-r--r-- | yaksh/templates/yaksh/course_modules.html | 17 | ||||
-rw-r--r-- | yaksh/templates/yaksh/quizzes_user.html | 2 |
6 files changed, 38 insertions, 69 deletions
diff --git a/yaksh/live_server_tests/selenium_test.py b/yaksh/live_server_tests/selenium_test.py index 5bf1988..41a0fad 100644 --- a/yaksh/live_server_tests/selenium_test.py +++ b/yaksh/live_server_tests/selenium_test.py @@ -27,6 +27,8 @@ class SeleniumTestError(Exception): class SeleniumTest(): def __init__(self, url, quiz_name, module_name, course_name): self.driver = webdriver.Firefox() + self.driver.set_window_position(0, 0) + self.driver.set_window_size(1024, 768) self.quiz_name = quiz_name self.module_name = module_name self.course_name = course_name @@ -124,8 +126,8 @@ class SeleniumTest(): def open_quiz(self): # open module link self.driver.find_elements_by_partial_link_text( - self.course_name)[0].click() - self.driver.find_element_by_link_text(self.module_name).click() + 'START')[0].click() + self.driver.find_element_by_link_text('Start').click() # open quiz link self.driver.find_element_by_link_text(self.quiz_name).click() @@ -157,12 +159,15 @@ class SeleniumTest(): quit_link_elem.click() def logout(self): - logout_link_elem = WebDriverWait(self.driver, 5).until( - EC.presence_of_element_located((By.ID, "logout")) + logout_link_menu = WebDriverWait(self.driver, 10).until( + EC.presence_of_element_located((By.ID, "user_dropdown")) + ) + logout_link_menu.click() + logout_link_elem = WebDriverWait(self.driver, 10).until( + EC.presence_of_element_located((By.ID, "user_logout")) ) logout_link_elem.click() - def user_gen(url, ids): return [(url, 'User%d' % x, 'User%d' % x) for x in ids] diff --git a/yaksh/static/yaksh/css/yakshcustom.css b/yaksh/static/yaksh/css/yakshcustom.css index 3b888cf..86403ac 100644 --- a/yaksh/static/yaksh/css/yakshcustom.css +++ b/yaksh/static/yaksh/css/yakshcustom.css @@ -72,57 +72,6 @@ width: 100%; } -/*---------------------*/ - -/*Buttons - -.btn-success, .badge-success{ - background-color: #35beb1; - border-color: #35beb1; - color: black; -} - -.btn-primary, .badge-primary{ - background-color: #4ce8d9; - border-color: #4ce8d9; - color: black; -} - -.btn-success:hover, .open>.dropdown-toggle.btn-success, .btn-primary:hover, .open>.dropdown-toggle.btn-primary { - background-color: #156b62; - color: white; - border-color: #156b62; -} - -.btn-warning, .badge-warning { - background-color: #f7bd38; - border-color: #f7bd38; - color: black; -} - -.btn-warning:hover, .open>.dropdown-toggle.btn-warning { - background-color: #c6921b; - color: white; - border-color: #c6921b; -} - -.btn-danger, .badge-danger{ - background-color: #f03c69; - border-color: #f03c69; - color: black; -} - -.btn-danger:hover, .open>.dropdown-toggle.btn-danger, .btn-danger:hover, .open>.dropdown-toggle.btn-danger { - background-color: #b7123b; - color: white; - border-color: #b7123b; -} - - - -/*---------------------*/ - - /* Sidebar */ diff --git a/yaksh/templates/manage.html b/yaksh/templates/manage.html index 3ba2817..fbd4c64 100644 --- a/yaksh/templates/manage.html +++ b/yaksh/templates/manage.html @@ -18,19 +18,20 @@ <li class="nav-item"><a class="nav-link" href="{{ URL_ROOT }}/exam/manage/gradeuser">Grade User</a></li> <li class="nav-item"><a class="nav-link" href="{{ url_root }}/exam/manage/grader"> Regrade </a></li> <li class="nav-item dropdown"> - <a class="dropdown-toggle nav-link" data-toggle="dropdown" href="#"> {{user.get_full_name|title}}</a> + <a class="dropdown-toggle nav-link" id="user_dropdown" data-toggle="dropdown" href="#"> {{user.get_full_name|title}}</a> <div class="dropdown-menu"> <a class="dropdown-item" href="{{ URL_ROOT }}/exam/viewprofile/"><i class="fa fa-user"></i> My Profile</a> <div class="dropdown-divider"></div> - <a class="dropdown-item" href="{{ URL_ROOT }}/exam/reset/changepassword/"><i class="fa fa-key"></i> Change Password</a> - <div class="dropdown-divider"></div> - <a class="dropdown-item" href="{{URL_ROOT}}/exam/logout/"><i class="fa fa-sign-out"></i> Logout</a> - <div class="dropdown-divider"></div> {% if user.profile.is_moderator %} <a class="dropdown-item" href="{{URL_ROOT}}/exam/toggle_moderator/"><i class="fa fa-exchange"></i> Switch To Student </a> + <div class="dropdown-divider"></div> {% endif %} + <a class="dropdown-item" href="{{ URL_ROOT }}/exam/reset/changepassword/"><i class="fa fa-key"></i> Change Password</a> + <div class="dropdown-divider"></div> + <a class="dropdown-item" id="user_logout" href="{{URL_ROOT}}/exam/logout/"><i class="fa fa-sign-out"></i> Logout</a> + <div class="dropdown-divider"></div> </div> </ul> </div> diff --git a/yaksh/templates/user.html b/yaksh/templates/user.html index 91b48ed..db65195 100644 --- a/yaksh/templates/user.html +++ b/yaksh/templates/user.html @@ -15,19 +15,20 @@ <ul class="nav nav-pills ml-auto"> <li class="nav-item"><a class="nav-link" href="{{ URL_ROOT }}/exam/"><i class="fa fa-home" style="size: 18px"></i></a></li> <li class="nav-item dropdown"> - <a class="dropdown-toggle nav-link" data-toggle="dropdown" href="#"> {{user.get_full_name|title}}</a> + <a class="dropdown-toggle nav-link" id="user_dropdown" data-toggle="dropdown" href="#"> {{user.get_full_name|title}}</a> <div class="dropdown-menu"> <a class="dropdown-item" href="{{ URL_ROOT }}/exam/viewprofile/"><i class="fa fa-user"></i> My Profile</a> <div class="dropdown-divider"></div> - <a class="dropdown-item" href="{{ URL_ROOT }}/exam/reset/changepassword/"><i class="fa fa-key"></i> Change Password</a> - <div class="dropdown-divider"></div> - <a class="dropdown-item" href="{{URL_ROOT}}/exam/logout/"><i class="fa fa-sign-out"></i> Logout</a> - <div class="dropdown-divider"></div> {% if user.profile.is_moderator %} <a class="dropdown-item" href="{{URL_ROOT}}/exam/toggle_moderator/"><i class="fa fa-exchange"></i> Switch To Moderator </a> + <div class="dropdown-divider"></div> {% endif %} + <a class="dropdown-item" href="{{ URL_ROOT }}/exam/reset/changepassword/"><i class="fa fa-key"></i> Change Password</a> + <div class="dropdown-divider"></div> + <a id="user_logout" class="dropdown-item" href="{{URL_ROOT}}/exam/logout/"><i class="fa fa-sign-out"></i> Logout</a> + </div> </li> </ul> diff --git a/yaksh/templates/yaksh/course_modules.html b/yaksh/templates/yaksh/course_modules.html index e839e8b..9d936d6 100644 --- a/yaksh/templates/yaksh/course_modules.html +++ b/yaksh/templates/yaksh/course_modules.html @@ -49,7 +49,7 @@ </center> <div class="row justify-content-md-center "> -{% if learning_modules %} +{% if modules %} <div class="col-md-10 yakshwell"> <strong>Overall Course Progress</strong> @@ -68,7 +68,7 @@ </div> </div> - {% for module in learning_modules %} + {% for module, percent in modules %} <div class="yakshwell"> <div class="row yakshlabel align-items-center"> <div class="col-md-4"> @@ -176,6 +176,19 @@ ------ {% endif %} </td> + <td> + <div class="progress"> + {% if percent <= 50 %} + <div class="progress-bar progress-bar-danger" role="progressbar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width:{{percent}}%"> + {% elif percent <= 75 %} + <div class="progress-bar progress-bar-warning" role="progressbar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width:{{percent}}%"> + {% else %} + <div class="progress-bar progress-bar-success" role="progressbar" aria-valuenow="40" aria-valuemin="0" aria-valuemax="100" style="width:{{percent}}%"> + {% endif %} + <b style="color: black;">{{percent}}% Completed</b> + </div> + </div> + </td> </tr> {% endfor %} </table> diff --git a/yaksh/templates/yaksh/quizzes_user.html b/yaksh/templates/yaksh/quizzes_user.html index 95fa08a..548eef4 100644 --- a/yaksh/templates/yaksh/quizzes_user.html +++ b/yaksh/templates/yaksh/quizzes_user.html @@ -100,7 +100,7 @@ <span class="col-sm-auto"> {% if user in course.requests.all %} <span class="badge badge-warning">Request Pending </span> {% elif user in course.rejected.all %}<span class="badge badge-danger">Request Rejected</span> - {% elif user in course.students.all %}<a class="btn btn-success" href="{{URL_ROOT}}/exam/course_modules/{{course.id}}" >START</a> + {% elif user in course.students.all %}<a class="btn btn-success" href="{{URL_ROOT}}/exam/course_modules/{{course.id}}" >START</a> {% else %} {% if course.active %} {% if course.is_active_enrollment %} |