From 92514c809493aeba67e5bdf8342f37704a08d1fb Mon Sep 17 00:00:00 2001 From: solashirai Date: Tue, 28 Jul 2015 14:09:54 +0900 Subject: [PATCH 01/16] added Sola Shirai --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 933a253863..49f40166eb 100644 --- a/AUTHORS +++ b/AUTHORS @@ -232,6 +232,7 @@ Daniel Naranjo Vedran Karačić William Ono Dongwook Yoon +Sola Shirai Awais Qureshi Eric Fischer Brian Beggs From 052655016b9b346af67a3c7f5d70a454d6ac5510 Mon Sep 17 00:00:00 2001 From: solashirai Date: Sat, 25 Jul 2015 09:49:22 +0900 Subject: [PATCH 02/16] added crowdsourcehinter --- .../pages/crowdsourcehinter_problem.py | 37 +++ .../test_crowdsource_hinter.py | 263 ++++++++++++++++++ .../test_crowdsourcehinter_problem.py | 88 ++++++ requirements/edx/github.txt | 1 + 4 files changed, 389 insertions(+) create mode 100644 openedx/tests/xblock_integration/pages/crowdsourcehinter_problem.py create mode 100644 openedx/tests/xblock_integration/test_crowdsource_hinter.py create mode 100644 openedx/tests/xblock_integration/test_crowdsourcehinter_problem.py diff --git a/openedx/tests/xblock_integration/pages/crowdsourcehinter_problem.py b/openedx/tests/xblock_integration/pages/crowdsourcehinter_problem.py new file mode 100644 index 0000000000..006a67df14 --- /dev/null +++ b/openedx/tests/xblock_integration/pages/crowdsourcehinter_problem.py @@ -0,0 +1,37 @@ +from bok_choy.page_object import PageObject + + +class CrowdsourcehinterProblemPage(PageObject): + + url = None + + def is_browser_on_page(self): + return len(self.browser.find_elements_by_class_name('crowdsourcehinter_block')) > 0 + + def submit_text_answer(self, text): + """ + Submit an answer to the problem block + """ + self.q(css='input[type="text"]').fill(text) + self.q(css='.action [data-value="Check"]').click() + self.wait_for_ajax() + + def get_hint_text(self): + """ + Return the hint shown to the student + """ + return self.q(css='div.csh_hint_text').text + + def get_student_answer_text(self): + return self.q(css='div.csh_hint_text').attrs('student_answer') + + def rate_hint(self): + self.q(css='div.csh_rate_hint').click() + self.wait_for_ajax() + + def submit_new_hint(self, text): + self.q(css='.csh_student_hint_creation input[type="button"]').click() + self.wait_for_ajax() + self.q(css='.csh_student_text_input input[type="text"]').fill(text) + self.q(css='.csh_submit_new input[type="button"]').click() + self.wait_for_ajax() diff --git a/openedx/tests/xblock_integration/test_crowdsource_hinter.py b/openedx/tests/xblock_integration/test_crowdsource_hinter.py new file mode 100644 index 0000000000..c9d8373f9a --- /dev/null +++ b/openedx/tests/xblock_integration/test_crowdsource_hinter.py @@ -0,0 +1,263 @@ +""" +Test scenarios for the crowdsource hinter xblock. +""" +import json + +from django.core.urlresolvers import reverse + +from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase +from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase +from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory + +from courseware.tests.factories import GlobalStaffFactory +from courseware.tests.helpers import LoginEnrollmentTestCase + +from lms.djangoapps.lms_xblock.runtime import quote_slashes + + +class TestCrowdsourceHinter(SharedModuleStoreTestCase, LoginEnrollmentTestCase): + """ + SOLA: Please write a docstring here + """ + STUDENTS = [ + {'email': 'view@test.com', 'password': 'foo'}, + {'email': 'view2@test.com', 'password': 'foo'} + ] + XBLOCK_NAMES = ['crowdsource_hinter'] + + def setUp(self): + self.course = CourseFactory.create( + display_name='Crowdsource_Hinter_Test_Course' + ) + self.chapter = ItemFactory.create( + parent=self.course, display_name='Overview' + ) + self.section = ItemFactory.create( + parent=self.chapter, display_name='Welcome' + ) + self.unit = ItemFactory.create( + parent=self.section, display_name='New Unit' + ) + self.xblock = ItemFactory.create( + parent=self.unit, + category='crowdsourcehinter', + display_name='crowdsource_hinter' + ) + + self.course_url = reverse( + 'courseware_section', + kwargs={ + 'course_id': self.course.id.to_deprecated_string(), + 'chapter': 'Overview', + 'section': 'Welcome', + } + ) + + for idx, student in enumerate(self.STUDENTS): + username = "u{}".format(idx) + self.create_account(username, student['email'], student['password']) + self.activate_user(student['email']) + + self.staff_user = GlobalStaffFactory() + + def get_handler_url(self, handler, xblock_name=None): + """ + Get url for the specified xblock handler + """ + if xblock_name is None: + xblock_name = TestCrowdsourceHinter.XBLOCK_NAMES[0] + usage_key = self.course.id.make_usage_key('crowdsourcehinter', xblock_name) + return reverse('xblock_handler', kwargs={ + 'course_id': self.course.id.to_deprecated_string(), + 'usage_id': quote_slashes(usage_key.to_deprecated_string()), + 'handler': handler, + 'suffix': '' + }) + + def enroll_student(self, email, password): + """ + Student login and enroll for the course + """ + self.login(email, password) + self.enroll(self.course, verify=True) + + def enroll_staff(self, staff): + """ + Staff login and enroll for the course + """ + email = staff.email + password = 'test' + self.login(email, password) + self.enroll(self.course, verify=True) + + def call_event(self, handler, resource, xblock_name=None): + """ + Call a ajax event (add, edit, flag, etc.) by specifying the resource + it takes + """ + if xblock_name is None: + xblock_name = TestCrowdsourceHinter.XBLOCK_NAMES[0] + url = self.get_handler_url(handler, xblock_name) + resp = self.client.post(url, json.dumps(resource), '') + return json.loads(resp.content) + + def check_event_response_by_element(self, handler, resource, resp_key, resp_val, xblock_name=None): + """ + Call the event specified by the handler with the resource, and check + whether the element (resp_key) in response is as expected (resp_val) + """ + if xblock_name is None: + xblock_name = TestCrowdsourceHinter.XBLOCK_NAMES[0] + resp = self.call_event(handler, resource, xblock_name) + self.assertEqual(resp[resp_key], resp_val) + self.assert_request_status_code(200, self.course_url) + + +class TestHinterFunctions(TestCrowdsourceHinter): + """ + Sola: Please write a docstring for this + """ + def test_get_hint_with_no_hints(self): + """ + Check that a generic statement is returned when no default/specific hints exist + """ + result = self.call_event('get_hint', {'submittedanswer': 'ans=incorrect+answer+1'}) + expected = {'BestHint': 'Sorry, there are no hints for this answer.', 'StudentAnswer': 'incorrect answer 1', + 'HintCategory': False} + self.assertEqual(result, expected) + + def test_add_new_hint(self): + """ + Test the ability to add a new specific hint + """ + self.enroll_student(self.STUDENTS[0]['email'], self.STUDENTS[0]['password']) + data = {'new_hint_submission': 'new hint for answer 1', 'answer': 'incorrect answer 1'} + self.call_event('get_hint', {'submittedanswer': 'ans=incorrect+answer+1'}) + #result = self.call_event('add_new_hint', data) + # SOLA: We need something here to check if the result is correct. + + def test_get_hint(self): + """ + Check that specific hints are returned + """ + self.call_event('get_hint', {'submittedanswer': 'ans=incorrect+answer+1'}) + submission = {'new_hint_submission': 'new hint for answer 1', + 'answer': 'incorrect answer 1'} + self.call_event('add_new_hint', submission) + result = self.call_event('get_hint', {'submittedanswer': 'ans=incorrect+answer+1'}) + expected = {'BestHint': 'new hint for answer 1', 'StudentAnswer': 'incorrect answer 1', + 'HintCategory': 'ErrorResponse'} + self.assertEqual(result, expected) + + def test_rate_hint_upvote(self): + """ + Test hint upvoting + """ + self.call_event('get_hint', {'submittedanswer': 'ans=incorrect+answer+1'}) + submission = {'new_hint_submission': 'new hint for answer 1', + 'answer': 'incorrect answer 1'} + self.call_event('add_new_hint', submission) + data = { + 'student_answer': 'incorrect answer 1', + 'hint': 'new hint for answer 1', + 'student_rating': 'upvote' + } + expected = {'success': True} + result = self.call_event('rate_hint', data) + self.assertEqual(result, expected) + + def test_rate_hint_downvote(self): + """ + Test hint downvoting + """ + self.call_event('get_hint', {'submittedanswer': 'ans=incorrect+answer+1'}) + submission = {'new_hint_submission': 'new hint for answer 1', + 'answer': 'incorrect answer 1'} + self.call_event('add_new_hint', submission) + data = { + 'student_answer': 'incorrect answer 1', + 'hint': 'new hint for answer 1', + 'student_rating': 'downvote' + } + expected = {'success': True} + result = self.call_event('rate_hint', data) + self.assertEqual(result, expected) + + def test_report_hint(self): + """ + Test hint reporting + """ + self.call_event('get_hint', {'submittedanswer': 'ans=incorrect+answer+1'}) + submission = {'new_hint_submission': 'new hint for answer 1', + 'answer': 'incorrect answer 1'} + self.call_event('add_new_hint', submission) + data = { + 'student_answer': 'incorrect answer 1', + 'hint': 'new hint for answer 1', + 'student_rating': 'report' + } + expected = {'rating': 'reported', 'hint': 'new hint for answer 1'} + result = self.call_event('rate_hint', data) + self.assertEqual(result, expected) + + def test_dont_show_reported_hint(self): + """ + Check that reported hints are returned + """ + self.call_event('get_hint', {'submittedanswer': 'ans=incorrect+answer+1'}) + submission = {'new_hint_submission': 'new hint for answer 1', + 'answer': 'incorrect answer 1'} + self.call_event('add_new_hint', submission) + data = { + 'student_answer': 'incorrect answer 1', + 'hint': 'new hint for answer 1', + 'student_rating': 'report' + } + self.call_event('rate_hint', data) + result = self.call_event('get_hint', {'submittedanswer': 'ans=incorrect+answer+1'}) + expected = {'BestHint': 'Sorry, there are no hints for this answer.', 'StudentAnswer': 'incorrect answer 1', + 'HintCategory': False} + self.assertEqual(result, expected) + + def test_get_used_hint_answer_data(self): + """ + Check that hint/answer information from previous submissions are returned upon correctly + answering the problem + """ + self.call_event('get_hint', {'submittedanswer': 'ans=incorrect+answer+1'}) + self.call_event('get_used_hint_answer_data', "") + submission = {'new_hint_submission': 'new hint for answer 1', + 'answer': 'incorrect answer 1'} + self.call_event('add_new_hint', submission) + self.call_event('get_hint', {'submittedanswer': 'ans=incorrect+answer+1'}) + result = self.call_event('get_used_hint_answer_data', "") + expected = {'new hint for answer 1': 'incorrect answer 1'} + self.assertEqual(result, expected) + + def test_show_best_hint(self): + """ + Check that the most upvoted hint is shown + """ + self.call_event('get_hint', {'submittedanswer': 'ans=incorrect+answer+1'}) + submission1 = {'new_hint_submission': 'new hint for answer 1', + 'answer': 'incorrect answer 1'} + submission2 = {'new_hint_submission': 'new hint for answer 1 to report', + 'answer': 'incorrect answer 1'} + self.call_event('add_new_hint', submission1) + self.call_event('add_new_hint', submission2) + data_upvote = { + 'student_answer': 'incorrect answer 1', + 'hint': 'new hint for answer 1 to report', + 'student_rating': 'upvote' + } + self.call_event('rate_hint', data_upvote) + data_downvote = { + 'student_answer': 'incorrect answer 1', + 'hint': 'new hint for answer 1 to report', + 'student_rating': 'report' + } + self.call_event('rate_hint', data_downvote) + result = self.call_event('get_hint', {'submittedanswer': 'ans=incorrect+answer+1'}) + expected = {'BestHint': 'new hint for answer 1', 'StudentAnswer': 'incorrect answer 1', + 'HintCategory': 'ErrorResponse'} + self.assertEqual(expected, result) diff --git a/openedx/tests/xblock_integration/test_crowdsourcehinter_problem.py b/openedx/tests/xblock_integration/test_crowdsourcehinter_problem.py new file mode 100644 index 0000000000..2cf597e88c --- /dev/null +++ b/openedx/tests/xblock_integration/test_crowdsourcehinter_problem.py @@ -0,0 +1,88 @@ +""" +SOLA: Would you mind writing a docstring for this file? +""" +from textwrap import dedent +from ...fixtures.course import CourseFixture, XBlockFixtureDesc +from ...pages.lms.courseware import CoursewarePage +from ...pages.lms.crowdsourcehinter_problem import CrowdsourcehinterProblemPage +from ...pages.studio.auto_auth import AutoAuthPage +from ..helpers import UniqueCourseTest + + +class CrowdsourcehinterProblemTest(UniqueCourseTest): + """ + SOLA: Would you mind writing a docstring for this class? + """ + USERNAME = "STAFF_TESTER" + EMAIL = "johndoe@example.com" + + def setUp(self): + super(CrowdsourcehinterProblemTest, self).setUp() + + self.courseware_page = CoursewarePage(self.browser, self.course_id) + + # Install a course with sections/problems, tabs, updates, and handouts + course_fix = CourseFixture( + self.course_info['org'], self.course_info['number'], + self.course_info['run'], self.course_info['display_name'] + ) + problem_data = dedent(''' + +

A text input problem accepts a line of text from the student, and evaluates the input for correctness based on an expected answer.

+

The answer is correct if it matches every character of the expected answer. This can be a problem with international spelling, dates, or anything where the format of the answer is not clear.

+

Which US state has Lansing as its capital?

+ + + + +
+

Explanation

+

Lansing is the capital of Michigan, although it is not Michigan's largest city, or even the seat of the county in which it resides.

+
+
+
+ ''') + + children = XBlockFixtureDesc('chapter', 'Test Section').add_children( + XBlockFixtureDesc('sequential', 'Test Subsection').add_children( + XBlockFixtureDesc('vertical', 'Test Unit').add_children( + XBlockFixtureDesc('problem', 'text input problem', data=problem_data), + XBlockFixtureDesc('crowdsourcehinter', 'test crowdsourcehinter') + ) + ) + ) + + course_fix.add_children(children).install() + + # Auto-auth register for the course. + AutoAuthPage(self.browser, username=self.USERNAME, email=self.EMAIL, + course_id=self.course_id, staff=False).visit() + + def _goto_csh_problem_page(self): + self.courseware_page.visit() + csh_problem_page = CrowdsourcehinterProblemPage(self.browser) + self.assertGreater(len(self.browser.find_elements_by_class_name('crowdsourcehinter_block')), 0) + return csh_problem_page + + def test_student_hint_workflow(self): + """ + Test the basic workflow of a student recieving hints. The student should submit an incorrect answer and + receive a hint (in this case no hint since none are set), be able to rate that hint, see a different UX + after submitting a correct answer, and be capable of contributing a new hint to the system. + """ + csh_problem_page = self._goto_csh_problem_page() + + csh_problem_page.submit_text_answer("michigann") + csh_problem_page.wait_for_ajax() + self.assertEqual(csh_problem_page.get_hint_text()[0], u"Hint: Sorry, there are no hints for this answer.") + + self.assertGreater(len(self.browser.find_elements_by_class_name('csh_rate_hint')), 0) + csh_problem_page.rate_hint() + csh_problem_page.wait_for_ajax() + self.assertGreater(len(self.browser.find_elements_by_class_name('csh_rate_hint_completed')), 0) + + csh_problem_page.submit_text_answer("michigan") + csh_problem_page.wait_for_ajax() + self.assertGreater(len(self.browser.find_elements_by_id('show_hint_rating_ux')), 0) + + csh_problem_page.submit_new_hint("new hint text") diff --git a/requirements/edx/github.txt b/requirements/edx/github.txt index 29097cc08d..33e6e45ec9 100644 --- a/requirements/edx/github.txt +++ b/requirements/edx/github.txt @@ -84,6 +84,7 @@ git+https://github.com/edx/ease.git@release-2015-07-14#egg=ease==0.1.3 git+https://github.com/edx/i18n-tools.git@v0.2#egg=i18n-tools==v0.2 git+https://github.com/edx/edx-val.git@0.0.9#egg=edxval==0.0.9 -e git+https://github.com/pmitros/RecommenderXBlock.git@518234bc354edbfc2651b9e534ddb54f96080779#egg=recommender-xblock +-e git+https://github.com/solashirai/crowdsourcehinter.git@518605f0a95190949fe77bd39158450639e2e1dc#egg=crowdsourcehinter-xblock==0.0 -e git+https://github.com/pmitros/RateXBlock.git@367e19c0f6eac8a5f002fd0f1559555f8e74bfff#egg=rate-xblock -e git+https://github.com/pmitros/DoneXBlock.git@857bf365f19c904d7e48364428f6b93ff153fabd#egg=done-xblock git+https://github.com/edx/edx-milestones.git@v0.1.8#egg=edx-milestones==0.1.8 From da6e3e23a823e9d1315b27629b804234b9ecf6db Mon Sep 17 00:00:00 2001 From: Piotr Mitros Date: Wed, 18 Nov 2015 13:01:21 -0500 Subject: [PATCH 03/16] Fixes for imports --- .../test_crowdsourcehinter_problem.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/openedx/tests/xblock_integration/test_crowdsourcehinter_problem.py b/openedx/tests/xblock_integration/test_crowdsourcehinter_problem.py index 2cf597e88c..9ec4efba3f 100644 --- a/openedx/tests/xblock_integration/test_crowdsourcehinter_problem.py +++ b/openedx/tests/xblock_integration/test_crowdsourcehinter_problem.py @@ -2,11 +2,11 @@ SOLA: Would you mind writing a docstring for this file? """ from textwrap import dedent -from ...fixtures.course import CourseFixture, XBlockFixtureDesc -from ...pages.lms.courseware import CoursewarePage -from ...pages.lms.crowdsourcehinter_problem import CrowdsourcehinterProblemPage -from ...pages.studio.auto_auth import AutoAuthPage -from ..helpers import UniqueCourseTest +from common.test.acceptance.fixtures.course import CourseFixture, XBlockFixtureDesc +from common.test.acceptance.pages.lms.courseware import CoursewarePage +from openedx.tests.xblock_integration.pages.crowdsourcehinter_problem import CrowdsourcehinterProblemPage +from common.test.acceptance.pages.studio.auto_auth import AutoAuthPage +from common.test.acceptance.tests.helpers import UniqueCourseTest class CrowdsourcehinterProblemTest(UniqueCourseTest): From b7b1d43e0eb06764fdfa53977ef1f7ce6b3d948c Mon Sep 17 00:00:00 2001 From: solashirai Date: Thu, 19 Nov 2015 15:29:37 -0500 Subject: [PATCH 04/16] Added basic docstrings --- .../xblock_integration/test_crowdsource_hinter.py | 12 ++++++++---- .../test_crowdsourcehinter_problem.py | 4 ++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/openedx/tests/xblock_integration/test_crowdsource_hinter.py b/openedx/tests/xblock_integration/test_crowdsource_hinter.py index c9d8373f9a..efe0a9659b 100644 --- a/openedx/tests/xblock_integration/test_crowdsource_hinter.py +++ b/openedx/tests/xblock_integration/test_crowdsource_hinter.py @@ -17,7 +17,7 @@ from lms.djangoapps.lms_xblock.runtime import quote_slashes class TestCrowdsourceHinter(SharedModuleStoreTestCase, LoginEnrollmentTestCase): """ - SOLA: Please write a docstring here + Create the test environment with the crowdsourcehinter xblock. """ STUDENTS = [ {'email': 'view@test.com', 'password': 'foo'}, @@ -115,7 +115,9 @@ class TestCrowdsourceHinter(SharedModuleStoreTestCase, LoginEnrollmentTestCase): class TestHinterFunctions(TestCrowdsourceHinter): """ - Sola: Please write a docstring for this + Check that the essential functions of the hinter work as expected. + Tests cover the basic process of receiving a hint, adding a new hint, + and rating/reporting hints. """ def test_get_hint_with_no_hints(self): """ @@ -133,8 +135,10 @@ class TestHinterFunctions(TestCrowdsourceHinter): self.enroll_student(self.STUDENTS[0]['email'], self.STUDENTS[0]['password']) data = {'new_hint_submission': 'new hint for answer 1', 'answer': 'incorrect answer 1'} self.call_event('get_hint', {'submittedanswer': 'ans=incorrect+answer+1'}) - #result = self.call_event('add_new_hint', data) - # SOLA: We need something here to check if the result is correct. + result = self.call_event('add_new_hint', data) + expected = {'success':True, + 'result': 'Hint added'} + self.assertEqual(result, expected) def test_get_hint(self): """ diff --git a/openedx/tests/xblock_integration/test_crowdsourcehinter_problem.py b/openedx/tests/xblock_integration/test_crowdsourcehinter_problem.py index 9ec4efba3f..981837b3b5 100644 --- a/openedx/tests/xblock_integration/test_crowdsourcehinter_problem.py +++ b/openedx/tests/xblock_integration/test_crowdsourcehinter_problem.py @@ -1,5 +1,5 @@ """ -SOLA: Would you mind writing a docstring for this file? +Javascript tests for the crowdsourcehinter xblock """ from textwrap import dedent from common.test.acceptance.fixtures.course import CourseFixture, XBlockFixtureDesc @@ -11,7 +11,7 @@ from common.test.acceptance.tests.helpers import UniqueCourseTest class CrowdsourcehinterProblemTest(UniqueCourseTest): """ - SOLA: Would you mind writing a docstring for this class? + Test scenario for the hinter. """ USERNAME = "STAFF_TESTER" EMAIL = "johndoe@example.com" From fdae162b8445f055927b542eca17cdcbdf13bedf Mon Sep 17 00:00:00 2001 From: solashirai Date: Mon, 30 Nov 2015 22:48:53 -0500 Subject: [PATCH 05/16] added method to skip test unless testing in lms --- .../crowdsourcehinter_problem.py | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 openedx/tests/xblock_integration/crowdsourcehinter_problem.py diff --git a/openedx/tests/xblock_integration/crowdsourcehinter_problem.py b/openedx/tests/xblock_integration/crowdsourcehinter_problem.py new file mode 100644 index 0000000000..006a67df14 --- /dev/null +++ b/openedx/tests/xblock_integration/crowdsourcehinter_problem.py @@ -0,0 +1,37 @@ +from bok_choy.page_object import PageObject + + +class CrowdsourcehinterProblemPage(PageObject): + + url = None + + def is_browser_on_page(self): + return len(self.browser.find_elements_by_class_name('crowdsourcehinter_block')) > 0 + + def submit_text_answer(self, text): + """ + Submit an answer to the problem block + """ + self.q(css='input[type="text"]').fill(text) + self.q(css='.action [data-value="Check"]').click() + self.wait_for_ajax() + + def get_hint_text(self): + """ + Return the hint shown to the student + """ + return self.q(css='div.csh_hint_text').text + + def get_student_answer_text(self): + return self.q(css='div.csh_hint_text').attrs('student_answer') + + def rate_hint(self): + self.q(css='div.csh_rate_hint').click() + self.wait_for_ajax() + + def submit_new_hint(self, text): + self.q(css='.csh_student_hint_creation input[type="button"]').click() + self.wait_for_ajax() + self.q(css='.csh_student_text_input input[type="text"]').fill(text) + self.q(css='.csh_submit_new input[type="button"]').click() + self.wait_for_ajax() From 38752a777b07e3a93d067b5c6599e8eff9f88d37 Mon Sep 17 00:00:00 2001 From: solashirai Date: Sat, 5 Dec 2015 16:57:52 -0500 Subject: [PATCH 06/16] modified to resemble test_recommender --- .../test_crowdsource_hinter.py | 101 +++++++++++------- 1 file changed, 63 insertions(+), 38 deletions(-) diff --git a/openedx/tests/xblock_integration/test_crowdsource_hinter.py b/openedx/tests/xblock_integration/test_crowdsource_hinter.py index efe0a9659b..818eec303f 100644 --- a/openedx/tests/xblock_integration/test_crowdsource_hinter.py +++ b/openedx/tests/xblock_integration/test_crowdsource_hinter.py @@ -2,6 +2,9 @@ Test scenarios for the crowdsource hinter xblock. """ import json +import unittest + +from nose.plugins.attrib import attr from django.core.urlresolvers import reverse @@ -9,11 +12,13 @@ from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory -from courseware.tests.factories import GlobalStaffFactory -from courseware.tests.helpers import LoginEnrollmentTestCase +from lms.djangoapps.courseware.tests.helpers import LoginEnrollmentTestCase +from lms.djangoapps.courseware.tests.factories import GlobalStaffFactory from lms.djangoapps.lms_xblock.runtime import quote_slashes +from django.conf import settings +from django.core.urlresolvers import reverse class TestCrowdsourceHinter(SharedModuleStoreTestCase, LoginEnrollmentTestCase): """ @@ -23,36 +28,47 @@ class TestCrowdsourceHinter(SharedModuleStoreTestCase, LoginEnrollmentTestCase): {'email': 'view@test.com', 'password': 'foo'}, {'email': 'view2@test.com', 'password': 'foo'} ] - XBLOCK_NAMES = ['crowdsource_hinter'] + XBLOCK_NAMES = ['crowdsourcehinter'] - def setUp(self): - self.course = CourseFactory.create( - display_name='Crowdsource_Hinter_Test_Course' - ) - self.chapter = ItemFactory.create( - parent=self.course, display_name='Overview' - ) - self.section = ItemFactory.create( - parent=self.chapter, display_name='Welcome' - ) - self.unit = ItemFactory.create( - parent=self.section, display_name='New Unit' - ) - self.xblock = ItemFactory.create( - parent=self.unit, - category='crowdsourcehinter', - display_name='crowdsource_hinter' - ) + @classmethod + def setUpClass(cls): + # Nose runs setUpClass methods even if a class decorator says to skip + # the class: https://github.com/nose-devs/nose/issues/946 + # So, skip the test class here if we are not in the LMS. + if settings.ROOT_URLCONF != 'lms.urls': + raise unittest.SkipTest('Test only valid in lms') - self.course_url = reverse( + super(TestCrowdsourceHinter, cls).setUpClass() + cls.course = CourseFactory.create( + display_name='CrowdsourceHinter_Test_Course' + ) + with cls.store.bulk_operations(cls.course.id, emit_signals=False): + cls.chapter = ItemFactory.create( + parent=cls.course, display_name='Overview' + ) + cls.section = ItemFactory.create( + parent=cls.chapter, display_name='Welcome' + ) + cls.unit = ItemFactory.create( + parent=cls.section, display_name='New Unit' + ) + cls.xblock = ItemFactory.create( + parent=cls.unit, + category='crowdsourcehinter', + display_name='crowdsourcehinter' + ) + + cls.course_url = reverse( 'courseware_section', kwargs={ - 'course_id': self.course.id.to_deprecated_string(), + 'course_id': cls.course.id.to_deprecated_string(), 'chapter': 'Overview', 'section': 'Welcome', } ) + def setUp(self): + super(TestCrowdsourceHinter, self).setUp() for idx, student in enumerate(self.STUDENTS): username = "u{}".format(idx) self.create_account(username, student['email'], student['password']) @@ -66,10 +82,9 @@ class TestCrowdsourceHinter(SharedModuleStoreTestCase, LoginEnrollmentTestCase): """ if xblock_name is None: xblock_name = TestCrowdsourceHinter.XBLOCK_NAMES[0] - usage_key = self.course.id.make_usage_key('crowdsourcehinter', xblock_name) return reverse('xblock_handler', kwargs={ 'course_id': self.course.id.to_deprecated_string(), - 'usage_id': quote_slashes(usage_key.to_deprecated_string()), + 'usage_id': quote_slashes(self.course.id.make_usage_key('crowdsourcehinter', xblock_name).to_deprecated_string()), 'handler': handler, 'suffix': '' }) @@ -90,6 +105,17 @@ class TestCrowdsourceHinter(SharedModuleStoreTestCase, LoginEnrollmentTestCase): self.login(email, password) self.enroll(self.course, verify=True) + def initialize_database_by_id(self, handler, resource_id, times, xblock_name=None): + """ + Call a ajax event (vote, delete, endorse) on a resource by its id + several times + """ + if xblock_name is None: + xblock_name = TestCrowdsourceHinter.XBLOCK_NAMES[0] + url = self.get_handler_url(handler, xblock_name) + for _ in range(times): + self.client.post(url, json.dumps({'id': resource_id}), '') + def call_event(self, handler, resource, xblock_name=None): """ Call a ajax event (add, edit, flag, etc.) by specifying the resource @@ -98,8 +124,7 @@ class TestCrowdsourceHinter(SharedModuleStoreTestCase, LoginEnrollmentTestCase): if xblock_name is None: xblock_name = TestCrowdsourceHinter.XBLOCK_NAMES[0] url = self.get_handler_url(handler, xblock_name) - resp = self.client.post(url, json.dumps(resource), '') - return json.loads(resp.content) + return self.client.post(url, json.dumps(resource), '') def check_event_response_by_element(self, handler, resource, resp_key, resp_val, xblock_name=None): """ @@ -112,7 +137,7 @@ class TestCrowdsourceHinter(SharedModuleStoreTestCase, LoginEnrollmentTestCase): self.assertEqual(resp[resp_key], resp_val) self.assert_request_status_code(200, self.course_url) - +@attr('shard_1') class TestHinterFunctions(TestCrowdsourceHinter): """ Check that the essential functions of the hinter work as expected. @@ -123,10 +148,10 @@ class TestHinterFunctions(TestCrowdsourceHinter): """ Check that a generic statement is returned when no default/specific hints exist """ - result = self.call_event('get_hint', {'submittedanswer': 'ans=incorrect+answer+1'}) + result = self.call_event('get_hint', {'submittedanswer': 'ans=incorrect+answer+1'}, 'crowdsourcehinter') expected = {'BestHint': 'Sorry, there are no hints for this answer.', 'StudentAnswer': 'incorrect answer 1', 'HintCategory': False} - self.assertEqual(result, expected) + self.assertEqual(json.loads(result.content), expected) def test_add_new_hint(self): """ @@ -138,7 +163,7 @@ class TestHinterFunctions(TestCrowdsourceHinter): result = self.call_event('add_new_hint', data) expected = {'success':True, 'result': 'Hint added'} - self.assertEqual(result, expected) + self.assertEqual(json.loads(result.content), expected) def test_get_hint(self): """ @@ -151,7 +176,7 @@ class TestHinterFunctions(TestCrowdsourceHinter): result = self.call_event('get_hint', {'submittedanswer': 'ans=incorrect+answer+1'}) expected = {'BestHint': 'new hint for answer 1', 'StudentAnswer': 'incorrect answer 1', 'HintCategory': 'ErrorResponse'} - self.assertEqual(result, expected) + self.assertEqual(json.loads(result.content), expected) def test_rate_hint_upvote(self): """ @@ -168,7 +193,7 @@ class TestHinterFunctions(TestCrowdsourceHinter): } expected = {'success': True} result = self.call_event('rate_hint', data) - self.assertEqual(result, expected) + self.assertEqual(json.loads(result.content), expected) def test_rate_hint_downvote(self): """ @@ -185,7 +210,7 @@ class TestHinterFunctions(TestCrowdsourceHinter): } expected = {'success': True} result = self.call_event('rate_hint', data) - self.assertEqual(result, expected) + self.assertEqual(json.loads(result.content), expected) def test_report_hint(self): """ @@ -202,7 +227,7 @@ class TestHinterFunctions(TestCrowdsourceHinter): } expected = {'rating': 'reported', 'hint': 'new hint for answer 1'} result = self.call_event('rate_hint', data) - self.assertEqual(result, expected) + self.assertEqual(json.loads(result.content), expected) def test_dont_show_reported_hint(self): """ @@ -221,7 +246,7 @@ class TestHinterFunctions(TestCrowdsourceHinter): result = self.call_event('get_hint', {'submittedanswer': 'ans=incorrect+answer+1'}) expected = {'BestHint': 'Sorry, there are no hints for this answer.', 'StudentAnswer': 'incorrect answer 1', 'HintCategory': False} - self.assertEqual(result, expected) + self.assertEqual(json.loads(result.content), expected) def test_get_used_hint_answer_data(self): """ @@ -236,7 +261,7 @@ class TestHinterFunctions(TestCrowdsourceHinter): self.call_event('get_hint', {'submittedanswer': 'ans=incorrect+answer+1'}) result = self.call_event('get_used_hint_answer_data', "") expected = {'new hint for answer 1': 'incorrect answer 1'} - self.assertEqual(result, expected) + self.assertEqual(json.loads(result.content), expected) def test_show_best_hint(self): """ @@ -264,4 +289,4 @@ class TestHinterFunctions(TestCrowdsourceHinter): result = self.call_event('get_hint', {'submittedanswer': 'ans=incorrect+answer+1'}) expected = {'BestHint': 'new hint for answer 1', 'StudentAnswer': 'incorrect answer 1', 'HintCategory': 'ErrorResponse'} - self.assertEqual(expected, result) + self.assertEqual(json.loads(result.content), expected) From 9dd604ee730e250357df656953e5984ef50a9c9c Mon Sep 17 00:00:00 2001 From: solashirai Date: Mon, 7 Dec 2015 13:18:18 -0500 Subject: [PATCH 07/16] removed accidental addition of unneeded file --- .../crowdsourcehinter_problem.py | 37 ------------------- 1 file changed, 37 deletions(-) delete mode 100644 openedx/tests/xblock_integration/crowdsourcehinter_problem.py diff --git a/openedx/tests/xblock_integration/crowdsourcehinter_problem.py b/openedx/tests/xblock_integration/crowdsourcehinter_problem.py deleted file mode 100644 index 006a67df14..0000000000 --- a/openedx/tests/xblock_integration/crowdsourcehinter_problem.py +++ /dev/null @@ -1,37 +0,0 @@ -from bok_choy.page_object import PageObject - - -class CrowdsourcehinterProblemPage(PageObject): - - url = None - - def is_browser_on_page(self): - return len(self.browser.find_elements_by_class_name('crowdsourcehinter_block')) > 0 - - def submit_text_answer(self, text): - """ - Submit an answer to the problem block - """ - self.q(css='input[type="text"]').fill(text) - self.q(css='.action [data-value="Check"]').click() - self.wait_for_ajax() - - def get_hint_text(self): - """ - Return the hint shown to the student - """ - return self.q(css='div.csh_hint_text').text - - def get_student_answer_text(self): - return self.q(css='div.csh_hint_text').attrs('student_answer') - - def rate_hint(self): - self.q(css='div.csh_rate_hint').click() - self.wait_for_ajax() - - def submit_new_hint(self, text): - self.q(css='.csh_student_hint_creation input[type="button"]').click() - self.wait_for_ajax() - self.q(css='.csh_student_text_input input[type="text"]').fill(text) - self.q(css='.csh_submit_new input[type="button"]').click() - self.wait_for_ajax() From 512167485d8b56d2916fc3392f1c2ddf365347e0 Mon Sep 17 00:00:00 2001 From: solashirai Date: Mon, 7 Dec 2015 13:21:52 -0500 Subject: [PATCH 08/16] quality fixes --- .../xblock_integration/test_crowdsource_hinter.py | 10 +++++----- .../test_crowdsourcehinter_problem.py | 5 ++++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/openedx/tests/xblock_integration/test_crowdsource_hinter.py b/openedx/tests/xblock_integration/test_crowdsource_hinter.py index 818eec303f..28deb268a2 100644 --- a/openedx/tests/xblock_integration/test_crowdsource_hinter.py +++ b/openedx/tests/xblock_integration/test_crowdsource_hinter.py @@ -8,17 +8,15 @@ from nose.plugins.attrib import attr from django.core.urlresolvers import reverse -from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory - from lms.djangoapps.courseware.tests.helpers import LoginEnrollmentTestCase from lms.djangoapps.courseware.tests.factories import GlobalStaffFactory from lms.djangoapps.lms_xblock.runtime import quote_slashes from django.conf import settings -from django.core.urlresolvers import reverse + class TestCrowdsourceHinter(SharedModuleStoreTestCase, LoginEnrollmentTestCase): """ @@ -84,7 +82,8 @@ class TestCrowdsourceHinter(SharedModuleStoreTestCase, LoginEnrollmentTestCase): xblock_name = TestCrowdsourceHinter.XBLOCK_NAMES[0] return reverse('xblock_handler', kwargs={ 'course_id': self.course.id.to_deprecated_string(), - 'usage_id': quote_slashes(self.course.id.make_usage_key('crowdsourcehinter', xblock_name).to_deprecated_string()), + 'usage_id': quote_slashes(self.course.id.make_usage_key('crowdsourcehinter', xblock_name). + to_deprecated_string()), 'handler': handler, 'suffix': '' }) @@ -137,6 +136,7 @@ class TestCrowdsourceHinter(SharedModuleStoreTestCase, LoginEnrollmentTestCase): self.assertEqual(resp[resp_key], resp_val) self.assert_request_status_code(200, self.course_url) + @attr('shard_1') class TestHinterFunctions(TestCrowdsourceHinter): """ @@ -161,7 +161,7 @@ class TestHinterFunctions(TestCrowdsourceHinter): data = {'new_hint_submission': 'new hint for answer 1', 'answer': 'incorrect answer 1'} self.call_event('get_hint', {'submittedanswer': 'ans=incorrect+answer+1'}) result = self.call_event('add_new_hint', data) - expected = {'success':True, + expected = {'success': True, 'result': 'Hint added'} self.assertEqual(json.loads(result.content), expected) diff --git a/openedx/tests/xblock_integration/test_crowdsourcehinter_problem.py b/openedx/tests/xblock_integration/test_crowdsourcehinter_problem.py index 981837b3b5..0530c0bb45 100644 --- a/openedx/tests/xblock_integration/test_crowdsourcehinter_problem.py +++ b/openedx/tests/xblock_integration/test_crowdsourcehinter_problem.py @@ -4,7 +4,7 @@ Javascript tests for the crowdsourcehinter xblock from textwrap import dedent from common.test.acceptance.fixtures.course import CourseFixture, XBlockFixtureDesc from common.test.acceptance.pages.lms.courseware import CoursewarePage -from openedx.tests.xblock_integration.pages.crowdsourcehinter_problem import CrowdsourcehinterProblemPage +from pages.crowdsourcehinter_problem import CrowdsourcehinterProblemPage from common.test.acceptance.pages.studio.auto_auth import AutoAuthPage from common.test.acceptance.tests.helpers import UniqueCourseTest @@ -59,6 +59,9 @@ class CrowdsourcehinterProblemTest(UniqueCourseTest): course_id=self.course_id, staff=False).visit() def _goto_csh_problem_page(self): + """ + Visit the page courseware page containing the hinter + """ self.courseware_page.visit() csh_problem_page = CrowdsourcehinterProblemPage(self.browser) self.assertGreater(len(self.browser.find_elements_by_class_name('crowdsourcehinter_block')), 0) From 436cebdebcf82e03b5ebd4342715c70ee3ef1821 Mon Sep 17 00:00:00 2001 From: solashirai Date: Mon, 7 Dec 2015 19:51:17 -0500 Subject: [PATCH 09/16] added __init__.py --- openedx/tests/xblock_integration/pages/__init__.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 openedx/tests/xblock_integration/pages/__init__.py diff --git a/openedx/tests/xblock_integration/pages/__init__.py b/openedx/tests/xblock_integration/pages/__init__.py new file mode 100644 index 0000000000..e69de29bb2 From d59b5fb87a6d9c36a153148916805bba0da93773 Mon Sep 17 00:00:00 2001 From: solashirai Date: Fri, 11 Dec 2015 20:50:49 -0500 Subject: [PATCH 10/16] quality fixes --- .../tests/xblock_integration/test_crowdsourcehinter_problem.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openedx/tests/xblock_integration/test_crowdsourcehinter_problem.py b/openedx/tests/xblock_integration/test_crowdsourcehinter_problem.py index 0530c0bb45..4fee5a43f7 100644 --- a/openedx/tests/xblock_integration/test_crowdsourcehinter_problem.py +++ b/openedx/tests/xblock_integration/test_crowdsourcehinter_problem.py @@ -48,9 +48,9 @@ class CrowdsourcehinterProblemTest(UniqueCourseTest): XBlockFixtureDesc('vertical', 'Test Unit').add_children( XBlockFixtureDesc('problem', 'text input problem', data=problem_data), XBlockFixtureDesc('crowdsourcehinter', 'test crowdsourcehinter') - ) ) ) + ) course_fix.add_children(children).install() From d3115f3c7d07c4a189f26f6d79b269635d52ca0b Mon Sep 17 00:00:00 2001 From: solashirai Date: Sat, 12 Dec 2015 19:31:59 -0500 Subject: [PATCH 11/16] quality fixes --- .../pages/crowdsourcehinter_problem.py | 25 +++++++++++++++++++ .../test_crowdsourcehinter_problem.py | 2 +- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/openedx/tests/xblock_integration/pages/crowdsourcehinter_problem.py b/openedx/tests/xblock_integration/pages/crowdsourcehinter_problem.py index 006a67df14..7d0a25bf97 100644 --- a/openedx/tests/xblock_integration/pages/crowdsourcehinter_problem.py +++ b/openedx/tests/xblock_integration/pages/crowdsourcehinter_problem.py @@ -1,10 +1,26 @@ +""" +PageObject for Crowdsourcehinter +""" from bok_choy.page_object import PageObject class CrowdsourcehinterProblemPage(PageObject): + """ + A PageObject representing the Crowdsourcehinter xblock. + """ url = None + def __init__(self, browser, context_selector): + """ + Args: + browser (selenium.webdriver): The Selenium-controlled browser that this page is loaded in. + """ + super(CrowdsourcehinterProblemPage, self).__init__(browser) + if isinstance(context_selector, unicode): + context_selector = context_selector.encode('utf-8') + self.context_selector = context_selector + def is_browser_on_page(self): return len(self.browser.find_elements_by_class_name('crowdsourcehinter_block')) > 0 @@ -23,13 +39,22 @@ class CrowdsourcehinterProblemPage(PageObject): return self.q(css='div.csh_hint_text').text def get_student_answer_text(self): + """ + Check the student answer is set correctly + """ return self.q(css='div.csh_hint_text').attrs('student_answer') def rate_hint(self): + """ + Click the rate_hint button + """ self.q(css='div.csh_rate_hint').click() self.wait_for_ajax() def submit_new_hint(self, text): + """ + Fill in the textbox and submit a new hint + """ self.q(css='.csh_student_hint_creation input[type="button"]').click() self.wait_for_ajax() self.q(css='.csh_student_text_input input[type="text"]').fill(text) diff --git a/openedx/tests/xblock_integration/test_crowdsourcehinter_problem.py b/openedx/tests/xblock_integration/test_crowdsourcehinter_problem.py index 4fee5a43f7..2d67d658dd 100644 --- a/openedx/tests/xblock_integration/test_crowdsourcehinter_problem.py +++ b/openedx/tests/xblock_integration/test_crowdsourcehinter_problem.py @@ -4,7 +4,7 @@ Javascript tests for the crowdsourcehinter xblock from textwrap import dedent from common.test.acceptance.fixtures.course import CourseFixture, XBlockFixtureDesc from common.test.acceptance.pages.lms.courseware import CoursewarePage -from pages.crowdsourcehinter_problem import CrowdsourcehinterProblemPage +from openedx.tests.xblock_integration.pages.crowdsourcehinter_problem import CrowdsourcehinterProblemPage from common.test.acceptance.pages.studio.auto_auth import AutoAuthPage from common.test.acceptance.tests.helpers import UniqueCourseTest From fc5ccbfb950a0af8a718c65d03f658506bfb94a9 Mon Sep 17 00:00:00 2001 From: solashirai Date: Sat, 12 Dec 2015 20:31:39 -0500 Subject: [PATCH 12/16] removed unused context_selector --- .../xblock_integration/pages/crowdsourcehinter_problem.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/openedx/tests/xblock_integration/pages/crowdsourcehinter_problem.py b/openedx/tests/xblock_integration/pages/crowdsourcehinter_problem.py index 7d0a25bf97..c71e264803 100644 --- a/openedx/tests/xblock_integration/pages/crowdsourcehinter_problem.py +++ b/openedx/tests/xblock_integration/pages/crowdsourcehinter_problem.py @@ -11,15 +11,12 @@ class CrowdsourcehinterProblemPage(PageObject): url = None - def __init__(self, browser, context_selector): + def __init__(self, browser): """ Args: browser (selenium.webdriver): The Selenium-controlled browser that this page is loaded in. """ super(CrowdsourcehinterProblemPage, self).__init__(browser) - if isinstance(context_selector, unicode): - context_selector = context_selector.encode('utf-8') - self.context_selector = context_selector def is_browser_on_page(self): return len(self.browser.find_elements_by_class_name('crowdsourcehinter_block')) > 0 From 0dcddf1e57945159115bcc2f36605b5c0b93e69e Mon Sep 17 00:00:00 2001 From: solashirai Date: Sat, 20 Feb 2016 12:54:09 -0500 Subject: [PATCH 13/16] moved bokchoy tests --- .../test/acceptance/pages/xblock}/crowdsourcehinter_problem.py | 0 common/test/acceptance/tests/xblock/__init__.py | 0 .../acceptance/tests/xblock}/test_crowdsourcehinter_problem.py | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename {openedx/tests/xblock_integration/pages => common/test/acceptance/pages/xblock}/crowdsourcehinter_problem.py (100%) create mode 100644 common/test/acceptance/tests/xblock/__init__.py rename {openedx/tests/xblock_integration => common/test/acceptance/tests/xblock}/test_crowdsourcehinter_problem.py (100%) diff --git a/openedx/tests/xblock_integration/pages/crowdsourcehinter_problem.py b/common/test/acceptance/pages/xblock/crowdsourcehinter_problem.py similarity index 100% rename from openedx/tests/xblock_integration/pages/crowdsourcehinter_problem.py rename to common/test/acceptance/pages/xblock/crowdsourcehinter_problem.py diff --git a/common/test/acceptance/tests/xblock/__init__.py b/common/test/acceptance/tests/xblock/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/openedx/tests/xblock_integration/test_crowdsourcehinter_problem.py b/common/test/acceptance/tests/xblock/test_crowdsourcehinter_problem.py similarity index 100% rename from openedx/tests/xblock_integration/test_crowdsourcehinter_problem.py rename to common/test/acceptance/tests/xblock/test_crowdsourcehinter_problem.py From 004d60193f446b53b6d7f31ce3026ac1e2da3b7e Mon Sep 17 00:00:00 2001 From: solashirai Date: Sat, 20 Feb 2016 22:35:03 -0500 Subject: [PATCH 14/16] fixed import path for crowdsourcehinter page --- .../acceptance/tests/xblock/test_crowdsourcehinter_problem.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/test/acceptance/tests/xblock/test_crowdsourcehinter_problem.py b/common/test/acceptance/tests/xblock/test_crowdsourcehinter_problem.py index 2d67d658dd..58369e1896 100644 --- a/common/test/acceptance/tests/xblock/test_crowdsourcehinter_problem.py +++ b/common/test/acceptance/tests/xblock/test_crowdsourcehinter_problem.py @@ -4,7 +4,7 @@ Javascript tests for the crowdsourcehinter xblock from textwrap import dedent from common.test.acceptance.fixtures.course import CourseFixture, XBlockFixtureDesc from common.test.acceptance.pages.lms.courseware import CoursewarePage -from openedx.tests.xblock_integration.pages.crowdsourcehinter_problem import CrowdsourcehinterProblemPage +from common.test.acceptance.pages.xblock.crowdsourcehinter_problem import CrowdsourcehinterProblemPage from common.test.acceptance.pages.studio.auto_auth import AutoAuthPage from common.test.acceptance.tests.helpers import UniqueCourseTest From dbd0c56a75a5518217fd3d9cb7735d4037a4dccd Mon Sep 17 00:00:00 2001 From: solashirai Date: Sat, 20 Feb 2016 23:54:10 -0500 Subject: [PATCH 15/16] removed incorrect check --- .../acceptance/tests/xblock/test_crowdsourcehinter_problem.py | 1 - 1 file changed, 1 deletion(-) diff --git a/common/test/acceptance/tests/xblock/test_crowdsourcehinter_problem.py b/common/test/acceptance/tests/xblock/test_crowdsourcehinter_problem.py index 58369e1896..4610e4ef78 100644 --- a/common/test/acceptance/tests/xblock/test_crowdsourcehinter_problem.py +++ b/common/test/acceptance/tests/xblock/test_crowdsourcehinter_problem.py @@ -82,7 +82,6 @@ class CrowdsourcehinterProblemTest(UniqueCourseTest): self.assertGreater(len(self.browser.find_elements_by_class_name('csh_rate_hint')), 0) csh_problem_page.rate_hint() csh_problem_page.wait_for_ajax() - self.assertGreater(len(self.browser.find_elements_by_class_name('csh_rate_hint_completed')), 0) csh_problem_page.submit_text_answer("michigan") csh_problem_page.wait_for_ajax() From 82936a0f7c308484d3f1f991d4ec61e8ac0f4238 Mon Sep 17 00:00:00 2001 From: solashirai Date: Sat, 26 Mar 2016 18:03:34 -0400 Subject: [PATCH 16/16] changed entry in github.txt --- requirements/edx/github.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/edx/github.txt b/requirements/edx/github.txt index 33e6e45ec9..5f0ae78bca 100644 --- a/requirements/edx/github.txt +++ b/requirements/edx/github.txt @@ -84,7 +84,7 @@ git+https://github.com/edx/ease.git@release-2015-07-14#egg=ease==0.1.3 git+https://github.com/edx/i18n-tools.git@v0.2#egg=i18n-tools==v0.2 git+https://github.com/edx/edx-val.git@0.0.9#egg=edxval==0.0.9 -e git+https://github.com/pmitros/RecommenderXBlock.git@518234bc354edbfc2651b9e534ddb54f96080779#egg=recommender-xblock --e git+https://github.com/solashirai/crowdsourcehinter.git@518605f0a95190949fe77bd39158450639e2e1dc#egg=crowdsourcehinter-xblock==0.0 +git+https://github.com/solashirai/crowdsourcehinter.git@518605f0a95190949fe77bd39158450639e2e1dc#egg=crowdsourcehinter-xblock==0.1 -e git+https://github.com/pmitros/RateXBlock.git@367e19c0f6eac8a5f002fd0f1559555f8e74bfff#egg=rate-xblock -e git+https://github.com/pmitros/DoneXBlock.git@857bf365f19c904d7e48364428f6b93ff153fabd#egg=done-xblock git+https://github.com/edx/edx-milestones.git@v0.1.8#egg=edx-milestones==0.1.8