diff --git a/anatomy/migrations/0016_auto_20210104_1310.py b/anatomy/migrations/0016_auto_20210104_1310.py new file mode 100644 index 00000000..6d6d08a6 --- /dev/null +++ b/anatomy/migrations/0016_auto_20210104_1310.py @@ -0,0 +1,25 @@ +# Generated by Django 3.1.2 on 2021-01-04 13:10 + +import anatomy.models +import django.core.files.storage +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('anatomy', '0015_auto_20201228_2235'), + ] + + operations = [ + migrations.AlterField( + model_name='anatomyquestion', + name='image', + field=models.ImageField(storage=django.core.files.storage.FileSystemStorage(base_url='http://penracourses.org.uk//media/anatomy/', location='/home/ross/sites/rad/media//anatomy/'), upload_to=anatomy.models.image_directory_path), + ), + migrations.AlterField( + model_name='useranswer', + name='cid', + field=models.BigIntegerField(blank=True, null=True), + ), + ] diff --git a/anatomy/migrations/0017_auto_20210104_1355.py b/anatomy/migrations/0017_auto_20210104_1355.py new file mode 100644 index 00000000..c7cca477 --- /dev/null +++ b/anatomy/migrations/0017_auto_20210104_1355.py @@ -0,0 +1,23 @@ +# Generated by Django 3.1.2 on 2021-01-04 13:55 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('anatomy', '0016_auto_20210104_1310'), + ] + + operations = [ + migrations.AlterField( + model_name='ciduseranswer', + name='cid', + field=models.BigIntegerField(blank=True, help_text='Candidate ID (limitied by BigIntegerField size)', null=True), + ), + migrations.AlterField( + model_name='useranswer', + name='cid', + field=models.BigIntegerField(blank=True, help_text='Candidate ID (limitied by BigIntegerField size)', null=True), + ), + ] diff --git a/anatomy/models.py b/anatomy/models.py index b9082712..8b14ca2e 100644 --- a/anatomy/models.py +++ b/anatomy/models.py @@ -297,7 +297,7 @@ class UserAnswer(models.Model): settings.AUTH_USER_MODEL, null=True, blank=True, on_delete=models.SET_NULL ) - cid = models.IntegerField(blank=True, null=True) + cid = models.BigIntegerField(blank=True, null=True, help_text="Candidate ID (limitied by BigIntegerField size)") # Each user answer is associated with a particular exam exam = models.ForeignKey( @@ -331,7 +331,7 @@ class CidUserAnswer(models.Model): ) answer = models.TextField(max_length=500, blank=True) - cid = models.IntegerField(blank=True, null=True) + cid = models.BigIntegerField(blank=True, null=True, help_text="Candidate ID (limitied by BigIntegerField size)") # Each user answer is associated with a particular exam exam = models.ForeignKey( diff --git a/anatomy/static/css/anatomy.css b/anatomy/static/css/anatomy.css index 47e07434..52a39c91 100644 --- a/anatomy/static/css/anatomy.css +++ b/anatomy/static/css/anatomy.css @@ -26,7 +26,8 @@ a, a:link { } .answer-list .correct { - color: green; + /* color: green; */ + color: lightblue; } .answer-list .correct::after{ @@ -53,7 +54,7 @@ a, a:link { } .answer-list .not-marked { - color: lightblue; + color: white; } .key { @@ -65,7 +66,8 @@ a, a:link { } .answered { - color: green; + /* color: green; */ + color: lightblue; } .unanswered { @@ -319,11 +321,12 @@ img.uploading:hover { } .user-answer-score-1 { - color: greenyellow; + color: yellow; } .user-answer-score-2 { - color: green; + /* color: green; */ + color: lightblue; } td.user-answer-score-0::after { @@ -383,7 +386,8 @@ td.user-answer-score-2::after { } .answer-1 { - color: green; + /* color: green; */ + color: lightblue; } .answer-0 { diff --git a/anatomy/static/js/anatomy.js b/anatomy/static/js/anatomy.js index 24d974b5..765530c0 100644 --- a/anatomy/static/js/anatomy.js +++ b/anatomy/static/js/anatomy.js @@ -31,7 +31,7 @@ $(document).ready(function () { if($(".post-form").length > 0) { $(".post-form").get(0).addEventListener("submit", function (e) { - if($(".not-marked").length > 0) { + if($(".not-marked").length > 0 && e.submitter.name != "skip") { e.preventDefault(); // before the code alert("Ensure all answers are marked first"); } diff --git a/anatomy/templates/anatomy/exam_overview.html b/anatomy/templates/anatomy/exam_overview.html index 1958779f..36e730d8 100644 --- a/anatomy/templates/anatomy/exam_overview.html +++ b/anatomy/templates/anatomy/exam_overview.html @@ -26,7 +26,7 @@
{{ question.question_type }}: {{ question.GetPrimaryAnswer }}
- Modality: {{ question.modality }}, View + Modality: {{ question.modality }}, View, Mark {% endfor %} diff --git a/anatomy/templates/anatomy/mark.html b/anatomy/templates/anatomy/mark.html index 89b6e4bc..90420b1c 100644 --- a/anatomy/templates/anatomy/mark.html +++ b/anatomy/templates/anatomy/mark.html @@ -38,6 +38,7 @@ {% if question_details.current >= question_details.total %} {% else %} + {% endif %} diff --git a/anatomy/templates/anatomy/mark_overview.html b/anatomy/templates/anatomy/mark_overview.html index c7c97465..ed2619b4 100644 --- a/anatomy/templates/anatomy/mark_overview.html +++ b/anatomy/templates/anatomy/mark_overview.html @@ -3,7 +3,7 @@ {% block content %}

Marking exam: {{ exam.name }}

- Question order may be different on the test system (as json order is not guaranteed to be maintained) + You can start marking from a particular question by clicking on it below.
diff --git a/anatomy/views.py b/anatomy/views.py index 7bc47e1a..6e23bcf6 100644 --- a/anatomy/views.py +++ b/anatomy/views.py @@ -281,12 +281,12 @@ def loadJsonAnswer(answer): if (not isinstance(answer["cid"], int)) or ( not isinstance(answer["eid"], int) or (not isinstance(answer["ans"], str)) ): - return JsonResponse({"success": False}) + return JsonResponse({"success": False, "error": "cid or eid or answers not defined"}) # The model should catch invalid data but this should be less intensive - max_int = 10000000 + max_int = 999999999999999999999 if answer["cid"] > max_int or answer["eid"] > max_int: - return JsonResponse({"success": False}) + return JsonResponse({"success": False, "error": "invalid cid"}) exam = get_object_or_404(Exam, pk=answer["eid"]) @@ -420,6 +420,10 @@ def mark(request, pk, sk): # TODO: convert to JSON request # ******************************* if form.is_valid(): + # If skip button is pressed skip the question without marking + if "skip" in request.POST: + return redirect("anatomy:mark", pk=pk, sk=n + 1) + cd = form.cleaned_data # correct = cd.get("correct") # half_correct = cd.get("half_correct")