-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #147 from Loginxtech/create-conceptual-exams-in-batch
Cria possibilidade de criar avaliações conceituais em lote
- Loading branch information
Showing
25 changed files
with
932 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
$(document).ready( function() { | ||
let beta_title = 'Este recurso ainda está em processo de desenvolvimento e pode apresentar problemas' | ||
let img_src = $('#image-beta').attr('src'); | ||
$(".fa-file-text-o").closest('h2').after(`<img src="${img_src}" class="beta-badge" style="margin-bottom: 9px; margin-left: 5px" title="${beta_title}">`); | ||
}) |
38 changes: 38 additions & 0 deletions
38
app/assets/javascripts/views/conceptual_exams_in_batchs/new.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
$(function() { | ||
'use strict'; | ||
const flashMessages = new FlashMessages(); | ||
|
||
$('#conceptual_exam_classroom_id').on('change', function () { | ||
flashMessages.pop(''); | ||
$('#conceptual_exam_step_id').select2('val', ''); | ||
|
||
populateSteps(); | ||
}); | ||
|
||
function populateSteps() { | ||
let classroom_id = $('#conceptual_exam_classroom_id').select2('val'); | ||
|
||
if (!_.isEmpty(classroom_id)) { | ||
$.ajax({ | ||
url: Routes.get_steps_conceptual_exams_in_batchs_pt_br_path({ | ||
classroom_id: classroom_id, | ||
format: 'json' | ||
}), | ||
success: handleFetchStepsSuccess, | ||
error: handleFetchStepsError | ||
}); | ||
} | ||
} | ||
|
||
function handleFetchStepsSuccess(data) { | ||
let steps = _.map(data.conceptual_exams_in_batchs, function(step) { | ||
return { id: step.table.id, name: step.table.name, text: step.table.text }; | ||
}); | ||
|
||
$('#conceptual_exam_step_id').select2({ data: steps }) | ||
} | ||
|
||
function handleFetchStepsError() { | ||
flashMessages.error('Ocorreu um erro ao buscar as etapas da turma.'); | ||
} | ||
}); |
Oops, something went wrong.