Fixed major Fudge up with challenges without functions

This commit is contained in:
benmcmahon100
2015-08-25 22:25:00 +01:00
parent a6153c86e4
commit b1b07a5b9e
4 changed files with 246 additions and 225 deletions

View File

@ -182,6 +182,7 @@ function scopejQuery(s){
}
function safeHTMLRun(test){
if(challengeType === "0"){
var previewFrame = document.getElementById('preview');
var preview = previewFrame.contentDocument || previewFrame.contentWindow.document;
if(editor.getValue().match(/\<script\>/gi) !== null) {
@ -224,6 +225,7 @@ function safeHTMLRun(test){
preview.close();
}
}
}
}
if(typeof prodOrDev !== 'undefined') {
@ -516,6 +518,25 @@ function bonfireExecute() {
codeOutput.setValue("Unsafe or Unfinished function declaration");
}
}
else{
submit(userJavaScript, function (cls, message) {
if (failedCommentTest) {
myCodeMirror.setValue(myCodeMirror.getValue() + "*/");
console.log('Caught Unfinished Comment');
codeOutput.setValue("Unfinished mulit-line comment");
failedCommentTest = false;
}
else if (cls) {
codeOutput.setValue(message.error);
runTests('Error', null);
} else {
codeOutput.setValue(message.output);
codeOutput.setValue(codeOutput.getValue().replace(/\\\"/gi, ''));
message.input = removeLogs(message.input);
runTests(null, message);
}
});
}
}
else {
editorValueForIFrame = editor.getValue();

View File

@ -18,7 +18,7 @@ block content
.row(ng-controller="pairedWithController")
.col-xs-12.col-sm-12.col-md-4.col-lg-3
//.scroll-locker(id = "scroll-locker")
.scroll-locker(id = "scroll-locker")
#testCreatePanel.well
h3.text-center.negative-10= name
.positive-15.positive-15-bottom

View File

@ -21,7 +21,7 @@ block content
script(src='/js/lib/codemirror/addon/emmet/emmet.js')
.row.courseware-height
.col-xs-12.col-sm-12.col-md-3.col-lg-3
//.scroll-locker(id = "scroll-locker")
.scroll-locker(id = "scroll-locker")
.innerMarginFix(style = "width: 99%;")
.well
.row

View File

@ -16,7 +16,7 @@ block content
script(type='text/javascript', src='/js/lib/coursewares/sandbox.js')
.row(ng-controller="pairedWithController")
.col-xs-12.col-sm-12.col-md-4.col-lg-3
//.scroll-locker(id = "scroll-locker")
.scroll-locker(id = "scroll-locker")
.innerMarginFix(style = "width: 99%;")
#testCreatePanel.well
h3.text-center.negative-10= name