diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9d532b1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,41 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +**/doc/api/ +**/ios/Flutter/.last_build_id +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +.packages +.pub-cache/ +.pub/ +/build/ + +# Web related +lib/generated_plugin_registrant.dart + +# Symbolication related +app.*.symbols + +# Obfuscation related +app.*.map.json diff --git a/lib/Maze.dart b/lib/Maze.dart index 49a72ea..04d1233 100644 --- a/lib/Maze.dart +++ b/lib/Maze.dart @@ -4,6 +4,7 @@ import 'dart:convert'; import 'PathGeneration.dart'; import 'server.dart'; import 'main.dart'; +import 'instructions.dart'; class gameButton extends StatefulWidget { int id; @@ -298,6 +299,18 @@ class mazeState extends State { } ), + Align( + alignment: Alignment.bottomRight, + child: IconButton( + icon: Icon(Icons.help), + onPressed:() { + Navigator.push( + context, + new MaterialPageRoute(builder: (ctxt) => new SecondScreen()), + ); + }, + ), + ) ] ), ), @@ -316,13 +329,12 @@ class MyHomePage extends StatefulWidget { class _MyHomePageState extends State { @override Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: Center(child: Text("GMT")), - ), - body: Center( - child: maze1, - ) + return Container( + child: Scaffold( + appBar: AppBar( + title: Center(child: Text("GMT")), + ), + ), ); } } \ No newline at end of file diff --git a/lib/MazeTest.dart b/lib/MazeTest.dart index b5fe7c8..83fa1dc 100644 --- a/lib/MazeTest.dart +++ b/lib/MazeTest.dart @@ -5,6 +5,7 @@ import 'dart:io'; import 'dart:convert'; import 'main.dart'; import 'server.dart'; +import 'instructions.dart'; //initialize new maze maze maze2= new maze(); Color color1 = Colors.grey; @@ -142,7 +143,7 @@ class gameButtonState extends State { void resetGame() { //reinitialize variables to default - moves = []; + moves2 = []; correctMoves2 = {}; consecErrors2 = 0; lastMove = 0; //records last CORRECT move of user @@ -154,6 +155,7 @@ class gameButtonState extends State { //function executed when any button pressed void buttonPress() { + moves2.add(widget.id); times2.add(clock2.elapsedMilliseconds); //first prevent uesr from making new moves during 250 milisecond animation timeOut2 = true; @@ -244,7 +246,6 @@ class gameButtonState extends State { } }); - moves2.add(widget.id); recentMove2=widget.id; } @override @@ -332,6 +333,20 @@ class mazeState extends State { } ), + + Align( + alignment: Alignment.bottomRight, + child: IconButton( + icon: Icon(Icons.help), + onPressed:() { + Navigator.push( + context, + new MaterialPageRoute(builder: (ctxt) => new SecondScreen()), + ); + }, + ), + ) + ] ), ), diff --git a/lib/instructions.dart b/lib/instructions.dart new file mode 100644 index 0000000..83d0396 --- /dev/null +++ b/lib/instructions.dart @@ -0,0 +1,26 @@ + +import 'package:flutter/material.dart'; + + + +class SecondScreen extends StatelessWidget { + @override + Widget build (BuildContext context) { + return new Scaffold( + appBar: new AppBar( + title: new Text("Instructions"), + ), + body: SingleChildScrollView( + child: Center( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: new Text("Subject must click on tiles one-by-one to make a path from the start tile (top leftmost tile) to the finish tile (bottom rightmost tile). There is a 28 step pathway hidden below these 100 possible locations. There are three rules that must be followed: \n 1.) The subject cannot move diagonally (only left, right, up, or down are legal moves). \n 2.) They cannot click on the same tile twice in succession. \n 3.) " + "They cannot move backwards (i.e. they cannot click on a tile that they have already revealed to be in the path). \n After each move, if the subject chose correctly a tile in the path, a green square is revealed briefly then hidden again. If the subject chose incorrectly, a red square is shown briefly. The green and red squares do not stay on the screen, but are revealed briefly just after the tile is clicked on.An incorrect choice (a red X) can be due to either the tile not being in the path, or because another type of error was made: \n 1.) They clicked on a tile that is diagonal from the last correct one. \n 2.) They clicked on the same tile twice in succession. \n 3.) They skipped a tile (choose a tile not connected to the last one they found to be in the path) \n If an incorrect tile choice is revealed, the subject must click on the last correct tile they chose before they click on another tile to try to advance to the end of the maze. Once they complete the maze, they are returned to the start position to do the same maze again, usually four more times, trying to remember the pathway that they just completed.In CogState, there are 20 well-matched alternate forms for the task, which are selected from in pseudo-random order (i.e. no path is repeated for a particular subject throughout a study). This ensures that a subject will not be presented the same hidden path on any two different testing sessions throughout a study.", + style: new TextStyle(fontSize: 20, height:1.5)), + ), + ), + ), + + ); + } +} \ No newline at end of file diff --git a/lib/server.dart b/lib/server.dart index 5b875ab..ef36204 100644 --- a/lib/server.dart +++ b/lib/server.dart @@ -3,9 +3,6 @@ import 'package:json_annotation/json_annotation.dart'; import 'dart:async'; import 'dart:convert'; -//const String serverURL = "https://x0-19.psych.umn.edu/posts"; -const String serverURL = "http://160.94.0.29/posts"; - @JsonSerializable(nullable: false) Data _$DataFromJson(Map json) { @@ -54,8 +51,7 @@ Future createData( print(jsonUser); final http.Response response = await http.post( - serverURL, - // 'http://160.94.0.29:5000/posts', + 'https://x0-29.psych.umn.edu/dend/posts', headers: { 'Content-Type': 'application/json; charset=UTF-8', },