Skip to content

Commit

Permalink
Split form card
Browse files Browse the repository at this point in the history
  • Loading branch information
chvp committed Sep 9, 2021
1 parent 44065d2 commit e289434
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 50 deletions.
4 changes: 4 additions & 0 deletions app/assets/javascripts/evaluation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,24 @@ export function initEvaluationStepper(): void {
userPanel.hide();
});


document.querySelector("#users-step-finish-button").addEventListener("click", function () {
userPanel.hide();
document.querySelector("#items-panel").classList.remove("hidden");
scorePanel.show();
});
}


function toUsersStep(): void {
interceptAddMultiUserClicks();
initCheckboxes();
document.querySelector("#deadline-group .btn").classList.add("disabled");
document.querySelector("#users-panel").classList.remove("hidden");
evalPanel.hide();
userPanel.show();
document.querySelector("#users-panel a[role=\"button\"]").setAttribute("href", "#users-step");
document.querySelector("#items-panel a[role=\"button\"]").setAttribute("href", "#items-step");
}

function interceptAddMultiUserClicks(): void {
Expand Down
19 changes: 9 additions & 10 deletions app/views/evaluations/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,22 @@
<%= form_for evaluation, html: { class: "form-horizontal feedback-form" }, remote: true do |f| %>
<div>
<%= f.hidden_field :series_id %>
<h4 class="evaluation-form-title"><%= evaluation.series.name %> <span class="small"><%= evaluation.series.course.name %></span></h4>

<%= render partial: 'exercises_table', locals: {
series: @evaluation.series,
exercises: @evaluation.series.exercises,
} %>

<br><b>Deadline</b><br>

<div class="field form-group<%= " has-error" if evaluation.deadline > Time.current %>">
<div class='col-sm-12'>
<div class="row">
<div class="col-lg-6 col-sm-12">
<br><b>Deadline</b><br>
<div class="input-group" id='deadline-group' data-wrap=true data-enable-time=true data-time_24hr=true data-max-date="<%= Time.current.httpdate %>">
<%= f.text_field :deadline, class: "form-control", 'data-input': true %>
<button class="btn btn-secondary" type="button" data-toggle <%= "disabled" if local_assigns[:readonly] %>><i class='mdi mdi-calendar-blank mdi-18'></i></button>
</div>
</div>
<span class="help-block col-sm-12"><%= t(".deadline-help_html") %></span>
<div class="col-lg-6 col-sm-12">
<div class="callout callout-info">
<%= t(".deadline-help_html") %>
</div>
</div>
</div>
</div>
</div>

Expand Down
51 changes: 25 additions & 26 deletions app/views/evaluations/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,37 @@
<% end %>
<div class="row">
<div class="col-md-10 offset-md-1 col-12">
<div id="stepper" class="panel-group stepper" role="tablist">
<div id="info-panel" class="panel panel-default">
<div class="panel-heading" role="tab">
<h4 class="panel-title">
<span class="step-circle">1</span>
<a role="button" data-bs-toggle="collapse" href="#info-step">
<%= t(".evaluation_info") %>
</a>
</h4>
</div>
<div id="info-step" class="panel-collapse collapse show" role="tabpanel">
<div class="panel-body">
<div class="stepper-part">
<div class="row">
<div class="col-lg-6 col-sm-12 order-lg-1">
<div class="callout callout-info">
<h4><%= t "evaluations.new.explanation_title" %></h4>
<%= t "evaluations.new.explanation_html" %>
</div>
</div>
<div class="col-lg-6 col-sm-12 order-lg-0">
<%= render 'form', evaluation: @evaluation, readonly: true %>
</div>
</div>
<div class="card">
<div class="card-title card-title-colored">
<h2 class="card-title-text"><%= @title %></h2>
</div>
<div class="card-supporting-text">
<div class="row">
<div class="col-lg-6 col-sm-12 order-lg-0">
<h4 class="evaluation-form-title">
<%= @evaluation.series.name %>
<span class="small"><%= @evaluation.series.course.name %></span>
</h4>
<%= render partial: 'exercises_table', locals: {
series: @evaluation.series,
exercises: @evaluation.series.exercises,
} %>
</div>

<div class="col-lg-6 col-sm-12 order-lg-1">
<div class="callout callout-info">
<h4><%= t "evaluations.new.explanation_title" %></h4>
<%= t "evaluations.new.explanation_html" %>
</div>
</div>
</div>
</div>
</div>
<div id="stepper" class="panel-group stepper" role="tablist">
<div id="users-panel" class="panel panel-default">
<div class="panel-heading" role="tab">
<h4 class="panel-title">
<span class="step-circle">2</span>
<span class="step-circle">1</span>
<a role="button" data-bs-toggle="collapse" href="#users-step">
<%= t("evaluations.add_users.title") %>
</a>
Expand Down Expand Up @@ -66,7 +65,7 @@
<div id="items-panel" class="panel panel-default">
<div class="panel-heading" role="tab">
<h4 class="panel-title">
<span class="step-circle">3</span>
<span class="step-circle">2</span>
<a role="button" data-bs-toggle="collapse" href="#items-step">
<%= t 'score_items.index.title' %>
</a>
Expand Down
46 changes: 32 additions & 14 deletions app/views/evaluations/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,47 @@
<% end %>
<div class="row">
<div class="col-md-10 offset-md-1 col-12">
<div class="card">
<div class="card-title card-title-colored">
<h2 class="card-title-text"><%= @title %></h2>
</div>
<div class="card-supporting-text">
<div class="row">
<div class="col-lg-6 col-sm-12 order-lg-0">
<h4 class="evaluation-form-title">
<%= @evaluation.series.name %>
<span class="small"><%= @evaluation.series.course.name %></span>
</h4>
<%= render partial: 'exercises_table', locals: {
series: @evaluation.series,
exercises: @evaluation.series.exercises,
} %>
</div>

<div class="col-lg-6 col-sm-12 order-lg-1">
<div class="callout callout-info">
<h4><%= t ".explanation_title" %></h4>
<%= t ".explanation_html" %>
</div>
</div>
</div>
</div>
</div>
<div id="stepper" class="panel-group stepper" role="tablist">
<div id="info-panel" class="panel panel-default">
<div class="panel-heading" role="tab">
<h4 class="panel-title">
<span class="step-circle">1</span>
<a role="button" data-bs-toggle="collapse" href="#info-step">
<%= t(".create_evaluation") %>
<%= t(".pick_deadline") %>
</a>
</h4>
</div>
<div id="info-step" class="panel-collapse collapse show" role="tabpanel">
<div class="panel-body">
<div class="stepper-part">
<div class="row">
<div class="col-lg-6 col-sm-12 order-lg-1">
<div class="callout callout-info">
<h4><%= t ".explanation_title" %></h4>
<%= t ".explanation_html" %>
</div>
</div>
<div class="col-lg-6 col-sm-12 order-lg-0">
<%= render 'form', evaluation: @evaluation %>
</div>
<%= render 'form', evaluation: @evaluation %>
</div>
</div>
<div class="stepper-actions stepper-border">
Expand All @@ -36,11 +54,11 @@
</div>
</div>
</div>
<div id="users-panel" class="panel panel-default hidden">
<div id="users-panel" class="panel panel-default">
<div class="panel-heading" role="tab">
<h4 class="panel-title">
<span class="step-circle">2</span>
<a role="button" data-bs-toggle="collapse" href="#users-step">
<a role="button" data-bs-toggle="collapse">
<%= t("evaluations.add_users.title") %>
</a>
</h4>
Expand All @@ -55,11 +73,11 @@
</div>
</div>

<div id="items-panel" class="panel panel-default hidden">
<div id="items-panel" class="panel panel-default">
<div class="panel-heading" role="tab">
<h4 class="panel-title">
<span class="step-circle">3</span>
<a role="button" data-bs-toggle="collapse" href="#items-step">
<a role="button" data-bs-toggle="collapse">
<%= t 'score_items.index.title' %>
</a>
</h4>
Expand Down
1 change: 1 addition & 0 deletions config/locales/views/evaluations/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ en:
new:
exercises: Exercises
create_evaluation: Evaluate series
pick_deadline: Pick deadline
explanation_title: "What is an evaluation?"
explanation_html: "Evaluating a series is a structured way to give feedback on all submitted solutions of a series. Dodona keeps track of which submissions are already checked, so you can easily split work between multiple course administrators. The feedback you give isn't immediately visible for the students; you can decide when it is released."
next: Next
Expand Down
1 change: 1 addition & 0 deletions config/locales/views/evaluations/nl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ nl:
grading_details_info_html: Deze tabel toont het puntenoverzicht voor deze evaluatie. Het totaal per gebruiker is de som van de punten van de oefeningen.<br> Als de punten grijs zijn is de oplossing nog niet afgewerkt.
new:
exercises: Oefeningen
pick_deadline: Deadline kiezen
create_evaluation: Reeks evalueren
explanation_title: "Wat is een evaluatie?"
explanation_html: "Het evalueren van een reeks is een gestructureerde manier om de ingediende oplossingen van een reeks te bekijken en er feedback op te geven. Dodona houdt bij welke oplossingen al bekeken zijn zodat je het evaluatiewerk eenvoudig kan verdelen over meerdere lesgevers. De feedback die je geeft is niet onmiddelijk zichtbaar voor de studenten; je kiest zelf wanneer je deze vrijgeeft."
Expand Down

0 comments on commit e289434

Please sign in to comment.