some I18n, stop command for server send event code (score), updated readme

This commit is contained in:
Ralf Teusner
2015-10-16 17:06:23 +02:00
parent 5f76c78411
commit 6151afcb55
5 changed files with 37 additions and 6 deletions

View File

@ -25,8 +25,9 @@ In order to execute code submissions using Docker, source code files are written
- create *config/sendmail.yml*
- create *config/smtp.yml*
- use boot2docker if there is no native support for docker on your OS
- use boot2docker or vagrant if there is no native support for docker on your OS
- create seed data by executing `rake db:seed`
- if you already created a configuration for your local installation and want to use vagrant, too, be sure to log into the vagrant instance via ssh and add your database user manually to the database. Afterwards, create, migrate and seed.
## Production Setup
@ -46,8 +47,8 @@ The application is compatible with MRI and JRuby. Due to superior parallelism, w
1.1
[ ] WebSocket Suppport
[ ] Interactive Exercises
[x] WebSocket Suppport
[x] Interactive Exercises
[ ] Allow Disabling of File Creation
[ ] Set Container Recyling per Environment

View File

@ -13,6 +13,9 @@ $(function() {
var THEME = 'ace/theme/textmate';
var REMEMBER_TAB = false;
var AUTOSAVE_INTERVAL = 15 * 1000;
var NONE = 0;
var WEBSOCKET = 1;
var SERVER_SEND_EVENT = 2;
var editors = [];
var active_file = undefined;
@ -20,6 +23,7 @@ $(function() {
var running = false;
var qa_api = undefined;
var output_mode_is_streaming = true;
var runmode = NONE;
var websocket,
turtlescreen,
@ -873,6 +877,7 @@ $(function() {
var runCode = function(event) {
event.preventDefault();
if ($('#run').is(':visible')) {
runmode = WEBSOCKET;
createSubmission(this, null, function(response) {
$('#stop').data('url', response.stop_url);
running = true;
@ -910,6 +915,7 @@ $(function() {
var scoreCode = function(event) {
event.preventDefault();
runmode = SERVER_SEND_EVENT;
createSubmission(this, null, function(response) {
showSpinner($('#assess'));
var url = response.score_url;
@ -1018,10 +1024,30 @@ $(function() {
var stopCode = function(event) {
event.preventDefault();
if ($('#stop').is(':visible')) {
killWebsocketAndContainer();
if(runmode == WEBSOCKET){
killWebsocketAndContainer();
} else if (runmode == SERVER_SEND_EVENT) {
stopCodeServerSendEvent(event);
}
runmode = NONE;
}
};
var stopCodeServerSendEvent = function(event){
var jqxhr = ajax({
data: {
container_id: $('#stop').data('container').id
},
url: $('#stop').data('url')
});
jqxhr.always(function() {
hideSpinner();
running = false;
toggleButtonStates();
});
jqxhr.fail(ajaxError);
};
var killWebsocketAndContainer = function() {
if (websocket.readyState != WebSocket.OPEN) {
return;

View File

@ -39,10 +39,10 @@
#output-col1
// todo set to full width if turtle isnt used
#prompt.input-group.hidden
span.input-group-addon = 'Your input'
span.input-group-addon = t('exercises.editor.input')
input#prompt-input.form-control type='text'
span.input-group-btn
button#prompt-submit.btn.btn-primary type="button" = 'Send'
button#prompt-submit.btn.btn-primary type="button" = t('exercises.editor.send')
#output
pre = t('.no_output_yet')
- if CodeOcean::Config.new(:code_ocean).read[:flowr][:enabled]

View File

@ -176,6 +176,7 @@ de:
destroy_file: Datei löschen
download: Herunterladen
dummy: Keine Aktion
input: Ihre Eingabe
lastsaved: 'Zuletzt gespeichert: '
network: 'Während Ihr Code läuft, ist Port %{port} unter folgender Adresse erreichbar: <a href="%{address}" target="_blank">%{address}</a>.'
render: Anzeigen
@ -185,6 +186,7 @@ de:
requestComments: Kommentare erbitten
save: Speichern
score: Bewerten
send: Senden
start_over: Von vorne anfangen
stop: Stoppen
submit: Code zur Bewertung abgeben

View File

@ -176,6 +176,7 @@ en:
destroy_file: Delete File
download: Download
dummy: No Action
input: Your input
lastsaved: 'Last saved: '
network: 'While your code is running, port %{port} is accessible using the following address: <a href="%{address}" target="_blank">%{address}</a>.'
render: Render
@ -185,6 +186,7 @@ en:
requestComments: Request comments
save: Save
score: Score
send: Send
start_over: Start over
stop: Stop
submit: Submit Code For Assessment