- added the new field review_rules for software secure
- added a new tab name "Additional Settings" for the proctored/timed exams
This commit is contained in:
Muhammad Shoaib
2015-11-10 18:03:55 +05:00
committed by Douglas Hall
parent 9e5eda0ab6
commit 788cece45e
16 changed files with 392 additions and 94 deletions

View File

@@ -11,7 +11,7 @@ import warnings
from lxml import etree
from xblock.core import XBlock
from xblock.fields import Integer, Scope, Boolean
from xblock.fields import Integer, Scope, Boolean, String
from xblock.fragment import Fragment
from .exceptions import NotFoundError
@@ -88,6 +88,15 @@ class ProctoringFields(object):
scope=Scope.settings,
)
exam_review_rules = String(
display_name=_("Software Secure Review Rules"),
help=_(
"This setting indicates what rules the proctoring team should follow when viewing the videos."
),
default='',
scope=Scope.settings,
)
is_practice_exam = Boolean(
display_name=_("Is Practice Exam"),
help=_(

View File

@@ -530,6 +530,13 @@ class CourseOutlinePage(CoursePage, CourseOutlineContainer):
self.q(css=".action-save").first.click()
self.wait_for_ajax()
def select_advanced_settings_tab(self):
"""
Select the advanced settings tab
"""
self.q(css=".advanced-settings-button").first.click()
self.wait_for_element_presence('#id_not_timed', 'Advanced settings fields not present.')
def make_exam_proctored(self):
"""
Makes a Proctored exam.
@@ -576,6 +583,12 @@ class CourseOutlinePage(CoursePage, CourseOutlineContainer):
"""
return self.q(css="#id_time_limit_div").visible
def exam_review_rules_field_visible(self):
"""
Returns whether the review rules field is visible
"""
return self.q(css=".exam-review-rules-list-fields").visible
def proctoring_items_are_displayed(self):
"""
Returns True if all the items are found.

View File

@@ -186,151 +186,188 @@ class ProctoredExamTest(UniqueCourseTest):
def test_can_create_proctored_exam_in_studio(self):
"""
Test that Proctored exam settings are visible in Studio.
Given that I am a staff member
When I visit the course outline page in studio.
And open the subsection edit dialog
Then I can view all settings related to Proctored and timed exams
"""
# Given that I am a staff member
LogoutPage(self.browser).visit()
self._auto_auth("STAFF_TESTER", "staff101@example.com", True)
# When I visit the course outline page in studio.
self.course_outline.visit()
# And open the subsection edit dialog
self.course_outline.open_exam_settings_dialog()
# Then I can view all settings related to Proctored and timed exams
self.assertTrue(self.course_outline.proctoring_items_are_displayed())
def test_proctored_exam_flow(self):
"""
Test that staff can create a proctored exam.
Given that I am a staff member on the exam settings section
select advanced settings tab
When I Make the exam proctored.
And I login as a verified student.
And visit the courseware as a verified student.
Then I can see an option to take the exam as a proctored exam.
"""
# Given that I am a staff member on the exam settings section
LogoutPage(self.browser).visit()
self._auto_auth("STAFF_TESTER", "staff101@example.com", True)
self.course_outline.visit()
self.course_outline.open_exam_settings_dialog()
# When I Make the exam proctored.
self.course_outline.select_advanced_settings_tab()
self.course_outline.make_exam_proctored()
# And I login as a verified student.
LogoutPage(self.browser).visit()
self._login_as_a_verified_user()
# And visit the courseware as a verified student.
self.courseware_page.visit()
# Then I can see an option to take the exam as a proctored exam.
self.assertTrue(self.courseware_page.can_start_proctored_exam)
def test_timed_exam_flow(self):
"""
Test that staff can create a timed exam.
Given that I am a staff member on the exam settings section
select advanced settings tab
When I Make the exam timed.
And I login as a verified student.
And visit the courseware as a verified student.
And I start the timed exam
Then I am taken to the exam with a timer bar showing
"""
# Given that I am a staff member on the exam settings section
LogoutPage(self.browser).visit()
self._auto_auth("STAFF_TESTER", "staff101@example.com", True)
self.course_outline.visit()
self.course_outline.open_exam_settings_dialog()
# When I Make the exam timed.
self.course_outline.select_advanced_settings_tab()
self.course_outline.make_exam_timed()
# And I login as a verified student.
LogoutPage(self.browser).visit()
self._login_as_a_verified_user()
# And visit the courseware as a verified student.
self.courseware_page.visit()
# And I start the timed exam
self.courseware_page.start_timed_exam()
# Then I am taken to the exam with a timer bar showing
self.assertTrue(self.courseware_page.is_timer_bar_present)
def test_time_allotted_field_is_not_visible_with_none_exam(self):
"""
Test that the time allotted text field is not shown if 'none' radio
button is selected
Given that I am a staff member
And I have visited the course outline page in studio.
And the subsection edit dialog is open
select advanced settings tab
When I select the 'None' exams radio button
Then the time allotted text field becomes invisible
"""
# Given that I am a staff member
# And I have visited the course outline page in studio.
# And the subsection edit dialog is open
LogoutPage(self.browser).visit()
self._auto_auth("STAFF_TESTER", "staff101@example.com", True)
self.course_outline.visit()
self.course_outline.open_exam_settings_dialog()
self.course_outline.select_advanced_settings_tab()
# When I select the 'None' exams radio button
self.course_outline.select_none_exam()
# Then the time allotted text field becomes invisible
self.assertFalse(self.course_outline.time_allotted_field_visible())
def test_time_allotted_field_is_visible_with_timed_exam(self):
"""
Test that the time allotted text field is shown if timed exam radio
button is selected
Given that I am a staff member
And I have visited the course outline page in studio.
And the subsection edit dialog is open
select advanced settings tab
When I select the timed exams radio button
Then the time allotted text field becomes visible
"""
# Given that I am a staff member
# And I have visited the course outline page in studio.
# And the subsection edit dialog is open
LogoutPage(self.browser).visit()
self._auto_auth("STAFF_TESTER", "staff101@example.com", True)
self.course_outline.visit()
self.course_outline.open_exam_settings_dialog()
self.course_outline.select_advanced_settings_tab()
# When I select the timed exams radio button
self.course_outline.select_timed_exam()
# Then the time allotted text field becomes visible
self.assertTrue(self.course_outline.time_allotted_field_visible())
def test_time_allotted_field_is_visible_with_proctored_exam(self):
"""
Test that the time allotted text field is shown if proctored exam radio
button is selected
Given that I am a staff member
And I have visited the course outline page in studio.
And the subsection edit dialog is open
select advanced settings tab
When I select the proctored exams radio button
Then the time allotted text field becomes visible
"""
# Given that I am a staff member
# And I have visited the course outline page in studio.
# And the subsection edit dialog is open
LogoutPage(self.browser).visit()
self._auto_auth("STAFF_TESTER", "staff101@example.com", True)
self.course_outline.visit()
self.course_outline.open_exam_settings_dialog()
self.course_outline.select_advanced_settings_tab()
# When I select the proctored exams radio button
self.course_outline.select_proctored_exam()
# Then the time allotted text field becomes visible
self.assertTrue(self.course_outline.time_allotted_field_visible())
def test_exam_review_rules_field_is_visible_with_proctored_exam(self):
"""
Given that I am a staff member
And I have visited the course outline page in studio.
And the subsection edit dialog is open
select advanced settings tab
When I select the proctored exams radio button
Then the review rules textarea field becomes visible
"""
LogoutPage(self.browser).visit()
self._auto_auth("STAFF_TESTER", "staff101@example.com", True)
self.course_outline.visit()
self.course_outline.open_exam_settings_dialog()
self.course_outline.select_advanced_settings_tab()
self.course_outline.select_proctored_exam()
self.assertTrue(self.course_outline.exam_review_rules_field_visible())
def test_exam_review_rules_field_is_not_visible_with_other_than_proctored_exam(self):
"""
Given that I am a staff member
And I have visited the course outline page in studio.
And the subsection edit dialog is open
select advanced settings tab
When I select the timed exams radio button
Then the review rules textarea field is not visible
When I select the none exam radio button
Then the review rules textarea field is not visible
When I select the practice exam radio button
Then the review rules textarea field is not visible
"""
LogoutPage(self.browser).visit()
self._auto_auth("STAFF_TESTER", "staff101@example.com", True)
self.course_outline.visit()
self.course_outline.open_exam_settings_dialog()
self.course_outline.select_advanced_settings_tab()
self.course_outline.select_timed_exam()
self.assertFalse(self.course_outline.exam_review_rules_field_visible())
self.course_outline.select_none_exam()
self.assertFalse(self.course_outline.exam_review_rules_field_visible())
self.course_outline.select_practice_exam()
self.assertFalse(self.course_outline.exam_review_rules_field_visible())
def test_time_allotted_field_is_visible_with_practice_exam(self):
"""
Test that the time allotted text field is shown if practice exam radio
button is selected
Given that I am a staff member
And I have visited the course outline page in studio.
And the subsection edit dialog is open
select advanced settings tab
When I select the practice exams radio button
Then the time allotted text field becomes visible
"""
# Given that I am a staff member
# And I have visited the course outline page in studio.
# And the subsection edit dialog is open
LogoutPage(self.browser).visit()
self._auto_auth("STAFF_TESTER", "staff101@example.com", True)
self.course_outline.visit()
self.course_outline.open_exam_settings_dialog()
self.course_outline.select_advanced_settings_tab()
# When I select the practice exams radio button
self.course_outline.select_practice_exam()
# Then the time allotted text field becomes visible
self.assertTrue(self.course_outline.time_allotted_field_visible())

View File

@@ -211,6 +211,10 @@ class ProctoredExamsTest(BaseInstructorDashboardTest):
# open the exam settings to make it a proctored exam.
self.course_outline.open_exam_settings_dialog()
# select advanced settings tab
self.course_outline.select_advanced_settings_tab()
self.course_outline.make_exam_proctored()
# login as a verified student and visit the courseware.
@@ -233,6 +237,10 @@ class ProctoredExamsTest(BaseInstructorDashboardTest):
# open the exam settings to make it a proctored exam.
self.course_outline.open_exam_settings_dialog()
# select advanced settings tab
self.course_outline.select_advanced_settings_tab()
self.course_outline.make_exam_timed()
# login as a verified student and visit the courseware.