Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP LT-534 #5

Open
wants to merge 143 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
143 commits
Select commit Hold shift + click to select a range
5240df8
testing with double prompts
DawoudSheraz Oct 11, 2019
b9c0571
add polling
DawoudSheraz Oct 16, 2019
1795118
grader test
DawoudSheraz Nov 15, 2019
0cb8fe3
test a problem on the grader
DawoudSheraz Dec 5, 2019
6496a9e
refactor code, fix formatting issue
DawoudSheraz Dec 5, 2019
7a98e46
return staff output but don't display it
DawoudSheraz Dec 10, 2019
9e9d944
add tmp_data folder
DawoudSheraz Dec 12, 2019
0649848
fix the output value
DawoudSheraz Dec 12, 2019
0468ef3
add staff test case output when viewing a learner submission
DawoudSheraz Dec 13, 2019
58da7bf
tweaks for the output showing
DawoudSheraz Dec 13, 2019
233fae8
make staff test cases private
DawoudSheraz Dec 17, 2019
761a18e
hiding unnecessary bits
DawoudSheraz Dec 18, 2019
1da2ca7
run code button checks
DawoudSheraz Dec 19, 2019
7f76b6e
recreate JS files
DawoudSheraz Dec 19, 2019
cb4748c
fix the deployment issue; disable code freeze
DawoudSheraz Dec 19, 2019
71e2614
add side by side rendering
DawoudSheraz Dec 30, 2019
6dffa25
fix some issue with side by side view
DawoudSheraz Dec 30, 2019
a6bbabf
add border logic in template
DawoudSheraz Dec 31, 2019
2f9152d
add correctness info in the backend
DawoudSheraz Dec 31, 2019
97dc20a
template changes
DawoudSheraz Jan 6, 2020
e49a239
add sample output upon submission
DawoudSheraz Jan 6, 2020
364a5d6
remove unnecessary line before the ora rendering
DawoudSheraz Jan 6, 2020
d7f2028
show correctness check on run code
DawoudSheraz Jan 6, 2020
0f33694
CSS changes
DawoudSheraz Jan 6, 2020
5b1e57f
remove commented code
DawoudSheraz Jan 6, 2020
af28cba
Merge pull request #1 from arbisoft/dsheraz/hiring-2
DawoudSheraz Jan 7, 2020
f51c922
fix server error on missing submission
DawoudSheraz Jan 13, 2020
a35259c
add syntax highlighting with prismjs
DawoudSheraz Jan 15, 2020
73c125f
fix some code highlight issues
DawoudSheraz Jan 15, 2020
defec60
fix grader issue and change the test case directory
DawoudSheraz Jan 23, 2020
857272e
fix cpp issues
DawoudSheraz Jan 24, 2020
611151f
grade & staff area is visible to staff only
DawoudSheraz Jan 24, 2020
9c71b68
template text changes
DawoudSheraz Jan 24, 2020
f5630e0
Merge pull request #2 from arbisoft/dsheraz/hiring-3
DawoudSheraz Jan 24, 2020
72ac647
change run code request behavior
DawoudSheraz Jan 28, 2020
064991c
disable unnecessary handlers calls
DawoudSheraz Jan 28, 2020
54cd5ab
Merge pull request #3 from arbisoft/dsheraz/hiring-4
DawoudSheraz Jan 28, 2020
71b077b
fix filename issue, console log
DawoudSheraz Jan 30, 2020
bc0ce99
Merge pull request #4 from arbisoft/dsheraz/hiring-5
DawoudSheraz Jan 30, 2020
3a49e72
add exception for OOP problems
DawoudSheraz Jan 31, 2020
03b23e4
Merge pull request #5 from arbisoft/dsheraz/hiring-6
DawoudSheraz Jan 31, 2020
b6379f3
fix file names for java files
DawoudSheraz Feb 1, 2020
a700d60
Merge pull request #6 from arbisoft/dsheraz/hiring-7
DawoudSheraz Feb 1, 2020
dd3e06f
change template tag
DawoudSheraz Feb 3, 2020
dc58db5
Merge pull request #7 from arbisoft/dsheraz/hiring-8
DawoudSheraz Feb 3, 2020
f4b0286
cpp library args
DawoudSheraz Feb 3, 2020
111e780
Merge pull request #8 from arbisoft/dsheraz/grader-changes
DawoudSheraz Feb 3, 2020
5607fd1
fix issue where staff output is facing error
DawoudSheraz Feb 3, 2020
4c7a7c5
Merge pull request #9 from arbisoft/submission_fix
DawoudSheraz Feb 3, 2020
5d33b39
fix the dictionary update
DawoudSheraz Feb 3, 2020
ae6f3ee
Merge pull request #10 from arbisoft/dsheraz/sub_fix_2
DawoudSheraz Feb 3, 2020
49e3a26
add per file test case capability
DawoudSheraz Apr 17, 2020
2c74dab
render submission information for student and staff
DawoudSheraz Apr 20, 2020
b05d69a
update the display details
DawoudSheraz Apr 23, 2020
1433691
correct percentage calculation
DawoudSheraz Apr 23, 2020
3d1b413
remove output length condition, update language check response
DawoudSheraz Apr 24, 2020
c7fbfb0
show test input
DawoudSheraz May 5, 2020
519d470
reset directory
DawoudSheraz May 5, 2020
483da3b
fix missing staff submission display
DawoudSheraz May 13, 2020
35d4044
Merge pull request #12 from arbisoft/dsheraz/hackerrank-2
DawoudSheraz May 13, 2020
03f01ce
fix java files not running with grader changes
DawoudSheraz Jun 5, 2020
d656056
Merge pull request #13 from arbisoft/dsheraz/hackerrank-java-fix
DawoudSheraz Jun 5, 2020
bc10a68
use exception.message for py2
DawoudSheraz Jun 8, 2020
d30c1f5
Merge pull request #14 from arbisoft/hackerranr-error-fix
DawoudSheraz Jun 8, 2020
ed3a292
fix rendering issue after rubric grading
DawoudSheraz Jun 19, 2020
a670781
Merge pull request #15 from arbisoft/dsheraz/render-fix
DawoudSheraz Jun 19, 2020
9b482bf
add temporary logs for run code
DawoudSheraz Jun 23, 2020
0dd6211
Merge pull request #16 from arbisoft/hackerrank/temporary-logs
DawoudSheraz Jun 23, 2020
14c8f20
log exceptions for debug (#17)
DawoudSheraz Jun 23, 2020
6877a68
handle unicode encode error on file write (#18)
DawoudSheraz Jun 23, 2020
ca8f79c
add unicode error reason (#19)
DawoudSheraz Jun 23, 2020
dd6591f
grader changes (#20)
DawoudSheraz Jun 25, 2020
d602348
code changes for dropdown integrations
DawoudSheraz Jul 2, 2020
f5b58e1
add backward compatible method for submission answer data conversion
DawoudSheraz Jul 6, 2020
889f7cb
update if condition check
DawoudSheraz Jul 6, 2020
2f6e397
Merge pull request #21 from arbisoft/dsheraz/dropdown-integration
DawoudSheraz Jul 6, 2020
fe7126c
frontend changes
DawoudSheraz Jul 20, 2020
91b1daa
Merge pull request #22 from arbisoft/dsheraz/hk-feedback-updates
DawoudSheraz Jul 21, 2020
13710e5
use codemirror for input (#23)
DawoudSheraz Jul 22, 2020
6e406a8
py3 update
DawoudSheraz Jul 23, 2020
12f94dc
Merge pull request #24 from arbisoft/dsheraz/py3-update
DawoudSheraz Jul 23, 2020
9c22934
update ORA requirements to work with py3
DawoudSheraz Jul 27, 2020
d89bdd4
Merge pull request #25 from arbisoft/upgrade-script
DawoudSheraz Jul 27, 2020
e6911b7
fix warning and ora listing issue
DawoudSheraz Jul 28, 2020
c96abb1
Merge pull request #26 from arbisoft/dsheraz/fix-warning
DawoudSheraz Jul 28, 2020
4110166
fix ORA studio edit view issue
DawoudSheraz Aug 7, 2020
cf10263
Merge pull request #27 from arbisoft/dsheraz/studio-authoring-fix
DawoudSheraz Aug 7, 2020
4baf9b0
fix error raised on studio save
DawoudSheraz Aug 7, 2020
3ab330f
Merge pull request #28 from arbisoft/dsheraz/studio-save-fix
DawoudSheraz Aug 7, 2020
36d8604
grader updates (#29)
DawoudSheraz Aug 18, 2020
5722f99
Run staff test cases after submission
DawoudSheraz Aug 20, 2020
2dba478
update task name
DawoudSheraz Aug 20, 2020
b4da28a
Merge pull request #30 from arbisoft/dsheraz/async-staff-run-submission
DawoudSheraz Aug 21, 2020
b19d745
select language from saved response on load (#31)
DawoudSheraz Sep 16, 2020
7262007
use os /tmp dir for creating code temp files
DawoudSheraz Nov 5, 2020
d90dc3e
Merge pull request #32 from arbisoft/dsheraz/change-tmp-code-dir
DawoudSheraz Nov 5, 2020
0279882
UI changes (#33)
DawoudSheraz Nov 11, 2020
c82b021
add method in ORA block to get test case count
DawoudSheraz Nov 25, 2020
a2ef529
Merge pull request #34 from arbisoft/dsheraz/lt-115
DawoudSheraz Nov 25, 2020
9b76a3b
add ability to run code without any input files
DawoudSheraz Dec 24, 2020
4e38d2d
submission render changes
DawoudSheraz Dec 24, 2020
9b8440c
update render details
DawoudSheraz Dec 28, 2020
7b25275
Merge pull request #35 from arbisoft/dsheraz/lt-113
DawoudSheraz Jan 1, 2021
888e7e5
fix ora studio server error
DawoudSheraz Jan 6, 2021
d8605d5
Merge pull request #36 from arbisoft/dsheraz/fix-ora-authoring
DawoudSheraz Jan 6, 2021
ce3ae28
ORA updates
DawoudSheraz Feb 17, 2021
147a28f
Merge pull request #37 from arbisoft/dsheraz/lt-169
DawoudSheraz Feb 18, 2021
76346d2
update run_staff_case celery task
DawoudSheraz Feb 18, 2021
5b93930
Merge pull request #38 from arbisoft/dsheraz/fix-celery-task
DawoudSheraz Feb 19, 2021
e44611c
Add labels field to ORA block - LT-183
HussainTaj-arbisoft Mar 9, 2021
2304a8b
Merge pull request #39 from arbisoft/htaj/lt-183-add-tags
HussainTaj-arbisoft Mar 25, 2021
13bf420
LT-182 Added doc string in grader file
Mar 26, 2021
2142492
Merge pull request #40 from arbisoft/doc-string-grader
nasimfatimaa Mar 26, 2021
7621a57
Convert TestGrader into Mixin
Mar 29, 2021
2c97a37
Merge pull request #41 from arbisoft/lt-184/codegrader-to-mixin
HussainTaj-arbisoft Apr 9, 2021
903ff52
Update JS bundles (#42)
HussainTaj-arbisoft Apr 19, 2021
64fc0ee
lt-207 ora async task bug (#43)
nasimfatimaa Apr 26, 2021
41c7fe7
Add show_private_test_case_results field to ora block (#44)
HussainTaj-arbisoft Aug 2, 2021
7ee4cf7
Add course_id, user_id to run_and_save_staff_test_cases task's kwargs…
HussainTaj-arbisoft Aug 30, 2021
391e1b7
Add private test case results to code execution output (#46)
HussainTaj-arbisoft Sep 14, 2021
c2c29a4
✨ Add a new signal CODING_TEST_CASES_EVALUATED
Sep 28, 2021
5bc0214
♻️ Revert the design problem condition
Sep 28, 2021
46dfac0
💄 Removed the due date message for learners
Nov 4, 2021
9693935
♻️ Remove the commented code
Nov 5, 2021
565261c
Merge pull request #48 from arbisoft/tazeem/better-ux
Nov 8, 2021
56310dc
Merge pull request #47 from arbisoft/tazeem/coding-signal
Nov 10, 2021
310d909
Integrate nodejs (#49)
muhammad-tazeem-imran Dec 16, 2021
c0cdde3
Fix extracting error from response (#50)
HussainTaj-arbisoft Jan 12, 2022
5e904c3
Added javascript syntax highlighting
hassantanveer97 Jan 27, 2022
5524427
Merge pull request #51 from arbisoft/hassan/LT-386-JS-Syntax-highligh…
hassantanveer97 Jan 27, 2022
9781b8e
Merge pull request #52 from arbisoft/litmustest.develop
hassantanveer97 Feb 11, 2022
6e8b3ff
Merge pull request #53 from arbisoft/litmustest.staging
hassantanveer97 Feb 11, 2022
c752268
Fix design problem response (#54)
HussainTaj-arbisoft Feb 16, 2022
de7c06d
Fix design problem response (#54) (#55)
HussainTaj-arbisoft Feb 16, 2022
9492a29
Fix design problem response (#54) (#55) (#56)
HussainTaj-arbisoft Feb 16, 2022
19b712c
Merge pull request #57 from arbisoft/litmustest.develop
rehanedly Feb 16, 2022
a7b617d
Merge pull request #58 from arbisoft/litmustest.staging
rehanedly Feb 16, 2022
11204de
ADR for show input file read code
Apr 6, 2022
59b8cd0
Approved ADR
Apr 12, 2022
ab461af
Merge pull request #59 from arbisoft/LT-534-ADR
rehanedly Apr 12, 2022
1076ce6
Added default file read code for all languages and option to enable i…
Apr 18, 2022
80d409f
complied javascript
Apr 18, 2022
4386d4e
Merge branch 'litmustest.develop' into LT-534
rehanedly Apr 18, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,5 @@ test/selenium/screenshots/*
logs/*.log*

edx-ora2/

openassessment/xblock/job_sample_grader/secret_data
17 changes: 17 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,20 @@ test-sandbox: test-acceptance test-a11y
install-osx-requirements:
brew install gettext
brew link gettext --force

upgrade: export CUSTOM_COMPILE_COMMAND=make upgrade
upgrade: ## update the requirements/*.txt files with the latest packages satisfying requirements/*.in
pip install -qr requirements/pip-tools.txt
pip-compile --upgrade -o requirements/pip-tools.txt requirements/pip-tools.in
pip-compile --upgrade -o requirements/base.txt requirements/base.in
pip-compile --upgrade -o requirements/test.txt requirements/test.in
pip-compile --upgrade -o requirements/quality.txt requirements/quality.in
# Delete django pin from test requirements to avoid tox version collision
sed -i.tmp '/^[d|D]jango==/d' requirements/test.txt
sed -i.tmp '/^djangorestframework==/d' requirements/test.txt
# Delete extra metadata that causes build to fail
sed -i.tmp '/^--index-url/d' requirements/*.txt
sed -i.tmp '/^--extra-index-url/d' requirements/*.txt
sed -i.tmp '/^--trusted-host/d' requirements/*.txt
# Delete temporary files
rm requirements/*.txt.tmp
51 changes: 51 additions & 0 deletions docs/decisions/0001-show-input-file-read-code.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
**Add support to show input file read code in the editor by default**
=======================================

Status
------

*Approved*

Context
-------

- Need to add an option to select if we want to add input file read code in the editor by default or not
- Current behavior of editor:

- There is no option to see from where candidates have to read the input file in the editor

- There is no code available for reading input files

- Users need support on how to read files very frequently

- We need a solution where we can add an option in ORA settings that asks the author if the system should display input file-read code by default in the editor or not

Decisions
---------

- An option to show read input file or not

- There should be a setting in ora that can be modified from the studio for each question where the author can select if the system should display input file read code or not

- Display the default read input file code in the editor

- Default read input file code will be loaded on language changed from the drop-down in the selected language
- Refer to *Appendix A* for the example of a sample input file read code concerning language

- Default read input file code will only be displayed in the editor is empty or contains the default code of any language
- Default read input file code will only displayed if author select true for value of `show_read_input_file_code`.


Appendix A
----------

**Sample input file read code example**:

.. code-block:: JSON

{
"Python":"Default code of Python",
"NodeJS":"Default code of NodeJs",
"Java":"Default code of Java",
"C++":"Default code of C++"
}
2 changes: 1 addition & 1 deletion openassessment/assessment/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import json

from django.contrib import admin
from django.core.urlresolvers import reverse_lazy
from django.urls import reverse_lazy
from django.utils import html

from openassessment.assessment.models import Assessment, AssessmentFeedback, PeerWorkflow, PeerWorkflowItem, Rubric
Expand Down
24 changes: 12 additions & 12 deletions openassessment/assessment/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class Migration(migrations.Migration):
fields=[
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
('feedback', models.TextField(default=b'', blank=True)),
('assessment', models.ForeignKey(related_name='parts', to='assessment.Assessment')),
('assessment', models.ForeignKey(related_name='parts', to='assessment.Assessment', on_delete=models.CASCADE)),
],
),
migrations.CreateModel(
Expand All @@ -72,7 +72,7 @@ class Migration(migrations.Migration):
('name', models.CharField(max_length=100)),
('label', models.CharField(max_length=100, blank=True)),
('explanation', models.TextField(max_length=10000, blank=True)),
('criterion', models.ForeignKey(related_name='options', to='assessment.Criterion')),
('criterion', models.ForeignKey(related_name='options', to='assessment.Criterion', on_delete=models.CASCADE)),
],
options={
'ordering': ['criterion', 'order_num'],
Expand Down Expand Up @@ -102,9 +102,9 @@ class Migration(migrations.Migration):
('submission_uuid', models.CharField(max_length=128, db_index=True)),
('started_at', models.DateTimeField(default=django.utils.timezone.now, db_index=True)),
('scored', models.BooleanField(default=False)),
('assessment', models.ForeignKey(to='assessment.Assessment', null=True)),
('author', models.ForeignKey(related_name='graded_by', to='assessment.PeerWorkflow')),
('scorer', models.ForeignKey(related_name='graded', to='assessment.PeerWorkflow')),
('assessment', models.ForeignKey(to='assessment.Assessment', null=True, on_delete=models.CASCADE)),
('author', models.ForeignKey(related_name='graded_by', to='assessment.PeerWorkflow', on_delete=models.CASCADE)),
('scorer', models.ForeignKey(related_name='graded', to='assessment.PeerWorkflow', on_delete=models.CASCADE)),
],
options={
'ordering': ['started_at', 'id'],
Expand Down Expand Up @@ -147,33 +147,33 @@ class Migration(migrations.Migration):
('raw_answer', models.TextField(blank=True)),
('content_hash', models.CharField(unique=True, max_length=40, db_index=True)),
('options_selected', models.ManyToManyField(to='assessment.CriterionOption')),
('rubric', models.ForeignKey(to='assessment.Rubric')),
('rubric', models.ForeignKey(to='assessment.Rubric', on_delete=models.CASCADE)),
],
),
migrations.AddField(
model_name='studenttrainingworkflowitem',
name='training_example',
field=models.ForeignKey(to='assessment.TrainingExample'),
field=models.ForeignKey(to='assessment.TrainingExample', on_delete=models.CASCADE),
),
migrations.AddField(
model_name='studenttrainingworkflowitem',
name='workflow',
field=models.ForeignKey(related_name='items', to='assessment.StudentTrainingWorkflow'),
field=models.ForeignKey(related_name='items', to='assessment.StudentTrainingWorkflow', on_delete=models.CASCADE),
),
migrations.AddField(
model_name='criterion',
name='rubric',
field=models.ForeignKey(related_name='criteria', to='assessment.Rubric'),
field=models.ForeignKey(related_name='criteria', to='assessment.Rubric', on_delete=models.CASCADE),
),
migrations.AddField(
model_name='assessmentpart',
name='criterion',
field=models.ForeignKey(related_name='+', to='assessment.Criterion'),
field=models.ForeignKey(related_name='+', to='assessment.Criterion', on_delete=models.CASCADE),
),
migrations.AddField(
model_name='assessmentpart',
name='option',
field=models.ForeignKey(related_name='+', to='assessment.CriterionOption', null=True),
field=models.ForeignKey(related_name='+', to='assessment.CriterionOption', null=True, on_delete=models.CASCADE),
),
migrations.AddField(
model_name='assessmentfeedback',
Expand All @@ -183,7 +183,7 @@ class Migration(migrations.Migration):
migrations.AddField(
model_name='assessment',
name='rubric',
field=models.ForeignKey(to='assessment.Rubric'),
field=models.ForeignKey(to='assessment.Rubric', on_delete=models.CASCADE),
),
migrations.AlterUniqueTogether(
name='studenttrainingworkflowitem',
Expand Down
16 changes: 8 additions & 8 deletions openassessment/assessment/models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def content_hash_from_dict(rubric_dict):
rubric_dict.pop("content_hash", None)

canonical_form = json.dumps(rubric_dict, sort_keys=True)
return sha1(canonical_form).hexdigest()
return sha1(canonical_form.encode('utf-8')).hexdigest()

@staticmethod
def structure_hash_from_dict(rubric_dict):
Expand Down Expand Up @@ -141,7 +141,7 @@ def structure_hash_from_dict(rubric_dict):
for criterion in rubric_dict.get('criteria', [])
]
canonical_form = json.dumps(structure, sort_keys=True)
return sha1(canonical_form).hexdigest()
return sha1(canonical_form.encode('utf-8')).hexdigest()


class Criterion(models.Model):
Expand All @@ -152,7 +152,7 @@ class Criterion(models.Model):

All Rubrics have at least one Criterion.
"""
rubric = models.ForeignKey(Rubric, related_name="criteria")
rubric = models.ForeignKey(Rubric, related_name="criteria", on_delete=models.CASCADE)

# Backwards compatibility: The "name" field was formerly
# used both as a display name and as a unique identifier.
Expand Down Expand Up @@ -192,7 +192,7 @@ class CriterionOption(models.Model):
Assessment. That state is stored in :class:`AssessmentPart`.
"""
# All Criteria must have at least one CriterionOption.
criterion = models.ForeignKey(Criterion, related_name="options")
criterion = models.ForeignKey(Criterion, related_name="options", on_delete=models.CASCADE)

# 0-based order in Criterion
order_num = models.PositiveIntegerField()
Expand Down Expand Up @@ -417,7 +417,7 @@ class Assessment(models.Model):
MAX_FEEDBACK_SIZE = 1024 * 100

submission_uuid = models.CharField(max_length=128, db_index=True)
rubric = models.ForeignKey(Rubric)
rubric = models.ForeignKey(Rubric, on_delete=models.CASCADE)

scored_at = models.DateTimeField(default=now, db_index=True)
scorer_id = models.CharField(max_length=40, db_index=True)
Expand Down Expand Up @@ -613,16 +613,16 @@ class AssessmentPart(models.Model):
"""
MAX_FEEDBACK_SIZE = 1024 * 100

assessment = models.ForeignKey(Assessment, related_name='parts')
assessment = models.ForeignKey(Assessment, related_name='parts', on_delete=models.CASCADE)

# Assessment parts are usually associated with an option
# (representing the point value selected for a particular criterion)
# It's possible, however, for an assessment part to contain
# only written feedback, with no point value.
# In this case, the assessment part is associated with a criterion,
# but not with any option (the `option` field is set to null).
criterion = models.ForeignKey(Criterion, related_name="+")
option = models.ForeignKey(CriterionOption, null=True, related_name="+")
criterion = models.ForeignKey(Criterion, related_name="+", on_delete=models.CASCADE)
option = models.ForeignKey(CriterionOption, null=True, related_name="+", on_delete=models.CASCADE)

# Free-form text feedback for the specific criterion
# Note that the `Assessment` model also has a feedback field,
Expand Down
6 changes: 3 additions & 3 deletions openassessment/assessment/models/peer.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,11 +440,11 @@ class PeerWorkflowItem(models.Model):
assessment represents the completed assessment for this work item.

"""
scorer = models.ForeignKey(PeerWorkflow, related_name='graded')
author = models.ForeignKey(PeerWorkflow, related_name='graded_by')
scorer = models.ForeignKey(PeerWorkflow, related_name='graded', on_delete=models.CASCADE)
author = models.ForeignKey(PeerWorkflow, related_name='graded_by', on_delete=models.CASCADE)
submission_uuid = models.CharField(max_length=128, db_index=True)
started_at = models.DateTimeField(default=now, db_index=True)
assessment = models.ForeignKey(Assessment, null=True)
assessment = models.ForeignKey(Assessment, null=True, on_delete=models.CASCADE)

# This WorkflowItem was used to determine the final score for the Workflow.
scored = models.BooleanField(default=False)
Expand Down
4 changes: 2 additions & 2 deletions openassessment/assessment/models/student_training.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,11 @@ class StudentTrainingWorkflowItem(models.Model):
if there are no examples left, the student has
successfully completed training.
"""
workflow = models.ForeignKey(StudentTrainingWorkflow, related_name="items")
workflow = models.ForeignKey(StudentTrainingWorkflow, related_name="items", on_delete=models.CASCADE)
order_num = models.PositiveIntegerField()
started_at = models.DateTimeField(auto_now_add=True)
completed_at = models.DateTimeField(default=None, null=True)
training_example = models.ForeignKey(TrainingExample)
training_example = models.ForeignKey(TrainingExample, on_delete=models.CASCADE)

class Meta:
app_label = "assessment"
Expand Down
4 changes: 2 additions & 2 deletions openassessment/assessment/models/training.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class TrainingExample(models.Model):
# The answer (JSON-serialized)
raw_answer = models.TextField(blank=True)

rubric = models.ForeignKey(Rubric)
rubric = models.ForeignKey(Rubric, on_delete=models.CASCADE)

# Use a m2m to avoid changing the criterion option
options_selected = models.ManyToManyField(CriterionOption)
Expand Down Expand Up @@ -137,7 +137,7 @@ def calculate_hash(answer, options_selected, rubric):
'options_selected': options_selected,
'rubric': rubric.id
})
return sha1(contents).hexdigest()
return sha1(contents.encode('utf-8')).hexdigest()

@classmethod
def cache_key(cls, answer, options_selected, rubric):
Expand Down
2 changes: 1 addition & 1 deletion openassessment/fileupload/backends/django_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from django.core.files.base import ContentFile
from django.core.files.storage import default_storage
from django.core.urlresolvers import reverse
from django.urls import reverse

from .base import BaseBackend

Expand Down
2 changes: 1 addition & 1 deletion openassessment/fileupload/backends/filesystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from django.conf import settings
import django.core.cache
from django.core.urlresolvers import reverse
from django.urls import reverse
from django.utils.encoding import smart_text

from .. import exceptions
Expand Down
2 changes: 1 addition & 1 deletion openassessment/fileupload/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

from django.conf import settings
from django.contrib.auth import get_user_model
from django.core.urlresolvers import reverse_lazy
from django.urls import reverse_lazy
from django.test import TestCase
from django.test.utils import override_settings

Expand Down
54 changes: 54 additions & 0 deletions openassessment/templates/openassessmentblock/edit/oa_edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,60 @@ <h2 class="openassessment_alert_title">{% trans "Rubric Change Impacts Settings
</div>
<p class="setting-help">{% trans "The display name for this component." %}</p>
</li>
<li class="openassessment_date_editor field comp-setting-entry">
<div class="wrapper-comp-setting">
<label
for="openassessment_labels_editor"
class="setting-label">
{% trans "Labels" %}
</label>
<input
type="text"
class="input setting-input"
id="openassessment_labels_editor"
value="{{ labels }}"
>
</div>
<p class="setting-help">
{% trans "A comma-separated list of label strings that can be used to categorize a problem. For example, oop, problem solving, dsa, etc." %}
<br /> {% trans "Rules:" %}
<br /> - {% trans "Only lower case alphabets [a-z]." %}
<br /> - {% trans "Special character &lt;space&gt; is allowed." %}
<br /> - {% trans "Use \",\" to separate labels." %}
</p>
</li>
<li class="field comp-setting-entry">
<div class="wrapper-comp-setting">
<label for="openassessment_show_private_test_case_results_editor" class="setting-label">
{% trans "Show Private Test Case Results"%}
</label>
<select id="openassessment_show_private_test_case_results_editor" class="input setting-input">
<option value="0">{% trans "False"%}</option>
<option value="1" {% if show_private_test_case_results %} selected="true" {% endif %}>
{% trans "True"%}
</option>
</select>
</div>
<p class="setting-help">
{% trans "Indicates whether or not to show private test case results. This only shows if the case passed or failed, it does not show any values."%}
</p>
</li>
<li class="field comp-setting-entry">
<div class="wrapper-comp-setting">
<label for="openassessment_show_file_read_code_editor" class="setting-label">
{% trans "Show File Read Code"%}
</label>
<select id="openassessment_show_file_read_code_editor" class="input setting-input">
<option value="0">{% trans "False"%}</option>
<option value="1" {% if show_file_read_code %} selected="true" {% endif %}>
{% trans "True"%}
</option>
</select>
</div>
<p class="setting-help">
{% trans "Indicates whether or not to show file read code."%}
</p>
</li>
<li class="openassessment_date_editor field comp-setting-entry">
<div class="wrapper-comp-setting">
<label
Expand Down
10 changes: 1 addition & 9 deletions openassessment/templates/openassessmentblock/oa_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,11 @@
<div class="wrapper wrapper--xblock wrapper--openassessment theme--basic">
<div class="openassessment problem">
<div class="wrapper--grid">
{% if title %}
<h3 class="openassessment__title problem__header">{% trans title %}</h3>
{% endif %}


<div class="wrapper-openassessment__message">

{% block message %}
<div class="openassessment__message message">
<div class="message__content">
<p>{% trans "This assignment has several steps. In the first step, you'll provide a response to the prompt. The other steps appear below the Your Response field." %}</p>
</div>
</div>
{% endblock %}
</div>

Expand All @@ -24,7 +17,6 @@ <h3 class="openassessment__title problem__header">{% trans title %}</h3>
<header class="step__header ui-slidable__container">
<h4 class="step__title">
<button class="ui-slidable" aria-expanded="false" aria-describedby="oa_step_status oa_step_deadline" disabled>
<span class="step__counter"></span>
<span class="wrapper--copy">
<span class="step__label">{% trans assessment.title %}</span>
</span>
Expand Down
Loading