Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
Merge pull request #292 from edx/dsjen/ungraded-content
Browse files Browse the repository at this point in the history
Added ungraded problems/content pages.
  • Loading branch information
dsjen committed Apr 8, 2015
2 parents a3d54be + fdd3688 commit 3ae7920
Show file tree
Hide file tree
Showing 31 changed files with 1,510 additions and 692 deletions.
16 changes: 13 additions & 3 deletions acceptance_tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,19 @@ def str2bool(s):
TEST_COURSE_ID = os.environ.get('TEST_COURSE_ID', u'edX/DemoX/Demo_Course')
TEST_ASSIGNMENT_TYPE = os.environ.get('TEST_ASSIGNMENT_TYPE', 'Homework')
TEST_ASSIGNMENT_ID = os.environ.get('TEST_ASSIGNMENT_ID', u'i4x://edX/DemoX/sequential/basic_questions')
TEST_PROBLEM_ID = os.environ.get('TEST_PROBLEM_ID', u'i4x://edX/DemoX/problem/a0effb954cca4759994f1ac9e9434bf4')
TEST_PROBLEM_PART_ID = os.environ.get('TEST_PROBLEM_PART_ID',
u'i4x-edX-DemoX-problem-a0effb954cca4759994f1ac9e9434bf4_2_1')
TEST_GRADED_PROBLEM_ID = os.environ.get('TEST_GRADED_PROBLEM_ID',
u'i4x://edX/DemoX/problem/a0effb954cca4759994f1ac9e9434bf4')
TEST_GRADED_PROBLEM_PART_ID = os.environ.get('TEST_GRADED_PROBLEM_PART_ID',
u'i4x-edX-DemoX-problem-a0effb954cca4759994f1ac9e9434bf4_2_1')
TEST_UNGRADED_SECTION_ID = os.environ.get('TEST_UNGRADED_SECTION_ID',
u'i4x://edX/DemoX/chapter/interactive_demonstrations')
TEST_UNGRADED_SUBSECTION_ID = os.environ.get('TEST_UNGRADED_SUBSECTION_ID',
u'i4x://edX/DemoX/sequential/19a30717eff543078a5d94ae9d6c18a5')
TEST_UNGRADED_PROBLEM_ID = os.environ.get('TEST_UNGRADED_PROBLEM_ID',
u'i4x://edX/DemoX/problem/303034da25524878a2e66fb57c91cf85')
TEST_UNGRADED_PROBLEM_PART_ID = os.environ.get('TEST_UNGRADED_PROBLEM_PART_ID',
u'i4x-edX-DemoX-problem-303034da25524878a2e66fb57c91cf85_2_1')


DOC_BASE_URL = os.environ.get('DOC_BASE_URL', 'http://edx-insights.readthedocs.org/en/latest')

Expand Down
65 changes: 58 additions & 7 deletions acceptance_tests/pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
from bok_choy.page_object import PageObject
from bok_choy.promise import EmptyPromise

from acceptance_tests import DASHBOARD_SERVER_URL, BASIC_AUTH_PASSWORD, BASIC_AUTH_USERNAME, LMS_HOSTNAME, \
TEST_COURSE_ID, TEST_PROBLEM_ID, TEST_PROBLEM_PART_ID, TEST_ASSIGNMENT_ID, TEST_ASSIGNMENT_TYPE, \
LMS_SSL_ENABLED
from acceptance_tests import (DASHBOARD_SERVER_URL, BASIC_AUTH_PASSWORD, BASIC_AUTH_USERNAME, LMS_HOSTNAME,
TEST_COURSE_ID, TEST_GRADED_PROBLEM_ID, TEST_GRADED_PROBLEM_PART_ID, TEST_ASSIGNMENT_ID,
TEST_ASSIGNMENT_TYPE, TEST_UNGRADED_SECTION_ID, TEST_UNGRADED_SUBSECTION_ID,
TEST_UNGRADED_PROBLEM_ID, TEST_UNGRADED_PROBLEM_PART_ID, LMS_SSL_ENABLED)


class DashboardPage(PageObject): # pylint: disable=abstract-method
Expand Down Expand Up @@ -154,6 +155,56 @@ def is_browser_on_page(self):
return self.browser.title.startswith('Courses')


class CoursePerformanceUngradedContentPage(CoursePage):
def __init__(self, browser, course_id=None):
super(CoursePerformanceUngradedContentPage, self).__init__(browser, course_id)
self.page_url += '/performance/ungraded_content/'

def is_browser_on_page(self):
return super(CoursePerformanceUngradedContentPage, self).is_browser_on_page() and \
'Ungraded Problems' in self.browser.title


class CoursePerformanceUngradedSectionPage(CoursePage):
def __init__(self, browser, course_id=None, section_id=None):
super(CoursePerformanceUngradedSectionPage, self).__init__(browser, course_id)
self.section_id = section_id or TEST_UNGRADED_SECTION_ID
self.page_url += '/performance/ungraded_content/sections/{}/'.format(self.section_id)

def is_browser_on_page(self):
return super(CoursePerformanceUngradedSectionPage, self).is_browser_on_page() and \
'Ungraded Problems' in self.browser.title


class CoursePerformanceUngradedSubsectionPage(CoursePage):
def __init__(self, browser, course_id=None, section_id=None, subsection_id=None):
super(CoursePerformanceUngradedSubsectionPage, self).__init__(browser, course_id)
self.section_id = section_id or TEST_UNGRADED_SECTION_ID
self.subsection_id = subsection_id or TEST_UNGRADED_SUBSECTION_ID
self.page_url += '/performance/ungraded_content/sections/{}/subsections/{}/'.format(
self.section_id, self.subsection_id)

def is_browser_on_page(self):
return super(CoursePerformanceUngradedSubsectionPage, self).is_browser_on_page() and \
'Ungraded Problems' in self.browser.title


class CoursePerformanceUngradedAnswerDistributionPage(CoursePage):
def __init__(self, browser, course_id=None, section_id=None, subsection_id=None, problem_id=None, part_id=None):
super(CoursePerformanceUngradedAnswerDistributionPage, self).__init__(browser, course_id)
self.section_id = section_id or TEST_UNGRADED_SECTION_ID
self.subsection_id = subsection_id or TEST_UNGRADED_SUBSECTION_ID
self.problem_id = problem_id or TEST_UNGRADED_PROBLEM_ID
self.part_id = part_id or TEST_UNGRADED_PROBLEM_PART_ID
self.page_url += '/performance/ungraded_content/sections/{}/subsections/{}/problems/{}/' \
'parts/{}/answer_distribution/'.format(self.section_id, self.subsection_id,
self.problem_id, self.part_id)

def is_browser_on_page(self):
return super(CoursePerformanceUngradedAnswerDistributionPage, self).is_browser_on_page() and \
self.browser.title.startswith('Performance: Problem Submissions')


class CoursePerformanceGradedContentPage(CoursePage):
def __init__(self, browser, course_id=None):
super(CoursePerformanceGradedContentPage, self).__init__(browser, course_id)
Expand All @@ -168,7 +219,7 @@ class CoursePerformanceGradedContentByTypePage(CoursePage):
def __init__(self, browser, course_id=None, assignment_type=None):
super(CoursePerformanceGradedContentByTypePage, self).__init__(browser, course_id)
self.assignment_type = assignment_type or TEST_ASSIGNMENT_TYPE
self.page_url = '{}/performance/graded_content/{}/'.format(self.page_url, self.assignment_type)
self.page_url += '/performance/graded_content/{}/'.format(self.assignment_type)

def is_browser_on_page(self):
return super(CoursePerformanceGradedContentByTypePage, self).is_browser_on_page() and \
Expand All @@ -179,7 +230,7 @@ class CoursePerformanceAssignmentPage(CoursePage):
def __init__(self, browser, course_id=None, assignment_id=None):
super(CoursePerformanceAssignmentPage, self).__init__(browser, course_id)
self.assignment_id = assignment_id or TEST_ASSIGNMENT_ID
self.page_url = '{}/performance/graded_content/assignments/{}/'.format(self.page_url, self.assignment_id)
self.page_url += '/performance/graded_content/assignments/{}/'.format(self.assignment_id)

def is_browser_on_page(self):
return super(CoursePerformanceAssignmentPage, self).is_browser_on_page() and \
Expand All @@ -190,8 +241,8 @@ class CoursePerformanceAnswerDistributionPage(CoursePage):
def __init__(self, browser, course_id=None, assignment_id=None, problem_id=None, part_id=None):
super(CoursePerformanceAnswerDistributionPage, self).__init__(browser, course_id)
self.assignment_id = assignment_id or TEST_ASSIGNMENT_ID
self.problem_id = problem_id or TEST_PROBLEM_ID
self.part_id = part_id or TEST_PROBLEM_PART_ID
self.problem_id = problem_id or TEST_GRADED_PROBLEM_ID
self.part_id = part_id or TEST_GRADED_PROBLEM_PART_ID
self.page_url += '/performance/graded_content/assignments/{}/problems/{}/parts/{}/answer_distribution/'.format(
self.assignment_id, self.problem_id, self.part_id)

Expand Down
Loading

0 comments on commit 3ae7920

Please sign in to comment.