Version Description
08 March, 2019 =
Added: onclick topic title slide topic body in course builder
Added: Add new instructor from instructors > add new instructor, in the dashboard
Removed: some commented unused code
Removed: Save and exit button in quiz builder
Removed: some console.log() at javascript files
Updated: course level input select to radio
Updated: Moved question type in the top in quiz builder question
Updated: Course builder lesson and quiz design
Updated: Quiz attempt view for the instructor
Updated: quiz attempts query for instructor and removed attempts which are not submitted yet.
Fixed: Frontend Template compatible, .tutor-container class CSS
Fixed: Perfectly topic toggle arrow down up, on click in course builder
Fixed: some buttons hover CSS in the quiz, course builder
Fixed: When Tutor Pro does not exist, get enroll button will be in course loop with the free price
Fixed: Ability to check multiple answers instant right after add question in quiz question type multiple_choice
Fixed: Image answering question type result in the quiz
Fixed: a bug in quiz attempt review, it was multi-time decrease when mark as incorrect, not actually marked.
Fixed: Few known bugs
Release Info
Developer | themeum |
Plugin | Tutor LMS – eLearning and online course solution |
Version | 1.0.3 |
Comparing to | |
See all releases |
Code changes from version 1.0.2 to 1.0.3
- assets/css/tutor-admin.css +169 -57
- assets/css/tutor-front.css +5 -2
- assets/js/tutor-admin.js +49 -79
- classes/Instructor.php +63 -0
- classes/Lesson.php +0 -51
- classes/Quiz.php +15 -14
- classes/Quiz_Attempts_List.php +9 -3
- classes/Utils.php +4 -5
- includes/tutor-template-functions.php +2 -0
- readme.txt +85 -9
- templates/dashboard/instructor/apply_for_instructor.php +3 -1
- templates/loop/course-price.php +0 -1
- tutor.php +3 -3
- views/metabox/course-additional-data.php +8 -11
- views/metabox/course-contents.php +7 -76
- views/modal/edit_quiz.php +0 -66
- views/modal/question_form.php +33 -46
- views/pages/add_new_instructor.php +133 -0
- views/pages/instructors.php +18 -4
- views/pages/view_attempt.php +229 -184
@@ -72,7 +72,7 @@ Option Field
|
|
72 |
|
73 |
.tutor-option-field-row {
|
74 |
border-bottom: 1px solid #e4e4e4;
|
75 |
-
padding:
|
76 |
font-size: 14px;
|
77 |
line-height: 1.3
|
78 |
}
|
@@ -151,24 +151,10 @@ Group Field Option
|
|
151 |
padding-bottom: 0;
|
152 |
margin: 0;
|
153 |
}
|
154 |
-
|
155 |
padding: 10px;
|
156 |
-
|
157 |
-
|
158 |
-
background-color: #ffffff;
|
159 |
-
}
|
160 |
-
.course-contents .tutor-quiz{
|
161 |
-
padding: 10px;
|
162 |
-
margin-bottom: 5px;
|
163 |
-
border: 1px solid #D9D9D9;
|
164 |
-
background-color: #ffffff;
|
165 |
-
}
|
166 |
-
#tutor-course-topics .drop-lessons{
|
167 |
-
border: 1px dashed #adabab96;
|
168 |
-
padding: 12px 15px;
|
169 |
-
background-color: #f9f9f9;
|
170 |
-
color: #777777;
|
171 |
-
text-align: center;
|
172 |
}
|
173 |
.tutor-lessons.ui-sortable {
|
174 |
min-height: 20px;
|
@@ -176,7 +162,7 @@ Group Field Option
|
|
176 |
#tutor-course-topics .drop-lessons p{
|
177 |
margin: 0;
|
178 |
}
|
179 |
-
#tutor-course-topics .
|
180 |
background-color: #EEEEEE;
|
181 |
}
|
182 |
#tutor-course-topics .tutor-lessons {
|
@@ -285,6 +271,7 @@ p.course-empty-content {
|
|
285 |
|
286 |
.tutor-topic-title .topic-inner-title{
|
287 |
flex: 1 0 auto;
|
|
|
288 |
}
|
289 |
.tutor-topic-title span{
|
290 |
padding: 0 5px;
|
@@ -340,31 +327,29 @@ p.course-empty-content {
|
|
340 |
background: #E9E9E9;
|
341 |
padding: 15px 20px;
|
342 |
}
|
343 |
-
#tutor-course-content-wrap .tutor-topics-wrap .tutor-topics-body .create-lesson-in-topic-btn{
|
344 |
-
line-height:
|
345 |
-
|
346 |
-
color: #ffffff;
|
347 |
display: inline-block;
|
348 |
padding: 0 20px;
|
349 |
-
border: 1px solid #016799;
|
350 |
border-radius: 2px;
|
351 |
margin-right: 20px;
|
352 |
-
|
353 |
-
|
354 |
-
background-color: #FFFFFF;
|
355 |
-
border: 1px solid #C6C9CF;
|
356 |
-
line-height: 38px;
|
357 |
-
padding: 0 20px;
|
358 |
-
display: inline-block;
|
359 |
-
border-radius: 2px;
|
360 |
cursor: pointer;
|
361 |
}
|
362 |
-
|
363 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
364 |
/**
|
365 |
Meta Box Heading
|
366 |
*/
|
367 |
-
|
368 |
#tutor-course-topics h2, #tutor-instructors h2{
|
369 |
padding: 15px;
|
370 |
line-height: 30px;
|
@@ -437,18 +422,34 @@ a.tutor-delete-attachment:hover {
|
|
437 |
.tutor-status-pending-context, .attempt_started{
|
438 |
background-color: #EEEEEE;
|
439 |
}
|
440 |
-
a.tutor-button{
|
441 |
padding: 10px 20px;
|
442 |
text-decoration: none;
|
443 |
margin-right: 20px;
|
444 |
}
|
445 |
-
.tutor-
|
446 |
-
background-color: #
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
447 |
color: #ffffff;
|
|
|
448 |
}
|
449 |
.tutor-status-blocked-context, .attempt_timeout, .tutor-button.button-danger {
|
450 |
background-color: #ff0000;
|
451 |
color: #ffffff;
|
|
|
452 |
}
|
453 |
.tutor-button.button-warning {
|
454 |
background-color: #ffb36d;
|
@@ -974,13 +975,16 @@ Quiz Modal
|
|
974 |
color: #3057D5;
|
975 |
}
|
976 |
.quiz-modal-tab-navigation-btn{
|
977 |
-
padding:
|
978 |
border-radius: 3px;
|
979 |
}
|
980 |
.quiz-modal-btn-next, .quiz-modal-btn-next:focus, .quiz-modal-btn-first-step, .quiz-modal-btn-first-step:focus, .quiz-modal-question-save-btn, .quiz-modal-question-save-btn:focus, .quiz-modal-settings-save-btn, .quiz-modal-settings-save-btn:focus{
|
981 |
background-color: #1B52D8;
|
982 |
color: #ffffff;
|
983 |
}
|
|
|
|
|
|
|
984 |
.quiz-modal-btn-cancel, .quiz-modal-btn-back{
|
985 |
color: #4B5981;
|
986 |
border: 1px solid #D4DADB;
|
@@ -1154,6 +1158,10 @@ i.tutor-icon-block.tutor-icon-plus-square-button, i.tutor-icon-block.tutor-icon-
|
|
1154 |
background-color: #7BBC30;
|
1155 |
}
|
1156 |
|
|
|
|
|
|
|
|
|
1157 |
.quiz-modal-field-wrap .question_options_group_wrap {
|
1158 |
margin: 20px 0;
|
1159 |
display: block;
|
@@ -1355,40 +1363,141 @@ p.quiz-search-suggest-text{
|
|
1355 |
font-size: 12px;
|
1356 |
}
|
1357 |
span.result-pass{
|
1358 |
-
color: #
|
|
|
|
|
|
|
1359 |
}
|
1360 |
span.result-fail{
|
1361 |
color: #FF0000;
|
1362 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1363 |
.tutor-quiz-attempt-info-row{
|
1364 |
-
|
1365 |
-
|
1366 |
}
|
1367 |
.tutor-quiz-attempt-info-row p{
|
1368 |
-
|
1369 |
}
|
1370 |
-
.tutor-quiz-attempt-info-row
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1371 |
font-size: 12px;
|
1372 |
-
color: #584dffe6;
|
1373 |
}
|
1374 |
-
.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1375 |
background-color: #ffffff;
|
1376 |
-
|
|
|
1377 |
padding: 20px;
|
1378 |
-
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
|
1379 |
}
|
1380 |
-
.
|
1381 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1382 |
}
|
1383 |
-
.
|
1384 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1385 |
}
|
1386 |
-
.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1387 |
display: flex;
|
|
|
|
|
1388 |
}
|
1389 |
-
.
|
1390 |
-
|
1391 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1392 |
.tutor-emails-lists-wrap{
|
1393 |
background-color: #ffffff;
|
1394 |
padding: 20px;
|
@@ -1427,8 +1536,11 @@ span.result-fail{
|
|
1427 |
.image-matching-item {
|
1428 |
flex: 0 0 50px;
|
1429 |
margin-right: 10px;
|
1430 |
-
|
1431 |
-
|
|
|
|
|
|
|
1432 |
}
|
1433 |
.image-matching-item img{
|
1434 |
max-width: 80px;
|
72 |
|
73 |
.tutor-option-field-row {
|
74 |
border-bottom: 1px solid #e4e4e4;
|
75 |
+
padding: 20px 0;
|
76 |
font-size: 14px;
|
77 |
line-height: 1.3
|
78 |
}
|
151 |
padding-bottom: 0;
|
152 |
margin: 0;
|
153 |
}
|
154 |
+
.course-contents .course-content-item {
|
155 |
padding: 10px;
|
156 |
+
border-bottom: 1px solid #D9D9D9;
|
157 |
+
background-color: #E9E9E9;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
158 |
}
|
159 |
.tutor-lessons.ui-sortable {
|
160 |
min-height: 20px;
|
162 |
#tutor-course-topics .drop-lessons p{
|
163 |
margin: 0;
|
164 |
}
|
165 |
+
#tutor-course-topics .course-content-item:hover{
|
166 |
background-color: #EEEEEE;
|
167 |
}
|
168 |
#tutor-course-topics .tutor-lessons {
|
271 |
|
272 |
.tutor-topic-title .topic-inner-title{
|
273 |
flex: 1 0 auto;
|
274 |
+
cursor: pointer;
|
275 |
}
|
276 |
.tutor-topic-title span{
|
277 |
padding: 0 5px;
|
327 |
background: #E9E9E9;
|
328 |
padding: 15px 20px;
|
329 |
}
|
330 |
+
#tutor-course-content-wrap .tutor-topics-wrap .tutor-topics-body .create-lesson-in-topic-btn, #tutor-course-content-wrap .tutor-topics-wrap .tutor-topics-body .tutor-add-quiz-btn{
|
331 |
+
line-height: 35px;
|
332 |
+
color: #393c40;
|
|
|
333 |
display: inline-block;
|
334 |
padding: 0 20px;
|
|
|
335 |
border-radius: 2px;
|
336 |
margin-right: 20px;
|
337 |
+
border: 1px solid #d3d4d5;
|
338 |
+
background-color: #f2f2f2;
|
|
|
|
|
|
|
|
|
|
|
|
|
339 |
cursor: pointer;
|
340 |
}
|
341 |
+
.tutor-add-quiz-btn i{
|
342 |
+
color: #4aade2;
|
343 |
+
}
|
344 |
+
/**
|
345 |
+
Instructor
|
346 |
+
*/
|
347 |
+
.tutor-required-fields{
|
348 |
+
color: #f13a3a;
|
349 |
+
}
|
350 |
/**
|
351 |
Meta Box Heading
|
352 |
*/
|
|
|
353 |
#tutor-course-topics h2, #tutor-instructors h2{
|
354 |
padding: 15px;
|
355 |
line-height: 30px;
|
422 |
.tutor-status-pending-context, .attempt_started{
|
423 |
background-color: #EEEEEE;
|
424 |
}
|
425 |
+
a.tutor-button, button.tutor-button{
|
426 |
padding: 10px 20px;
|
427 |
text-decoration: none;
|
428 |
margin-right: 20px;
|
429 |
}
|
430 |
+
.tutor-button-primary{
|
431 |
+
background-color: #3057D5;
|
432 |
+
color: #ffffff;
|
433 |
+
display: inline-block;
|
434 |
+
border-radius: 2px;
|
435 |
+
font-size: 14px;
|
436 |
+
font-weight: 300;
|
437 |
+
border: none;
|
438 |
+
box-shadow: none;
|
439 |
+
cursor: pointer;
|
440 |
+
}
|
441 |
+
.tutor-button-primary:hover {
|
442 |
+
background-color: #2446A6;
|
443 |
+
}
|
444 |
+
.tutor-status-approved-context, .tutor-button.button-success {
|
445 |
+
background-color: #7BBC30;
|
446 |
color: #ffffff;
|
447 |
+
border-radius: 2px;
|
448 |
}
|
449 |
.tutor-status-blocked-context, .attempt_timeout, .tutor-button.button-danger {
|
450 |
background-color: #ff0000;
|
451 |
color: #ffffff;
|
452 |
+
border-radius: 2px;
|
453 |
}
|
454 |
.tutor-button.button-warning {
|
455 |
background-color: #ffb36d;
|
975 |
color: #3057D5;
|
976 |
}
|
977 |
.quiz-modal-tab-navigation-btn{
|
978 |
+
padding: 10px 20px;
|
979 |
border-radius: 3px;
|
980 |
}
|
981 |
.quiz-modal-btn-next, .quiz-modal-btn-next:focus, .quiz-modal-btn-first-step, .quiz-modal-btn-first-step:focus, .quiz-modal-question-save-btn, .quiz-modal-question-save-btn:focus, .quiz-modal-settings-save-btn, .quiz-modal-settings-save-btn:focus{
|
982 |
background-color: #1B52D8;
|
983 |
color: #ffffff;
|
984 |
}
|
985 |
+
.quiz-modal-btn-next:hover, .quiz-modal-btn-first-step:hover, .quiz-modal-question-save-btn:hover, .quiz-modal-settings-save-btn:hover{
|
986 |
+
color: #ffffff;
|
987 |
+
}
|
988 |
.quiz-modal-btn-cancel, .quiz-modal-btn-back{
|
989 |
color: #4B5981;
|
990 |
border: 1px solid #D4DADB;
|
1158 |
background-color: #7BBC30;
|
1159 |
}
|
1160 |
|
1161 |
+
.create-lesson-in-topic-btn i.tutor-icon-block.tutor-icon-plus{
|
1162 |
+
background-color: #3057d5;
|
1163 |
+
}
|
1164 |
+
|
1165 |
.quiz-modal-field-wrap .question_options_group_wrap {
|
1166 |
margin: 20px 0;
|
1167 |
display: block;
|
1363 |
font-size: 12px;
|
1364 |
}
|
1365 |
span.result-pass{
|
1366 |
+
background-color: #7BBC30;
|
1367 |
+
color: #fff;
|
1368 |
+
padding: 3px 5px;
|
1369 |
+
border-radius: 2px;
|
1370 |
}
|
1371 |
span.result-fail{
|
1372 |
color: #FF0000;
|
1373 |
}
|
1374 |
+
.attempt-status-attempt_ended{
|
1375 |
+
background-color: #7BBC30;
|
1376 |
+
color: #ffffff;
|
1377 |
+
padding: 3px 5px;
|
1378 |
+
border-radius: 2px;
|
1379 |
+
font-weight: 300;
|
1380 |
+
}
|
1381 |
.tutor-quiz-attempt-info-row{
|
1382 |
+
background-color: #ffffff;
|
1383 |
+
padding: 20px;
|
1384 |
}
|
1385 |
.tutor-quiz-attempt-info-row p{
|
1386 |
+
margin: 0;
|
1387 |
}
|
1388 |
+
.tutor-quiz-attempt-info-row p a{
|
1389 |
+
text-decoration: none;
|
1390 |
+
}
|
1391 |
+
.attempt-property-name{
|
1392 |
+
color: #7A7F85;
|
1393 |
+
margin-bottom: 10px !important;
|
1394 |
+
}
|
1395 |
+
.attempt-property-value.value-display-flex{
|
1396 |
+
display: flex;
|
1397 |
+
}
|
1398 |
+
.attempt-property-value.value-display-flex span{
|
1399 |
+
margin-right: 10px;
|
1400 |
+
font-weight: 300;
|
1401 |
font-size: 12px;
|
|
|
1402 |
}
|
1403 |
+
.attempt-property-value{
|
1404 |
+
font-weight: 500;
|
1405 |
+
}
|
1406 |
+
.attempt-view-top {
|
1407 |
+
display: flex;
|
1408 |
+
border-bottom: 1px solid #DCDFE5;
|
1409 |
+
padding: 20px 0;
|
1410 |
+
}
|
1411 |
+
.attempt-view-bottom{
|
1412 |
+
display: flex;
|
1413 |
+
padding: 20px 0;
|
1414 |
+
}
|
1415 |
+
.attempt-info-col{
|
1416 |
+
margin-right: 6%;
|
1417 |
+
}
|
1418 |
+
.quiz-attempt-answers-wrap{
|
1419 |
background-color: #ffffff;
|
1420 |
+
}
|
1421 |
+
.attempt-answers-header{
|
1422 |
padding: 20px;
|
|
|
1423 |
}
|
1424 |
+
.quiz-attempt-answers-wrap table{
|
1425 |
+
width: 100%;
|
1426 |
+
}
|
1427 |
+
.quiz-attempt-answers-wrap table tr th{
|
1428 |
+
text-align: left;
|
1429 |
+
vertical-align: top;
|
1430 |
+
color: #878A8F;
|
1431 |
+
background-color: #FCFCFC;
|
1432 |
+
border-top: 1px solid #EAEAEA;
|
1433 |
+
}
|
1434 |
+
.quiz-attempt-answers-wrap table tr th, .quiz-attempt-answers-wrap table tr td{
|
1435 |
+
padding: 20px;
|
1436 |
+
vertical-align: top;
|
1437 |
+
border-bottom: 1px solid #EAEAEA;
|
1438 |
}
|
1439 |
+
.attempt-mark-correct-btn {
|
1440 |
+
border: 1px solid #7BBC30;
|
1441 |
+
color: #7BBC30;
|
1442 |
+
border-radius: 4px;
|
1443 |
+
padding: 10px;
|
1444 |
+
text-decoration: none;
|
1445 |
+
margin-left: 5px;
|
1446 |
+
margin-right: 5px;
|
1447 |
+
}
|
1448 |
+
.attempt-mark-correct-btn:hover {
|
1449 |
+
border: 1px solid #3fbc12;
|
1450 |
+
color: #ffffff;
|
1451 |
+
background-color: #3fbc12;
|
1452 |
}
|
1453 |
+
.attempt-mark-incorrect-btn{
|
1454 |
+
border: 1px solid #ec0001;
|
1455 |
+
color: #EC0001;
|
1456 |
+
border-radius: 4px;
|
1457 |
+
padding: 10px;
|
1458 |
+
text-decoration: none;
|
1459 |
+
margin-left: 5px;
|
1460 |
+
margin-right: 5px;
|
1461 |
+
}
|
1462 |
+
.attempt-mark-incorrect-btn:hover{
|
1463 |
+
border: 1px solid #ec0001;
|
1464 |
+
color: #ffffff;
|
1465 |
+
background-color: #ec0001;
|
1466 |
+
}
|
1467 |
+
.quiz-attempt-answers-wrap .tutor-status-approved-context, .quiz-attempt-answers-wrap .tutor-status-blocked-context{
|
1468 |
+
padding: 3px 5px;
|
1469 |
+
}
|
1470 |
+
span.notice-excl {
|
1471 |
+
background-color: #F5C813;
|
1472 |
+
color: #fff;
|
1473 |
+
padding: 2px 8px;
|
1474 |
+
border-radius: 50%;
|
1475 |
+
}
|
1476 |
+
.attempt-review-notice-wrap {
|
1477 |
display: flex;
|
1478 |
+
justify-content: space-between;
|
1479 |
+
margin: 20px 0;
|
1480 |
}
|
1481 |
+
.attempt-review-notice-wrap p{
|
1482 |
+
margin: 0;
|
1483 |
}
|
1484 |
+
.circle-arrow{
|
1485 |
+
color: #3057D5;
|
1486 |
+
font-weight: bold;
|
1487 |
+
font-size: 1rem;
|
1488 |
+
}
|
1489 |
+
h2.attempt-review-title{
|
1490 |
+
font-size: 18px !important;
|
1491 |
+
margin-bottom: 30px !important;
|
1492 |
+
}
|
1493 |
+
h2.attempt-review-title i{
|
1494 |
+
color: #3057D5;
|
1495 |
+
}
|
1496 |
+
/**
|
1497 |
+
End Attempt
|
1498 |
+
*/
|
1499 |
+
|
1500 |
+
|
1501 |
.tutor-emails-lists-wrap{
|
1502 |
background-color: #ffffff;
|
1503 |
padding: 20px;
|
1536 |
.image-matching-item {
|
1537 |
flex: 0 0 50px;
|
1538 |
margin-right: 10px;
|
1539 |
+
}
|
1540 |
+
.image-matching-item p{
|
1541 |
+
margin-bottom: 5px;
|
1542 |
+
margin-top: 0;
|
1543 |
+
color: #878A8F;
|
1544 |
}
|
1545 |
.image-matching-item img{
|
1546 |
max-width: 80px;
|
@@ -4,14 +4,17 @@
|
|
4 |
.tutor-wrap{
|
5 |
color: #4B5981;
|
6 |
}
|
7 |
-
|
|
|
|
|
|
|
8 |
.tutor-container{
|
9 |
padding-left: 15px;
|
10 |
padding-right: 15px;
|
11 |
max-width: 1170px;
|
12 |
margin-right: auto;
|
13 |
margin-left: auto;
|
14 |
-
}
|
15 |
.tutor-row{
|
16 |
display: -ms-flexbox;
|
17 |
display: flex;
|
4 |
.tutor-wrap{
|
5 |
color: #4B5981;
|
6 |
}
|
7 |
+
/**
|
8 |
+
Most Important CSS
|
9 |
+
.tutor-container
|
10 |
+
*/
|
11 |
.tutor-container{
|
12 |
padding-left: 15px;
|
13 |
padding-right: 15px;
|
14 |
max-width: 1170px;
|
15 |
margin-right: auto;
|
16 |
margin-left: auto;
|
17 |
+
}
|
18 |
.tutor-row{
|
19 |
display: -ms-flexbox;
|
20 |
display: flex;
|
@@ -188,102 +188,27 @@ jQuery(document).ready(function($){
|
|
188 |
*/
|
189 |
$(document).on('click', '.topic-delete-btn a', function(e){
|
190 |
var topic_id = $(this).attr('data-topic-id');
|
191 |
-
console.log(topic_id);
|
192 |
|
193 |
if ( ! confirm('Are you sure to delete?')){
|
194 |
e.preventDefault();
|
195 |
}
|
196 |
});
|
197 |
|
198 |
-
/**
|
199 |
-
* Create Lesson Under Topic
|
200 |
-
*/
|
201 |
-
/*
|
202 |
-
$(document).on('click', '.create-lesson-in-topic-btn', function(e){
|
203 |
-
e.preventDefault();
|
204 |
-
$(this).closest('.tutor-lessons').find('.tutor-create-new-lesson-form').toggle();
|
205 |
-
});
|
206 |
-
$(document).on('click', '.tutor-create-lesson-btn', function(e){
|
207 |
-
e.preventDefault();
|
208 |
-
var $that = $(this);
|
209 |
-
|
210 |
-
var course_id = $('#post_ID').val();
|
211 |
-
var topic_id = $that.closest('.tutor-create-new-lesson-form').attr('data-topic-id');
|
212 |
-
|
213 |
-
var form_data = $that.closest('.tutor-create-new-lesson-form').find('input, textarea').serialize()+'&course_id='+course_id+'&topic_id='+topic_id+'&action=tutor_create_lesson';
|
214 |
-
|
215 |
-
$.ajax({
|
216 |
-
url : ajaxurl,
|
217 |
-
type : 'POST',
|
218 |
-
data : form_data,
|
219 |
-
beforeSend: function () {
|
220 |
-
$that.addClass('tutor-updating-message');
|
221 |
-
},
|
222 |
-
success: function (data) {
|
223 |
-
if (data.success){
|
224 |
-
$('#tutor-course-content-wrap').html(data.data.course_contents);
|
225 |
-
$that.closest('.tutor-create-new-lesson-form').find('input, textarea').each(function () {
|
226 |
-
$(this).val('');
|
227 |
-
});
|
228 |
-
enable_sorting_topic_lesson();
|
229 |
-
}
|
230 |
-
},
|
231 |
-
complete: function () {
|
232 |
-
$that.removeClass('tutor-updating-message');
|
233 |
-
}
|
234 |
-
});
|
235 |
-
});
|
236 |
-
|
237 |
-
$(document).on('click', '.open-inline-lesson-edit-btn', function(e){
|
238 |
-
e.preventDefault();
|
239 |
-
$(this).closest('.tutor-lesson').find('.tutor-edit-inline-lesson-form').toggle();
|
240 |
-
});
|
241 |
-
$(document).on('change keyup', '.inline-lesson-title-input', function (e) {
|
242 |
-
e.preventDefault();
|
243 |
-
$(this).closest('.tutor-lesson').find('.open-inline-lesson-edit-btn').html($(this).val());
|
244 |
-
});
|
245 |
-
|
246 |
-
$(document).on('click', '.edit-inline-lesson-btn', function(e){
|
247 |
-
e.preventDefault();
|
248 |
-
var $that = $(this);
|
249 |
-
|
250 |
-
var course_id = $('#post_ID').val();
|
251 |
-
var lesson_id = $that.closest('.tutor-edit-inline-lesson-form').attr('data-lesson-id');
|
252 |
-
var topic_id = $that.closest('.tutor-edit-inline-lesson-form').attr('data-topic-id');
|
253 |
-
|
254 |
-
var form_data = $that.closest('.tutor-edit-inline-lesson-form').find('input, textarea').serialize()+'&course_id='+course_id+'&lesson_id='+lesson_id+'&topic_id='+topic_id+'&action=tutor_update_inline_lesson';
|
255 |
-
|
256 |
-
$.ajax({
|
257 |
-
url : ajaxurl,
|
258 |
-
type : 'POST',
|
259 |
-
data : form_data,
|
260 |
-
beforeSend: function () {
|
261 |
-
$that.addClass('tutor-updating-message');
|
262 |
-
},
|
263 |
-
success: function (data) {
|
264 |
-
if (data.success){
|
265 |
-
$that.closest('.tutor-edit-inline-lesson-form').hide();
|
266 |
-
}
|
267 |
-
},
|
268 |
-
complete: function () {
|
269 |
-
$that.removeClass('tutor-updating-message');
|
270 |
-
}
|
271 |
-
});
|
272 |
-
});
|
273 |
-
*/
|
274 |
$(document).on('click', '.tutor-expand-all-topic', function (e) {
|
275 |
e.preventDefault();
|
276 |
$('.tutor-topics-body').slideDown();
|
|
|
277 |
});
|
278 |
$(document).on('click', '.tutor-collapse-all-topic', function (e) {
|
279 |
e.preventDefault();
|
280 |
$('.tutor-topics-body').slideUp();
|
|
|
281 |
});
|
282 |
-
$(document).on('click', '.expand-collapse-wrap', function (e) {
|
283 |
e.preventDefault();
|
284 |
var $that = $(this);
|
285 |
$that.closest('.tutor-topics-wrap').find('.tutor-topics-body').slideToggle();
|
286 |
-
$that.closest('.tutor-topics-wrap').find('.expand-collapse-wrap
|
287 |
});
|
288 |
|
289 |
/**
|
@@ -1677,4 +1602,49 @@ jQuery(document).ready(function($){
|
|
1677 |
$that.closest('.tutor-media-upload-wrap').find('input').val('');
|
1678 |
});
|
1679 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1680 |
});
|
188 |
*/
|
189 |
$(document).on('click', '.topic-delete-btn a', function(e){
|
190 |
var topic_id = $(this).attr('data-topic-id');
|
|
|
191 |
|
192 |
if ( ! confirm('Are you sure to delete?')){
|
193 |
e.preventDefault();
|
194 |
}
|
195 |
});
|
196 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
197 |
$(document).on('click', '.tutor-expand-all-topic', function (e) {
|
198 |
e.preventDefault();
|
199 |
$('.tutor-topics-body').slideDown();
|
200 |
+
$('.expand-collapse-wrap i').removeClass('tutor-icon-light-down').addClass('tutor-icon-light-up');
|
201 |
});
|
202 |
$(document).on('click', '.tutor-collapse-all-topic', function (e) {
|
203 |
e.preventDefault();
|
204 |
$('.tutor-topics-body').slideUp();
|
205 |
+
$('.expand-collapse-wrap i').removeClass('tutor-icon-light-up').addClass('tutor-icon-light-down');
|
206 |
});
|
207 |
+
$(document).on('click', '.topic-inner-title, .expand-collapse-wrap', function (e) {
|
208 |
e.preventDefault();
|
209 |
var $that = $(this);
|
210 |
$that.closest('.tutor-topics-wrap').find('.tutor-topics-body').slideToggle();
|
211 |
+
$that.closest('.tutor-topics-wrap').find('.expand-collapse-wrap i').toggleClass('tutor-icon-light-down tutor-icon-light-up');
|
212 |
});
|
213 |
|
214 |
/**
|
1602 |
$that.closest('.tutor-media-upload-wrap').find('input').val('');
|
1603 |
});
|
1604 |
|
1605 |
+
/**
|
1606 |
+
* Add instructor
|
1607 |
+
* @since v.1.0.3
|
1608 |
+
*/
|
1609 |
+
$(document).on('submit', '#new-instructor-form', function(e){
|
1610 |
+
e.preventDefault();
|
1611 |
+
|
1612 |
+
var $that = $(this);
|
1613 |
+
var formData = $that.serialize()+'&action=tutor_add_instructor';
|
1614 |
+
|
1615 |
+
$.ajax({
|
1616 |
+
url : ajaxurl,
|
1617 |
+
type : 'POST',
|
1618 |
+
data : formData,
|
1619 |
+
success: function (data) {
|
1620 |
+
if (data.success){
|
1621 |
+
$that.trigger("reset");
|
1622 |
+
$('#form-response').html('<p class="tutor-status-approved-context">'+data.data.msg+'</p>');
|
1623 |
+
}else{
|
1624 |
+
var errorMsg = '';
|
1625 |
+
|
1626 |
+
var errors = data.data.errors;
|
1627 |
+
if (errors && Object.keys(errors).length){
|
1628 |
+
$.each(data.data.errors, function( index, value ) {
|
1629 |
+
if (isObject(value)){
|
1630 |
+
|
1631 |
+
$.each(value, function( key, value1 ) {
|
1632 |
+
errorMsg += '<p class="tutor-required-fields">'+value1[0]+'</p>';
|
1633 |
+
});
|
1634 |
+
} else{
|
1635 |
+
errorMsg += '<p class="tutor-required-fields">'+value+'</p>';
|
1636 |
+
}
|
1637 |
+
});
|
1638 |
+
$('#form-response').html(errorMsg);
|
1639 |
+
}
|
1640 |
+
|
1641 |
+
}
|
1642 |
+
}
|
1643 |
+
});
|
1644 |
+
});
|
1645 |
+
|
1646 |
+
function isObject (value) {
|
1647 |
+
return value && typeof value === 'object' && value.constructor === Object;
|
1648 |
+
}
|
1649 |
+
|
1650 |
});
|
@@ -16,6 +16,9 @@ class Instructor {
|
|
16 |
public function __construct() {
|
17 |
add_action('template_redirect', array($this, 'register_instructor'));
|
18 |
add_action('template_redirect', array($this, 'apply_instructor'));
|
|
|
|
|
|
|
19 |
}
|
20 |
|
21 |
/**
|
@@ -134,4 +137,64 @@ class Instructor {
|
|
134 |
die();
|
135 |
}
|
136 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
137 |
}
|
16 |
public function __construct() {
|
17 |
add_action('template_redirect', array($this, 'register_instructor'));
|
18 |
add_action('template_redirect', array($this, 'apply_instructor'));
|
19 |
+
|
20 |
+
//Add instructor from admin panel.
|
21 |
+
add_action('wp_ajax_tutor_add_instructor', array($this, 'add_new_instructor'));
|
22 |
}
|
23 |
|
24 |
/**
|
137 |
die();
|
138 |
}
|
139 |
|
140 |
+
|
141 |
+
public function add_new_instructor(){
|
142 |
+
$required_fields = apply_filters('tutor_instructor_registration_required_fields', array(
|
143 |
+
'first_name' => __('First name field is required', 'tutor'),
|
144 |
+
'last_name' => __('Last name field is required', 'tutor'),
|
145 |
+
'email' => __('E-Mail field is required', 'tutor'),
|
146 |
+
'user_login' => __('User Name field is required', 'tutor'),
|
147 |
+
'phone_number' => __('Phone Number field is required', 'tutor'),
|
148 |
+
'password' => __('Password field is required', 'tutor'),
|
149 |
+
'password_confirmation' => __('Password Confirmation field is required', 'tutor'),
|
150 |
+
));
|
151 |
+
|
152 |
+
$validation_errors = array();
|
153 |
+
foreach ($required_fields as $required_key => $required_value){
|
154 |
+
if (empty($_POST[$required_key])){
|
155 |
+
$validation_errors[$required_key] = $required_value;
|
156 |
+
}
|
157 |
+
}
|
158 |
+
|
159 |
+
if (!filter_var(tutor_utils()->input_old('email'), FILTER_VALIDATE_EMAIL)) {
|
160 |
+
$validation_errors['email'] = __('Valid E-Mail is required', 'tutor');
|
161 |
+
}
|
162 |
+
if (tutor_utils()->input_old('password') !== tutor_utils()->input_old('password_confirmation')){
|
163 |
+
$validation_errors['password_confirmation'] = __('Confirm password does not matched with Password field', 'tutor');
|
164 |
+
}
|
165 |
+
|
166 |
+
if (count($validation_errors)){
|
167 |
+
wp_send_json_error(array('errors' => $validation_errors));
|
168 |
+
}
|
169 |
+
|
170 |
+
$first_name = sanitize_text_field(tutor_utils()->input_old('first_name'));
|
171 |
+
$last_name = sanitize_text_field(tutor_utils()->input_old('last_name'));
|
172 |
+
$email = sanitize_text_field(tutor_utils()->input_old('email'));
|
173 |
+
$user_login = sanitize_text_field(tutor_utils()->input_old('user_login'));
|
174 |
+
$phone_number = sanitize_text_field(tutor_utils()->input_old('phone_number'));
|
175 |
+
$password = sanitize_text_field(tutor_utils()->input_old('password'));
|
176 |
+
$tutor_profile_bio = wp_kses_post(tutor_utils()->input_old('tutor_profile_bio'));
|
177 |
+
|
178 |
+
$userdata = array(
|
179 |
+
'user_login' => $user_login,
|
180 |
+
'user_email' => $email,
|
181 |
+
'first_name' => $first_name,
|
182 |
+
'last_name' => $last_name,
|
183 |
+
'role' => tutor()->instructor_role,
|
184 |
+
'user_pass' => $password,
|
185 |
+
);
|
186 |
+
$user_id = wp_insert_user( $userdata ) ;
|
187 |
+
if ( ! is_wp_error($user_id)) {
|
188 |
+
update_user_meta($user_id, 'phone_number', $phone_number);
|
189 |
+
update_user_meta($user_id, 'description', $tutor_profile_bio);
|
190 |
+
update_user_meta($user_id, '_tutor_profile_bio', $tutor_profile_bio);
|
191 |
+
update_user_meta($user_id, '_is_tutor_instructor', time());
|
192 |
+
update_user_meta($user_id, '_tutor_instructor_status', apply_filters('tutor_initial_instructor_status', 'approved'));
|
193 |
+
|
194 |
+
wp_send_json_success(array('msg' => __('Instructor has been added successfully', 'tutor') ));
|
195 |
+
}
|
196 |
+
|
197 |
+
wp_send_json_error(array('errors' => $user_id));
|
198 |
+
}
|
199 |
+
|
200 |
}
|
@@ -11,10 +11,6 @@ class Lesson extends Tutor_Base {
|
|
11 |
add_action( 'add_meta_boxes', array($this, 'register_meta_box') );
|
12 |
add_action('save_post_'.$this->lesson_post_type, array($this, "save_lesson_meta"));
|
13 |
|
14 |
-
|
15 |
-
//add_action('wp_ajax_tutor_create_lesson', array($this, "tutor_create_lesson"));
|
16 |
-
//add_action('wp_ajax_tutor_update_inline_lesson', array($this, "tutor_update_inline_lesson"));
|
17 |
-
|
18 |
add_action('wp_ajax_tutor_load_edit_lesson_modal', array($this, "tutor_load_edit_lesson_modal"));
|
19 |
add_action('wp_ajax_tutor_modal_create_or_update_lesson', array($this, "tutor_modal_create_or_update_lesson"));
|
20 |
add_action('wp_ajax_tutor_delete_lesson_by_id', array($this, "tutor_delete_lesson_by_id"));
|
@@ -88,53 +84,6 @@ class Lesson extends Tutor_Base {
|
|
88 |
update_post_meta($post_ID, '_tutor_attachments', $attachments);
|
89 |
}
|
90 |
|
91 |
-
/**
|
92 |
-
* Create Lesson from topic area in course builder
|
93 |
-
*/
|
94 |
-
|
95 |
-
/*
|
96 |
-
public function tutor_create_lesson(){
|
97 |
-
$course_id = (int) sanitize_text_field( $_POST['course_id'] );
|
98 |
-
$topic_id = (int) sanitize_text_field( $_POST['topic_id'] );
|
99 |
-
$lesson_title = sanitize_text_field($_POST['lesson_title']);
|
100 |
-
|
101 |
-
$post_arr = array(
|
102 |
-
'post_type' => $this->lesson_post_type,
|
103 |
-
'post_title' => $lesson_title,
|
104 |
-
'post_status' => 'publish',
|
105 |
-
'post_author' => get_current_user_id(),
|
106 |
-
'post_parent' => $topic_id,
|
107 |
-
);
|
108 |
-
$post_ID = wp_insert_post( $post_arr );
|
109 |
-
|
110 |
-
if ( $course_id && $post_ID ) {
|
111 |
-
update_post_meta( $post_ID, '_tutor_course_id_for_lesson', $course_id );
|
112 |
-
|
113 |
-
ob_start();
|
114 |
-
include tutor()->path.'views/metabox/course-contents.php';
|
115 |
-
$course_contents = ob_get_clean();
|
116 |
-
|
117 |
-
wp_send_json_success(array('course_contents' => $course_contents));
|
118 |
-
}
|
119 |
-
|
120 |
-
wp_send_json_error();
|
121 |
-
}
|
122 |
-
|
123 |
-
|
124 |
-
public function tutor_update_inline_lesson(){
|
125 |
-
$lesson_id = (int) sanitize_text_field( $_POST['lesson_id'] );
|
126 |
-
$lesson_title = sanitize_text_field($_POST['lesson_title']);
|
127 |
-
|
128 |
-
$post_arr = array(
|
129 |
-
'ID' => $lesson_id,
|
130 |
-
'post_title' => $lesson_title,
|
131 |
-
);
|
132 |
-
wp_update_post( $post_arr );
|
133 |
-
wp_send_json_success();
|
134 |
-
}
|
135 |
-
|
136 |
-
*/
|
137 |
-
|
138 |
public function tutor_load_edit_lesson_modal(){
|
139 |
$lesson_id = (int) tutor_utils()->avalue_dot('lesson_id', $_POST);
|
140 |
$topic_id = (int) sanitize_text_field( $_POST['topic_id'] );
|
11 |
add_action( 'add_meta_boxes', array($this, 'register_meta_box') );
|
12 |
add_action('save_post_'.$this->lesson_post_type, array($this, "save_lesson_meta"));
|
13 |
|
|
|
|
|
|
|
|
|
14 |
add_action('wp_ajax_tutor_load_edit_lesson_modal', array($this, "tutor_load_edit_lesson_modal"));
|
15 |
add_action('wp_ajax_tutor_modal_create_or_update_lesson', array($this, "tutor_modal_create_or_update_lesson"));
|
16 |
add_action('wp_ajax_tutor_delete_lesson_by_id', array($this, "tutor_delete_lesson_by_id"));
|
84 |
update_post_meta($post_ID, '_tutor_attachments', $attachments);
|
85 |
}
|
86 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
87 |
public function tutor_load_edit_lesson_modal(){
|
88 |
$lesson_id = (int) tutor_utils()->avalue_dot('lesson_id', $_POST);
|
89 |
$topic_id = (int) sanitize_text_field( $_POST['topic_id'] );
|
@@ -394,20 +394,20 @@ class Quiz {
|
|
394 |
}
|
395 |
|
396 |
}elseif ($question_type === 'image_answering'){
|
|
|
|
|
397 |
$image_inputs = tutor_utils()->avalue_dot('answer_id', $answers);
|
|
|
398 |
$given_answer = maybe_serialize($image_inputs);
|
399 |
-
|
400 |
$is_answer_was_correct = false;
|
401 |
|
402 |
-
|
403 |
-
|
404 |
-
$db_answer = $wpdb->get_row("SELECT * FROM {$wpdb->prefix}tutor_quiz_question_answers WHERE answer_id = {$answer_id} ;");
|
405 |
|
406 |
-
|
407 |
-
|
408 |
}
|
409 |
-
|
410 |
-
}
|
411 |
|
412 |
$question_mark = $is_answer_was_correct ? $question->question_mark : 0;
|
413 |
$total_marks += $question_mark;
|
@@ -505,6 +505,7 @@ class Quiz {
|
|
505 |
$attempt_answer_id = (int) sanitize_text_field($_GET['attempt_answer_id']);
|
506 |
$mark_as = sanitize_text_field($_GET['mark_as']);
|
507 |
|
|
|
508 |
$attempt_answer = $wpdb->get_row("SELECT * FROM {$wpdb->prefix}tutor_quiz_attempt_answers WHERE attempt_answer_id = {$attempt_answer_id} ");
|
509 |
$attempt = tutor_utils()->get_attempt($attempt_id);
|
510 |
|
@@ -532,12 +533,12 @@ class Quiz {
|
|
532 |
'achieved_mark' => '0.00',
|
533 |
'is_correct' => 0,
|
534 |
);
|
535 |
-
$wpdb->update($wpdb->prefix.'tutor_quiz_attempt_answers', $answer_update_data, array('attempt_answer_id' => $
|
536 |
|
537 |
$attempt_update_data = array(
|
538 |
-
'earned_marks'
|
539 |
-
'is_manually_reviewed'
|
540 |
-
'manually_reviewed_at'
|
541 |
);
|
542 |
|
543 |
$wpdb->update($wpdb->prefix.'tutor_quiz_attempts', $attempt_update_data, array('attempt_id' => $attempt_id ));
|
@@ -928,13 +929,13 @@ class Quiz {
|
|
928 |
if ($answer->image_id){
|
929 |
echo '<span class="tutor-question-answer-image"><img src="'.wp_get_attachment_image_url($answer->image_id).'" /> </span>';
|
930 |
}
|
931 |
-
if ($
|
932 |
?>
|
933 |
<span class="tutor-quiz-answers-mark-correct-wrap">
|
934 |
<input type="radio" name="mark_as_correct[<?php echo $answer->belongs_question_id; ?>]" value="<?php echo $answer->answer_id; ?>" title="<?php _e('Mark as correct', 'tutor'); ?>" <?php checked(1, $answer->is_correct); ?> >
|
935 |
</span>
|
936 |
<?php
|
937 |
-
}elseif ($
|
938 |
?>
|
939 |
<span class="tutor-quiz-answers-mark-correct-wrap">
|
940 |
<input type="checkbox" name="mark_as_correct[<?php echo $answer->belongs_question_id; ?>]" value="<?php echo $answer->answer_id; ?>" title="<?php _e('Mark as correct', 'tutor'); ?>" <?php checked(1, $answer->is_correct); ?> >
|
394 |
}
|
395 |
|
396 |
}elseif ($question_type === 'image_answering'){
|
397 |
+
echo '<pre>';
|
398 |
+
|
399 |
$image_inputs = tutor_utils()->avalue_dot('answer_id', $answers);
|
400 |
+
$image_inputs = (array) array_map('sanitize_text_field', $image_inputs);
|
401 |
$given_answer = maybe_serialize($image_inputs);
|
|
|
402 |
$is_answer_was_correct = false;
|
403 |
|
404 |
+
$db_answer = $wpdb->get_col("SELECT answer_title FROM {$wpdb->prefix}tutor_quiz_question_answers WHERE belongs_question_id = {$question_id} AND belongs_question_type =
|
405 |
+
'image_answering' ORDER BY answer_order asc ;");
|
|
|
406 |
|
407 |
+
if (is_array($db_answer) && count($db_answer)){
|
408 |
+
$is_answer_was_correct = (strtolower(maybe_serialize(array_values($image_inputs))) == strtolower(maybe_serialize($db_answer)) );
|
409 |
}
|
410 |
+
}
|
|
|
411 |
|
412 |
$question_mark = $is_answer_was_correct ? $question->question_mark : 0;
|
413 |
$total_marks += $question_mark;
|
505 |
$attempt_answer_id = (int) sanitize_text_field($_GET['attempt_answer_id']);
|
506 |
$mark_as = sanitize_text_field($_GET['mark_as']);
|
507 |
|
508 |
+
|
509 |
$attempt_answer = $wpdb->get_row("SELECT * FROM {$wpdb->prefix}tutor_quiz_attempt_answers WHERE attempt_answer_id = {$attempt_answer_id} ");
|
510 |
$attempt = tutor_utils()->get_attempt($attempt_id);
|
511 |
|
533 |
'achieved_mark' => '0.00',
|
534 |
'is_correct' => 0,
|
535 |
);
|
536 |
+
$wpdb->update($wpdb->prefix.'tutor_quiz_attempt_answers', $answer_update_data, array('attempt_answer_id' => $attempt_answer_id ));
|
537 |
|
538 |
$attempt_update_data = array(
|
539 |
+
'earned_marks' => $attempt->earned_marks - $attempt_answer->question_mark,
|
540 |
+
'is_manually_reviewed' => 1,
|
541 |
+
'manually_reviewed_at' => date("Y-m-d H:i:s"),
|
542 |
);
|
543 |
|
544 |
$wpdb->update($wpdb->prefix.'tutor_quiz_attempts', $attempt_update_data, array('attempt_id' => $attempt_id ));
|
929 |
if ($answer->image_id){
|
930 |
echo '<span class="tutor-question-answer-image"><img src="'.wp_get_attachment_image_url($answer->image_id).'" /> </span>';
|
931 |
}
|
932 |
+
if ($question_type === 'true_false' || $question_type === 'single_choice'){
|
933 |
?>
|
934 |
<span class="tutor-quiz-answers-mark-correct-wrap">
|
935 |
<input type="radio" name="mark_as_correct[<?php echo $answer->belongs_question_id; ?>]" value="<?php echo $answer->answer_id; ?>" title="<?php _e('Mark as correct', 'tutor'); ?>" <?php checked(1, $answer->is_correct); ?> >
|
936 |
</span>
|
937 |
<?php
|
938 |
+
}elseif ($question_type === 'multiple_choice'){
|
939 |
?>
|
940 |
<span class="tutor-quiz-answers-mark-correct-wrap">
|
941 |
<input type="checkbox" name="mark_as_correct[<?php echo $answer->belongs_question_id; ?>]" value="<?php echo $answer->answer_id; ?>" title="<?php _e('Mark as correct', 'tutor'); ?>" <?php checked(1, $answer->is_correct); ?> >
|
@@ -36,8 +36,13 @@ class Quiz_Attempts_List extends \Tutor_List_Table {
|
|
36 |
$actions['answer'] = sprintf('<a href="?page=%s&sub_page=%s&attempt_id=%s">'.__('Review', 'tutor').'</a>',$_REQUEST['page'],'view_attempt',$item->attempt_id);
|
37 |
//$actions['delete'] = sprintf('<a href="?page=%s&action=%s&attempt_id=%s">Delete</a>',$_REQUEST['page'],'delete',$item->attempt_id);
|
38 |
|
39 |
-
$quiz_title =
|
40 |
-
|
|
|
|
|
|
|
|
|
|
|
41 |
|
42 |
//Return the title contents
|
43 |
return sprintf('%1$s <span style="color:silver">(id:%2$s)</span>%3$s',
|
@@ -90,7 +95,8 @@ class Quiz_Attempts_List extends \Tutor_List_Table {
|
|
90 |
|
91 |
function column_attempt_status($item){
|
92 |
$status = ucwords(str_replace('quiz_', '', $item->attempt_status));
|
93 |
-
|
|
|
94 |
}
|
95 |
|
96 |
function get_columns(){
|
36 |
$actions['answer'] = sprintf('<a href="?page=%s&sub_page=%s&attempt_id=%s">'.__('Review', 'tutor').'</a>',$_REQUEST['page'],'view_attempt',$item->attempt_id);
|
37 |
//$actions['delete'] = sprintf('<a href="?page=%s&action=%s&attempt_id=%s">Delete</a>',$_REQUEST['page'],'delete',$item->attempt_id);
|
38 |
|
39 |
+
$quiz_title = "<p><strong>{$item->display_name}</strong></p>";
|
40 |
+
$quiz_title .= "<p>{$item->user_email}</p>";
|
41 |
+
|
42 |
+
if ($item->attempt_ended_at){
|
43 |
+
$ended_ago_time = human_time_diff(strtotime($item->attempt_ended_at)).__(' ago', 'tutor');
|
44 |
+
$quiz_title .= "<span>{$ended_ago_time}</span>";
|
45 |
+
}
|
46 |
|
47 |
//Return the title contents
|
48 |
return sprintf('%1$s <span style="color:silver">(id:%2$s)</span>%3$s',
|
95 |
|
96 |
function column_attempt_status($item){
|
97 |
$status = ucwords(str_replace('quiz_', '', $item->attempt_status));
|
98 |
+
|
99 |
+
return "<span class='attempt-status-{$item->attempt_status}'>{$status}</span>";
|
100 |
}
|
101 |
|
102 |
function get_columns(){
|
@@ -3213,7 +3213,7 @@ class Utils {
|
|
3213 |
ON quiz_attempts.quiz_id = quiz.ID
|
3214 |
INNER JOIN {$wpdb->users}
|
3215 |
ON quiz_attempts.user_id = {$wpdb->users}.ID
|
3216 |
-
WHERE 1=1 {$search_term} ");
|
3217 |
return (int) $count;
|
3218 |
}
|
3219 |
|
@@ -3242,7 +3242,7 @@ class Utils {
|
|
3242 |
ON quiz_attempts.quiz_id = quiz.ID
|
3243 |
INNER JOIN {$wpdb->users}
|
3244 |
ON quiz_attempts.user_id = {$wpdb->users}.ID
|
3245 |
-
WHERE 1=1 {$search_term}
|
3246 |
ORDER BY quiz_attempts.attempt_id DESC
|
3247 |
LIMIT {$start},{$limit}; ");
|
3248 |
return $query;
|
@@ -3251,7 +3251,6 @@ class Utils {
|
|
3251 |
public function get_quiz_attempts_by_course_ids($start = 0, $limit = 10, $course_ids = array(), $search_term = '') {
|
3252 |
global $wpdb;
|
3253 |
|
3254 |
-
|
3255 |
if ($search_term){
|
3256 |
$search_term = " AND ( user_email like '%{$search_term}%' OR display_name like '%{$search_term}%' OR post_title like '%{$search_term}%' ) ";
|
3257 |
}
|
@@ -3266,7 +3265,7 @@ class Utils {
|
|
3266 |
ON quiz_attempts.quiz_id = quiz.ID
|
3267 |
INNER JOIN {$wpdb->users}
|
3268 |
ON quiz_attempts.user_id = {$wpdb->users}.ID
|
3269 |
-
WHERE 1=1 {$search_term}
|
3270 |
ORDER BY quiz_attempts.attempt_id DESC
|
3271 |
LIMIT {$start},{$limit}; ");
|
3272 |
return $query;
|
@@ -3289,7 +3288,7 @@ class Utils {
|
|
3289 |
ON quiz_attempts.quiz_id = quiz.ID
|
3290 |
INNER JOIN {$wpdb->users}
|
3291 |
ON quiz_attempts.user_id = {$wpdb->users}.ID
|
3292 |
-
WHERE 1=1 {$search_term} ");
|
3293 |
return (int) $count;
|
3294 |
}
|
3295 |
|
3213 |
ON quiz_attempts.quiz_id = quiz.ID
|
3214 |
INNER JOIN {$wpdb->users}
|
3215 |
ON quiz_attempts.user_id = {$wpdb->users}.ID
|
3216 |
+
WHERE 1=1 AND quiz_attempts.attempt_ended_at <= NOW() {$search_term} ");
|
3217 |
return (int) $count;
|
3218 |
}
|
3219 |
|
3242 |
ON quiz_attempts.quiz_id = quiz.ID
|
3243 |
INNER JOIN {$wpdb->users}
|
3244 |
ON quiz_attempts.user_id = {$wpdb->users}.ID
|
3245 |
+
WHERE 1=1 AND quiz_attempts.attempt_ended_at <= NOW() {$search_term}
|
3246 |
ORDER BY quiz_attempts.attempt_id DESC
|
3247 |
LIMIT {$start},{$limit}; ");
|
3248 |
return $query;
|
3251 |
public function get_quiz_attempts_by_course_ids($start = 0, $limit = 10, $course_ids = array(), $search_term = '') {
|
3252 |
global $wpdb;
|
3253 |
|
|
|
3254 |
if ($search_term){
|
3255 |
$search_term = " AND ( user_email like '%{$search_term}%' OR display_name like '%{$search_term}%' OR post_title like '%{$search_term}%' ) ";
|
3256 |
}
|
3265 |
ON quiz_attempts.quiz_id = quiz.ID
|
3266 |
INNER JOIN {$wpdb->users}
|
3267 |
ON quiz_attempts.user_id = {$wpdb->users}.ID
|
3268 |
+
WHERE 1=1 AND quiz_attempts.attempt_ended_at <= NOW() {$search_term}
|
3269 |
ORDER BY quiz_attempts.attempt_id DESC
|
3270 |
LIMIT {$start},{$limit}; ");
|
3271 |
return $query;
|
3288 |
ON quiz_attempts.quiz_id = quiz.ID
|
3289 |
INNER JOIN {$wpdb->users}
|
3290 |
ON quiz_attempts.user_id = {$wpdb->users}.ID
|
3291 |
+
WHERE 1=1 AND quiz_attempts.attempt_ended_at <= NOW() {$search_term} ");
|
3292 |
return (int) $count;
|
3293 |
}
|
3294 |
|
@@ -315,6 +315,8 @@ if ( ! function_exists('tutor_course_loop_price')) {
|
|
315 |
$tutor_course_sell_by = apply_filters('tutor_course_sell_by', null);
|
316 |
if ($tutor_course_sell_by){
|
317 |
tutor_load_template( 'loop.course-price-'.$tutor_course_sell_by );
|
|
|
|
|
318 |
}
|
319 |
$output = apply_filters( 'tutor_course_loop_price', ob_get_clean() );
|
320 |
|
315 |
$tutor_course_sell_by = apply_filters('tutor_course_sell_by', null);
|
316 |
if ($tutor_course_sell_by){
|
317 |
tutor_load_template( 'loop.course-price-'.$tutor_course_sell_by );
|
318 |
+
}else{
|
319 |
+
tutor_load_template( 'loop.course-price' );
|
320 |
}
|
321 |
$output = apply_filters( 'tutor_course_loop_price', ob_get_clean() );
|
322 |
|
@@ -5,7 +5,7 @@ Tags: lms, education, wp-lms, education management system
|
|
5 |
Requires at least: 4.5
|
6 |
Tested up to: 5.1
|
7 |
Requires PHP: 5.4.0
|
8 |
-
Stable tag: 1.0.
|
9 |
License: GPLv3
|
10 |
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
11 |
|
@@ -13,18 +13,21 @@ A complete WordPress LMS plugin to create any e-learning website easily.
|
|
13 |
|
14 |
== Description ==
|
15 |
|
16 |
-
Tutor is
|
17 |
|
18 |
-
|
19 |
|
20 |
-
|
21 |
|
22 |
[youtube https://www.youtube.com/watch?v=yo47fDYIGQo]
|
23 |
|
|
|
|
|
24 |
= Features =
|
25 |
|
26 |
Here are the most notable features of Tutor LMS plugin. If you need any further information, please feel free to contact us. Below are the best offerings of Tutor LMS.
|
27 |
|
|
|
28 |
* Unlimited courses and lessons
|
29 |
* Frontend student dashboard
|
30 |
* Video lessons
|
@@ -43,32 +46,72 @@ Here are the most notable features of Tutor LMS plugin. If you need any further
|
|
43 |
* Add course requirement and instruction
|
44 |
* Quiz Timer
|
45 |
* Quiz Attempts
|
46 |
-
|
|
|
47 |
|
48 |
= Intuitive Course Builder =
|
49 |
-
Create courses with their details like videos, attachments, excerpt, additional data, benefit of the course, requirement, topic, summary, announcement, and video banners. Have lessons under course and attach video and other attachments to each lesson. Tutor, the advanced WordPress LMS plugin lets you present courses on an intuitive user interface with all required options to offer a top
|
50 |
|
51 |
= Smart Course and Lesson Manager =
|
52 |
-
With tons of awesome features inside this WordPress course plugin, it is easy to setup, control, and manage teachers, students, courses & lessons.
|
|
|
53 |
|
54 |
= Frontend Student Dashboard =
|
55 |
Each student registered on your WordPress learning management system will have a frontend dashboard to see their course status, progress, notifications, announcements, and any other thing an admin or a course teacher sets from the backend.
|
56 |
|
|
|
|
|
|
|
|
|
57 |
= Quiz Creator =
|
58 |
Create quizzes with this WordPress course plugin. Add questions while setting up quizzes or add them from preset questions from Question section. Set up the time limit and restrict the number of attempts, passing grades and so on. This WordPress LMS plugin also lets you limit the number of questions available for students to answer.
|
59 |
|
60 |
-
=
|
|
|
|
|
|
|
|
|
61 |
With this free LMS plugin for WordPress, you create questions that are supposed to be added to the Quizzes. Create questions by defining question type (True/False, Multiple Choice, Single Choice), marks for each question (if answered right), answer type, descriptions and answer hints for the students to attempt the right answer.
|
62 |
|
|
|
|
|
|
|
|
|
63 |
= Email Notifications =
|
64 |
Sending emails to students and teachers has been made automated in Tutor. You can send course enrollment, course completion, and quiz completion email to both students and teachers automatically.
|
65 |
|
66 |
= WooCommerce Integration to Sell Course =
|
67 |
Being integrated with WooCommerce, Tutor, the WordPress LMS plugin offers eCommerce functionalities and enables you to sell courses on your website.
|
68 |
|
69 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
70 |
|
|
|
71 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
|
73 |
== Installation ==
|
74 |
|
@@ -95,10 +138,22 @@ The WordPress codex contains [instructions on how to do this here](https://codex
|
|
95 |
|
96 |
Yes. Tutor can be used with your existing theme or any theme you wish to use it with.
|
97 |
|
|
|
|
|
|
|
|
|
98 |
= Is this plugin free? =
|
99 |
|
100 |
This WordPress course plugin has two versions. One is free and another is paid. The paid version has more advanced features which are not accessible in this free version. Click here to get the paid version.
|
101 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
102 |
= Where can I get support? =
|
103 |
|
104 |
You can get support by posting your issues on the support section of this plugin on WordPress plugins directory or directly place your question to Themeum Forums.
|
@@ -128,6 +183,27 @@ This is an alpha version of Tutor, as bugs and issues expected, if you found any
|
|
128 |
|
129 |
== Changelog ==
|
130 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
131 |
= 1.0.2 - 06 March, 2019 =
|
132 |
|
133 |
* Added: button save, save and closed in quiz modal
|
5 |
Requires at least: 4.5
|
6 |
Tested up to: 5.1
|
7 |
Requires PHP: 5.4.0
|
8 |
+
Stable tag: 1.0.3
|
9 |
License: GPLv3
|
10 |
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
11 |
|
13 |
|
14 |
== Description ==
|
15 |
|
16 |
+
Tutor is a complete, feature-packed and robust WordPress LMS plugin to create & sell courses online easily. All the features of this learning management system hits all the checkpoints for a full-fledged online course marketplace. You can create challenging and fun quizzes, interactive lessons, powerful reports and stats making Tutor potentially the best free WordPress LMS plugin. Manage, administer and monetize your education, online school, and online courses without having to write a single line of code.
|
17 |
|
18 |
+
Tutor LMS is a completely free plugin with premium high quality addons that you can add to empower the core plugin more! This WordPress LMS plugin is lightweight with addons to enable certificates, e-mail notifications, shopping carts and so much more!
|
19 |
|
20 |
+
Get Tutor, the most advanced and powerful WordPress online course plugin.
|
21 |
|
22 |
[youtube https://www.youtube.com/watch?v=yo47fDYIGQo]
|
23 |
|
24 |
+
Create, customize, manage, and sell online courses by building a functional e-learning website with this free LMS plugin for WordPress.
|
25 |
+
|
26 |
= Features =
|
27 |
|
28 |
Here are the most notable features of Tutor LMS plugin. If you need any further information, please feel free to contact us. Below are the best offerings of Tutor LMS.
|
29 |
|
30 |
+
* Intuitive course builder
|
31 |
* Unlimited courses and lessons
|
32 |
* Frontend student dashboard
|
33 |
* Video lessons
|
46 |
* Add course requirement and instruction
|
47 |
* Quiz Timer
|
48 |
* Quiz Attempts
|
49 |
+
* Gutenberg compatible
|
50 |
+
* Content Security
|
51 |
|
52 |
= Intuitive Course Builder =
|
53 |
+
Create courses with their details like videos, attachments, excerpt, additional data, benefit of the course, requirement, topic, summary, announcement, and video banners. Have lessons under course and attach video and other attachments to each lesson. Tutor, the advanced WordPress LMS plugin lets you present courses on an intuitive user interface with all required options to offer a top-notch learning system.
|
54 |
|
55 |
= Smart Course and Lesson Manager =
|
56 |
+
With tons of awesome features inside this WordPress course plugin, it is easy to setup, control, and manage teachers, students, courses & lessons.
|
57 |
+
There’s rich Tutor Settings to define, select, and limit options for Course, Lesson, Quiz, Teacher, Student, and Email Notification.
|
58 |
|
59 |
= Frontend Student Dashboard =
|
60 |
Each student registered on your WordPress learning management system will have a frontend dashboard to see their course status, progress, notifications, announcements, and any other thing an admin or a course teacher sets from the backend.
|
61 |
|
62 |
+
= Teacher Profiles and Panel =
|
63 |
+
|
64 |
+
Set up easy registration forms to approve instructors for a course with this WordPress LMS plugin. Review instructor profiles and then have custom settings for instructor role. Select whether instructors can publish course directly or to be checked before publishing.
|
65 |
+
|
66 |
= Quiz Creator =
|
67 |
Create quizzes with this WordPress course plugin. Add questions while setting up quizzes or add them from preset questions from Question section. Set up the time limit and restrict the number of attempts, passing grades and so on. This WordPress LMS plugin also lets you limit the number of questions available for students to answer.
|
68 |
|
69 |
+
= Multimedia Attachments =
|
70 |
+
|
71 |
+
Engage your students by uploading multimedia lessons in versatile video sources such as Vimeo, YouTube videos, etc. Set an introductory video at the start of your course easily and define video poster and duration with this WordPress course plugin.
|
72 |
+
|
73 |
+
= Question Patterns =
|
74 |
With this free LMS plugin for WordPress, you create questions that are supposed to be added to the Quizzes. Create questions by defining question type (True/False, Multiple Choice, Single Choice), marks for each question (if answered right), answer type, descriptions and answer hints for the students to attempt the right answer.
|
75 |
|
76 |
+
= Student forum =
|
77 |
+
|
78 |
+
Students can submit questions about courses before enrolling from their respective profiles. This useful feature in the WordPress LMS plugin encourages student interactions and helps boost conversion rates.
|
79 |
+
|
80 |
= Email Notifications =
|
81 |
Sending emails to students and teachers has been made automated in Tutor. You can send course enrollment, course completion, and quiz completion email to both students and teachers automatically.
|
82 |
|
83 |
= WooCommerce Integration to Sell Course =
|
84 |
Being integrated with WooCommerce, Tutor, the WordPress LMS plugin offers eCommerce functionalities and enables you to sell courses on your website.
|
85 |
|
86 |
+
= Gutenberg Compatible =
|
87 |
+
|
88 |
+
Create online courses with the new Gutenberg editor without facing any issues whatsoever. Tutor is completely compatible with the Gutenberg editor in case you want to display your courses in the block interface.
|
89 |
+
|
90 |
+
= Content Security =
|
91 |
+
|
92 |
+
Have the most secured learning management system when creating your online courses. Third parties cannot view the videos with the URL. It ensures that only enrolled students can have access to course videos.
|
93 |
+
|
94 |
+
== UPCOMING PREMIUM FEATURE FOR TUTOR ==
|
95 |
+
|
96 |
+
- **Tutor Report:** Get powerful stats for a complete analysis of which courses are performing great with students and judge individual course popularity. Monitor reviews with this WordPress LMS plugin and manually change quiz grades right from the panel.
|
97 |
|
98 |
+
- **Tutor Email:** Sending emails to students and teachers has been made automated in Tutor. You can send course enrollment, course completion, and quiz completion email to both students and teachers automatically. Customize email templates easily with the WordPress LMS plugin.
|
99 |
|
100 |
+
- **Tutor Certificates:** Offer beautifully designed certificates for completed courses to students. You can upload your own certificates with this amazing addon that comes with this WordPress LMS plugin.
|
101 |
+
|
102 |
+
- **Tutor Course Preview:** Unlock a few courses for students to try out before they enroll in a lesson. This boosts conversion rates and allows target students to get the feel of the lessons.
|
103 |
+
|
104 |
+
- **Tutor EDD:** Sell courses with this popular shopping cart addon with Tutor WordPress LMS plugin.
|
105 |
+
|
106 |
+
- **Tutor Course Attachment:** Include all the class materials in pdf, doc, etc. format for students to download. Attach lesson files, course outlines and every other information as an attachment with Tutor.
|
107 |
+
|
108 |
+
- **Tutor Multi Instructors:** Add as many instructors as you want to individual courses. Enhance course experience of students by having the option to have a great lineup of teachers.
|
109 |
+
|
110 |
+
- **Tutor Prerequisites:** Define a certain set of courses that students need to complete before enrolling for a new course.
|
111 |
+
|
112 |
+
- **Tutor WooCommerce:** Integrate your learning management system with the renowned WooCommerce addon. Sell your courses seamlessly with multiple payment gateways supported by WooCommerce.
|
113 |
+
|
114 |
+
Looking for the best LMS for WordPress? Get Tutor and start your e-learning website immediately.
|
115 |
|
116 |
== Installation ==
|
117 |
|
138 |
|
139 |
Yes. Tutor can be used with your existing theme or any theme you wish to use it with.
|
140 |
|
141 |
+
= Where can I find Tutor LMS user guides and documentation? =
|
142 |
+
|
143 |
+
For a detailed guideline on how to build a Learning Management system, refer to our user documentation on the Themeum site.
|
144 |
+
|
145 |
= Is this plugin free? =
|
146 |
|
147 |
This WordPress course plugin has two versions. One is free and another is paid. The paid version has more advanced features which are not accessible in this free version. Click here to get the paid version.
|
148 |
|
149 |
+
= Is Tutor LMS device friendly? =
|
150 |
+
|
151 |
+
If you’re using a responsive theme, then Tutor LMS will look great across all devices.
|
152 |
+
|
153 |
+
= Can I use any plugins with Tutor? =
|
154 |
+
|
155 |
+
Tutor enables you to use any third party plugins without facing any compatibility issues. You can integrate Tutor easily in your existing site without any trouble.
|
156 |
+
|
157 |
= Where can I get support? =
|
158 |
|
159 |
You can get support by posting your issues on the support section of this plugin on WordPress plugins directory or directly place your question to Themeum Forums.
|
183 |
|
184 |
== Changelog ==
|
185 |
|
186 |
+
= 1.0.3 - 08 March, 2019 =
|
187 |
+
|
188 |
+
* Added: onclick topic title slide topic body in course builder
|
189 |
+
* Added: Add new instructor from instructors > add new instructor, in the dashboard
|
190 |
+
* Removed: some commented unused code
|
191 |
+
* Removed: Save and exit button in quiz builder
|
192 |
+
* Removed: some console.log() at javascript files
|
193 |
+
* Updated: course level input select to radio
|
194 |
+
* Updated: Moved question type in the top in quiz builder question
|
195 |
+
* Updated: Course builder lesson and quiz design
|
196 |
+
* Updated: Quiz attempt view for the instructor
|
197 |
+
* Updated: quiz attempts query for instructor and removed attempts which are not submitted yet.
|
198 |
+
* Fixed: Frontend Template compatible, .tutor-container class CSS
|
199 |
+
* Fixed: Perfectly topic toggle arrow down up, on click in course builder
|
200 |
+
* Fixed: some buttons hover CSS in the quiz, course builder
|
201 |
+
* Fixed: When Tutor Pro does not exist, get enroll button will be in course loop with the free price
|
202 |
+
* Fixed: Ability to check multiple answers instant right after add question in quiz question type multiple_choice
|
203 |
+
* Fixed: Image answering question type result in the quiz
|
204 |
+
* Fixed: a bug in quiz attempt review, it was multi-time decrease when mark as incorrect, not actually marked.
|
205 |
+
* Fixed: Few known bugs
|
206 |
+
|
207 |
= 1.0.2 - 06 March, 2019 =
|
208 |
|
209 |
* Added: button save, save and closed in quiz modal
|
@@ -5,7 +5,9 @@
|
|
5 |
<div class="tutor-form-row">
|
6 |
<div class="tutor-form-col-12">
|
7 |
<div class="tutor-form-group">
|
8 |
-
<button type="submit" name="tutor_register_instructor_btn" value="apply"
|
|
|
|
|
9 |
</div>
|
10 |
</div>
|
11 |
</div>
|
5 |
<div class="tutor-form-row">
|
6 |
<div class="tutor-form-col-12">
|
7 |
<div class="tutor-form-group">
|
8 |
+
<button type="submit" name="tutor_register_instructor_btn" value="apply">
|
9 |
+
<?php _e('Apply to become an instructor', 'tutor'); ?>
|
10 |
+
</button>
|
11 |
</div>
|
12 |
</div>
|
13 |
</div>
|
@@ -24,7 +24,6 @@
|
|
24 |
$price_html = '<p class="price"> '.$product->get_price_html().$enroll_btn.' </p>';
|
25 |
}
|
26 |
}
|
27 |
-
|
28 |
echo $price_html;
|
29 |
?>
|
30 |
</div>
|
24 |
$price_html = '<p class="price"> '.$product->get_price_html().$enroll_btn.' </p>';
|
25 |
}
|
26 |
}
|
|
|
27 |
echo $price_html;
|
28 |
?>
|
29 |
</div>
|
@@ -5,10 +5,10 @@ Plugin URI: http://https://themeum.com/tutor
|
|
5 |
Description: Tutor is a complete solution for creating a Learning Management System in WordPress way. It can help you to create
|
6 |
courses, lessons and quizzes.
|
7 |
Author: Themeum
|
8 |
-
Version: 1.0.
|
9 |
Author URI: http://themeum.com
|
10 |
Requires at least: 4.5
|
11 |
-
Tested up to:
|
12 |
Text Domain: tutor
|
13 |
Domain Path: /languages/
|
14 |
*/
|
@@ -18,7 +18,7 @@ if ( ! defined( 'ABSPATH' ) )
|
|
18 |
/**
|
19 |
* Defined the tutor main file
|
20 |
*/
|
21 |
-
define('TUTOR_VERSION', '1.0.
|
22 |
define('TUTOR_FILE', __FILE__);
|
23 |
|
24 |
if ( ! function_exists('tutor')) {
|
5 |
Description: Tutor is a complete solution for creating a Learning Management System in WordPress way. It can help you to create
|
6 |
courses, lessons and quizzes.
|
7 |
Author: Themeum
|
8 |
+
Version: 1.0.3
|
9 |
Author URI: http://themeum.com
|
10 |
Requires at least: 4.5
|
11 |
+
Tested up to: 5.1
|
12 |
Text Domain: tutor
|
13 |
Domain Path: /languages/
|
14 |
*/
|
18 |
/**
|
19 |
* Defined the tutor main file
|
20 |
*/
|
21 |
+
define('TUTOR_VERSION', '1.0.3');
|
22 |
define('TUTOR_FILE', __FILE__);
|
23 |
|
24 |
if ( ! function_exists('tutor')) {
|
@@ -55,17 +55,14 @@ $material_includes = get_post_meta($course_id, '_tutor_course_material_includes'
|
|
55 |
</label>
|
56 |
</div>
|
57 |
<div class="tutor-option-field">
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
<p class="desc">
|
67 |
-
<?php _e('Set the course level', 'tutor'); ?>
|
68 |
-
</p>
|
69 |
</div>
|
70 |
</div>
|
71 |
|
55 |
</label>
|
56 |
</div>
|
57 |
<div class="tutor-option-field">
|
58 |
+
<?php
|
59 |
+
foreach ($levels as $level_key => $level){
|
60 |
+
?>
|
61 |
+
<label> <input type="radio" name="course_level" value="<?php echo $level_key; ?>" <?php checked($level_key, $course_level) ?> > <?php echo
|
62 |
+
$level; ?> </label>
|
63 |
+
<?php
|
64 |
+
}
|
65 |
+
?>
|
|
|
|
|
|
|
66 |
</div>
|
67 |
</div>
|
68 |
|
@@ -74,8 +74,8 @@
|
|
74 |
$attached_lesson_ids[] = $lesson->ID;
|
75 |
|
76 |
if ($lesson->post_type === 'tutor_quiz'){
|
77 |
-
|
78 |
-
|
79 |
<div id="tutor-quiz-<?php echo $quiz->ID; ?>" class="course-content-item tutor-quiz tutor-quiz-<?php echo $topic->ID; ?>">
|
80 |
<div class="tutor-lesson-top">
|
81 |
<i class="tutor-icon-move"></i>
|
@@ -86,18 +86,14 @@
|
|
86 |
</div>
|
87 |
</div>
|
88 |
|
89 |
-
|
90 |
-
|
91 |
?>
|
92 |
<div id="tutor-lesson-<?php echo $lesson->ID; ?>" class="course-content-item tutor-lesson tutor-lesson-<?php echo
|
93 |
$lesson->ID; ?>">
|
94 |
<div class="tutor-lesson-top">
|
95 |
<i class="tutor-icon-move"></i>
|
96 |
<a href="javascript:;" class="open-tutor-lesson-modal" data-lesson-id="<?php echo $lesson->ID; ?>" data-topic-id="<?php echo $topic->ID; ?>"><?php echo $lesson->post_title; ?> </a>
|
97 |
-
<!--
|
98 |
-
<a href="<?php /*echo admin_url( "post.php?post={$lesson->ID}&action=edit" ); */?>"><i class="tutor-icon-pencil"></i>
|
99 |
-
</a>-->
|
100 |
-
|
101 |
<a href="javascript:;" class="tutor-delete-lesson-btn" data-lesson-id="<?php echo $lesson->ID; ?>"><i class="tutor-icon-garbage"></i></a>
|
102 |
</div>
|
103 |
</div>
|
@@ -105,76 +101,15 @@
|
|
105 |
}
|
106 |
}
|
107 |
?>
|
108 |
-
|
109 |
-
|
110 |
-
<?php
|
111 |
-
/*
|
112 |
-
if (count($query_lesson->posts) > count($attached_lesson_ids)){
|
113 |
-
|
114 |
-
|
115 |
-
?>
|
116 |
-
<div class="drop-lessons">
|
117 |
-
<p>
|
118 |
-
<i class="dashicons dashicons-upload"></i>
|
119 |
-
<?php echo __('Drop lesson here or', 'tutor'); ?>
|
120 |
-
|
121 |
-
<a href="javascript:;" class="create-lesson-in-topic-btn open-tutor-lesson-modal" data-topic-id="<?php echo $topic->ID; ?>" data-lesson-id="0" ><?php _e('Create one'); ?></a>
|
122 |
-
</p>
|
123 |
-
</div>
|
124 |
-
<?php }else{
|
125 |
-
?>
|
126 |
-
<div class="create-new-lesson-wrap">
|
127 |
-
<a href="javascript:;" class="create-lesson-in-topic-btn open-tutor-lesson-modal" data-topic-id="<?php echo $topic->ID; ?>" data-lesson-id="0" ><?php _e('Create new lesson', 'tutor'); ?></a>
|
128 |
-
</div>
|
129 |
-
<?php
|
130 |
-
}
|
131 |
-
*/ ?>
|
132 |
-
|
133 |
-
<!--
|
134 |
-
<div class="tutor-create-new-lesson-form" style="display: none;" data-topic-id="<?php /*echo $topic->ID; */?>">
|
135 |
-
<div class="tutor-option-field-row">
|
136 |
-
<div class="tutor-option-field">
|
137 |
-
<input type="text" name="lesson_title" value="" placeholder="<?php /*_e('Lesson title', 'tutor'); */?>">
|
138 |
-
|
139 |
-
<button type="button" class="button button-primary tutor-create-lesson-btn"> <?php /*_e('Create Lesson', 'tutor'); */?></button>
|
140 |
-
</div>
|
141 |
-
</div>
|
142 |
-
</div>
|
143 |
-
-->
|
144 |
-
|
145 |
</div>
|
146 |
|
147 |
<div class="tutor_add_quiz_wrap" data-add-quiz-under="<?php echo $topic->ID; ?>">
|
148 |
-
|
149 |
-
<!--
|
150 |
-
<div class="tutor-available-quizzes">
|
151 |
-
<?php
|
152 |
-
/* $attached_quizzes = tutor_utils()->get_attached_quiz($topic->ID);
|
153 |
-
if ($attached_quizzes){
|
154 |
-
foreach ($attached_quizzes as $attached_quiz){
|
155 |
-
*/?>
|
156 |
-
<div id="added-quiz-id-<?php /*echo $attached_quiz->ID; */?>" class="added-quiz-item added-quiz-item-<?php /*echo $attached_quiz->ID; */?>" data-quiz-id="<?php /*echo $attached_quiz->ID; */?>">
|
157 |
-
<span class="quiz-icon"><i class="dashicons dashicons-clock"></i></span>
|
158 |
-
<span class="quiz-name">
|
159 |
-
<?php /*edit_post_link( $attached_quiz->post_title, null, null, $attached_quiz->ID ); */?>
|
160 |
-
</span>
|
161 |
-
<span class="quiz-control">
|
162 |
-
<a href="javascript:;" class="tutor-quiz-delete-btn"><i class="tutor-icon-garbage"></i></a>
|
163 |
-
</span>
|
164 |
-
</div>
|
165 |
-
<?php
|
166 |
-
/* }
|
167 |
-
}
|
168 |
-
*/?>
|
169 |
-
</div>
|
170 |
-
-->
|
171 |
-
|
172 |
<div class="tutor-add-quiz-button-wrap">
|
173 |
-
<a href="javascript:;" class="create-lesson-in-topic-btn open-tutor-lesson-modal" data-topic-id="<?php echo $topic->ID; ?>" data-lesson-id="0"
|
174 |
|
175 |
-
<button type="button" class="tutor-add-quiz-btn"> <?php _e('Add Topic Quiz',
|
|
|
176 |
</div>
|
177 |
-
|
178 |
</div>
|
179 |
|
180 |
</div>
|
@@ -195,10 +130,6 @@
|
|
195 |
<h3><?php _e( 'Un-assigned lessons' ); ?></h3>
|
196 |
|
197 |
<div class="tutor-lessons">
|
198 |
-
<!--<div class="drop-lessons" >
|
199 |
-
<p><i class="dashicons dashicons-upload"></i> <?php /*_e('Drop any unassigned lesson here', 'tutor'); */
|
200 |
-
?></p>
|
201 |
-
</div>-->
|
202 |
<?php
|
203 |
foreach ( $query_lesson->posts as $lesson ) {
|
204 |
if ( ! in_array( $lesson->ID, $attached_lesson_ids ) ) {
|
74 |
$attached_lesson_ids[] = $lesson->ID;
|
75 |
|
76 |
if ($lesson->post_type === 'tutor_quiz'){
|
77 |
+
$quiz = $lesson;
|
78 |
+
?>
|
79 |
<div id="tutor-quiz-<?php echo $quiz->ID; ?>" class="course-content-item tutor-quiz tutor-quiz-<?php echo $topic->ID; ?>">
|
80 |
<div class="tutor-lesson-top">
|
81 |
<i class="tutor-icon-move"></i>
|
86 |
</div>
|
87 |
</div>
|
88 |
|
89 |
+
<?php
|
90 |
+
}else {
|
91 |
?>
|
92 |
<div id="tutor-lesson-<?php echo $lesson->ID; ?>" class="course-content-item tutor-lesson tutor-lesson-<?php echo
|
93 |
$lesson->ID; ?>">
|
94 |
<div class="tutor-lesson-top">
|
95 |
<i class="tutor-icon-move"></i>
|
96 |
<a href="javascript:;" class="open-tutor-lesson-modal" data-lesson-id="<?php echo $lesson->ID; ?>" data-topic-id="<?php echo $topic->ID; ?>"><?php echo $lesson->post_title; ?> </a>
|
|
|
|
|
|
|
|
|
97 |
<a href="javascript:;" class="tutor-delete-lesson-btn" data-lesson-id="<?php echo $lesson->ID; ?>"><i class="tutor-icon-garbage"></i></a>
|
98 |
</div>
|
99 |
</div>
|
101 |
}
|
102 |
}
|
103 |
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
104 |
</div>
|
105 |
|
106 |
<div class="tutor_add_quiz_wrap" data-add-quiz-under="<?php echo $topic->ID; ?>">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
107 |
<div class="tutor-add-quiz-button-wrap">
|
108 |
+
<a href="javascript:;" class="create-lesson-in-topic-btn open-tutor-lesson-modal" data-topic-id="<?php echo $topic->ID; ?>" data-lesson-id="0" ><i class="tutor-icon-block tutor-icon-plus"></i> <?php _e('Add new lesson', 'tutor'); ?></a>
|
109 |
|
110 |
+
<button type="button" class="icon-bl tutor-add-quiz-btn"> <i class="tutor-icon-doubt"></i> <?php _e('Add Topic Quiz',
|
111 |
+
'tutor'); ?></button>
|
112 |
</div>
|
|
|
113 |
</div>
|
114 |
|
115 |
</div>
|
130 |
<h3><?php _e( 'Un-assigned lessons' ); ?></h3>
|
131 |
|
132 |
<div class="tutor-lessons">
|
|
|
|
|
|
|
|
|
133 |
<?php
|
134 |
foreach ( $query_lesson->posts as $lesson ) {
|
135 |
if ( ! in_array( $lesson->ID, $attached_lesson_ids ) ) {
|
@@ -225,8 +225,6 @@ if ( ! $quiz){
|
|
225 |
<div class="quiz-builder-btn-group-left">
|
226 |
<a href="#quiz-builder-tab-questions" class="quiz-modal-tab-navigation-btn quiz-modal-btn-back"><?php _e('Back', 'tutor'); ?></a>
|
227 |
<a href="#quiz-builder-tab-advanced-options" class="quiz-modal-tab-navigation-btn quiz-modal-settings-save-btn"><?php _e('Save', 'tutor'); ?></a>
|
228 |
-
<a href="#quiz-builder-tab-advanced-options" class="quiz-modal-tab-navigation-btn quiz-modal-settings-save-btn"
|
229 |
-
data-action="modal_close"><?php _e('Save & Exit', 'tutor'); ?></a>
|
230 |
</div>
|
231 |
<!--<div class="quiz-builder-btn-group-right">
|
232 |
<a href="#quiz-builder-tab-questions" class="quiz-modal-tab-navigation-btn quiz-modal-btn-cancel"><?php /*_e('Cancel', 'tutor'); */?></a>
|
@@ -271,22 +269,6 @@ if ( ! $quiz){
|
|
271 |
</div>
|
272 |
</div>
|
273 |
|
274 |
-
<!-- <div class="tutor-quiz-builder-form-row">
|
275 |
-
<div class="tutor-quiz-builder-form-cols-row">
|
276 |
-
<div class="quiz-form-field-col">
|
277 |
-
<label><?php /*_e('Show correct questions - display', 'tutor'); */?></label>
|
278 |
-
</div>
|
279 |
-
|
280 |
-
<div class="quiz-form-field-col">
|
281 |
-
<label class="btn-switch">
|
282 |
-
<input type="checkbox" value="1" name="quiz_option[show_correct_questions]" <?php /*checked('1', tutor_utils()->get_quiz_option($quiz_id, 'show_correct_questions')); */?> />
|
283 |
-
<div class="btn-slider btn-round"></div>
|
284 |
-
</label>
|
285 |
-
<p class="quiz-modal-form-help"><?php /*_e('If this option is activated, all answers are displayed below each other, i.e. all questions are on a single page.', 'tutor'); */?></p>
|
286 |
-
</div>
|
287 |
-
</div>
|
288 |
-
</div>-->
|
289 |
-
|
290 |
<div class="tutor-quiz-builder-form-row">
|
291 |
<div class="tutor-quiz-builder-form-cols-row">
|
292 |
<div class="quiz-form-field-col">
|
@@ -319,58 +301,10 @@ if ( ! $quiz){
|
|
319 |
</div>
|
320 |
</div>
|
321 |
|
322 |
-
<!--<div class="tutor-quiz-builder-form-row">
|
323 |
-
<div class="tutor-quiz-builder-form-cols-row">
|
324 |
-
<div class="quiz-form-field-col">
|
325 |
-
<label><?php /*_e('Question overview', 'tutor'); */?></label>
|
326 |
-
</div>
|
327 |
-
|
328 |
-
<div class="quiz-form-field-col">
|
329 |
-
<label class="btn-switch">
|
330 |
-
<input type="checkbox" value="1" name="quiz_option[question_overview]" <?php /*checked('1', tutor_utils()->get_quiz_option($quiz_id, 'question_overview')); */?> />
|
331 |
-
<div class="btn-slider btn-round"></div>
|
332 |
-
</label>
|
333 |
-
</div>
|
334 |
-
</div>
|
335 |
-
</div>
|
336 |
-
|
337 |
-
<div class="tutor-quiz-builder-form-row">
|
338 |
-
<div class="tutor-quiz-builder-form-cols-row">
|
339 |
-
<div class="quiz-form-field-col">
|
340 |
-
<label><?php _e('Hide "Skip Question"', 'tutor'); ?></label>
|
341 |
-
</div>
|
342 |
-
|
343 |
-
<div class="quiz-form-field-col">
|
344 |
-
<label class="btn-switch">
|
345 |
-
<input type="checkbox" value="1" name="quiz_option[hide_skip_question]" <?php checked('1', tutor_utils()->get_quiz_option($quiz_id, 'hide_skip_question')); ?> />
|
346 |
-
<div class="btn-slider btn-round"></div>
|
347 |
-
</label>
|
348 |
-
</div>
|
349 |
-
</div>
|
350 |
-
</div>
|
351 |
-
|
352 |
-
<div class="tutor-quiz-builder-form-row">
|
353 |
-
<div class="tutor-quiz-builder-form-cols-row">
|
354 |
-
<div class="quiz-form-field-col">
|
355 |
-
<label><?php _e('Hide "Retry Quiz"', 'tutor'); ?></label>
|
356 |
-
</div>
|
357 |
-
|
358 |
-
<div class="quiz-form-field-col">
|
359 |
-
<label class="btn-switch">
|
360 |
-
<input type="checkbox" value="1" name="quiz_option[hide_retry_quiz]" <?php checked('1', tutor_utils()->get_quiz_option($quiz_id, 'hide_retry_quiz')); ?> />
|
361 |
-
<div class="btn-slider btn-round"></div>
|
362 |
-
</label>
|
363 |
-
</div>
|
364 |
-
</div>
|
365 |
-
</div>-->
|
366 |
-
|
367 |
-
|
368 |
<div class="tutor-quiz-builder-modal-control-btn-group">
|
369 |
<div class="quiz-builder-btn-group-left">
|
370 |
<a href="#quiz-builder-tab-settings" class="quiz-modal-tab-navigation-btn quiz-modal-btn-back"><?php _e('Back', 'tutor'); ?></a>
|
371 |
<a href="#quiz-builder-tab-advanced-options" class="quiz-modal-tab-navigation-btn quiz-modal-settings-save-btn"><?php _e('Save', 'tutor'); ?></a>
|
372 |
-
<a href="#quiz-builder-tab-advanced-options" class="quiz-modal-tab-navigation-btn quiz-modal-settings-save-btn"
|
373 |
-
data-action="modal_close"><?php _e('Save & Exit', 'tutor'); ?></a>
|
374 |
</div>
|
375 |
<!--<div class="quiz-builder-btn-group-right">
|
376 |
<a href="#quiz-builder-tab-questions" class="quiz-modal-tab-navigation-btn quiz-modal-btn-cancel"><?php /*_e('Cancel', 'tutor'); */?></a>
|
225 |
<div class="quiz-builder-btn-group-left">
|
226 |
<a href="#quiz-builder-tab-questions" class="quiz-modal-tab-navigation-btn quiz-modal-btn-back"><?php _e('Back', 'tutor'); ?></a>
|
227 |
<a href="#quiz-builder-tab-advanced-options" class="quiz-modal-tab-navigation-btn quiz-modal-settings-save-btn"><?php _e('Save', 'tutor'); ?></a>
|
|
|
|
|
228 |
</div>
|
229 |
<!--<div class="quiz-builder-btn-group-right">
|
230 |
<a href="#quiz-builder-tab-questions" class="quiz-modal-tab-navigation-btn quiz-modal-btn-cancel"><?php /*_e('Cancel', 'tutor'); */?></a>
|
269 |
</div>
|
270 |
</div>
|
271 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
272 |
<div class="tutor-quiz-builder-form-row">
|
273 |
<div class="tutor-quiz-builder-form-cols-row">
|
274 |
<div class="quiz-form-field-col">
|
301 |
</div>
|
302 |
</div>
|
303 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
304 |
<div class="tutor-quiz-builder-modal-control-btn-group">
|
305 |
<div class="quiz-builder-btn-group-left">
|
306 |
<a href="#quiz-builder-tab-settings" class="quiz-modal-tab-navigation-btn quiz-modal-btn-back"><?php _e('Back', 'tutor'); ?></a>
|
307 |
<a href="#quiz-builder-tab-advanced-options" class="quiz-modal-tab-navigation-btn quiz-modal-settings-save-btn"><?php _e('Save', 'tutor'); ?></a>
|
|
|
|
|
308 |
</div>
|
309 |
<!--<div class="quiz-builder-btn-group-right">
|
310 |
<a href="#quiz-builder-tab-questions" class="quiz-modal-tab-navigation-btn quiz-modal-btn-cancel"><?php /*_e('Cancel', 'tutor'); */?></a>
|
@@ -25,42 +25,8 @@ $settings = maybe_unserialize($question->question_settings);
|
|
25 |
</div>
|
26 |
</div>
|
27 |
|
28 |
-
<div class="tutor-quiz-builder-form-row">
|
29 |
-
|
30 |
-
<div class="tutor-quiz-builder-form-cols-row">
|
31 |
-
<div class="quiz-form-field-col">
|
32 |
-
<label><?php _e('Mark for this question', 'tutor'); ?></label>
|
33 |
-
<div class="quiz-modal-field-wrap">
|
34 |
-
<input type="text" name="tutor_quiz_question[<?php echo $question_id; ?>][question_mark]" placeholder="<?php _e('set the mark ex. 10', 'tutor'); ?>" value="<?php
|
35 |
-
echo $question->question_mark; ?>">
|
36 |
-
</div>
|
37 |
-
</div>
|
38 |
-
|
39 |
-
<div class="quiz-form-field-col">
|
40 |
-
<div class="quiz-modal-field-wrap">
|
41 |
-
<div class="quiz-modal-switch-field">
|
42 |
-
<label class="btn-switch">
|
43 |
-
<input type="checkbox" value="1" name="tutor_quiz_question[<?php echo $question_id; ?>][show_question_mark]" <?php checked('1', tutor_utils()->avalue_dot('show_question_mark', $settings)); ?> />
|
44 |
-
<div class="btn-slider btn-round"></div>
|
45 |
-
</label>
|
46 |
-
<label><?php _e('Show marks', 'tutor'); ?></label>
|
47 |
-
</div>
|
48 |
-
</div>
|
49 |
-
</div>
|
50 |
-
</div>
|
51 |
-
|
52 |
-
</div>
|
53 |
-
|
54 |
-
<div class="tutor-quiz-builder-form-row">
|
55 |
-
<label><?php _e('Description', 'tutor'); ?> <span>(<?php _e('Optional', 'tutor'); ?>)</span> </label>
|
56 |
-
<div class="quiz-modal-field-wrap">
|
57 |
-
<textarea name="tutor_quiz_question[<?php echo $question_id; ?>][question_description]"><?php echo $question->question_description;?></textarea>
|
58 |
-
</div>
|
59 |
-
</div>
|
60 |
-
|
61 |
|
62 |
<div class="tutor-quiz-builder-form-row">
|
63 |
-
|
64 |
<div class="tutor-quiz-builder-form-cols-row">
|
65 |
<div class="quiz-form-field-col">
|
66 |
<label><?php _e('Question Type', 'tutor'); ?></label>
|
@@ -92,26 +58,15 @@ $settings = maybe_unserialize($question->question_settings);
|
|
92 |
<p class="tutor-select-option" data-value="fill_in_the_blank" <?php echo $question->question_type === 'fill_in_the_blank' ? ' data-selected="selected"' : ''; ?>>
|
93 |
<i class="tutor-icon-block tutor-icon-fill-gaps"></i> <?php _e('Fill In The Gaps'); ?>
|
94 |
</p>
|
95 |
-
|
96 |
-
<!--
|
97 |
-
<p class="tutor-select-option" data-value="answer_sorting" <?php echo $question->question_type === 'answer_sorting' ? ' data-selected="selected"' : ''; ?>>
|
98 |
-
<i class="tutor-icon-block tutor-icon-answer-shorting"></i> <?php _e('Answer Sorting', 'tutor'); ?>
|
99 |
-
</p>
|
100 |
-
<p class="tutor-select-option" data-value="assessment" <?php /*echo $question->question_type === 'assessment' ? ' data-selected="selected"' : ''; */?>>
|
101 |
-
<i class="tutor-icon-block tutor-icon-assesment"></i> <?php /*_e('Assessment', 'tutor'); */?>
|
102 |
-
</p>-->
|
103 |
-
|
104 |
<p class="tutor-select-option" data-value="matching" <?php echo $question->question_type === 'matching' ? ' data-selected="selected"' : ''; ?>>
|
105 |
<i class="tutor-icon-block tutor-icon-matching"></i> <?php _e('Matching', 'tutor'); ?>
|
106 |
</p>
|
107 |
<p class="tutor-select-option" data-value="image_matching" <?php echo $question->question_type === 'image_matching' ? ' data-selected="selected"' : ''; ?>>
|
108 |
<i class="tutor-icon-block tutor-icon-image-matching"></i> <?php _e('Image Matching', 'tutor'); ?>
|
109 |
</p>
|
110 |
-
|
111 |
<p class="tutor-select-option" data-value="image_answering" <?php echo $question->question_type === 'image_answering' ? ' data-selected="selected"' : ''; ?>>
|
112 |
<i class="tutor-icon-block tutor-icon-image-ans"></i> <?php _e('Image Answering', 'tutor'); ?>
|
113 |
</p>
|
114 |
-
|
115 |
<p class="tutor-select-option" data-value="ordering" <?php echo $question->question_type === 'ordering' ? ' data-selected="selected"' : ''; ?>>
|
116 |
<i class="tutor-icon-block tutor-icon-ordering"></i> <?php _e('Ordering', 'tutor'); ?>
|
117 |
</p>
|
@@ -121,7 +76,6 @@ $settings = maybe_unserialize($question->question_settings);
|
|
121 |
</div>
|
122 |
</div>
|
123 |
|
124 |
-
|
125 |
<div class="quiz-form-field-col">
|
126 |
<div class="quiz-modal-field-wrap">
|
127 |
<div class="quiz-modal-switch-field">
|
@@ -145,11 +99,44 @@ $settings = maybe_unserialize($question->question_settings);
|
|
145 |
</div>
|
146 |
</div>
|
147 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
148 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
149 |
</div>
|
150 |
|
151 |
</div>
|
152 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
153 |
<div class="tutor-quiz-builder-form-row">
|
154 |
|
155 |
|
25 |
</div>
|
26 |
</div>
|
27 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
|
29 |
<div class="tutor-quiz-builder-form-row">
|
|
|
30 |
<div class="tutor-quiz-builder-form-cols-row">
|
31 |
<div class="quiz-form-field-col">
|
32 |
<label><?php _e('Question Type', 'tutor'); ?></label>
|
58 |
<p class="tutor-select-option" data-value="fill_in_the_blank" <?php echo $question->question_type === 'fill_in_the_blank' ? ' data-selected="selected"' : ''; ?>>
|
59 |
<i class="tutor-icon-block tutor-icon-fill-gaps"></i> <?php _e('Fill In The Gaps'); ?>
|
60 |
</p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
<p class="tutor-select-option" data-value="matching" <?php echo $question->question_type === 'matching' ? ' data-selected="selected"' : ''; ?>>
|
62 |
<i class="tutor-icon-block tutor-icon-matching"></i> <?php _e('Matching', 'tutor'); ?>
|
63 |
</p>
|
64 |
<p class="tutor-select-option" data-value="image_matching" <?php echo $question->question_type === 'image_matching' ? ' data-selected="selected"' : ''; ?>>
|
65 |
<i class="tutor-icon-block tutor-icon-image-matching"></i> <?php _e('Image Matching', 'tutor'); ?>
|
66 |
</p>
|
|
|
67 |
<p class="tutor-select-option" data-value="image_answering" <?php echo $question->question_type === 'image_answering' ? ' data-selected="selected"' : ''; ?>>
|
68 |
<i class="tutor-icon-block tutor-icon-image-ans"></i> <?php _e('Image Answering', 'tutor'); ?>
|
69 |
</p>
|
|
|
70 |
<p class="tutor-select-option" data-value="ordering" <?php echo $question->question_type === 'ordering' ? ' data-selected="selected"' : ''; ?>>
|
71 |
<i class="tutor-icon-block tutor-icon-ordering"></i> <?php _e('Ordering', 'tutor'); ?>
|
72 |
</p>
|
76 |
</div>
|
77 |
</div>
|
78 |
|
|
|
79 |
<div class="quiz-form-field-col">
|
80 |
<div class="quiz-modal-field-wrap">
|
81 |
<div class="quiz-modal-switch-field">
|
99 |
</div>
|
100 |
</div>
|
101 |
</div>
|
102 |
+
</div>
|
103 |
+
</div>
|
104 |
+
|
105 |
+
|
106 |
+
<div class="tutor-quiz-builder-form-row">
|
107 |
+
|
108 |
+
<div class="tutor-quiz-builder-form-cols-row">
|
109 |
+
<div class="quiz-form-field-col">
|
110 |
+
<label><?php _e('Mark for this question', 'tutor'); ?></label>
|
111 |
+
<div class="quiz-modal-field-wrap">
|
112 |
+
<input type="text" name="tutor_quiz_question[<?php echo $question_id; ?>][question_mark]" placeholder="<?php _e('set the mark ex. 10', 'tutor'); ?>" value="<?php
|
113 |
+
echo $question->question_mark; ?>">
|
114 |
+
</div>
|
115 |
+
</div>
|
116 |
|
117 |
+
<div class="quiz-form-field-col">
|
118 |
+
<div class="quiz-modal-field-wrap">
|
119 |
+
<div class="quiz-modal-switch-field">
|
120 |
+
<label class="btn-switch">
|
121 |
+
<input type="checkbox" value="1" name="tutor_quiz_question[<?php echo $question_id; ?>][show_question_mark]" <?php checked('1', tutor_utils()->avalue_dot('show_question_mark', $settings)); ?> />
|
122 |
+
<div class="btn-slider btn-round"></div>
|
123 |
+
</label>
|
124 |
+
<label><?php _e('Show marks', 'tutor'); ?></label>
|
125 |
+
</div>
|
126 |
+
</div>
|
127 |
+
</div>
|
128 |
</div>
|
129 |
|
130 |
</div>
|
131 |
|
132 |
+
<div class="tutor-quiz-builder-form-row">
|
133 |
+
<label><?php _e('Description', 'tutor'); ?> <span>(<?php _e('Optional', 'tutor'); ?>)</span> </label>
|
134 |
+
<div class="quiz-modal-field-wrap">
|
135 |
+
<textarea name="tutor_quiz_question[<?php echo $question_id; ?>][question_description]"><?php echo $question->question_description;?></textarea>
|
136 |
+
</div>
|
137 |
+
</div>
|
138 |
+
|
139 |
+
|
140 |
<div class="tutor-quiz-builder-form-row">
|
141 |
|
142 |
|
@@ -0,0 +1,133 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
<div class="wrap">
|
3 |
+
<h1 class="wp-heading-inline"><?php _e('Add new instructor', 'tutor'); ?></h1>
|
4 |
+
<hr class="wp-header-end">
|
5 |
+
|
6 |
+
<form action="" id="new-instructor-form" method="post">
|
7 |
+
<input type="hidden" name="action" value="add_new_instructor">
|
8 |
+
|
9 |
+
|
10 |
+
<div id="form-response"></div>
|
11 |
+
|
12 |
+
<?php
|
13 |
+
$errors = apply_filters('tutor_instructor_register_validation_errors', array());
|
14 |
+
if (is_array($errors) && count($errors)){
|
15 |
+
echo '<div class="tutor-alert-warning"><ul class="tutor-required-fields">';
|
16 |
+
foreach ($errors as $error_key => $error_value){
|
17 |
+
echo "<li>{$error_value}</li>";
|
18 |
+
}
|
19 |
+
echo '</ul></div>';
|
20 |
+
}
|
21 |
+
?>
|
22 |
+
|
23 |
+
|
24 |
+
<div class="tutor-option-field-row">
|
25 |
+
<div class="tutor-option-field-label">
|
26 |
+
<label for="">
|
27 |
+
<?php _e('First Name', 'tutor'); ?>
|
28 |
+
</label>
|
29 |
+
</div>
|
30 |
+
<div class="tutor-option-field">
|
31 |
+
<input type="text" name="first_name" value="<?php echo tutor_utils()->input_old('first_name'); ?>" placeholder="<?php _e('First Name', 'tutor'); ?>">
|
32 |
+
</div>
|
33 |
+
</div>
|
34 |
+
|
35 |
+
|
36 |
+
<div class="tutor-option-field-row">
|
37 |
+
<div class="tutor-option-field-label">
|
38 |
+
<label>
|
39 |
+
<?php _e('Last Name', 'tutor'); ?>
|
40 |
+
</label>
|
41 |
+
</div>
|
42 |
+
|
43 |
+
<div class="tutor-option-field">
|
44 |
+
<input type="text" name="last_name" value="<?php echo tutor_utils()->input_old('last_name'); ?>" placeholder="<?php _e('Last Name', 'tutor'); ?>">
|
45 |
+
</div>
|
46 |
+
</div>
|
47 |
+
|
48 |
+
<div class="tutor-option-field-row">
|
49 |
+
<div class="tutor-option-field-label">
|
50 |
+
<label>
|
51 |
+
<?php _e('User Name', 'tutor'); ?>
|
52 |
+
</label>
|
53 |
+
</div>
|
54 |
+
|
55 |
+
<div class="tutor-option-field">
|
56 |
+
<input type="text" name="user_login" class="tutor_user_name" value="<?php echo tutor_utils()->input_old('user_login'); ?>" placeholder="<?php _e('User Name', 'tutor'); ?>">
|
57 |
+
</div>
|
58 |
+
</div>
|
59 |
+
|
60 |
+
<div class="tutor-option-field-row">
|
61 |
+
<div class="tutor-option-field-label">
|
62 |
+
<label>
|
63 |
+
<?php _e('E-Mail', 'tutor'); ?>
|
64 |
+
</label>
|
65 |
+
</div>
|
66 |
+
|
67 |
+
<div class="tutor-option-field">
|
68 |
+
<input type="text" name="email" value="<?php echo tutor_utils()->input_old('email'); ?>" placeholder="<?php _e('E-Mail', 'tutor'); ?>">
|
69 |
+
</div>
|
70 |
+
</div>
|
71 |
+
|
72 |
+
<div class="tutor-option-field-row">
|
73 |
+
<div class="tutor-option-field-label">
|
74 |
+
<label>
|
75 |
+
<?php _e('Phone Number', 'tutor'); ?>
|
76 |
+
</label>
|
77 |
+
</div>
|
78 |
+
|
79 |
+
<div class="tutor-option-field">
|
80 |
+
<input type="text" name="phone_number" value="<?php echo tutor_utils()->input_old('phone_number'); ?>" placeholder="<?php _e('Phone Number', 'tutor'); ?>">
|
81 |
+
</div>
|
82 |
+
</div>
|
83 |
+
|
84 |
+
<div class="tutor-option-field-row">
|
85 |
+
<div class="tutor-option-field-label">
|
86 |
+
<label>
|
87 |
+
<?php _e('Password', 'tutor'); ?>
|
88 |
+
</label>
|
89 |
+
</div>
|
90 |
+
|
91 |
+
<div class="tutor-option-field">
|
92 |
+
<input type="password" name="password" value="<?php echo tutor_utils()->input_old('password'); ?>" placeholder="<?php _e('Password', 'tutor'); ?>">
|
93 |
+
</div>
|
94 |
+
</div>
|
95 |
+
|
96 |
+
<div class="tutor-option-field-row">
|
97 |
+
<div class="tutor-option-field-label">
|
98 |
+
<label>
|
99 |
+
<?php _e('Password confirmation', 'tutor'); ?>
|
100 |
+
</label>
|
101 |
+
</div>
|
102 |
+
|
103 |
+
<div class="tutor-option-field">
|
104 |
+
<input type="password" name="password_confirmation" value="<?php echo tutor_utils()->input_old('password_confirmation'); ?>" placeholder="<?php _e('Password Confirmation', 'tutor'); ?>">
|
105 |
+
</div>
|
106 |
+
</div>
|
107 |
+
|
108 |
+
<div class="tutor-option-field-row">
|
109 |
+
<div class="tutor-option-field-label">
|
110 |
+
<label>
|
111 |
+
<?php _e('Bio', 'tutor'); ?>
|
112 |
+
</label>
|
113 |
+
</div>
|
114 |
+
<div class="tutor-option-field">
|
115 |
+
|
116 |
+
<textarea name="tutor_profile_bio"><?php echo tutor_utils()->input_old('tutor_profile_bio'); ?></textarea>
|
117 |
+
</div>
|
118 |
+
</div>
|
119 |
+
|
120 |
+
<div class="tutor-option-field-row">
|
121 |
+
<div class="tutor-option-field-label"></div>
|
122 |
+
|
123 |
+
<div class="tutor-option-field">
|
124 |
+
<div class="tutor-form-group tutor-reg-form-btn-wrap">
|
125 |
+
<button type="submit" name="tutor_register_instructor_btn" value="register" class="tutor-button tutor-button-primary">
|
126 |
+
<i class="tutor-icon-plus-square-button"></i>
|
127 |
+
<?php _e('Add new instructor', 'tutor'); ?></button>
|
128 |
+
</div>
|
129 |
+
</div>
|
130 |
+
</div>
|
131 |
+
|
132 |
+
</form>
|
133 |
+
</div>
|
@@ -1,16 +1,30 @@
|
|
1 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
$instructorList = new \TUTOR\Instructors_List();
|
3 |
$instructorList->prepare_items();
|
4 |
?>
|
5 |
|
6 |
|
7 |
<div class="wrap">
|
8 |
-
|
|
|
|
|
|
|
|
|
9 |
|
10 |
-
|
11 |
-
|
12 |
<?php
|
13 |
$instructorList->search_box(__('Search', 'tutor'), 'instructors');
|
14 |
$instructorList->display(); ?>
|
15 |
-
|
16 |
</div>
|
1 |
<?php
|
2 |
+
|
3 |
+
$sub_page = tutor_utils()->avalue_dot('sub_page', $_GET);
|
4 |
+
if ( ! empty($sub_page)){
|
5 |
+
$include_file = tutor()->path."views/pages/{$sub_page}.php";
|
6 |
+
if (file_exists($include_file)){
|
7 |
+
include $include_file;
|
8 |
+
return;
|
9 |
+
}
|
10 |
+
}
|
11 |
+
|
12 |
$instructorList = new \TUTOR\Instructors_List();
|
13 |
$instructorList->prepare_items();
|
14 |
?>
|
15 |
|
16 |
|
17 |
<div class="wrap">
|
18 |
+
<h1 class="wp-heading-inline"><?php _e('Instructors', 'tutor'); ?></h1>
|
19 |
+
<a href="<?php echo add_query_arg(array('sub_page' => 'add_new_instructor')); ?>" class="page-title-action"><i class="tutor-icon-plus"></i>
|
20 |
+
<?php _e('Add New Instructor', 'tutor');
|
21 |
+
?></a>
|
22 |
+
<hr class="wp-header-end">
|
23 |
|
24 |
+
<form id="students-filter" method="get">
|
25 |
+
<input type="hidden" name="page" value="<?php echo $_REQUEST['page'] ?>" />
|
26 |
<?php
|
27 |
$instructorList->search_box(__('Search', 'tutor'), 'instructors');
|
28 |
$instructorList->display(); ?>
|
29 |
+
</form>
|
30 |
</div>
|
@@ -4,264 +4,309 @@ $attempt = tutor_utils()->get_attempt($attempt_id);
|
|
4 |
|
5 |
if ( ! $attempt){
|
6 |
?>
|
7 |
-
|
8 |
<h1><?php _e('Attempt not found', 'tutor'); ?></h1>
|
9 |
-
|
10 |
<?php
|
11 |
return;
|
12 |
}
|
13 |
|
14 |
$quiz_attempt_info = tutor_utils()->quiz_attempt_info($attempt->attempt_info);
|
15 |
$answers = tutor_utils()->get_quiz_answers_by_attempt_id($attempt->attempt_id);
|
|
|
|
|
|
|
16 |
?>
|
17 |
|
18 |
<div class="wrap">
|
19 |
-
<h2
|
20 |
|
21 |
<div class="tutor-quiz-attempt-info-row">
|
22 |
-
<div class="
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
?>
|
27 |
-
|
28 |
-
<p class="quiz-attempt-info-row">
|
29 |
-
<?php echo '<span class="attempt-property-name">'.__('Attempt By', 'tutor').' </span><span> : '. $user->display_name.'</span>'; ?>
|
30 |
-
</p>
|
31 |
|
32 |
-
<
|
33 |
-
<?php
|
34 |
-
|
|
|
|
|
35 |
|
36 |
-
<
|
37 |
-
|
38 |
-
|
39 |
-
</span>
|
40 |
|
41 |
-
|
|
|
|
|
|
|
|
|
42 |
<?php
|
43 |
$status = ucwords(str_replace('quiz_', '', $attempt->attempt_status));
|
44 |
-
echo "<span class='
|
45 |
?>
|
46 |
-
</span>
|
47 |
-
</p>
|
48 |
-
|
49 |
-
<?php if ((bool) $attempt->is_manually_reviewed ){
|
50 |
-
?>
|
51 |
-
<p class="quiz-attempt-info-row text-notified">
|
52 |
-
<span class="attempt-property-name"><?php _e('Manually reviewed at', 'tutor'); ?></span>
|
53 |
-
|
54 |
-
<span class="attempt-property-value"> :
|
55 |
-
<?php echo date_i18n(get_option('date_format'), strtotime($attempt->manually_reviewed_at)).' '.date_i18n(get_option('time_format'), strtotime($attempt->manually_reviewed_at)); ?>
|
56 |
-
</span>
|
57 |
</p>
|
58 |
-
|
59 |
-
} ?>
|
60 |
-
|
61 |
</div>
|
62 |
|
63 |
-
<div class="
|
64 |
-
<p class="quiz-attempt-info-row">
|
65 |
-
<?php
|
66 |
-
echo '<span class="attempt-property-name">'. __('Quiz', 'tutor').' </span> <span class="attempt-property-value"> : '."<a href='".admin_url("post.php?post={$attempt->quiz_id}&action=edit")."'>".get_the_title($attempt->quiz_id)."</a> </span> ";
|
67 |
-
?>
|
68 |
-
</p>
|
69 |
|
70 |
-
<
|
71 |
<?php
|
72 |
$quiz = tutor_utils()->get_course_by_quiz($attempt->quiz_id);
|
73 |
if ($quiz) {
|
74 |
-
echo '<
|
75 |
}
|
76 |
?>
|
77 |
-
</
|
78 |
-
|
79 |
-
<p class="quiz-attempt-info-row">
|
80 |
-
<span class="attempt-property-name"><?php _e('Result', 'tutor'); ?></span>
|
81 |
|
82 |
-
|
|
|
|
|
83 |
<?php
|
84 |
$pass_mark_percent = tutor_utils()->get_quiz_option($attempt->quiz_id, 'passing_grade', 0);
|
85 |
$earned_percentage = $attempt->earned_marks > 0 ? ( number_format(($attempt->earned_marks * 100) / $attempt->total_marks)) : 0;
|
86 |
|
87 |
-
$output =
|
88 |
-
$output .= "Marks earned ({$earned_percentage}%)<br />";
|
89 |
-
|
90 |
if ($earned_percentage >= $pass_mark_percent){
|
91 |
-
$output .= '<span class="result-pass">'.__('Pass', 'tutor').'</span>';
|
92 |
}else{
|
93 |
-
$output .= '<span class="result-fail">'.__('Fail', 'tutor').'</span>';
|
94 |
}
|
95 |
|
|
|
|
|
96 |
echo $output;
|
97 |
?>
|
98 |
-
</
|
99 |
-
</
|
100 |
|
101 |
-
<
|
102 |
-
<
|
103 |
-
<
|
104 |
<?php
|
105 |
$time_limit_seconds = tutor_utils()->avalue_dot('time_limit.time_limit_seconds', $quiz_attempt_info);
|
106 |
echo tutor_utils()->seconds_to_time_context($time_limit_seconds);
|
107 |
?>
|
108 |
-
</
|
109 |
-
</
|
110 |
-
|
111 |
|
112 |
-
<
|
113 |
-
<
|
114 |
-
<
|
115 |
<?php
|
116 |
$attempt_time_sec = strtotime($attempt->attempt_ended_at) - strtotime($attempt->attempt_started_at);
|
117 |
echo tutor_utils()->seconds_to_time_context($attempt_time_sec);
|
118 |
?>
|
119 |
-
</
|
120 |
-
</
|
121 |
|
122 |
</div>
|
|
|
123 |
</div>
|
124 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
125 |
<?php
|
126 |
if (is_array($answers) && count($answers)){
|
|
|
127 |
?>
|
128 |
-
<
|
129 |
-
<tr>
|
130 |
-
<th width="200"><?php _e('Question', 'tutor'); ?></th>
|
131 |
-
<th><?php _e('Correct', 'tutor'); ?></th>
|
132 |
-
<th><?php _e('Given Answers', 'tutor'); ?></th>
|
133 |
-
<th><?php _e('Review', 'tutor'); ?></th>
|
134 |
-
</tr>
|
135 |
-
<?php
|
136 |
-
foreach ($answers as $answer){
|
137 |
-
?>
|
138 |
|
|
|
|
|
|
|
|
|
|
|
139 |
<tr>
|
140 |
-
<
|
141 |
-
<
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
$
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
179 |
}
|
180 |
|
181 |
-
|
182 |
-
|
183 |
-
|
|
|
184 |
}
|
185 |
|
186 |
-
|
187 |
-
}
|
188 |
|
189 |
-
|
|
|
|
|
|
|
|
|
|
|
190 |
|
191 |
-
|
192 |
-
echo wpautop(stripslashes($answer->given_answer));
|
193 |
-
}
|
194 |
|
195 |
-
|
|
|
196 |
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
202 |
}
|
203 |
|
204 |
-
|
|
|
205 |
|
206 |
-
|
207 |
-
|
208 |
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
foreach ($provided_answer_order as $provided_answer_order);
|
213 |
-
echo $original_saved_answer->answer_title ." - {$provided_answer_order->answer_two_gap_match} <br />";
|
214 |
-
}
|
215 |
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
echo '<div class="answer-image-matched-wrap">';
|
222 |
-
foreach ($original_saved_answers as $key => $original_saved_answer){
|
223 |
-
$provided_answer_order_id = isset($ordering_ids[$key]) ? $ordering_ids[$key] : 0;
|
224 |
-
$provided_answer_order = tutor_utils()->get_answer_by_id($provided_answer_order_id);
|
225 |
-
foreach ($provided_answer_order as $provided_answer_order);
|
226 |
-
?>
|
227 |
-
<div class="image-matching-item">
|
228 |
-
<p class="dragged-img-rap"><img src="<?php echo wp_get_attachment_image_url( $original_saved_answer->image_id); ?>" /> </p>
|
229 |
-
<p class="dragged-caption"><?php echo $provided_answer_order->answer_title; ?></p>
|
230 |
-
</div>
|
231 |
-
<?php
|
232 |
-
}
|
233 |
-
echo '</div>';
|
234 |
-
}elseif ($answer->question_type === 'image_answering'){
|
235 |
-
|
236 |
-
$ordering_ids = maybe_unserialize($answer->given_answer);
|
237 |
-
|
238 |
-
echo '<div class="answer-image-matched-wrap">';
|
239 |
-
foreach ($ordering_ids as $answer_id => $answer){
|
240 |
-
$db_answers = tutor_utils()->get_answer_by_id($answer_id);
|
241 |
-
foreach ($db_answers as $db_answer);
|
242 |
-
?>
|
243 |
-
<div class="image-matching-item">
|
244 |
-
<p class="dragged-img-rap"><img src="<?php echo wp_get_attachment_image_url( $db_answer->image_id); ?>" /> </p>
|
245 |
-
<p class="dragged-caption"><?php echo $answer; ?></p>
|
246 |
-
</div>
|
247 |
-
<?php
|
248 |
}
|
249 |
-
echo '</div>';
|
250 |
-
}
|
251 |
|
252 |
-
?>
|
253 |
-
</td>
|
254 |
|
255 |
-
|
256 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
257 |
|
258 |
-
<a href="<?php echo admin_url("admin.php?action=review_quiz_answer&attempt_id={$attempt_id}&attempt_answer_id={$answer->attempt_answer_id}&mark_as=incorrect"); ?>" title="<?php _e('Mark as In correct', 'tutor'); ?>" class="tutor-button button button-danger"><i class="dashicons dashicons-no-alt"></i></a>
|
259 |
-
</td>
|
260 |
-
</tr>
|
261 |
-
<?php
|
262 |
-
}
|
263 |
-
?>
|
264 |
-
</table>
|
265 |
<?php
|
266 |
}
|
267 |
?>
|
4 |
|
5 |
if ( ! $attempt){
|
6 |
?>
|
|
|
7 |
<h1><?php _e('Attempt not found', 'tutor'); ?></h1>
|
|
|
8 |
<?php
|
9 |
return;
|
10 |
}
|
11 |
|
12 |
$quiz_attempt_info = tutor_utils()->quiz_attempt_info($attempt->attempt_info);
|
13 |
$answers = tutor_utils()->get_quiz_answers_by_attempt_id($attempt->attempt_id);
|
14 |
+
|
15 |
+
$user_id = tutor_utils()->avalue_dot('user_id', $attempt);
|
16 |
+
$user = get_userdata($user_id);
|
17 |
?>
|
18 |
|
19 |
<div class="wrap">
|
20 |
+
<h2 class="attempt-review-title"> <i class="tutor-icon-list"></i> <?php _e('View Attempts', 'tutor'); ?></h2>
|
21 |
|
22 |
<div class="tutor-quiz-attempt-info-row">
|
23 |
+
<div class="attempt-view-top">
|
24 |
+
<div class="attempt-info-col">
|
25 |
+
<?php echo '<p class="attempt-property-name">'.__('Attempt By', 'tutor').' </p><h4>'. $user->display_name.'</h4>'; ?>
|
26 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
27 |
|
28 |
+
<div class="attempt-info-col">
|
29 |
+
<?php
|
30 |
+
echo '<p class="attempt-property-name">'. __('Quiz', 'tutor')." </p> <p class='attempt-property-value'><a href='" .admin_url("post.php?post={$attempt->quiz_id}&action=edit")."'>".get_the_title($attempt->quiz_id)."</a> </p> ";
|
31 |
+
?>
|
32 |
+
</div>
|
33 |
|
34 |
+
<div class="attempt-info-col">
|
35 |
+
<?php echo '<p class="attempt-property-name">'.__('Attempt At', 'tutor').'</p><p class="attempt-property-value">'. date_i18n(get_option('date_format'), strtotime($attempt->attempt_started_at)).' '.date_i18n(get_option('time_format'), strtotime($attempt->attempt_started_at)).'</p>'; ?>
|
36 |
+
</div>
|
|
|
37 |
|
38 |
+
<div class="attempt-info-col">
|
39 |
+
<p class="attempt-property-name">
|
40 |
+
<?php echo __('Status', 'tutor'); ?>
|
41 |
+
</p>
|
42 |
+
<p class="attempt-property-value">
|
43 |
<?php
|
44 |
$status = ucwords(str_replace('quiz_', '', $attempt->attempt_status));
|
45 |
+
echo "<span class='attempt-status-{$attempt->attempt_status}'>{$status}</span>";
|
46 |
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
</p>
|
48 |
+
</div>
|
|
|
|
|
49 |
</div>
|
50 |
|
51 |
+
<div class="attempt-view-bottom">
|
|
|
|
|
|
|
|
|
|
|
52 |
|
53 |
+
<div class="attempt-info-col">
|
54 |
<?php
|
55 |
$quiz = tutor_utils()->get_course_by_quiz($attempt->quiz_id);
|
56 |
if ($quiz) {
|
57 |
+
echo '<p class="attempt-property-name">' . __( 'Course', 'tutor' ) . '</p> <p class="attempt-property-value"> ' . "<a href='".admin_url( "post.php?post={$quiz->ID}&action=edit" ) . "'><strong>". get_the_title( $quiz->ID )."</strong></a> </p>";
|
58 |
}
|
59 |
?>
|
60 |
+
</div>
|
|
|
|
|
|
|
61 |
|
62 |
+
<div class="attempt-info-col">
|
63 |
+
<div class="attempt-property-name"><?php _e('Result', 'tutor'); ?></div>
|
64 |
+
<div class="attempt-property-value value-display-flex">
|
65 |
<?php
|
66 |
$pass_mark_percent = tutor_utils()->get_quiz_option($attempt->quiz_id, 'passing_grade', 0);
|
67 |
$earned_percentage = $attempt->earned_marks > 0 ? ( number_format(($attempt->earned_marks * 100) / $attempt->total_marks)) : 0;
|
68 |
|
69 |
+
$output = '';
|
|
|
|
|
70 |
if ($earned_percentage >= $pass_mark_percent){
|
71 |
+
$output .= '<p><span class="result-pass">'.__('Pass', 'tutor').'</span></p>';
|
72 |
}else{
|
73 |
+
$output .= '<p> <span class="result-fail">'.__('Fail', 'tutor').'</span></p>';
|
74 |
}
|
75 |
|
76 |
+
$output .= "<p class='result-in-write'>".$attempt->earned_marks." out of {$attempt->total_marks} <br />";
|
77 |
+
$output .= "Marks earned ({$earned_percentage}%)</p>";
|
78 |
echo $output;
|
79 |
?>
|
80 |
+
</div>
|
81 |
+
</div>
|
82 |
|
83 |
+
<div class="attempt-info-col">
|
84 |
+
<p class="attempt-property-name"><?php _e('Quiz Time', 'tutor'); ?></p>
|
85 |
+
<p class="attempt-property-value">
|
86 |
<?php
|
87 |
$time_limit_seconds = tutor_utils()->avalue_dot('time_limit.time_limit_seconds', $quiz_attempt_info);
|
88 |
echo tutor_utils()->seconds_to_time_context($time_limit_seconds);
|
89 |
?>
|
90 |
+
</p>
|
91 |
+
</div>
|
|
|
92 |
|
93 |
+
<div class="attempt-info-col">
|
94 |
+
<p class="attempt-property-name"><?php _e('Attempt Time', 'tutor'); ?></p>
|
95 |
+
<p class="attempt-property-value">
|
96 |
<?php
|
97 |
$attempt_time_sec = strtotime($attempt->attempt_ended_at) - strtotime($attempt->attempt_started_at);
|
98 |
echo tutor_utils()->seconds_to_time_context($attempt_time_sec);
|
99 |
?>
|
100 |
+
</p>
|
101 |
+
</div>
|
102 |
|
103 |
</div>
|
104 |
+
|
105 |
</div>
|
106 |
|
107 |
+
|
108 |
+
<div class="attempt-review-notice-wrap">
|
109 |
+
<?php
|
110 |
+
if (is_array($answers) && count($answers)) {
|
111 |
+
$question_no = 0;
|
112 |
+
$required_review = array();
|
113 |
+
|
114 |
+
foreach ($answers as $answer){
|
115 |
+
$question_no++;
|
116 |
+
if ($answer->question_type === 'open_ended' || $answer->question_type === 'short_answer'){
|
117 |
+
$required_review[] = $question_no;
|
118 |
+
}
|
119 |
+
}
|
120 |
+
|
121 |
+
if (count($required_review)){
|
122 |
+
echo '<p class="attempt-review-notice"> <span class="notice-excl">!</span> <strong>Reminder:</strong> Please review answers for question no.
|
123 |
+
'.implode
|
124 |
+
(', ',
|
125 |
+
$required_review).' </p>';
|
126 |
+
}
|
127 |
+
}
|
128 |
+
|
129 |
+
|
130 |
+
?>
|
131 |
+
|
132 |
+
|
133 |
+
<?php if ((bool) $attempt->is_manually_reviewed ){
|
134 |
+
?>
|
135 |
+
<p class="attempt-review-at">
|
136 |
+
<span class="circle-arrow"> ↻ </span>
|
137 |
+
<?php _e('Manually reviewed at :', 'tutor'); ?>
|
138 |
+
<strong>
|
139 |
+
<?php echo date_i18n(get_option('date_format'), strtotime($attempt->manually_reviewed_at)).' '.date_i18n(get_option('time_format'), strtotime($attempt->manually_reviewed_at)); ?>
|
140 |
+
</strong>
|
141 |
+
</p>
|
142 |
+
<?php
|
143 |
+
} ?>
|
144 |
+
|
145 |
+
</div>
|
146 |
<?php
|
147 |
if (is_array($answers) && count($answers)){
|
148 |
+
|
149 |
?>
|
150 |
+
<div class="quiz-attempt-answers-wrap">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
151 |
|
152 |
+
<div class="attempt-answers-header">
|
153 |
+
<h3><?php _e('Quiz Overview', 'tutor'); ?></h3>
|
154 |
+
</div>
|
155 |
+
|
156 |
+
<table class="wp-list-table">
|
157 |
<tr>
|
158 |
+
<th><?php _e('Type', 'tutor'); ?></th>
|
159 |
+
<th><?php _e('No.', 'tutor'); ?></th>
|
160 |
+
<th width="200"><?php _e('Question', 'tutor'); ?></th>
|
161 |
+
<th><?php _e('Given Answers', 'tutor'); ?></th>
|
162 |
+
<th width="80"><?php _e('Correct/Incorrect', 'tutor'); ?></th>
|
163 |
+
<th width="100"><?php _e('Review', 'tutor'); ?></th>
|
164 |
+
</tr>
|
165 |
+
<?php
|
166 |
+
$answer_i = 0;
|
167 |
+
foreach ($answers as $answer){
|
168 |
+
$answer_i++;
|
169 |
+
$question_type = tutor_utils()->get_question_types($answer->question_type);
|
170 |
+
?>
|
171 |
+
|
172 |
+
<tr>
|
173 |
+
<td><?php echo $question_type['icon']; ?></td>
|
174 |
+
<td><?php echo $answer_i; ?></td>
|
175 |
+
<td><?php echo $answer->question_title; ?></td>
|
176 |
+
<td>
|
177 |
+
<?php
|
178 |
+
if ($answer->question_type === 'true_false' || $answer->question_type === 'single_choice' ){
|
179 |
+
|
180 |
+
$get_answers = tutor_utils()->get_answer_by_id($answer->given_answer);
|
181 |
+
$answer_titles = wp_list_pluck($get_answers, 'answer_title');
|
182 |
+
echo '<p>'.implode('</p><p>', $answer_titles).'</p>';
|
183 |
+
|
184 |
+
}elseif ($answer->question_type === 'multiple_choice'){
|
185 |
+
|
186 |
+
$get_answers = tutor_utils()->get_answer_by_id(maybe_unserialize($answer->given_answer));
|
187 |
+
$answer_titles = wp_list_pluck($get_answers, 'answer_title');
|
188 |
+
echo '<p>'.implode('</p><p>', $answer_titles).'</p>';
|
189 |
+
|
190 |
+
}elseif ($answer->question_type === 'fill_in_the_blank'){
|
191 |
+
|
192 |
+
$answer_titles = maybe_unserialize($answer->given_answer);
|
193 |
+
|
194 |
+
$get_db_answers_by_question = tutor_utils()->get_answers_by_quiz_question($answer->question_id);
|
195 |
+
foreach ($get_db_answers_by_question as $db_answer);
|
196 |
+
$count_dash_fields = substr_count($db_answer->answer_title, '{dash}');
|
197 |
+
if ($count_dash_fields){
|
198 |
+
$dash_string = array();
|
199 |
+
$input_data = array();
|
200 |
+
|
201 |
+
for($i=0; $i<$count_dash_fields; $i++){
|
202 |
+
//$dash_string[] = '{dash}';
|
203 |
+
$input_data[] = isset($answer_titles[$i]) ? "<span class='filled_dash_unser'>{$answer_titles[$i]}</span>" : "______";
|
204 |
+
}
|
205 |
+
|
206 |
+
$answer_title = $db_answer->answer_title;
|
207 |
+
foreach($input_data as $replace){
|
208 |
+
$answer_title = preg_replace('/{dash}/i', $replace, $answer_title, 1);
|
209 |
+
}
|
210 |
+
|
211 |
+
echo str_replace('{dash}', '_____', $answer_title);
|
212 |
}
|
213 |
|
214 |
+
}elseif ($answer->question_type === 'open_ended' || $answer->question_type === 'short_answer'){
|
215 |
+
|
216 |
+
if ($answer->given_answer){
|
217 |
+
echo wpautop(stripslashes($answer->given_answer));
|
218 |
}
|
219 |
|
220 |
+
}elseif ($answer->question_type === 'ordering'){
|
|
|
221 |
|
222 |
+
$ordering_ids = maybe_unserialize($answer->given_answer);
|
223 |
+
foreach ($ordering_ids as $ordering_id){
|
224 |
+
$get_answers = tutor_utils()->get_answer_by_id($ordering_id);
|
225 |
+
$answer_titles = wp_list_pluck($get_answers, 'answer_title');
|
226 |
+
echo '<p>'.implode('</p><p>', $answer_titles).'</p>';
|
227 |
+
}
|
228 |
|
229 |
+
}elseif ($answer->question_type === 'matching'){
|
|
|
|
|
230 |
|
231 |
+
$ordering_ids = maybe_unserialize($answer->given_answer);
|
232 |
+
$original_saved_answers = tutor_utils()->get_answers_by_quiz_question($answer->question_id);
|
233 |
|
234 |
+
foreach ($original_saved_answers as $key => $original_saved_answer){
|
235 |
+
$provided_answer_order_id = isset($ordering_ids[$key]) ? $ordering_ids[$key] : 0;
|
236 |
+
$provided_answer_order = tutor_utils()->get_answer_by_id($provided_answer_order_id);
|
237 |
+
foreach ($provided_answer_order as $provided_answer_order);
|
238 |
+
echo $original_saved_answer->answer_title ." - {$provided_answer_order->answer_two_gap_match} <br />";
|
239 |
+
}
|
240 |
+
|
241 |
+
}elseif ($answer->question_type === 'image_matching'){
|
242 |
+
|
243 |
+
$ordering_ids = maybe_unserialize($answer->given_answer);
|
244 |
+
$original_saved_answers = tutor_utils()->get_answers_by_quiz_question($answer->question_id);
|
245 |
+
|
246 |
+
echo '<div class="answer-image-matched-wrap">';
|
247 |
+
foreach ($original_saved_answers as $key => $original_saved_answer){
|
248 |
+
$provided_answer_order_id = isset($ordering_ids[$key]) ? $ordering_ids[$key] : 0;
|
249 |
+
$provided_answer_order = tutor_utils()->get_answer_by_id($provided_answer_order_id);
|
250 |
+
foreach ($provided_answer_order as $provided_answer_order);
|
251 |
+
?>
|
252 |
+
<div class="image-matching-item">
|
253 |
+
<p class="dragged-img-rap"><img src="<?php echo wp_get_attachment_image_url( $original_saved_answer->image_id); ?>" /> </p>
|
254 |
+
<p class="dragged-caption"><?php echo $provided_answer_order->answer_title; ?></p>
|
255 |
+
</div>
|
256 |
+
<?php
|
257 |
+
}
|
258 |
+
echo '</div>';
|
259 |
+
}elseif ($answer->question_type === 'image_answering'){
|
260 |
+
|
261 |
+
$ordering_ids = maybe_unserialize($answer->given_answer);
|
262 |
+
|
263 |
+
echo '<div class="answer-image-matched-wrap">';
|
264 |
+
foreach ($ordering_ids as $answer_id => $image_answer){
|
265 |
+
$db_answers = tutor_utils()->get_answer_by_id($answer_id);
|
266 |
+
foreach ($db_answers as $db_answer);
|
267 |
+
?>
|
268 |
+
<div class="image-matching-item">
|
269 |
+
<p class="dragged-img-rap"><img src="<?php echo wp_get_attachment_image_url( $db_answer->image_id); ?>" /> </p>
|
270 |
+
<p class="dragged-caption"><?php echo $image_answer; ?></p>
|
271 |
+
</div>
|
272 |
+
<?php
|
273 |
+
}
|
274 |
+
echo '</div>';
|
275 |
}
|
276 |
|
277 |
+
?>
|
278 |
+
</td>
|
279 |
|
280 |
+
<td>
|
281 |
+
<?php
|
282 |
|
283 |
+
if ( (bool) isset( $answer->is_correct ) ? $answer->is_correct : '' ) {
|
284 |
+
echo '<span class="tutor-status-approved-context"><i class="tutor-icon-mark"></i> </span>';
|
285 |
+
} else {
|
|
|
|
|
|
|
286 |
|
287 |
+
if ($answer->question_type === 'open_ended' || $answer->question_type === 'short_answer'){
|
288 |
+
echo '<p style="color: #878A8F;"><span style="color: #ff282a;">*</span> '.__('Review Required', 'tutor').'</p>';
|
289 |
+
}else {
|
290 |
+
echo '<span class="tutor-status-blocked-context"><i class="tutor-icon-line-cross"></i> </span>';
|
291 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
292 |
}
|
|
|
|
|
293 |
|
|
|
|
|
294 |
|
295 |
+
?>
|
296 |
+
</td>
|
297 |
+
|
298 |
+
<td>
|
299 |
+
<a href="<?php echo admin_url("admin.php?action=review_quiz_answer&attempt_id={$attempt_id}&attempt_answer_id={$answer->attempt_answer_id}&mark_as=correct"); ?>" title="<?php _e('Mark as correct', 'tutor'); ?>" class="attempt-mark-correct-btn"><i class="tutor-icon-mark"></i> </a>
|
300 |
+
|
301 |
+
<a href="<?php echo admin_url("admin.php?action=review_quiz_answer&attempt_id={$attempt_id}&attempt_answer_id={$answer->attempt_answer_id}&mark_as=incorrect"); ?>" title="<?php _e('Mark as In correct', 'tutor'); ?>" class="attempt-mark-incorrect-btn"><i class="tutor-icon-line-cross"></i></a>
|
302 |
+
</td>
|
303 |
+
</tr>
|
304 |
+
<?php
|
305 |
+
}
|
306 |
+
?>
|
307 |
+
</table>
|
308 |
+
</div>
|
309 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
310 |
<?php
|
311 |
}
|
312 |
?>
|