Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
d488ae8
removed media file contents
ankitamk14 Sep 30, 2022
8fca33d
Merge branch 'Spoken-tutorial:master' into master
ankitamk14 Sep 30, 2022
9fc085a
Merge branch 'Spoken-tutorial:master' into master
ankitamk14 Sep 30, 2022
7c40828
Merge branch 'Spoken-tutorial:master' into master
ankitamk14 Oct 3, 2022
9003ba9
Merge branch 'Spoken-tutorial:master' into master
ankitamk14 Oct 4, 2022
3bcdc8d
Merge branch 'Spoken-tutorial:master' into master
ankitamk14 Oct 11, 2022
93d7071
Merge branch 'Spoken-tutorial:master' into master
ankitamk14 Oct 21, 2022
5d7e3a3
Merge branch 'Spoken-tutorial:master' into master
ankitamk14 Oct 25, 2022
07ff053
Merge branch 'Spoken-tutorial:master' into master
ankitamk14 Oct 27, 2022
55e89fc
Merge branch 'Spoken-tutorial:master' into master
ankitamk14 Nov 4, 2022
aa7e979
Merge branch 'Spoken-tutorial:master' into master
ankitamk14 Nov 21, 2022
2611c02
Merge branch 'Spoken-tutorial:master' into master
ankitamk14 Nov 21, 2022
3a16072
Merge branch 'Spoken-tutorial:master' into master
ankitamk14 Nov 22, 2022
c32ea3c
Merge branch 'Spoken-tutorial:master' into master
ankitamk14 Nov 24, 2022
6c7146f
Merge branch 'Spoken-tutorial:master' into master
ankitamk14 Nov 25, 2022
2b08711
Merge branch 'Spoken-tutorial:master' into master
ankitamk14 Nov 30, 2022
bc676fe
Merge branch 'Spoken-tutorial:master' into master
ankitamk14 Dec 5, 2022
80aab76
Merge branch 'Spoken-tutorial:master' into master
ankitamk14 Dec 5, 2022
d9995b2
Merge branch 'Spoken-tutorial:master' into master
ankitamk14 Dec 6, 2022
2040d9f
Merge branch 'Spoken-tutorial:master' into master
ankitamk14 Dec 9, 2022
2213710
Merge branch 'Spoken-tutorial:master' into master
ankitamk14 Jan 5, 2023
e0f6dac
Merge branch 'Spoken-tutorial:master' into master
ankitamk14 Jan 9, 2023
9256ac2
Merge branch 'Spoken-tutorial:master' into master
ankitamk14 Jan 12, 2023
4fd2d9d
bug-fix for retest
ankitamk14 Jan 12, 2023
5ed27b0
resolved bug of student-invigilator dual role
ankitamk14 Jan 12, 2023
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: 1 addition & 1 deletion csc/templates/csc/sidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ <h6 class="sidebar-heading d-flex justify-content-between align-items-center px-
</h6>

<li class="nav-item">
<a class="dropdown-item" href="{% url 'csc:invi_dashboard' %}"><i class="fas fa-user-tag sb-icon"></i>Invigilator Dashboard</a>
<a class="dropdown-item" href="{{ request.scheme }}://{{request.get_host}}/csc/invigilator_dashboard/"><i class="fas fa-user-tag sb-icon"></i>Invigilator Dashboard</a>
<a class="nav-link scroll_link " href="{% url 'home' %}"><i class="fas fa-home sb-icon" ></i>Home<span class="sr-only">(current)</span></a>
</li>

Expand Down
8 changes: 4 additions & 4 deletions csc/templates/csc/student_dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@
{% if attendance.status == 1%}
<input type="hidden" id="testurl{{course.mdlcourse_id}}" name="testurl" value="{{ CSC_ONLINE_TEST_URL }}/course/view.php?id={{course.mdlcourse_id}}">

<button class="btn btn-info" type="button" onclick="take_to_test({{course.mdlcourse_id}});">
<button class="btn btn-outline-info btn-sm " type="button" onclick="take_to_test({{course.mdlcourse_id}});">
Attempt {{course.testfoss.foss}} Test
</button>
{% elif attendance.status >= 3%}
Expand All @@ -242,7 +242,7 @@
<span class="badge">Grade: {{grade_entry.mdlgrade}} </span></button>

{% elif grade_entry.status == 3 and not student.id|is_retest_allowed:course.testfoss_id %}
<button type="button" class="btn btn-warning" >Test attempts over &nbsp;
<button type="button" class="btn btn-warning" >No more attempts left&nbsp;
<span class="badge">Grade: {{grade_entry.mdlgrade}} </span></button>
{% endif %}

Expand Down Expand Up @@ -309,7 +309,7 @@
{% if attendance.status == 1%}
<input type="hidden" id="testurl{{course.mdlcourse_id}}" name="testurl" value="{{ CSC_ONLINE_TEST_URL }}/course/view.php?id={{course.mdlcourse_id}}">

<button class="btn btn-info" type="button" onclick="take_to_test({{course.mdlcourse_id}});">
<button class="btn btn-outline-info btn-sm " type="button" onclick="take_to_test({{course.mdlcourse_id}});">
Attempt {{course.testfoss.foss}} Test
</button>
{% elif attendance.status >= 3%}
Expand All @@ -323,7 +323,7 @@
<span class="badge">Grade: {{grade_entry.mdlgrade}} </span></button>

{% elif grade_entry.status == 3 and not student.id|is_retest_allowed:course.testfoss_id %}
<button type="button" class="btn btn-warning" >Test attempts over &nbsp;
<button type="button" class="btn btn-warning" >No more attempts left
<span class="badge">Grade: {{grade_entry.mdlgrade}} </span></button>
{% endif %}

Expand Down
9 changes: 7 additions & 2 deletions csc/templates/csc/test_assign.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,13 @@
<tr>
<td>
<div class="form-check">
<input class="form-check-input" type="checkbox" value="{{student.user.email}}" id="flexCheckDefault" name="students" {% if student.assigned %}checked{% endif %} {% if student.ineligible %}disabled{% endif %} {% if student.test_taken %}disabled{% endif %}>
<label class="form-check-label" for="flexCheckDefault"></label>
<input class="form-check-input" type="checkbox" value="{{student.user.email}}" id="flexCheckDefault" name="students"
{% if student.assigned %}checked{% endif %}
{% if student.ineligible %}disabled{% endif %}
{% if student.test_taken %}disabled{% endif %}

>
<label class="form-check-label" for="flexCheckDefault">{% if student.retest %}(Retest Request){% endif %}</label>
</div>
</td>
<td>{{student.user.get_full_name|title}}</td>
Expand Down
7 changes: 6 additions & 1 deletion csc/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,12 @@ def get_valid_students_for_test(vle,test):
fosses.append(item.testfoss)
fosses.append(item.foss)
other_tests = Test.objects.filter(foss__in=fosses).exclude(id=test.id)
students = Student.objects.filter(vle_id=vle.id,student_foss__csc_foss_id__in=fosses,student_foss__foss_start_date__lte=datetime.date.today()-timedelta(days=10)).annotate(assigned=Exists(CSCTestAtttendance.objects.filter(student_id=OuterRef('id'),test=test))).annotate(ineligible=Exists(CSCTestAtttendance.objects.filter(student_id=OuterRef('id'),test__in=other_tests))).annotate(test_taken=Exists(CSCTestAtttendance.objects.filter(student_id=OuterRef('id'),test=test,status=TEST_COMPLETED_BY_STUDENT))).distinct()
all_tests = Test.objects.filter(foss__in=fosses)
students = Student.objects.filter(vle_id=vle.id,student_foss__csc_foss_id__in=fosses,student_foss__foss_start_date__lte=datetime.date.today()-timedelta(days=10)).annotate(
assigned=Exists(CSCTestAtttendance.objects.filter(~Q(status=RETEST),student_id=OuterRef('id'),test=test))).annotate(
ineligible=Exists(CSCTestAtttendance.objects.filter(student_id=OuterRef('id'),test__in=other_tests))).annotate(
test_taken=Exists(CSCTestAtttendance.objects.filter(student_id=OuterRef('id'),test=test,status=TEST_COMPLETED_BY_STUDENT))).annotate(
retest=Exists(CSCTestAtttendance.objects.filter(student_id=OuterRef('id'),test__in=all_tests,status=RETEST))).distinct()

return students

Expand Down
15 changes: 8 additions & 7 deletions csc/vle_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -630,22 +630,23 @@ def test_assign(request):
print(e)
try:
ta = CSCTestAtttendance.objects.create(test=test,student=student,mdluser_id=mdluser.id,mdlcourse_id=mdlcourse_id,status=0,mdlquiz_id=mdlquiz_id)
print("************* 4F")
except IntegrityError as e:
print(e)
print("************* 5F")
print('test: ',test.id)
ta= CSCTestAtttendance.objects.get(test=test,student=student,mdluser_id=mdluser.id,mdlcourse_id=mdlcourse_id,status=4,mdlquiz_id=mdlquiz_id)
ta.status=0
ta.attempts=ta.attempts+1
ta.save()
try:
ta= CSCTestAtttendance.objects.get(test=test,student=student,mdluser_id=mdluser.id,mdlcourse_id=mdlcourse_id,status=4,mdlquiz_id=mdlquiz_id)
ta.status=0
ta.attempts=ta.attempts+1
ta.save()
except CSCTestAtttendance.DoesNotExist as e:
pass
if request.POST.get('action_type') == 'add_students':
nta = CSCTestAtttendance.objects.filter(test=test,status=TEST_OPEN).exclude(student__user__email__in=assigned_students)
for item in nta:
item.delete()
else:
print(f"\n\n action type is NOT add_students **************************** ")
messages.add_message(request,messages.SUCCESS,f'Test assigned to the students.')

except Exception as e:
print(e)
messages.error(request,"No test in moodle for the selected foss.Please contact support.")
Expand Down
2 changes: 1 addition & 1 deletion spoken/templates/spoken/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@


{% if request.user|has_group:"INVIGILATOR" %}
<a class="dropdown-item" href="{% url 'csc:invi_dashboard' %}">INVIGILATOR Dashboard</a>
<a class="dropdown-item" href="{{ request.scheme }}://{{request.get_host}}{% url 'csc:invi_dashboard'%}">INVIGILATOR Dashboard</a>
{% endif %}


Expand Down