Skip to content

Commit

Permalink
Merge pull request #134 from CCALI/quizwright/new-question-fix
Browse files Browse the repository at this point in the history
Quizwright/new question fix
  • Loading branch information
emasters authored Jan 3, 2019
2 parents 94bb09b + 58c2d97 commit db48cbb
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .htaccess
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Protect files and directories from prying eyes.
<FilesMatch ".+\.(inc)$">
Allow from all
Require all granted
</FilesMatch>

# some PHP settings for sessions
Expand Down
2 changes: 1 addition & 1 deletion includes/page-quiz-mc.inc
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ $('#page-submit').click(function(){ // Save page let author add new page
cawCKEditorUpdates();
if (!validate()) return false;
$.post( "./includes/page-update.php", $( "#page-quiz-form" ).serialize() ,function( data ) {
$("#main-panel").load("./includes/page-quiz.inc");
$("#main-panel").load("./includes/page-quiz.php");
window.scrollTo(0, 0);
});
return false;
Expand Down
2 changes: 1 addition & 1 deletion includes/page-quiz-tf.inc
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ $('#page-submit').click(function(){ // Save page let author add new page
cawCKEditorUpdates();
if (!validate()) return false;
$.post( "./includes/page-update.php", $( "#page-quiz-form" ).serialize() ,function( data ) {
$("#main-panel").load("./includes/page-quiz.inc");
$("#main-panel").load("./includes/page-quiz.php");
window.scrollTo(0, 0);
});
return false;
Expand Down
2 changes: 1 addition & 1 deletion includes/page-quiz-yn.inc
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ $('#page-submit').click(function(){ // Save page let author add new page
cawCKEditorUpdates();
if (!validate()) return false;
$.post( "./includes/page-update.php", $( "#page-quiz-form" ).serialize() ,function( data ) {
$("#main-panel").load("./includes/page-quiz.inc");
$("#main-panel").load("./includes/page-quiz.php");
window.scrollTo(0, 0);
});
return false;
Expand Down
46 changes: 46 additions & 0 deletions includes/page-quiz.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<!-- Form for select a new quiz page type -->
<form class="form-horizontal" id="page-quiz-form">


<fieldset>
<legend>Quiz Question</legend>
<!-- Button -->
<div class="form-group">
<label class="col-sm-2 control-label" for="page-submit">Type of question?</label>
<div class="col-sm-3">
<button id="page-quiz-tf" class="btn btn-primary">True/False</button>
</div>
<div class="col-sm-3">
<button id="page-quiz-yn" class="btn btn-primary">Yes/No</button>
</div>
<div class="col-sm-3">
<button id="page-quiz-mc" class="btn btn-primary">Multiple Choice</button>
</div>
</div>
</fieldset>
</form>


<script>
$('#page-quiz-tf').click(function(){
$("#main-panel").load("./includes/page-quiz-tf.inc");
return false;
});
$('#page-quiz-yn').click(function(){
$("#main-panel").load("./includes/page-quiz-yn.inc");
return false;
});
$('#page-quiz-mc').click(function(){
$("#main-panel").load("./includes/page-quiz-mc.inc");
return false;
});
</script>
2 changes: 1 addition & 1 deletion includes/quiz-prep-pages.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ function updateForm()

});
$('#page-new').click(function(){
$("#main-panel").load("./includes/page-quiz.inc");
$("#main-panel").load("./includes/page-quiz.php");
return false;
});
$('#pages-add-submit').click(function(){ // Save page selection, let author prepare quiz
Expand Down

0 comments on commit db48cbb

Please sign in to comment.