diff --git a/Agent86/Agent86/Pages/Index.cshtml b/Agent86/Agent86/Pages/Index.cshtml index 944dba2..9692b7c 100644 --- a/Agent86/Agent86/Pages/Index.cshtml +++ b/Agent86/Agent86/Pages/Index.cshtml @@ -3,7 +3,7 @@ @if (Model.theScene.role == "error") { -

Vælg project

+

Choose Project Type

+
+

+
+

+
+

+
+

+
+

+ +
+


+ + +
+
+

Suggested AI template

+

+ I made a roleplay AI agent to allow my compter science students to have a simulated customer to converse with for a code project.
+ I need examples of the system prompt to guide the AI in behaving like a customer who wants an online sales site.
+ The customer, named Anita Bath, is a head hunter selling human heads to savages.
+ Quality criterias like shrunk, skin color, missing eye(s) or ear(s), mounted on poles or not, you may be creative even funny
+ +

+
+
+} +else +{ +

Access Denied

+

You do not have permission to access this page.

+} diff --git a/Agent86/Agent86/Pages/Insert.cshtml.cs b/Agent86/Agent86/Pages/Insert.cshtml.cs new file mode 100644 index 0000000..aea8d4b --- /dev/null +++ b/Agent86/Agent86/Pages/Insert.cshtml.cs @@ -0,0 +1,42 @@ +using Agent86.Models; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.RazorPages; + +namespace Agent86.Pages +{ + public class InsertModel : PageModel + { + [BindProperty] + public string myRole { get; set; } + [BindProperty] + public List Scenes { get; set; } = new(); + [BindProperty] + public Scene theScene { get; set; } = new(); + + + + public void OnGet() + { + myRole = User.Claims.FirstOrDefault(c => c.Type == "roles")?.Value; + if (theScene.role == "error") + { + // Handle the case where the scene role is not set + Scenes = [.. new Persistence.DbOps().GetScenes().OrderBy(s => s.role)]; + } + } + + public IActionResult OnPost(string action = "error", string projectName = "error", string quest = "error", string member = "error", string customer = "error", string instruction = "error") + { + myRole = User.Claims.FirstOrDefault(c => c.Type == "roles")?.Value; + if (myRole == "teacher" || myRole == "owner") + { + if (action == "insert") + { + new Persistence.DbOps().InsertScene(projectName, quest, member, customer, instruction); + } + return RedirectToPage("/Index"); + } + return RedirectToPage("/Index"); + } + } +} diff --git a/Agent86/Agent86/Pages/Shared/_Layout.cshtml b/Agent86/Agent86/Pages/Shared/_Layout.cshtml index fc27027..a630478 100644 --- a/Agent86/Agent86/Pages/Shared/_Layout.cshtml +++ b/Agent86/Agent86/Pages/Shared/_Layout.cshtml @@ -20,9 +20,12 @@