Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Binary file modified db.sqlite3
Binary file not shown.
2 changes: 1 addition & 1 deletion lms/templates/lms/course/course_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
<td><a href="#"></a></td>
</tr>
<tr class="model-user">
<th scope="row"><a href="#">Quizes</a></th>
<th scope="row"><a href="{% url 'lms:quizzes' object.id %}">Quizes</a></th>
<td><a href="#"></a></td>
</tr>
<tr class="model-user">
Expand Down
30 changes: 30 additions & 0 deletions lms/templates/quiz/QuizAll.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Capstone Quiz App</title>
{% load static %}
<link rel="stylesheet" href="{% static 'style.css' %}">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">
<script src="{% static 'script.js' %}">
</script>
</head>
<body>
<div class="col-lg-8 border border-success p-4 m-4 mx-auto">
<h1>Quizzes</h1>
</div>

<div class="col-lg-8 border border-success p-4 m-4 mx-auto">
{% for quiz in quizs%}
{% csrf_token %}
<h5><li class="btn btn-block btn-responsive" style="background-color: #daad86;width: 250px;height:50px;margin-top: 10px">
<a href="{% url 'lms:quiz_instructions' object.id %}?Quiz={{ quiz.id }}&QuizName={{quiz.Quizname}}"><h4>{{ quiz.Quizname }}</h4></a></li></h5>
{% endfor %}
</div>
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js" integrity="sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI" crossorigin="anonymous"></script>
</body>
</html>
40 changes: 40 additions & 0 deletions lms/templates/quiz/quiz_instructions.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Capstone Quiz App</title>
{% load static %}
<link rel="stylesheet" href="{% static 'style.css' %}">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">
<script src="{% static 'script.js' %}">
</script>
</head>
<body>
<div class="col-lg-8 border border-success p-4 m-4 mx-auto">
<h1> {{ quizname}}</h1>
</div>

<div class="col-lg-8 border border-success p-4 m-4 mx-auto">
<p><b>Due</b> Apr 29, 2019 at 5:30pm
<b>Points</b> 100 <br>
<b>Available</b> until Jan 29, 2021 at 5:30pm
<b>Time Limit</b> 30 Minutes</p>
</div>

<div class="col-lg-8 border border-success p-4 m-4 mx-auto">
<h2>Instructions</h2>
1. You have 30 minutes to attempt the quiz<br>
2. Once you start the quiz, you cannot go back and re-attempt it<br>
3. You will not find answers online, so please make sure you are ready for the quiz<br>
4. For Multiple Answer Questions, ALL the answers must be correct to score any point
</div>
<div>
<center><h1><a href="{% url 'lms:studentQuiz' object.id%}?Quiz={{ quizid}}">Start Quiz</a></h1></center>
</div>
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js" integrity="sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI" crossorigin="anonymous"></script>
</body>
</html>
205 changes: 205 additions & 0 deletions lms/templates/quiz/studentQuiz.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,205 @@


{% block content %}
<div class="container">
<h1 class="text-center pt-3 pb-3 border-bottom">{{ quiz.Quizname }}</h1>
<right>Time : <span id="timer"></span></right>
<!-- <left>
<hr/>
<p style='margin-left:10px'><b>Points</b>{{ quiz.points }} &nbsp;&nbsp;
<b>Questions {{ quiz.Questions }} </b></p>

<a href="{% url 'lms:quiz_view' course_id quiz.id %}">
<button class="btn-btn-primary" style="float:right" id="previewbtn" type="submit"> Back to quiz detail
</button>
</a>


<div id="xyz">
<form>
<labels style='margin-left:10px'><b> Time Limit</b></labels>
<select name="minutes" id="minutes">
<option value="volvo">15</option>
<option value="saab">30</option>
<option value="opel">60</option>
<option value="audi">90</option>
<p>Minutes</p>
</select>
</form>
<br/>
<div class='col-sm-3'>
<div class="form-group">
<label class="control-label" style="float:left">Available From &nbsp;</label>
<p>{{ quiz.Availablefrom }}</p>
<p> Until {{ quiz.Until }}</p>
</div>
</div>
</div>

<div>

<br/>
<hr/>

</left> -->


<div id="masterContent" class=container style="width:800px; margin-left:200px;">
<div class=row>
{% for quest in questions %}
<article class="media content-section">
<div class="media-body">

<h2 class="article-title">Question {{ forloop.counter }}
<label style="display:inline;float:right;">
<h4>{{ quest.points }} pts</h4>
</label>
</h2>

<div class="pb-lg-2">
<p><b> {{ quest.question | safe }} </b></p>
<p> {{ quest.description | safe }} </p>
</div>

<div>
<div class="lmn">
{% if quest.img %}
<img src="{{ quest.img.url }}" alt="">
{% endif %}
</div>

{% if quest.questiontype == "Multiple choice" %}
<p><input style="margin-left:30px;" type="radio" class="rb" name="{{ quest.id }}"
id="option1"
value="{{ quest.option1 }}">&nbsp;{{ quest.option1 }}</p>
<p><input style="margin-left:30px;" type="radio" class="rb" name="{{ quest.id }}"
id="option2"
value="{{ quest.option2 }}">&nbsp;{{ quest.option2 }}</p>

{% if quest.option3 != "" and quest.option4 != "" %}
<p><input style="margin-left:30px;" type="radio" class="rb"
name="{{ quest.id }}"
id="option3" value="{{ quest.option2 }}">&nbsp;{{ quest.option3 }}</p>
<p><input style="margin-left:30px;" type="radio" class="rb"
name="{{ quest.id }}"
id="option4" value="{{ quest.option2 }}">&nbsp;{{ quest.option4 }}</p>
{% endif %}
{% elif quest.questiontype == "Multiple correct" %}

<p><input style="margin-left:30px;" type="radio" class="rb" id="option1"
value="{{ quest.option1 }}">&nbsp;{{ quest.option1 }}</p>
<p><input style="margin-left:30px;" type="radio" class="rb" id="option2"
value="{{ quest.option2 }}">&nbsp;{{ quest.option2 }}</p>

{% if quest.option3 != "" and quest.option4 != "" %}
<p><input style="margin-left:30px;" type="radio" class="rb" id="option3"
value="{{ quest.option2 }}">&nbsp;{{ quest.option3 }}</p>
<p><input style="margin-left:30px;" type="radio" class="rb" id="option4"
value="{{ quest.option2 }}">&nbsp;{{ quest.option4 }}</p>
{% endif %}
{% elif quest.questiontype == "True or False" %}

<p><input style="margin-left:30px;" type="radio" class="rb" name="{{ quest.id }}"
id="option1"
value="{{ quest.option1 }}">&nbsp;{{ quest.option1 }}</p>
<p><input style="margin-left:30px;" type="radio" class="rb" name="{{ quest.id }}"
id="option2"
value="{{ quest.option2 }}">&nbsp;{{ quest.option2 }}</p>

{% endif %}

<div class="row">
<textarea rows="2" cols="50" name="comment" form="usrform"
style="float:right;">Enter comments here
</textarea>
</div>

<p><label class="rb" style="display:none;color:green"> <b>Answer:</b> {{ quest.answer }}
</label></p>
</div>
</p>
</div>
</article>
{% endfor %}

<p> Have question for us <input style="width:500px; height:30px"></input></p>

</div>

</div>

<hr/>
<button type="submit" class="btn btn-success" id="b1">Submit Quiz</button>

</div>
{% endblock content %}

{% block scripts %}

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/momentjs/2.14.1/moment.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.37/js/bootstrap-datetimepicker.min.js"></script>
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datetimepicker/4.17.37/css/bootstrap-datetimepicker.min.css">

<script>
$(document).ready(function () {
$("#b1").click(function () {
$(".rb").show();
$(".rb").attr("disabled", true);
clearInterval(interval);
document.getElementById('timer').innerHTML='Done!!';
});






var count = 300;
var interval = setInterval(function(){
document.getElementById('timer').innerHTML=count + " seconds left";
count--;
if (count === 0){
clearInterval(interval);
document.getElementById('timer').innerHTML='Done!!';
$(".rb").show();
$(".rb").attr("disabled","true");
$("#b1").attr("disabled","true");

// //alert(dict_obj);

// $.ajax({
// type: 'POST',
// url: 'SaveQuizAnswers',
// data: {
// csrfmiddlewaretoken: '{{ csrf_token }}',
// "answers":JSON.stringify(dict_obj)
// },
// dataType: 'json',
// success: function (data) {
// if (data) {
// alert("success.");
// }
// }
// });

// or...
alert("You're out of time!");
}
}, 1000);





});
</script>

<script>
$(function () {
$('#datetimepicker1').datetimepicker();
});
</script>

{% endblock scripts %}
31 changes: 16 additions & 15 deletions lms/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
from lms.views.course.course_views import (
CourseListView,
GradeBookCourseView,
StudentGradeBookCourseView, CourseCreateView
StudentGradeBookCourseView
# table_download
)
from lms.views.course.grading_scheme_view import (
Expand Down Expand Up @@ -79,7 +79,10 @@
preview_quiz,
enter_quiz_comment,
quiz_publish, QuizCreateView, QuizUpdateView, QuizDeleteView,
QuizQuestionCreateView, QuizQuestionUpdateView, QuizQuestionDeleteView
QuizQuestionCreateView, QuizQuestionUpdateView, QuizQuestionDeleteView,
quiz_instructions,
quizzes,
studentQuiz
)

# Specifies the app name for name spacing.
Expand Down Expand Up @@ -219,11 +222,6 @@
name="course_unpublish"
),

path(
route="course/create/",
view=CourseCreateView.as_view(),
name="course_create"
),
# /author/notification/
path(
route="notifications/",
Expand Down Expand Up @@ -305,8 +303,7 @@
# By Quiz Teacher View Team.[Start]
path('course/<int:course_id>/quiz/course_stats/', compute_stats, name="compute_stats"),

path('course/<int:course_id>/quiz/<int:pk>/one_at_a_time/', fetch_questions_one_at_a_time,
name="fetch_questions_one_at_a_time"),
path('course/<int:course_id>/quiz/<int:pk>/one_at_a_time/', fetch_questions_one_at_a_time, name="fetch_questions_one_at_a_time"),

path('course/<int:course_id>/quiz/<int:pk>/fetch_questions/', fetch_questions, name="fetch_questions"),

Expand All @@ -316,12 +313,9 @@
path('course/<int:course_id>/quiz/<int:pk>/update/', QuizUpdateView.as_view(), name="quiz_update"),
path('course/<int:course_id>/quiz/<int:pk>/delete/', QuizDeleteView.as_view(), name="quiz_delete"),

path('course/<int:course_id>/quiz/<int:quiz_id>/question/create', QuizQuestionCreateView.as_view(),
name="quiz_question_create"),
path('course/<int:course_id>/quiz/<int:quiz_id>/question/<int:pk>/update/', QuizQuestionUpdateView.as_view(),
name="quiz_question_update"),
path('course/<int:course_id>/quiz/<int:quiz_id>/question/<int:pk>/delete/', QuizQuestionDeleteView.as_view(),
name="quiz_question_delete"),
path('course/<int:course_id>/quiz/<int:quiz_id>/question/create', QuizQuestionCreateView.as_view(), name="quiz_question_create"),
path('course/<int:course_id>/quiz/<int:quiz_id>/question/<int:pk>/update/', QuizQuestionUpdateView.as_view(), name="quiz_question_update"),
path('course/<int:course_id>/quiz/<int:quiz_id>/question/<int:pk>/delete/', QuizQuestionDeleteView.as_view(), name="quiz_question_delete"),

path('course/<int:course_id>/quiz/<int:pk>/detail/', quiz_detail, name="quiz_view"),

Expand All @@ -332,6 +326,13 @@
path('course/<int:course_id>/quiz/<int:pk>/publish/', quiz_publish, name='quiz_publish'),
# By Quiz Teacher View Team.[End]

# By Quiz Student Team - START
path('course/<int:course_id>/quiz/quizzes/', quizzes, name='quizzes'),
path('course/<int:course_id>/quiz/quiz_instructions/', quiz_instructions, name='quiz_instructions'),
path('course/<int:course_id>/quiz/studentQuiz/', studentQuiz, name='studentQuiz'),

# By Quiz Student Team - END

# Assignment Views
path(
route="course/<int:pkcourse>/student_assignment/home/",
Expand Down
Loading