Skip to content
Snippets Groups Projects
Commit 94e31e17 authored by Isabel Uffinger's avatar Isabel Uffinger
Browse files

Merge branch 'dev/isabel_52' into develop

parents 3dbb72ac b6bf3d87
Branches
No related tags found
No related merge requests found
......@@ -118,6 +118,16 @@ define(['core/ajax',
let searchVal = selectedGrader["html_representation"];
setSelectionSafely("#id_graderselect option[value='" + searchVal + "']");
//setting the proglang and gradername as tag (easiest point to access selected grader name)
let tagInput = document.querySelectorAll('[id^=form_autocomplete_input]')[0];
tagInput.value = result.proglang;
enterKeyEvent(tagInput);
let gradername = document.querySelector("#id_graderselect option[value='" + searchVal + "']").text;
tagInput.value = gradername;
enterKeyEvent(tagInput);
tagInput.value = "MooPT";
enterKeyEvent(tagInput);
if ('result_spec' in selectedGrader) {
if ('format' in selectedGrader['result_spec']) {
searchVal = selectedGrader['result_spec']['format'];
......@@ -237,3 +247,19 @@ function setSelectionSafely(query) {
if(null !== select)
select.selected = true;
}
function enterKeyEvent(elem) {
var event = new KeyboardEvent("keydown", {
bubbles: true,
cancelBubble: false,
cancelable: true,
charCode: 0,
code: "Enter",
isTrusted: true,
key: "Enter",
keyCode: 13,
repeat: false,
type: "keydown",
which: 13});
elem.dispatchEvent(event);
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment