Merge branch 'master' into lti_param_model
This commit is contained in:
@@ -351,7 +351,7 @@ configureEditors: function () {
|
||||
},
|
||||
|
||||
isBrowserSupported: function () {
|
||||
// websockets is used for run, score and test
|
||||
// websockets are used for run, score and test
|
||||
return Modernizr.websockets;
|
||||
},
|
||||
|
||||
@@ -361,7 +361,7 @@ configureEditors: function () {
|
||||
panel.find('.panel-title .number').text(index + 1);
|
||||
panel.find('.row .col-sm-9').eq(0).find('.number').eq(0).text(result.passed);
|
||||
panel.find('.row .col-sm-9').eq(0).find('.number').eq(1).text(result.count);
|
||||
panel.find('.row .col-sm-9').eq(1).find('.number').eq(0).text((result.score * result.weight).toFixed(2));
|
||||
panel.find('.row .col-sm-9').eq(1).find('.number').eq(0).text(parseFloat((result.score * result.weight).toFixed(2)));
|
||||
panel.find('.row .col-sm-9').eq(1).find('.number').eq(1).text(result.weight);
|
||||
panel.find('.row .col-sm-9').eq(2).text(result.message);
|
||||
if (result.error_messages) panel.find('.row .col-sm-9').eq(3).text(result.error_messages.join(', '));
|
||||
|
@@ -6,6 +6,7 @@ CodeOceanEditorEvaluation = {
|
||||
*/
|
||||
scoreCode: function (event) {
|
||||
event.preventDefault();
|
||||
this.clearScoringOutput();
|
||||
this.createSubmission('#assess', null, function (response) {
|
||||
this.showSpinner($('#assess'));
|
||||
$('#score_div').removeClass('hidden');
|
||||
@@ -139,6 +140,14 @@ CodeOceanEditorEvaluation = {
|
||||
$('#output pre').remove();
|
||||
},
|
||||
|
||||
clearScoringOutput: function() {
|
||||
$('#results ul').first().html('');
|
||||
$('.test-count .number').html(0);
|
||||
$('#score').data('score', 0);
|
||||
this.renderScore();
|
||||
this.clearOutput();
|
||||
},
|
||||
|
||||
printOutput: function (output, colorize, index) {
|
||||
var element = this.findOrCreateOutputElement(index);
|
||||
if (!colorize) {
|
||||
|
@@ -265,7 +265,7 @@ class ExercisesController < ApplicationController
|
||||
return
|
||||
|
||||
# else: show open rfc for same exercise if available
|
||||
elsif rfc = RequestForComment.unsolved.where(exercise_id: @submission.exercise).order("RANDOM()").first
|
||||
elsif rfc = RequestForComment.unsolved.where(exercise_id: @submission.exercise).where.not(question: nil).order("RANDOM()").first
|
||||
# set a message that informs the user that his score was perfect and help in RFC is greatly appreciated.
|
||||
flash[:notice] = I18n.t('exercises.submit.full_score_redirect_to_rfc')
|
||||
flash.keep(:notice)
|
||||
|
@@ -6,7 +6,9 @@
|
||||
submission = @request_for_comment.submission
|
||||
%>
|
||||
<%= user.displayname %> | <%= @request_for_comment.created_at.localtime %>
|
||||
|
||||
</p>
|
||||
|
||||
<h5>
|
||||
<u><%= t('activerecord.attributes.exercise.description') %>:</u> <%= render_markdown(@request_for_comment.exercise.description) %>
|
||||
</h5>
|
||||
@@ -25,6 +27,20 @@
|
||||
<% else %>
|
||||
|
||||
<% end %>
|
||||
|
||||
<% if @current_user.admin? && user.is_a?(ExternalUser) %>
|
||||
<br>
|
||||
<br>
|
||||
<h4>Admin Menu</h4>
|
||||
<h5>
|
||||
<ul>
|
||||
<li><%= link_to "User's current status of this exercise", statistics_external_user_exercise_path(id: @request_for_comment.exercise_id, external_user_id: @request_for_comment.user_id) %></li>
|
||||
<li><%= link_to "All exercises of this user", statistics_external_user_path(id: @request_for_comment.user_id) %></li> <br>
|
||||
<li><%= link_to "Implement the exercise yourself", implement_exercise_path(id: @request_for_comment.exercise_id) %> </li>
|
||||
<li><%= link_to "Show the exercise", exercise_path(id: @request_for_comment.exercise_id) %> </li>
|
||||
</ul>
|
||||
</h5>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<!--
|
||||
|
Reference in New Issue
Block a user