Commit c92ea9ca by Stephen Sanchez

Merge pull request #11 from edx/sanchez/bdd

WIP: First pass at creating BDD tests for the Problem Creation stories
parents 4ec216fd 8484309a
Feature: An author can configured required reviewers per submission.
As an author
I can configure a number of required reviewers per submission.
Scenario: Author configures required reviewers per submission
Given: I am an author
And: I configure "<RequiredReviews>" required reviewers per submissions
And: I submit a submission
And: I review enough peer submissions
When: "<RequiredReviews>" students review the submission
Then: I receive my reviews.
Examples:
| RequiredReviews |
| 1 |
| 3 |
| 7 |
# -*- coding: utf-8 -*-
from lettuce import step
@step(u'Given: I am an author')
def given_i_am_an_author(step):
pass
@step(u'And: I configure "([^"]*)" required reviewers per submissions')
def and_i_configure_required_reviewers_per_submission(step, required):
pass
@step(u'And: I submit a submission')
def and_i_submit_a_submission(step):
pass
@step(u'And: I review enough peer submissions')
def and_i_review_enough_peer_submissions(step):
pass
@step(u'When: "([^"]*)" students review the submission')
def when_students_review_the_submission(step, required):
pass
@step(u'Then: I receive my reviews.')
def then_i_receive_my_reviews(step):
pass
\ No newline at end of file
Feature: An author can configured required reviews per student.
As an author
I can configure a number of required reviews per student
Before the student can see their reviewed submission.
Scenario: Author configures required reviewers per submission
Given: I am an author
And: I configure "<RequiredPeerReviews>" required reviews per student
And: A student submits a submission
When: Enough students review the submission
And: The student requests a grade
Then: The student is notified they did not review enough peer submissions
And: A student reviews "<RequiredPeerReviews>" peer submissions
Then: The student receives reviews.
Examples:
| RequiredPeerReviews |
| 2 |
| 5 |
| 12 |
\ No newline at end of file
# -*- coding: utf-8 -*-
from lettuce import step
@step(u'Given: I am an author')
def given_i_am_an_author(step):
pass
@step(u'And: I configure "([^"]*)" required reviews per student')
def and_i_configure_required_reviews_per_student(step, required):
pass
@step(u'And: A student submits a submission')
def and_a_student_submits_a_submission(step):
pass
@step(u'And: A student reviews "([^"]*)" peer submissions')
def and_a_student_reviews_peer_submissions(step, required):
pass
@step(u'When: Enough students review the submission')
def when_enough_students_review_the_submission(step):
pass
@step(u'And: The student requests a grade')
def and_the_student_requests_a_grade(step):
pass
@step(u'Then: The student is notified they did not review enough peer submissions')
def then_the_student_is_notified_they_did_not_review_enough_peer_submissions(step):
pass
@step(u'Then: The student receives reviews.')
def then_the_student_receives_reviews(step):
pass
\ No newline at end of file
Feature: An author is required to configure less reviews than reviewers
As an author
I can configure a number of required reviews per student
I can configure the number of reviews required per submission
The reviews required per submission is validated to be less
than the number of reviews required per student
Scenario: An author is required to configure less reviews than reviewers
Given: I am an author
And: I configure "<RequiredPeerReviews>" required reviews per student
And: I configure "<RequiredReviews>" required reviews per submission
Then: The validation "<Result>"
Examples:
| RequiredReviews | RequiredPeerReviews | Result |
| 1 | 2 | passes |
| 3 | 5 | passes |
| 7 | 12 | passes |
| 3 | 3 | fails |
| 3 | 2 | fails |
| 0 | 0 | fails |
| 0 | 1 | fails |
# -*- coding: utf-8 -*-
from lettuce import step
@step(u'Given: I am an author')
def given_i_am_an_author(step):
pass
@step(u'And: I configure "([^"]*)" required reviewers per student')
def and_i_configure_required_reviewers_per_student(step, required):
pass
@step(u'And: I configure "([^"]*)" required reviewers per submission')
def and_i_configure_required_reviewers_per_student(step, required):
pass
@step(u'Then: The validation "([^"]*)"')
def then_the_validation(step, result):
pass
Feature: An author can configure the peer review start and end dates
As an author
I can configure the date when a question is open for peer review
I can configure the date when a question is closed for peer review
Scenario: An author can configure the peer review start and end dates
Given: I am an author
And: I configure a start date in the "<RelativeStartTime>"
And: I configure an end date in the "<RelativeEndTime>"
When: I attempt to review a peer submission
Then: My attempt to review a peer submission "<Result>"
Examples:
| RelativeStartTime | RelativeEndTime | Result |
| past | future | passes |
| future | future | fails |
| future | past | fails |
| past | past | fails |
# -*- coding: utf-8 -*-
from lettuce import step
@step(u'Given: I am an author')
def given_i_am_an_author(step):
pass
@step(u'And: I configure a start date in the "([^"]*)"')
def and_i_configure_a_start_date(step, start_date):
pass
@step(u'And: I configure an end date in the "([^"]*)"')
def and_i_configure_an_end_date(step, end_date):
pass
@step(u'When: I attempt to review a peer submission')
def when_i_attempt_to_submit_a_submission(step):
pass
@step(u'Then: My attempt to review a peer submission "([^"]*)"')
def then_my_attempt_to_submit_a_submission(step, result):
pass
Feature: Submissions are fixed once reviews have begun
As a student
Once review of my submission has begun
I cannot modify my submission
Scenario: A student can modify a submission if reviewing has not begun
Given: I am a student
When: I submit a submission for peer review
And: I modify my submission
Then: I successfully save changes to my submission
Scenario: A student cannot modify a submission once reviewing has begun
Given: I am a student
When: I submit a submission for peer review
And: A peer begins to review my submission
Then: I cannot modify my submission
# -*- coding: utf-8 -*-
from lettuce import step
@step(u'Given: I am a student')
def given_i_am_a_student(step):
pass
@step(u'When: I submit a submission for peer review')
def when_i_submit_a_submission_for_peer_review(step):
pass
@step(u'And: A peer begins to review my submission')
def and_a_peer_begins_to_review_my_submission(step):
pass
@step(u'Then: I cannot modify my submission')
def then_i_cannot_modify_my_submission(step):
pass
@step(u'And: I modify my submission')
def and_i_modify_my_submission(step):
pass
@step(u'Then: I successfully save changes to my submission')
def then_i_successfully_save_changes_to_my_submission(step):
pass
Feature: A student can submit a submission
As a student
I can submit a submission for peer review
Scenario: A student can submit a submission for peer review
Given: I am a student
When: I submit a submission for peer review
Then: I am notified that my submission has been submitted
Scenario: A student can submit a submission with unicode characters
Given: I am a student
When: I submit a submission for peer review with unicode characters
Then: My submission is submitted and the unicode characters are preserved
# -*- coding: utf-8 -*-
from lettuce import step
@step(u'Given: I am a student')
def given_i_am_a_student(step):
pass
@step(u'When: I submit a submission for peer review')
def when_i_submit_a_submission_for_peer_review(step):
pass
@step(u'Then: I am notified that my submission has been submitted')
def then_i_am_notified_that_my_submission_has_been_submitted(step):
pass
@step(u'When: I submit a submission for peer review with unicode characters')
def when_i_submit_a_submission_for_peer_review_with_unicode_characters(step):
pass
@step(u'Then: My submission is submitted and the unicode characters are preserved')
def then_my_submission_is_submitted_and_the_unicode_characters_are_preserved(step):
pass
\ No newline at end of file
Feature: As an author I can create a rubric
As an author
I want to create a rubric
In order to give feedback on Submissions
Scenario: As an author I create a rubric
Given: I have created a rubric for a problem
When: I review the problem
Then: I should see the rubric
Scenario: As an author I update a rubric
Given: I am an author
When: I review a published rubric
Then: I should see the rubric
And: I update a rubric for a problem
When: I review the problem
Then: I should see the changes to the rubric
# -*- coding: utf-8 -*-
from lettuce import step
@step(u'Given: I am an author')
def given_i_am_an_author(step):
pass
@step(u'Given: I have created a rubric for a problem')
def given_i_have_created_a_rubric_for_a_problem(step):
pass
@step(u'When: I review the problem')
def when_i_review_the_problem(step):
pass
@step(u'Then: I should see the rubric')
def then_i_should_see_the_rubric(step):
pass
@step(u'When: I review a published rubric')
def when_i_review_a_published_rubric(step):
pass
@step(u'And: I update a rubric for a problem')
def and_i_update_a_rubric_for_a_problem(step):
pass
@step(u'When: I review the problem')
def when_i_review_the_problem(step):
pass
@step(u'Then: I should see the changes to the rubric')
def then_i_should_see_the_changes_to_the_rubric(step):
pass
\ No newline at end of file
Feature: An author can configure the submission start and end dates
As an author
I can configure the date when a question is open for submissions
I can configure the date when a question is closed for submissions
Scenario: An author can configure the submission start and end dates
Given: I am an author
And: I configure a start date in the "<RelativeStartTime>"
And: I configure an end date in the "<RelativeEndTime>"
When: I attempt to submit a submission
Then: My attempt to submit a submission "<Result>"
Examples:
| RelativeStartTime | RelativeEndTime | Result |
| past | future | passes |
| future | future | fails |
| future | past | fails |
| past | past | fails |
# -*- coding: utf-8 -*-
from lettuce import step
@step(u'Given: I am an author')
def given_i_am_an_author(step):
pass
@step(u'And: I configure a start date in the "([^"]*)"')
def and_i_configure_a_start_date(step, start_date):
pass
@step(u'And: I configure an end date in the "([^"]*)"')
def and_i_configure_an_end_date(step, end_date):
pass
@step(u'When: I attempt to submit a submission')
def when_i_attempt_to_submit_a_submission(step):
pass
@step(u'Then: My attempt to submit a submission "([^"]*)"')
def then_my_attempt_to_submit_a_submission(step, result):
pass
Feature: Students will not accidentally submit a submission
As a student
When I submit my submission
I will need to confirm my action.
Scenario: A student will not accidentally submit a submission
Given: I am a student
When: I submit a submission for peer review
Then: I am prompted to confirm my decision
# -*- coding: utf-8 -*-
from lettuce import step
@step(u'Given: I am a student')
def given_i_am_a_student(step):
pass
@step(u'When: I submit a submission for peer review')
def when_i_submit_a_submission_for_peer_review(step):
pass
@step(u'Then: I am prompted to confirm my decision')
def then_i_am_prompted_to_confirm_my_decision(step):
pass
"""
Common Grading contains a set of shared grading classes across Peer, Self, Instructor, and Machine Learning.
"""
Feature: Bootstrap
In order to verify that lettuce is working in Travis.
As a Test Engineer
I want to run a dummy BDD spec.
Scenario: Dummy spec
Given: I have defined a step
And: I have implemented the step in lettuce
Then: The spec should run in Travis
# -*- coding: utf-8 -*-
from lettuce import step
@step(u'Given: I have defined a step')
def given_i_have_defined_a_step(step):
pass
@step(u'And: I have implemented the step in lettuce')
def and_i_have_implemented_the_step_in_lettuce(step):
pass
@step(u'Then: The spec should run in Travis')
def then_the_spec_should_run_in_travis(step):
pass
from django.db import models
MAX_LENGTH = 255
ESSAY_BODY_MAX_LENGTH = 10000
GRADING_TYPES = (
('PE', 'Peer Assessment'),
)
class Submission(models.Model):
student_id = models.CharField(max_length=MAX_LENGTH, db_index=True)
location_id = models.CharField(max_length=MAX_LENGTH, default="")
course_id = models.CharField(max_length=MAX_LENGTH, default="")
essay_body = models.TextField(max_length=ESSAY_BODY_MAX_LENGTH, default="")
preferred_grading = models.CharField(max_length=2, choices=GRADING_TYPES)
submitted_date = models.DateTimeField()
class Scoring(models.Model):
points_earned = models.PositiveIntegerField(default=0)
points_possible = models.PositiveIntegerField(default=0)
scored_date = models.DateTimeField()
student_id = models.CharField(max_length=MAX_LENGTH)
score_type = models.CharField(max_length=2, choices=GRADING_TYPES)
confidence = models.FloatField(default=0.0)
included = models.BooleanField(default=True)
submission = models.ForeignKey(Submission)
class Feedback(models.Model):
text = models.TextField(max_length=MAX_LENGTH, default="")
score = models.ForeignKey(Scoring)
"""
The Peer Grading Application pushes a student submission through the Peer Grading Workflow, allowing other students
and instructors to give and receive grades for any open ended submission.
"""
\ No newline at end of file
def get_next_submission(student_id, location):
"""Request the next submission to be peer graded.
Args:
student_id (str): The student requesting to grade a peer. Must check to determine if the requesting student has
submitted an answer of their own.
location (str): The associated location for the submission to be graded.
Returns:
Submission: The submission to grade, if one is available.
"""
pass
def get_last_submission(student_id, location):
"""Used to give visibility to scoring and workflow for a submission in peer grading.
If the student has submitted a submission and has graded enough peers, this function will return the submission as
is, with all available scoring data. If the student has not finished grading peers, scoring information on their
submission is withheld.
Args:
student_id (str): The student.
location (str): The associated location.
Returns:
Submission: The student's latest submission, restrained on workflow completion.
"""
pass
def submit_submission(submission):
"""Submit a submission for peer grading.
Args:
submission (Submission): The submission to add to the peer grading queue. Should contain the student_id,
associated location, and all answer related fields prepopulated. Submission date,
preferred grader, and other attributes can be determined internally.
Returns:
Submission: The saved submission.
"""
pass
def submit_score(scoring, submission):
"""Submit a scoring for a particular submission
Args:
scoring (Scoring): The score for a particular submission.
submission (Submission): The associated submission.
Returns:
bool: True if the submission succeeded.
"""
pass
Feature: Bootstrap
In order to verify that lettuce is working in Travis.
As a Test Engineer
I want to run a dummy BDD spec.
Scenario: Dummy spec
Given: I have defined a step
And: I have implemented the step in lettuce
Then: The spec should run in Travis
# -*- coding: utf-8 -*-
from lettuce import step
@step(u'Given: I have defined a step')
def given_i_have_defined_a_step(step):
pass
@step(u'And: I have implemented the step in lettuce')
def and_i_have_implemented_the_step_in_lettuce(step):
pass
@step(u'Then: The spec should run in Travis')
def then_the_spec_should_run_in_travis(step):
pass
from django.db import models
from common_grading.models import MAX_LENGTH
class Status(models.Model):
student_id = models.CharField(max_length=MAX_LENGTH, db_index=True)
problem_id = models.CharField(max_length=MAX_LENGTH, default="")
grading_status = models.CharField(max_length=MAX_LENGTH, default="")
\ No newline at end of file
"""
Contains all Peer Grading XModule code.
"""
__author__ = 'stephensanchez'
import logging
from xblock.core import XBlock
log = logging.getLogger(__name__)
class PeerGradingBlock(XBlock):
pass
\ No newline at end of file
......@@ -5,7 +5,7 @@ Test-specific Django settings.
# Inherit from base settings
from .base import *
TEST_APPS = ('common_grading', 'peer_grading')
TEST_APPS = ('peer_grading', 'common_grading',)
# Configure nose
NOSE_ARGS = [
......@@ -20,4 +20,4 @@ LETTUCE_APPS = TEST_APPS
LETTUCE_SERVER_PORT = 8005
# Install test-specific Django apps
INSTALLED_APPS += ('django_nose', 'lettuce.django')
INSTALLED_APPS += ('django_nose', 'lettuce.django',)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment